'nix run' threw 'spawnSync openssl ENOENT' on the real NixOS target even
though openssl is installed there system-wide - nix run's environment
doesn't carry ambient host PATH entries like /usr/bin, only what the
flake explicitly provides. run-local.mjs shells out to openssl to
generate its HTTPS cert, so pkgs.openssl now gets explicitly prefixed
onto PATH in the apps.default wrapper script, guaranteeing it's
reachable regardless of host state - the actual Nix-idiomatic fix,
not a hope that a system binary happens to be on PATH.
Verified via the real flake: nix build succeeded, and nix run fetched
openssl-3.5.9-bin from cache.nixos.org specifically because of this
reference (proof it is a real, explicit dependency now), then served
HTTPS successfully with a real generated cert.
Root cause of the wallet balance stuck at '--' and every other mini-app
write silently failing: @noble/ed25519's signing needs crypto.subtle,
which every browser restricts to a secure context (https://, or
http://localhost). A plain http://<lan-ip>:port origin - exactly what a
second device on the same network needs to reach this - is NOT a secure
context, so crypto.subtle is undefined there and init()'s promise
rejects with no .catch(), leaving accountId stuck at undefined forever.
Reproduced directly against the live deployment with a real headless
browser: confirmed 'crypto.subtle must be defined, consider polyfill'
in the console, isSecureContext: false. Fixed by generating a
self-signed cert (openssl, auto-generated on first run, reused after,
SANs cover localhost/127.0.0.1/every detected LAN IPv4) and serving
HTTPS by default - verified end to end: hasSubtle: true,
isSecureContext: true, wallet balance resolves to a real value instead
of '--'. HTTP_ONLY=1 opts back into plain HTTP for same-machine-only
testing, where http://localhost is already a secure context on its own.
'nix run' failed with ENOENT trying to mkdir inside the built package's
own Nix store path (.../the-commons-hollow-0.0.0/.data) - Nix store
paths are immutable by design, mkdir there can never succeed regardless
of permissions. The data directory must default to somewhere the
invoking user actually controls: process.cwd(), not the script's own
install location. Verified end to end through the real flake: 'nix
build' + 'nix run' from a separate writable directory now creates
.data there and serves real HTTP 200.
363MB of accumulated video-render iterations (every full-vN.mp4 from this
session's video-rework work) were all still tracked in git, ballooning
.git to 500MB+. This is almost certainly why a shallow clone over HTTP
was failing ('RPC failed; curl 18 transfer closed with outstanding read
data remaining', 'fetch-pack: unexpected disconnect') - a --depth 1
clone still has to transfer every currently-tracked file's full content.
Untracked the 10 superseded versions (files stay on disk locally, just
no longer tracked going forward); gitignored the whole renders/ dir
except full-v11.mp4, the current canonical render README.md links to.
This does not rewrite existing history (no force-push, nothing
destructive) - it shrinks what a FRESH --depth 1 clone needs to
transfer from here forward, since shallow clones only need the tip
commit's tree, not historical blobs.
Replace the .ledger-entry sig/type/fields/note markup (hex sig, JSON
fields, monospace note) with .app-entry's simpler label/headline/
optional-type-pill, mirroring buildComposition.mjs's current per-app
text beat for beat. No ledger/hex/JSON styling remains in the deck.
Per explicit preference: no NixOS module/global config edit required.
'nix run .' starts one process serving both the static frontend and
api/* on one auto-picked free port (tries 3001, falls back to any free
port). Ctrl+C or kill stops it; only ./.data's SQLite files persist.
Verified directly: real HTTP 200 on the served frontend.
Per explicit feedback on full-v10: the "SIGNED EVENT LOG - LIVE" terminal
panel (hex hash, type/fields JSON line, blinking cursor) and the per-app
frozen-still hold are both gone.
- buildComposition.mjs: removed layoutAppStage's static-snapshot hold +
extractAppClips() entirely; each app's window now plays its own real
captured clip continuously. Per-app text is a single large/bold/short
plain-language headline with an optional small event-type pill - no
hash/JSON/monospace anywhere.
- tour.mjs: added app-<id>-start/-end marks around all 13 mini-apps plus
a linger() helper (real scroll + :hover motion, never a held frame) so
a from-scratch recapture can give each app a dedicated, longer real clip.
Also fixed a real flake: ShellLayout's boot-time auto-seed means the
Admin page's demo-load status now usually reads "already loaded", not
"Demo data loaded" - the beat's waitFor accepts both.
- capture.mjs: CLIP_SPEC slices one real clip per mini-app via the new
marks (replacing the old 3 giant per-act blobs) for that recapture path.
- src/lib/farms.ts: fixed a real LP-solver bug surfaced while recapturing -
a crop with kWhPerM2: 0 under any positive energyBudgetKwh produced a
false "infeasible" (an all-zero-coefficient constraint row breaks
javascript-lp-solver's simplex solve). Now the energy constraint is only
added when some eligible crop actually draws power. Regression test added.
SHIP-NOW NOTE: the from-scratch recapture (dedicated 8-12s real dwell per
app) hit an additional intermittent Health Post hang under deadline
pressure; full-v11 instead reuses the already-captured, already-verified
act1/act2/act3 footage, playing each app's own real sub-window
continuously (old, shorter per-app dwell - disclosed, not padded with any
hold). A true recapture with longer dwell is the follow-up.
Per direct request: everything happened well within the official build
window, so a defensive caveat about pre-window planning activity raises
a non-issue a reader has no reason to ask about. Removed, not required
disclosure (distinct from ECONOMY.md's actual limitations, which stay).
Two throughlines (one signed identity/log; real cross-app wiring via
that same log), ~3min timed script with on-screen actions, tech stack
covered briefly per the form's explicit ask. Per direct user request:
not a feature-by-feature tour of all 13 mini-apps.
Follows the fairshare/ResourceTiles fix (8c434b5) with the same bug class
found everywhere else a continuous/computed value was echoed raw in JSX:
- FarmsScreen: the grow-light power budget echo (same live Fair Share CEEI
allocation ResourceTiles already fixes)
- PlantingInputForm / TemperatureEntryForm: echoed plot area, crop GDD/
yield/kWh, and min/max temperature entries
- shell WalletCard + TransactionHistory: the wallet balance, send-status
amounts, and per-row transaction amounts - the same wallet-balance bug
as fairshare, in the app's single most prominent wallet display
- The Climb's ScheduleTimeline / CongestionHeatmap / ScheduleInputForm:
traced the min-cost-flow solver's own types (ShaftEdge.capacityPerPeriod,
WaveDemandGroup.count, SurfaceCapacityPeriod.capacity) and confirmed none
are integer-constrained, so totalDelivered/totalCost/peopleMoved/queue
lengths/wait totals can all carry real fractional precision
- Water Watch DeviceMonitor: the reported reading feed value
- Light Clock ManualLogForm: the echoed hours/lux manual-log entries
Every fix ships with a proving test mirroring ResourceTiles.test.tsx's
pattern: a sanity-check that the raw value genuinely exceeds 2 decimal
digits before asserting the rendered text is truncated to exactly 2.
Investigated and left unformatted (genuine integer/bounded values,
confirmed by tracing source, not variable-name guessing):
- Housing's fit score and fairness-debt ledger (always an integer sum by
construction - traced buildRankedCyclePreferences/solveHousingAssignment)
- Mentor's dependents-count/holder-count and match score (sum of integers)
- Tunnel Safety's route distance (sums a static, fixed-integer demo graph,
never user input)
- Health Post's triage ageMonths (documented "whole months" field)
- Testimony's median rating (division by 2 only, never exceeds 1 decimal)
Full suite (870 tests / 99 files), npm run build, and npx oxlint all pass.
The earlier fix only covered the CEEI allocation quantity (qty). Three
more unformatted numbers remained on the same screen: the wallet
balance, each tile's supply ("of X pool"), and the echoed need amount in
the post-submit status message - all raw, no .toFixed(), all capable of
showing many decimal digits (balance from any wallet.issue amount;
supply from a real cross-app settlement like Farms' LP/GDD forecast,
which is frequently non-round; the need echo straight from whatever a
resident types).
Fixed all three with .toFixed(2), matching the project's established
convention. New tests prove each with a genuinely non-round value (not
a coincidentally-clean fixture): a fractional wallet.issue amount, a
fractional seed.resource.food value modeling Farms' real forecast credit,
and a 9-decimal need amount typed into the real form and submitted via
the real UI.
full-v10.mp4 fixes the "still too fast" feedback against v9: every one of
the 13 mini-apps now gets its own genuinely-timed segment (8.5-13s) with a
single plain-language benefit blurb, using the full 3-minute budget
deliberately rather than compressing everything into ~90s. Updated both
docs' descriptive text to match the real current runtime and content.
User feedback on full-v9.mp4 (91.9s): "too fast, too much text on screen."
Directive: "go over every mini app and have a short blurb about what it
does for you... You have 3 minutes."
- Replace all 13 ledger notes with short, second-person, benefit-framed
blurbs (what each app does FOR a resident, not its internal mechanism).
- Give each of the 13 mini-apps its own individually-timed segment inside
its act (previously several apps shared one continuously-playing window,
which is why it still felt rushed after the last "one entry at a time" fix).
Window duration = max(reading time at ~2 wps, real footage dwell, 8.5s floor).
- Hold mechanism: each app's own real dwell (empirically verified via
frame-diffing + manually reading extracted frames from act*.mp4 - not
derived from capture-manifest.json beats, which mark in-app events rather
than the UI's own on-screen window, and don't account for the brief
"back to home" / cross-app-revisit beat the real recording takes between
almost every app pair) is captured as ONE real still frame
(assets/app-<id>-hold.png) that becomes that app's entire on-screen
window via a plain GSAP opacity set - no live <video> for any of the 13
apps. Two live-video designs (shared-act-file clamp, then per-app trimmed
clips) were tried first and both intermittently rendered a BLACK frame at
an app's window start (reproduced on both a 0.85s and a 3.7s dwell clip),
so live playback was dropped in favor of the always-reliable static
snapshot; intro/epilogue keep real video playback (single dedicated
files, never observed to glitch).
- Total runtime 182.1s (within the ~175-185s / "3 minutes" target), verified
via ffprobe and a 39-frame (start/mid/end x 13 apps) manual QA pass
confirming the correct blurb, the correct app on screen, and a clean
hold with no bleed-through from a neighboring app.
Render: renders/full-v10.mp4 (182.1s), via the hyperframes CLI.
full-v9.mp4 fixes the two problems flagged directly against v8: ledger
entries no longer stack 4-6 deep per act, and the "NEW"/before-after
framing is gone entirely (an introduction has no "before" for a
first-time viewer). Updated both docs' own descriptive text to match,
not just the file reference.
Act II alone stacked all 6 mini-apps' two-line ledger entries visible
simultaneously - way too much text on screen at once, and every entry
carried a before/after "isNew" framing (NEW badge + detail line) that
makes no sense for a first-time introduction with no "before" to
contrast against.
- buildTimeline(): drop isNew/detail from every ledger entry; merge
each entry's mechanism + outcome facts into one plain description.
Each entry now carries an explicit "at" (seconds into its stage)
derived from capture-manifest.json beats, cross-referenced against
the raw per-app screen transitions in assets/act*.mp4 (reordered
Act II to Farms/FairShare -> Housing -> Mentor -> HealthPost ->
LightClock -> TheClimb to match footage order).
- promo.html entries markup: drop the NEW badge/detail-line rendering;
wrap entries in a fixed-height .ledger-entries stack with each
.entry absolutely positioned so only one occupies the panel.
GSAP: replace the shared stagger-reveal-and-persist with a per-entry
scan-wipe-in at its "at" time and a fade-out right before the next
entry's reveal, so at most one entry is ever visible per stage.
Re-rendered renders/full-v9.mp4 (91.9s, matches prior runtime).
The waterborne-outbreak info box (background #eff6ff, border #bfdbfe) and
its two <p> elements used static inline style={{...}} instead of the
project's CSS-Modules + design-token convention.
- Added .waterborneInterop / .waterborneInteropMessage /
.waterborneInteropStatus classes to SymptomTallyDashboard.module.css,
token-referenced via --space-3/--space-2/--radius-sm/--text-body-size.
- The background's closest existing token is --color-accent-soft
(#e8f2ff); no existing token matched the border color, so added
--color-accent-border: #bfdbfe to tokens.css following the existing
--color-warning-border naming precedent.
- Verified: vitest (5/5 green), tsc -b && vite build clean, oxlint clean
(0 warnings in touched files), before/after Playwright screenshots of
the live /miniapp/health-post view render identically.
AdminSeedPanel.tsx was 100% inline-styled with hardcoded hex colors that
didn't match the app's real design tokens (e.g. error #b00020 vs the real
--color-negative #d4380d). Extract every static style={{...}} into
AdminSeedPanel.module.css, mapping each value to the matching token:
- #555 text -> var(--color-ink-soft)
- #b00020 error -> var(--color-negative)
- #1a7a1a success -> var(--color-positive)
- #8a6d00 disclaimer -> var(--color-warning-strong)
- #ddd section border -> var(--color-border)
- 24px/16px spacing -> var(--space-6)/var(--space-4)
- system-ui font stack -> var(--sans)
Follows the exact class-naming/value convention already used by the
sibling AdminAggregatePanel.module.css (container, section, heading,
description, error). No layout/structure change; visual proportions are
preserved except for the off-brand colors being corrected.
Verified: vitest run src/admin/AdminSeedPanel.test.tsx (11/11 passing),
npm run build (clean), npx oxlint on both changed files (clean), and a
Playwright before/after screenshot comparison of the live /admin route.
Migrate every static inline style={{...}} object (and the inputStyle
const) in WalletCard.tsx to classes in WalletCard.module.css, matching
the file's existing className convention. Exact-matching design tokens
from src/styles/tokens.css are used (8px spacing -> var(--space-2));
values with no exact token match (border-radius 8px, border color
#d0d5dd, font-sizes 12/13/14px, text color #6b7280, max-width 110px)
are kept as literal CSS so rendered output stays pixel-identical,
unchanged from before this refactor.
Same two issues the submission-answer rewrite fixed, found in the video's
on-screen text: the outro card said "Thirteen mini-apps" with no stated
referent for a viewer with no context, and the intro card said "No
server" which is now false (a self-hosted backend genuinely exists).
Text-only change in tour.mjs; re-rendering the promo video with these
corrections is a separate follow-up.
ResourceTiles.tsx rendered the CEEI water-filling solver's raw iterative
output directly (bare {qty}, no formatting) for all 4 resource tiles. The
demo's seed data always used parallel need vectors across agents, which a
Fisher-market CEEI solve degenerates to a clean equal-budget-share split
for regardless of magnitude - so the bug never showed in the recorded
demo. A real resident's real reported need (or any non-parallel need
vectors across residents) produces a genuine fractional market-clearing
split with many decimal digits, rendered verbatim with no truncation.
Fixed with .toFixed(2), matching the project's existing 2-decimal
convention (Farms' harvest forecast, Water Watch's reading value). New
test uses a genuinely non-degenerate (non-parallel) need scenario,
confirmed via a sanity check that the raw solver output actually carries
more than 2 decimal digits before asserting the rendered text is
truncated to exactly 2 - proving the fix against the real bug mechanism,
not a coincidentally-round fixture.
Cut the narrative problem-setup opening, the unexplained 'thirteen
disconnected gadgets' reference, and every bare number (13/15) with no
stated referent. Every field now leads directly with the problems solved
and the mechanism that solves them, self-contained for a reader with no
project context. Switched all first-person plural to singular (solo
build). Field 4 also drops an odd 'grepped the README for a credits
section' aside that read like leftover process narration, not a direct
answer. Re-verified word counts: 185/192/187/58, all <=200.
Field 1 didn't claim anything false, but it undersold what the backend
push actually bought: a shelter cut off from the surface can self-host its
own civic infrastructure on hardware it owns, with no outside server in
the loop - a point that belongs in the non-technical impact answer, not
just the technical one. Re-verified at 199/200 words.
Field 2 of SUBMISSION-ANSWERS.md said "no server holding application state"
and undersold the backend as optional - inaccurate after this session's real
self-hosted blob/sync/admin backend, Nix flake deployment, and
domain-separated pseudonym sync privacy fix. Rewritten, re-verified at 199/200
words. Also points FINAL-CHECKLIST.md and README.md's demo-video section at
full-v8.mp4 (the just-rendered, richer-detail cut), not the now-stale v7.
Each of the 13 app-specific SIGNED EVENT LOG entries (act1/act2/act3) grows
from a single terse note into note + a dimmer second-line detail ("NEW"
badge where this session actually fixed something real): Water Watch's
pipe-graph-adjacency corroboration, Fair Share's power/cooling trend
events, Tunnel Safety's geolocation fallback, Find Family's self-
registration, Farms' live Fair Share power read, Housing's solver-enforced
accessibility/medical constraints, Assembly's wired QR-sneakernet camera
scan, and Sky's cross-device memory-wall/mood-pulse sync - plus deeper
mechanism detail (WHO-IMCI, Hannay19 circadian model, min-cost-flow +
congestion sim, ts-fsrs scheduling, commit-reveal lottery) for the other
five. Chapter-card window (CH_DUR 2.6s -> 3.1s) and per-entry stagger
(0.5s -> 0.6s) are lengthened modestly - the only real levers available
without touching captured footage - giving the richer two-line entries
room to read. Baseline full-v7.mp4 was actually 89.87s (not ~3min); new
full-v8.mp4 is 91.87s, a ~2s/2% growth. Re-rendered via the real
hyperframes pipeline; frame read-back at each act confirms all 13 entries
are legible and uncut.
Full read-only audit of all 13 mini-apps against README's problem-mapping
table + each module's own doc comments. 6 COHERENT (lightclock, fairdraw,
healthpost, theclimb, sky, mentor), 7 GAP-FOUND and fixed in prior commits
(fairshare, waterwatch, tunnelsafety, housing, assembly, findfamily, farms).
coherence-audit/farms.md #3: FarmsScreen.tsx's energyBudgetKwh was a
free-text number the grower typed, fully disconnected from Fair Share's
real power supply/allocation despite the README calling it "a fixed
grow-light power budget".
- FarmsScreen.tsx: replace the energyBudgetInput text state with a live
read via useActiveAccountId + useEventLogEntries + computeFairshareAllocation
(mirrors ResourceTiles.tsx's own live-allocation read and
settleFarmsForecast's readAll()+computeFairshareAllocation call pattern),
gated on allocation.supply.power > 0 so an account that merely
participates in some OTHER resource market (e.g. food) before any power
market exists doesn't get a fabricated hard-zero budget from that map's
zero-initialized default. solveFarmsPlantingOptimizer's constraint logic
is untouched.
- The manual number input becomes a read-only display of the resolved
Fair Share figure ("No Fair Share power allocation yet (unlimited)" when
absent).
- ceeiSpike.ts: fixes a real pre-existing divide-by-zero in
solveCeeiWaterFilling, surfaced by this wiring - a market good with zero
total bids (price 0 despite positive supply, i.e. no agent currently
wants it) produced 0/0 = NaN that poisoned every later iteration and
every other resource's allocation for that agent. Zero demand now
allocates zero honestly instead of propagating NaN.
- FarmsScreen.test.tsx: new test proves the LP schedule re-solves when
Fair Share's real power allocation changes (1 kWh -> 2.00 kg forecast,
10 kWh -> 20.00 kg), with no manual budget entry.
Manual browser QA of the previous fix (eb72625) surfaced a real bug: the
"genuinely new value" guard lived only in a useRef, which resets on every
component remount (a page reload, or React remounting ResourceTiles).
Reloading the Fair Share screen re-announced the SAME unchanged power/
cooling total as a brand-new fairshare.allocation.cycle event every time,
corrupting the trend with duplicate flat points (observed first-hand: a
browser QA session produced 4 power cycle points - [100,250,250,250] -
from only 2 real supply changes).
Fix: check the real, already-signed Event Log history
(getAllocationHistory's last point) before settling, not only the
in-memory ref - a ref reset by remount no longer matters once the guard's
source of truth is the persisted log itself. The ref stays as a same-
session fast path to skip a redundant recheck across rapid re-renders.
Added a regression test exercising the exact unmount/remount sequence
that exposed the bug, verifying the event count stays at 1 after a
remount with no real change, and still settles correctly on a genuine
follow-up change.
Re-verified via real-browser QA (chromium, owned/pipe engine): seeded
power twice (100 -> 250) and cooling twice (40 -> 70) through the live
admin panel and Fair Share UI; both TrendCharts now render a real
multi-point SVG trend (screenshots in .omo/evidence/coherence-audit/).
The audit (.omo/evidence/coherence-audit/assembly.md) found src/lib/qrSneakernet.ts
fully built and tested (encodeDelta/decodeFrames/FrameCollector/renderFramesToDataURLs/
scanFrameFromImage, real qrcode+jsQR, CRC32-checked chunking) but with zero callers
outside its own test file, and no getUserMedia call anywhere in the app - the
README's claimed "QR-sneakernet air-gapped fallback" third resilience layer was
unreachable from the UI.
Adds QrSneakernetPanel (new component under src/miniapps/assembly/), wired into
AssemblyScreen.tsx alongside (not replacing) the existing WebRTC sync toggle:
- "Export state as QR": encodeAssemblyState -> encodeDelta -> renderFramesToDataURLs,
cycling frames with a visible "Frame N of M" counter.
- "Scan a device's QR": real getUserMedia camera permission prompt with a clean
denied/unavailable error UI, <video> + canvas capture loop feeding
scanFrameFromImage into a FrameCollector, applying the reassembled delta via
applyAssemblyUpdate once collector.isComplete(), with a "synced via QR, N frames
received" success state. Camera track.stop() runs on cancel/unmount/completion.
Tests (QrSneakernetPanel.test.tsx, 7 passing): export frame rendering/counter,
getUserMedia denial + no-camera error states, cancel/unmount stop the stream
cleanly, and a genuine round trip - real QR bitmaps decoded via scanFrameFromImage,
reassembled via FrameCollector, applied via applyAssemblyUpdate, with the target
replica's CRDT state proven equal to the source's.
QA (e2e/assemblyQrSneakernet.e2e.mjs, Playwright): the export UI's rendered PNGs
decode via the real scanFrameFromImage and match the transport's own encodeDelta
output; a real camera-permission-denied path renders the error UI in headless
Chromium; and - the strongest evidence - a full device-to-device round trip via
Chrome's --use-file-for-fake-video-capture fed a real Y4M video built (ffmpeg-static)
from the actual PNG bytes the export UI rendered, driving the real "Scan a device's
QR" button end to end and confirming the receiving device's CRDT state matches what
was exported. Evidence: .omo/evidence/coherence-audit/assembly-qr-sneakernet-e2e.json.
Closes the confirmed coherence gap in .omo/evidence/coherence-audit/findfamily.md
(finding #2): SEED_DIRECTORY was the only directory source anywhere, with no
append path and no findfamily.* Event Log payload type, so no resident could
ever be found however sound the PSI crypto was.
- Add findfamily.register payload type + type guard, and registerInDirectory()
/ extractRegisteredDirectoryEntries() in a new findfamilyEvents.ts, following
the exact per-mini-app local-payload pattern (skyMemoryWall.ts/testimony.ts) -
no central payload union exists in eventlog.ts to extend.
- registerInDirectory() signs and appends through the real append() (the sole
local-signing write path) - never bypasses it.
- SearchScreen.tsx now reads the live Event Log via useEventLogEntries(),
merges findfamily.register entries with SEED_DIRECTORY fresh on every
render (same replay-only pattern as ledger.ts), and feeds the merged
directory into both the local PSI channel and the nearby-device WebRTC
channel. Added a "Register yourself or a missing family member" form with
honest success/error states matching the search form's own pattern.
- Added findfamily.register to sync.ts's PUSH_TYPE_ALLOWLIST under the real
identity key: a resident voluntarily registering as findable is the same
"public community data" category as sky.memoryWall/testimony (not personal
data like lightclock.*), and the whole point is being found by OTHER
devices - documented reasoning inline, including why this does not
reintroduce the plaintext-query leak directory.ts's doc comment warns
about (that guarantee is unconditional regardless of where entries came
from).
- README.md: one-line clarification that the privacy guarantee is on the
searcher's query, not on directory membership.
Tests:
- findfamilyEvents.test.ts (new): payload guard, append+extract round trip,
validation, distinct ids per registration, sync-wiring, and the real
end-to-end behavioral proof - a name registered via registerInDirectory()
is found by a genuine findFamilyMember()/PSI search merged with
SEED_DIRECTORY, with every seed fixture still searchable unchanged.
- SearchScreen.test.tsx: three new tests driving the real UI form (register
-> search -> match), confirming seed fixtures still work after an
unrelated registration, and the empty-name guard.
- sync.test.ts: new test proving findfamily.register is now pushed under
the real identity key (not a pseudonym), following the existing
sky.memoryWall.entry/testimony.statement allowlist test pattern.
QA: targeted vitest (5 files / 44 tests) green, full npm run test green
(93 files / 848 tests), tsc -b clean for all touched files, oxlint has no
new errors (pre-existing warning baseline unchanged). npm run build
currently fails on src/miniapps/farms/FarmsScreen.tsx - that is unrelated,
uncommitted WIP from a concurrent session editing this same checkout
(confirmed via git diff; not part of this change, not staged here).
Water (settleCorroboratedReading) and food (settleFarmsForecast) were the
only resources that ever appended a fairshare.allocation.cycle event, so
power and cooling's TrendChart was structurally stuck at "no trend yet"
forever - exactly the resource (power) P1 "warn before power cuts" is
about (.omo/evidence/coherence-audit/fairshare.md).
Add settleAllocationCycle(resource, deps) to lib/fairshare.ts, mirroring
settleCorroboratedReading/settleFarmsForecast 1:1: re-reads the signed
Event Log, re-solves via computeFairshareAllocation, appends a real
fairshare.allocation.cycle event. Wire it into ResourceTiles.tsx via a
useEffect gated on allocation.supply[resource] > 0 && agents.length > 0,
firing only on a genuinely new totalAllocated per resource (ref guard
mirrors FarmsScreen.tsx's lastSettledForecastRef) - scoped to power and
cooling only, never touching the working water/food write paths.
Tests: new fairshare.test.ts cases prove settleAllocationCycle appends a
real event and computeAllocationTrend/getAllocationHistory build a real
2-point trend from it, for both resources. New ResourceTiles.test.tsx
cases drive the fix through the real UI (seed.resource.power/cooling
changes) and assert the TrendChart leaves "no trend yet". Also hardened
the two pre-existing ResourceTiles happy-path tests to quiesce their own
newly-triggered settlement writes before ending, closing a same-file
cross-test race this change exposed (a fire-and-forget write landing in
the next test's freshly-reset DB).
Coherence-audit gap (.omo/evidence/coherence-audit/housing.md): README/doc-comment
named "accessibility, family cohesion, medical proximity" as enforced constraints,
but HousingSlot/HousingPreference carried no such fields and the only production
preference-builder (buildRankedCyclePreferences) kept every resident eligible for
every slot, differentiating purely by self-reported ranking.
- HousingSlot gains stepFree/distanceToMedicalMeters; HousingResidentNeeds
(requiresStepFree/medicalUrgency) is a new per-resident type.
- isSlotEligibleForResidentNeeds is the real eligibility gate; wired into
buildRankedCyclePreferences so an ineligible (resident, slot) pair is hard-
omitted from the solver's input, never a soft preference.
- HousingSlotPreferenceInput/Payload and HousingSpaceReportInput/Payload both
carry the new fields end to end (validate -> sign -> append -> replay via
computeResidentHousingNeeds / discoverAvailableSlots), so both the resident-
run cycle and the admin demo exercise the same real constraint.
- FloorPlanScreen: SlotPreferenceForm gets a step-free checkbox + medical-
urgency select; ReportSpaceForm gets a step-free checkbox + medical-distance
field for self-reported idle spaces.
- buildDemoHousingCycleInput (seedEvents.ts) now calls the real production
buildRankedCyclePreferences instead of a hand-rolled score matrix, and one
demo slot is non-step-free while one demo neighbor requires step-free
access - provably excluded from their own top-ranked slot.
- New behavioral tests in housing.test.ts prove the solver's actual eligible-
pair set changes (never a mocked call): a step-free-requiring or high-
medical-urgency resident is never assigned an ineligible slot even when
it's their top-ranked preference, and infeasible when zero eligible slots
remain. seedEvents.test.ts adds a demo-fixture-level proof of the same.
Family cohesion remains unimplemented (no familyGroupId field/grouping rule) -
disclosed as a known remaining gap, not fabricated.
Full suite: 92 files / 836 tests passing. Build and oxlint clean.
Coherence audit (.omo/evidence/coherence-audit/tunnelsafety.md) found
navigator.geolocation unused repo-wide while hazard reports carried no
location signal beyond a manual segment-name dropdown. ReportHazardForm
now reads a best-effort GPS/network fix on mount via
useBestEffortGeolocation() and attaches it as an optional coords field
on submit - never required, never fabricated on denial/timeout/absence,
and never used to auto-select segmentId (GPS alone cannot resolve which
named corridor a resident is in; segment selection stays manual and
authoritative). tunnelrouting.ts is untouched - routing stays purely
segment-id-based.
- HazardReportPayload/HazardReport gain an optional coords field
(latitude/longitude/accuracy), validated and round-tripped by
computeHazardReports; a malformed coords shape is rejected like any
other corrupt payload.
- The form shows a "Location captured"/"Location unavailable" indicator;
the hazard feed renders captured coords per report.
- New tests: reportHazard coords round-trip, no-coords unaffected
behavior, tampered-coords rejection, and a component test mocking
navigator.geolocation.getCurrentPosition for both the success and
denied/unavailable paths.
- New Playwright e2e (chromium, real context.permissions geolocation
grant/deny) proves the full grant and deny flows end to end with
screenshot evidence.
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The corroboration gate (createCorroborationGate().ingest()) previously
promoted a pending candidate to "alert" on distinct-sensorId + same
CUSUM side + timing alone - it never checked physical proximity, even
though DEFAULT_PIPE_NETWORK topology and lowestCommonAncestor already
existed and were used for post-hoc leak localization/display only.
Two sensors on unrelated branches (e.g. kiosk-1 East wing vs kiosk-3
West wing) reporting unrelated anomalies on the same channel within
the window could falsely "corroborate" and trigger a real Fair Share
water-allocation re-solve, contradicting README's "corroborated
resident water readings" claim.
- Move lowestCommonAncestor/climbToDepth from waterWatchController.ts
into waterNetwork.ts (the topology module) as shared, exported graph
algorithms; add topologyDistance on top of them. This avoids a
circular import (corroboration.ts <-> waterWatchController.ts) and
reuses the existing topology representation rather than inventing a
new one.
- createCorroborationGate() gains optional network/maxTopologyDistance
options. When both the pending and incoming reading's sensorIds
resolve to known DEFAULT_PIPE_NETWORK nodes, ingest() now also
requires them to be within maxTopologyDistance (default 2 - the
distance between two taps sharing the same wing junction) before
promoting to "alert". A sensorId unknown to the topology (free-text
device id) falls back to the original distinct-id + timing-only
check, never blocking corroboration outright - additive, not a
regression for sensors the demo topology doesn't know.
- waterWatchController.ts now imports the shared LCA helper instead of
defining its own copy; localizeAnomaly's behavior is unchanged.
Tests: corroboration.test.ts adds 3 cases - kiosk-1/kiosk-3 (distant
wings) no longer promotes to alert and never credits
seed.resource.water; kiosk-1/kiosk-2 (same wing) still promotes;
kiosk-1/unmapped free-text sensor still falls back and promotes. All
10 corroboration.test.ts cases pass; full suite 802/811 pass (9
pre-existing failures in AppRoutes.test.tsx/TunnelSafetyScreen.test.ts
are unrelated to this change - confirmed via git stash - caused by
other uncommitted work already in the tree touching
navigator.geolocation); build (tsc -b && vite build) and oxlint on
changed files are clean.
Restores two more of the 4 broken community features the sync audit found
(.omo/evidence/service-sync-reevaluation.md), per the user's explicit choice
of the privacy-preserving design over a plain allowlist entry:
- identity.ts: signPseudonymous(domain, message) / getPseudonymousPublicKey
derive a domain-separated Ed25519 keypair from the real secret key via
SHA-256(secretKey || domain) - one-way (unlinkable back to the real
identity without already holding the real secret key) and deterministic
per (identity, domain), so a resident's own pseudonymous entries stay
recognizably theirs and distinct-reporter counts stay meaningful.
- eventlog.ts: appendPseudonymous(payload, domain) shares the same
lamportTs-serializing appendTail queue as append(), so real and
pseudonymous appends on one device can never race on Lamport assignment.
- skyMorale.ts's postMoralePulse and healthpostEvents.ts's postSymptomReport
now sign under SKY_MORALE_DOMAIN / HEALTHPOST_REPORTER_DOMAIN instead of
the real identity key.
- sync.ts allowlists both payload types (they were excluded entirely
before), with the doc comment explaining the pseudonym design.
Most importantly: healthpost.symptomReport's distinct-reporter corroboration
gate (countDistinctSymptomReporters, which gates the waterborne-outbreak ->
Fair Share water-floor interop) was structurally unreachable on a
per-resident-device deployment before this fix, since every device only
ever saw its own author pubkey. A new test proves 3 distinct residents'
real, pseudonymously-signed reports now correctly count as 3 distinct
reporters once merged (simulating what relay sync delivers).
Verified: 805/805 tests pass (6 new), build clean, oxlint clean, and a real
browser check posting a mood pulse + memory wall entry through the actual
Sky UI end-to-end.
Both are public, author-attributed community boards (their own UI already
shows every entry's author to other residents) that were silently excluded
from PUSH_TYPE_ALLOWLIST alongside genuinely private data (mood, symptoms).
On a one-phone-per-resident deployment this meant each resident's wall/board
only ever showed their own posts - the exact defect the user flagged for
Sky's memory wall, confirmed to generalize via a full cross-device sync audit
(.omo/evidence/service-sync-reevaluation.md).
Also wires the missing export/share half of testimony's manual sneakernet
path (TestimonyBoard.tsx): only paste-import existed before; a Share button
now reveals the serializeTestimonyEntry() blob for the primary relay sync
path's offline fallback.
sky.morale.pulse and healthpost.symptomReport stay excluded - those carry a
real health/wallet correlation risk via the raw identity pubkey; the audit
recommends a domain-separated pseudonym design for those two, not a plain
allowlist entry, which is a larger privacy-preserving mechanism still to be
decided/built.
Also commits the full cross-device sync architecture re-evaluation across all 13 mini-apps (.omo/evidence/service-sync-reevaluation.md), which found 4 broken community features (Sky memory wall/morale, Health Post symptom tally, Assembly testimony) caused by the same local-only-sync root cause the user flagged.
- Add .vercelignore excluding api/ from this Vercel deployment (api/'s
sqlite-backed stores write to a read-only serverless filesystem, and its
top-level *.integration.test.ts files import vitest and would break the
zero-config function convention) - the committed api/ directory itself is
untouched, only excluded from this specific static deploy.
- Override vercel.json's buildCommand to type-check only the app/node
tsconfig projects (tsc -b tsconfig.app.json tsconfig.node.json), since
tsconfig.api.json's "include": ["api"] has no inputs once api/ is
excluded from the uploaded deployment files - package.json's own "build"
script is untouched for local full-repo builds.
- Deploy to a new Vercel project (first-place-overhaul-todo6, account
yoyoyonono / team aaron-thapas-projects) via npx vercel --prod --yes.
Stable canonical production URL:
https://first-place-overhaul-todo6.vercel.app
- Update README's "## Live demo" section to point at the permanent URL,
remove the stale "may already be dead"/"planned separately" temp-preview
language, and note the live deploy is the static frontend only - the
self-hosted sync/blob/admin backend (api/) remains a separate,
self-hosted-only component, not part of this public URL.
The referral and hazard resolve reconstructions now join on the intrinsic referralId/reportId, not the local Event Log id; the doc comments said otherwise.
Identical bug to the healthpost referral one: tunnelsafety.hazard.resolve joined on StoredEventLogEntry.id (a per-device Dexie autoincrement), and hazards sync cross-device - so a hazard resolved on one device showed 'active' forever on every other device and stayed falsely corroborated, and routing kept avoiding a cleared segment. Each hazard report now carries an intrinsic reportId (UUID) in its signed payload; resolveHazard + computeHazardReports join on it. Verified by a cross-device test (resolve matches despite differing entry ids). The convergence review confirmed this was the last such join bug - theclimb/fairdraw/governance/fairshare/assembly all already use intrinsic ids.
Honest-limits section now also discloses: (1) a signed mentor.skillReview / Assembly delegation binds its author but not its subject (learner/delegate id is asserted, not co-signed) - a forgeable class like Sybil, but it cannot forge authorship or inflate QV weight; (2) a healthpost.referral syncs the triage RESULT to the shared relay as the resident's consent-bearing handoff, while all passive/personal health inputs stay strictly local.
trySyncWithBackend fires a best-effort fetch('/api/sync') on many component mounts; in happy-dom it resolves to the dead localhost:3000 origin and the undici socket error could race teardown and flip the run's exit code to 1 even though all 791 tests passed. The global test setup now intercepts only that relay endpoint and rejects instantly with no socket, so best-effort sync still exercises its caught-error path. Verified: WalletCard's sync mount shows 0 ECONNREFUSED and 9/9 full-suite runs exit 0.
decisionFor derived `enacted` from mere membership in the enacted set, so a forged or peer-synced governance.proposal.enacted for a proposal that did NOT pass would render as Enacted. Now enacted requires the proposal to actually pass (isProposalPassed over the signed ballots, the ground truth), so a forged enactment of a failing proposal is ignored. Also relabeled the badge's tally 'Current tally' (it is the live replay-derived tally, not a frozen snapshot) to stop implying the numbers are recorded. New test: a forged enactment of a failing proposal shows no Enacted badge.
healthpost.referral.resolve joined on StoredEventLogEntry.id (a device-local Dexie autoincrement). Once referrals sync cross-device, the same referral has a different local id on each device, so a resolution never matched - a handled case stayed 'open' on every other device, breaking the cross-device clinician loop the referral sync was meant to enable. Each referral now carries an intrinsic UUID (ReferralPayload.referralId) in its signed payload, and the resolve + extractReferrals join on that stable id. Verified by a test asserting a resolve matches its referral despite differing entry ids.
The Health Post -> Fair Share water-floor interop needs >=3 DISTINCT diarrhea reporters (anti-inflation), so it was not demonstrable on a single fresh device. The hollow-demo-v3 seed now appends 5 foreign-signed diarrhea symptom reports from 3 distinct resident identities, so loading the demo shows an elevated dispatch priority + the one-click Raise Fair Share water floor action with no manual multi-device setup. Verified cold on the real surface (banner present, diarrhea count 5, dispatch elevated). Fixture bumped v2->v3.
Governance had no teeth: a passed QV tally produced no recorded consequence. A proposal with Yes weight strictly greater than No can now be Enacted by any enrolled resident, appending a signed governance.proposal.enacted event; the proposal then shows an Enacted badge with the frozen tally and honest copy (the Assembly records a binding decision, it cannot force anyone - there is no server underground). Derived purely by replay (extractEnactedProposalIds), idempotent, and allowlisted so the decision syncs cross-device like ballots. Verified on the real surface (self-enroll -> Enact -> badge replaces button). 47 governance/assembly tests + the sync allowlist test; full gate 790 tests + build green.
DEMO.md now points at the regenerated full-feature-demo video (was the stale task-60 clip), lists the new flows (wallet send, Fair Share need, Health->Fair Share interop, Assembly live QV tally, Fair Draw integrity badge, Housing debt), and documents the Bun runner. ECONOMY.md's offline-double-spend disclosure now credits the always-on computeBalances credit-limit rejection at replay (the real protection) instead of mergeReplicas, which is not wired into the live sync pull.
The waterborne->water-floor interop fired on a single resident tapping Report diarrhea 5x (count>=5), letting one person raise everyone's water ration - contradicting Tunnel Safety's distinct-reporter corroboration standard. Added countDistinctSymptomReporters (distinct authorPubkeys) and gated the action on >=3 DISTINCT residents. Relabeled the tally 'Symptom tally (this device)' since symptom reports stay local (not synced). Follow-up: seed a demo outbreak (foreign-signed diarrhea reports) so it is cold-demoable single-device.
The default-deny push allowlist was too coarse: it excluded entire families whose own code comments promise cross-device delivery, silently breaking real features. Most critically healthpost.referral(.resolve) - a resident's consent-bearing handoff of their own case to a clinician - never reached a second device, so the 'reaches real care' half of Health Post was dead cross-device (the passive healthpost.symptomReport stays local). Also allowlisted mentor.skillReview/mentor.match (community apprentice-mentor matching), theclimb.tiebreak (the audit trail must travel with its plan), and fairdraw (public-by-design verifiable lottery).
Repaired the drifted demo-video beats (Assembly: the removed direct-vote control -> real QV ballot after self-enrolling, both scenes; Health Post: answer the new WHO-IMCI fever question so Classify enables; Fair Draw: read the new draw-integrity badge) and regenerated the full-feature demo. The video now shows the real fixed behavior: Assembly live QV tally (seeded Yes 6.00 + a live self-enrolled Yes 3.00), the single collapsed vote widget + global delegation, Health 'Needs treatment' -> real referral, Fair Draw 'Draw integrity: valid', honest actigraphy, and the Farms->Fair Share + Water->Fair Share interop edges. RUNNER NOTE: run with 'bun e2e/demoVideoFull.e2e.mjs' - Node 24's native TS loader cannot resolve the codebase's extensionless relative imports; Bun does.
Documents the economy spend path, the root-cause fakeness fixes, Assembly QV integrity, the new features (Fair Share need form, Farms power budget, Mentor transitive, Fair Draw badge, Housing debt), the Health->Fair Share water-floor interop, and the privacy allowlist, each with QA evidence paths. Corrects the 'no hardware / never a simulated sensor' line to account for Light Clock's honest device actigraphy.
The demo seed predated the recent fixes: Assembly tally showed 0.00 (dead castVote path removed), Housing never rotated fairness-debt (identity-matrix prefs), Tunnel never corroborated (one signer), Mentor had no reachable match. Now: founding residents are enrolled with putResidentCredit + cast real signed QV ballots (yes 6.00); the demo identity and a neighbour contest one single-capacity slot so debt accrues then flips; a genuinely foreign-signed corroborating hazard (appendEntry, re-verified) makes seg-market-bypass Confirmed by 2; the local identity is a still-learning apprentice and a foreign-signed mentor Good review yields one real match. Fixture bumped to hollow-demo-v2.
npm run build (tsc -b) enforces noUnusedLocals, which tsc --noEmit did not surface, so two leftovers from the wave-1 lanes were silently failing the production build: findfamily.ts hashNameToPoint (orphaned by the AEAD-seal rewrite) and an unused test import. Removed both; npm run build is green again.
First cross-mini-app interop for breadth: when the community symptom tally shows a diarrhea cluster (dispatch priority elevated/urgent, a waterborne-outbreak signal), the clinician gets a one-click action to raise the Fair Share water floor (postFairshareFloor water) so every resident is guaranteed enough water for oral rehydration. Real clinician decision, shared key = the water resource, no fabricated data; links Health Post + Fair Share + the water theme.
runSync pushed every local event type to the pubkey-stamped relay, letting a puller correlate healthpost/sky.morale/wallet under one identity. Push is now a default-deny allowlist (health/mood/lightclock/mentor/fairdraw/testimony stay strictly local; only merge-needing types sync). Default WebRTC signaling is now self-hostable (VITE_SIGNALING_URL -> ws://localhost:4444), public host opt-in only; DEPLOY.md documents self-hosting.
Criticality used raw direct in-degree, so a deep/leaf prerequisite the whole settlement transitively rests on could slip under the at-risk threshold. Added computeTransitiveDependentsCounts (DAG closure, GAP-15 edge normalization + cycle guard); kept the direct count for mentorMatching. A deep leaf prerequisite now flags at-risk.
RevealDraw claimed a re-roll after a published commit is auditable+rejected, but validateReveal had zero production callers. The reveal flow now replays the signed log and renders a Draw integrity: valid/rejected badge; a duplicate or pre-commit reveal flips it to rejected.
computeQvTally weighed votes by the unsigned WebRTC-synced CRDT residentCredits, so a peer could set credits to 1e6 and dominate any tally. extractQvBallots now carries the signed tamper-evident credits and the tally weighs sqrt(min(ballot.credits, DEFAULT_QV_CREDITS)); residentCredits is used only as the enrolled-membership set. Also collapsed the inert direct-vote widget into the one signed QV ballot and moved delegation to a single global card with a Revoke button.
The Climb held its plan in useState (wiped on reload, never collective) and its Fair Draw tie-break used Math.random with commit+reveal+verify in one call (self-theater, non-reproducible). The plan is now theclimb.plan.propose/commit signed events replayed on mount (survives reload, identical on a second identity); the tie-break seed is derived deterministically from signed log content, the commit is appended before the reveal, and verifyClimbTieBreakAudit re-checks it from the log. Plus inline input validation.