docs(plans): commit remaining fix-miniapp-gaps-and-demo-video checkbox state and gate-review evidence
This commit is contained in:
1 parent
582f2397b2
commit
cd705d20fa
6 files changed
+323
-18
No files matched your search
@@ -0,0 +1,80 @@
|
||||
# F2 Code Quality Retry — Gate Review
|
||||
|
||||
- **recommendation:** APPROVE
|
||||
- **date:** 2026-11-18
|
||||
- **checkout:** /home/athapa/patriothacks (master, HEAD `8158f3d0a967c5d1ceae2a3168f707a82702691f`)
|
||||
- **goalId:** fix-miniapp-gaps-and-demo-video / Final Verification Wave
|
||||
|
||||
## originalIntent
|
||||
Prior F2 run REJECTED on 2 real `npm run build` failures (healthpostEvents.test.ts
|
||||
Uint8Array typing; waterWatchController.ts unused `net` param) caused by a missing
|
||||
cherry-pick. Fix landed as commit `8158f3d` on master. This retry re-runs build and lint
|
||||
fresh and confirms both exit 0 and that the 2 specific lines are now fixed.
|
||||
|
||||
## desiredOutcome
|
||||
`npm run build` and `npm run lint` both exit 0 on master, with the two previously-broken
|
||||
lines corrected.
|
||||
|
||||
## userOutcomeReview
|
||||
Both gate commands pass cleanly on master HEAD. The two named defects are confirmed fixed
|
||||
at the source. No new errors introduced. Nothing else edited. Outcome satisfied.
|
||||
|
||||
## Verification — command outputs
|
||||
|
||||
### `npm run build` → exit 0
|
||||
```
|
||||
> tsc -b && vite build
|
||||
vite v8.3.8 building client environment for production...
|
||||
✓ 287 modules transformed.
|
||||
dist/assets/index-CJTxPG6j.js 1,026.87 kB │ gzip: 321.85 kB
|
||||
✓ built in 571ms
|
||||
PWA v2.0.0 precache 20 entries
|
||||
BUILD_EXIT=0
|
||||
```
|
||||
`tsc -b` passed (no type errors — the healthpost Uint8Array error is gone). The only vite
|
||||
output is the pre-existing 500 kB chunk-size advisory (a warning, not a failure).
|
||||
|
||||
### `npm run lint` → exit 0
|
||||
```
|
||||
> oxlint
|
||||
LINT_EXIT=0
|
||||
```
|
||||
oxlint reports 14 pre-existing `warning`-level findings (react set-state-in-effect,
|
||||
only-export-components, one unused import in `e2e/demoRecording.e2e.mjs`). Zero errors;
|
||||
exit 0. None are in the two target files and none are regressions from this fix.
|
||||
|
||||
## Confirmed fixes (the 2 previously-broken lines)
|
||||
|
||||
- `src/miniapps/healthpost/healthpostEvents.test.ts:76-77`
|
||||
```ts
|
||||
authorPubkey: new Uint8Array(32).fill(1),
|
||||
signature: new Uint8Array(64).fill(2),
|
||||
```
|
||||
Now typed as `Uint8Array` (was `string`). Matches the eventLog schema → tsc clean.
|
||||
|
||||
- `src/miniapps/waterwatch/waterWatchController.ts:132`
|
||||
```ts
|
||||
export function localizeAnomaly(
|
||||
_net: PipeNetwork,
|
||||
```
|
||||
Parameter renamed to `_net` (underscore-prefixed unused), resolving the unused-param error.
|
||||
|
||||
## Overfit / slop pass (remove-ai-slops criteria, applied to the fix)
|
||||
The fix commit `8158f3d` is a minimal two-line type/param correction: a test mock typed to
|
||||
match the real schema, and an unused param prefixed per convention. No new tests, no
|
||||
deletion-only tests, no tautological or implementation-mirroring tests, no production
|
||||
extraction/parsing/normalization added. Nothing to flag.
|
||||
|
||||
## Checked artifacts
|
||||
- git log / HEAD on master (`8158f3d`)
|
||||
- `src/miniapps/healthpost/healthpostEvents.test.ts` lines 68-85
|
||||
- `src/miniapps/waterwatch/waterWatchController.ts` lines 124-139
|
||||
- `npm run build` live run (exit 0)
|
||||
- `npm run lint` live run (exit 0)
|
||||
|
||||
## blockers
|
||||
None.
|
||||
|
||||
## Evidence gaps
|
||||
None for the stated scope. Scope was build+lint gate on master; tests (`npm run test`) were
|
||||
not part of this retry's task and were not re-run here.
|
||||
@@ -0,0 +1,54 @@
|
||||
# Gate Review - Todo 1: Water Watch leak localization + per-tap arrival countdown
|
||||
|
||||
- **goal:** fix-miniapp-gaps-and-demo-video
|
||||
- **todo:** 1 (GAP-1)
|
||||
- **worktree:** /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1
|
||||
- **branch:** fix-miniapp-gaps-and-demo-video-wave1
|
||||
- **commit under review:** e5ff7f9 (worktree HEAD is 67c7561 = Todo 2 fairshare, disjoint files)
|
||||
- **base commit:** 3f6e21a (master, plan commit)
|
||||
- **recommendation:** APPROVE
|
||||
|
||||
## originalIntent
|
||||
The user wants each mini-app's real feature set to match its stated problem. For Water Watch (GAP-1), a Hollow resident could get a corroborated contamination alert but had no way to learn **where** the leak is or **when** it reaches their own tap. Todo 1 must add pipe-graph leak localization and a per-tap arrival-time countdown.
|
||||
|
||||
## desiredOutcome
|
||||
A resident sees (a) an origin banner naming the localized leak node and (b) a sorted per-tap countdown to contamination arrival, computed from a static tree-graph of the water network - not a real hydraulic simulator, and without touching the existing CUSUM/EWMA/corroboration detection logic.
|
||||
|
||||
## userOutcomeReview
|
||||
Delivered. `waterNetwork.ts` provides the `PipeNode`/`PipeEdge`/`PipeNetwork` types, a `DEFAULT_PIPE_NETWORK` reservoir->main->east/west-wing->kiosk tree, and `buildIndex()` (sensorToNode/parent/children/depth/edgeFlowSeconds). `localizeAnomaly()` is a genuine lowest-common-ancestor fold (depth-lift then lockstep climb); single sensor -> "corridor"/low confidence, 2+ sensors -> "pinpoint"/high confidence; unmapped sensorIds are dropped into `unmappedSensorIds` and never throw. `arrivalCountdowns()` is a real BFS accumulation of `flowSeconds` from the origin with wall-clock ETA and `secondsRemaining`, marking non-downstream taps `reachable:false`/`Infinity` rather than omitting them. `ingest()` populates `ChannelStatus.localization`/`countdowns` only on `alert`/`corroborating` states when a network is present. `DeviceMonitor.tsx`/`.module.css` render the origin banner + sorted countdown list + my-tap selector. The user-visible outcome is satisfied.
|
||||
|
||||
## Independent verification performed
|
||||
1. **Re-ran tests myself** (not just the artifact): `npx vitest run src/miniapps/waterwatch --reporter=verbose` -> **48 passed, 1 failed (49 total)**, matching the executor's claim exactly. The new Todo-1 tests (LCA worked example folding to J1, corridor single-sensor, unmapped/garbage sensorId non-throwing, drop-unmapped-but-still-localize, 15s downstream countdown, non-downstream Infinity, soonest-first sort, elapsed-time reflection, absent-origin all-unreachable, ChannelStatus population gating, cold-replay pinpoint rebuild) all pass.
|
||||
2. **Detection logic untouched:** `git diff 3f6e21a e5ff7f9 --stat -- cusum.ts ewma.ts corroboration.ts` is **empty**; `git show e5ff7f9 --stat` does not list them. Confirmed not modified.
|
||||
3. **Pre-existing failure confirmed environmental, not a regression:** `fixtureIsolation.test.ts` is byte-identical at base 3f6e21a (predates this todo, untouched by e5ff7f9). It throws `dist/ does not exist - run npm run build first`; `ls dist` -> absent in this worktree (no build run). This is an environmental build-artifact gap unrelated to Todo 1, not a regression it introduced.
|
||||
4. **Code is real, not stubbed:** read `waterNetwork.ts` and `waterWatchController.ts` in full. `lowestCommonAncestor`/`climbToDepth` implement a correct LCA; `cumulativeFlowSecondsFrom` implements a correct tree BFS; `localizeAnomaly` returns `{method:"unmapped", nodeId:null, confidence:"none"}` for all-unmapped input (no throw). No fakery.
|
||||
5. **Scope compliance (no hydraulic sim):** grep for pressure/hydraulic/valve/navier/bernoulli/simulate in the new code -> none (only the doc comment stating it is NOT a simulator). The network models only downstream topology + per-edge travel seconds. No new event type; static config module as permitted.
|
||||
6. **Stale-state probe:** the cold-replay test feeds raw `waterwatch.reading.report` entries through `replayWaterWatchController` -> `extractWaterReadingReports` -> `controller.ingest` -> `gate.ingest`, the identical path as live ingest - no shortcut that pre-builds localization. It drives the full two-sensor corroboration to "alert" and also asserts a second replay is `toEqual` the first (idempotent, no double-apply).
|
||||
|
||||
## remove-ai-slops / programming overfit pass (performed directly)
|
||||
- No deletion-only, removal-verification, or tautological tests. Tests assert hand-computed values over a concrete worked-example network (LCA=J1, 15s tapB, Infinity tapD).
|
||||
- No implementation-mirroring: tests check observable results (nodeId, reachable, secondsRemaining, sort order), not internal steps.
|
||||
- No unnecessary production extraction/parsing/normalization; `waterNetwork.ts` is a plain config + index builder the plan explicitly sanctioned.
|
||||
- Minor NOTE (not a blocker): two unmapped-path tests overlap (single garbage id vs all-garbage pair), but they exercise distinct code branches (drop-from-pair vs length-0 early return), so this is reasonable coverage, not slop.
|
||||
|
||||
## Code review report coverage note
|
||||
No separate code-review-report artifact was supplied in this task input; I performed the skill-perspective overfit/slop check directly above as instructed in the fallback case.
|
||||
|
||||
## blockers
|
||||
None.
|
||||
|
||||
## evidence gaps
|
||||
- `dist/` is absent so `fixtureIsolation.test.ts`'s dist check cannot pass in this worktree; this is a pre-existing environmental condition (identical test at base 3f6e21a), tied to no Todo-1 criterion. The final-wave F2/F3 steps run `npm run build`, which will create `dist/` and exercise that check.
|
||||
|
||||
## checked artifact paths
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/waterwatch/waterNetwork.ts
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/waterwatch/waterWatchController.ts
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/waterwatch/waterWatchController.test.ts
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/waterwatch/waterNetwork.test.ts
|
||||
- /home/athapa/patriothacks/.omo/plans/fix-miniapp-gaps-and-demo-video.md (Todo 1 spec + acceptance criteria)
|
||||
- git: e5ff7f9 --stat, diff 3f6e21a..e5ff7f9 on detection files, show 3f6e21a:fixtureIsolation.test.ts
|
||||
|
||||
## repro
|
||||
```
|
||||
cd /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1 && npx vitest run src/miniapps/waterwatch --reporter=verbose
|
||||
```
|
||||
@@ -0,0 +1,50 @@
|
||||
# Gate Review — Todo 11: Mentor apprentice-to-mentor matching
|
||||
|
||||
- **recommendation:** APPROVE
|
||||
- **goalId:** task-11-mentor (fix-miniapp-gaps-and-demo-video, wave1)
|
||||
- **worktree:** /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1 (branch fix-miniapp-gaps-and-demo-video-wave1)
|
||||
- **reviewed commit:** 803fcfd `feat(mentor): add apprentice-to-mentor matching engine and signed match event`
|
||||
- **reviewer:** omo-native-gate-reviewer (independent AdversarialVerify)
|
||||
|
||||
## originalIntent
|
||||
The user asked (Todo 11 of `.omo/plans/fix-miniapp-gaps-and-demo-video.md`) to close the mentor mini-app gap: the skill-criticality engine could flag an at-risk skill but never said *who* an apprentice could learn from. The task was to add real apprentice-to-mentor matching: a new `src/lib/mentorMatching.ts` (MentorProfile/ApprenticeNeed/MentorMatch types, `matchApprenticesToMentors()` scoring by exact skill coverage + dependency coverage, reusing mentor.ts's criticality computation, with a deterministic account-id tie-break), a new `mentor.match` payload + `postMentorMatch()` in `mentorEvents.ts`, fed from `MentorScreen.tsx`. Must NOT change `computeSkillCriticality`/`rankAtRiskSkills`/FSRS scheduling, and must NOT expand the fixed 5-node skill graph.
|
||||
|
||||
## desiredOutcome
|
||||
A mentor user sees a real, non-fabricated proposed mentor for an apprentice need, scored by genuine skill + dependency coverage weighted by real skill centrality; an explicit "no-match" state (not a crash, not an arbitrary pick) when nobody covers the needed skills; and a confirmed match persisted as a signed Event Log entry that replays after reload. The criticality/FSRS engines and the 5-node skill graph stay untouched.
|
||||
|
||||
## userOutcomeReview
|
||||
The shipped artifact satisfies the desired outcome. Matching is real (coverage + dependency-coverage weighted by the shared `computeDependentsCounts` centrality), no-match is a first-class result, the match is signed via `postMentorMatch` and replays through `buildConfirmedMentorMatches`, and the protected engines/graph are byte-for-byte unchanged. All builder + matcher functions are wired into `MentorScreen.tsx` (not test-only dead code).
|
||||
|
||||
## Verification performed (independent, from artifacts)
|
||||
|
||||
1. **Tests re-run (reproduced).** `npx vitest run src/lib/mentorMatching.test.ts src/miniapps/mentor --reporter=verbose` → **22 passed (2 files)**, 701ms. Includes the highest-coverage+tiebreak test and the explicit no-match test. Matches executor evidence `.omo/evidence/fix-miniapp-gaps-and-demo-video/task-11-mentor-vitest.txt`.
|
||||
|
||||
2. **mentor.ts / mentorSchedule.ts untouched (confirmed).** `git diff origin/master -- src/lib/mentor.ts src/lib/mentorSchedule.ts` → empty. `git show --stat 803fcfd` lists only: mentorMatching.ts(+test), MentorScreen.tsx(+test), mentorEvents.ts, and the evidence txt. No criticality/FSRS files in the commit.
|
||||
|
||||
3. **Scoring is real, not a stub (confirmed).** `matchApprenticesToMentors` imports and calls `computeDependentsCounts` from `./mentor.ts` (reused, not reimplemented — mentor.ts line 152 confirms this is the exact centrality `computeSkillCriticality` is built on). `scoreCandidate`: exactScore = Σ over covered needed skills of `1 + dependentsCounts.get(skill)` (real criticality weighting); dependency coverage adds `+1` per mentor-held prerequisite drawn from the graph's real `dependsOn` edges (`prerequisiteIdsFor`). Tie-break in `pickBest`: higher score wins, equal score → ascending `accountId.localeCompare`. Deterministic, real.
|
||||
|
||||
4. **Explicit no-match test (confirmed).** `src/lib/mentorMatching.test.ts` test "returns an explicit no-match, not a crash or an arbitrary pick…" asserts `toEqual({ status: "no-match", apprenticeId: "apprentice-1" })` for a mentor holding only `electrician` against a `well-repair` need (no coverage, no prerequisite overlap). Clean no-match, not a crash or arbitrary pick. `pickBest` drops candidates with `score <= 0`, so an arbitrary pick is impossible.
|
||||
|
||||
5. **5-node skill graph NOT expanded (confirmed).** `git diff origin/master 803fcfd -- src/miniapps/mentor/mentorEvents.ts` shows zero changes to `MENTOR_SKILL_GRAPH`; it remains the 5 nodes (well-repair, water-treatment, irrigation, electrician, radio-repair). The mentorEvents.ts diff adds only match plumbing (`MentorMatchPayload`, `isMentorMatchPayload`, `postMentorMatch`, `buildConfirmedMentorMatches`).
|
||||
|
||||
6. **Disclosed design judgment evaluated (acceptable).** Deriving mentor profiles (latest review Good/Easy) and apprentice needs (latest review Again/Hard on an at-risk skill) from existing `mentor.skillReview` entries is honest and reasonable: no dedicated profile/need event shape pre-existed, and `mentor.skillReview` is the only real rating source. The matcher itself takes profiles/needs as inputs and is tested independently of their source, so no functional gap results. The proficiency bar uses ts-fsrs's own `Rating.Good`, and needs are scoped to the real at-risk set from `rankAtRiskSkills` — no fabricated data.
|
||||
|
||||
## remove-ai-slops / programming pass (reviewer's own)
|
||||
- No deletion-only, tautological, or requested-removal tests. Tests assert real behavior (coverage ranking, centrality weighting, tie-break, no-match, self-exclusion, empty-input branches, builder promotion/demotion rules, and the MentorScreen integration incl. cold-reload replay).
|
||||
- The three empty-input tests cover three distinct code branches (empty mentors → no-match, empty needs → empty result, both empty) — edge coverage, not redundant slop.
|
||||
- Production code is not over-extracted: `isSkillReviewPayload` is a legitimate Event Log boundary guard on `unknown` payloads; the `\u0000` composite key is a reasonable map key, not speculative normalization. All exported functions are consumed by MentorScreen.tsx.
|
||||
- No implementation-mirroring assertions; tests use concrete expected objects/values.
|
||||
|
||||
## Checked artifact paths
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/lib/mentorMatching.ts
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/lib/mentorMatching.test.ts
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/mentor/mentorEvents.ts
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/mentor/MentorScreen.tsx
|
||||
- /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/lib/mentor.ts (lines 99/147/152/180 — confirmed shared centrality, unchanged)
|
||||
- .omo/evidence/fix-miniapp-gaps-and-demo-video/task-11-mentor-vitest.txt (executor evidence, corroborated)
|
||||
|
||||
## blockers
|
||||
None.
|
||||
|
||||
## evidence gaps
|
||||
None. All six task checkpoints reproduced from artifacts/commit; no criterion is unverified.
|
||||
@@ -0,0 +1,76 @@
|
||||
# Gate Review - Todo 8: Fair Draw commit-before-reveal (append-to-log fix)
|
||||
|
||||
- **recommendation:** APPROVE
|
||||
- **goal/plan:** `.omo/plans/fix-miniapp-gaps-and-demo-video.md` Todo 8
|
||||
- **worktree:** `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1` (branch `fix-miniapp-gaps-and-demo-video-wave1`)
|
||||
- **commit under review:** `14025ed` (`fix(fairdraw): require a published signed commit before reveal, rejecting unpublished or double reveals`)
|
||||
- **reviewer:** omo-native-gate-reviewer (independent AdversarialVerify), task `st_01a1f037`
|
||||
|
||||
## originalIntent
|
||||
The user (hackathon judge perspective + a hypothetical Hollow resident relying on the draw tool) asked for Fair Draw's commit-reveal gap (GAP-6) to be closed: the commit was never published before reveal, so a draw could be silently re-rolled locally with zero trace. The user explicitly chose the **append-to-log fix only, not a multiparty protocol**, at the approval gate, and explicitly barred any "provably fair" overclaim.
|
||||
|
||||
## desiredOutcome
|
||||
A draw whose commit is genuinely published to the signed, append-only Event Log before its reveal, where:
|
||||
- `startDraw` reaches "committed" UI state (Reveal enabled) only after the commit `append()` resolves AND a `readAll()` confirms the entry persisted.
|
||||
- `revealDraw` appends a `fairdraw.reveal` and the existing crypto runs unchanged.
|
||||
- a pure `validateReveal(log, drawId)` rejects (a) a reveal with no same-`drawId` commit, (b) a reveal not strictly after its commit in `lamportTs`, (c) a reveal that fails `verify()`, and (d) a second reveal for an already-revealed `drawId`.
|
||||
- NO multiparty protocol, NO "provably fair" claim in code/test/UI, NO second-party hard gate (offline solo draw must still work).
|
||||
|
||||
## userOutcomeReview
|
||||
The shipped artifact delivers exactly the outcome the user asked for, at the chosen scope. Re-rolling after a commit is published is now auditable and rejectable; a reveal without a prior published commit, or a second reveal, is rejected by `validateReveal`. The UI no longer overclaims. The offline solo-draw path is preserved (no second party required). The residual risk (pre-publication solo grinding is auditable-not-prevented) is honestly disclosed in the module docstring and matches the user's explicit scope choice.
|
||||
|
||||
## Verification performed (independent reproduction)
|
||||
|
||||
### 1. Test re-run (reproduced, not trusted)
|
||||
`npx vitest run src/miniapps/fairdraw src/lib/fairdraw.test.ts --reporter=verbose`
|
||||
-> **Test Files 2 passed (2), Tests 31 passed (31)**. Matches the executor's evidence file `.omo/evidence/fix-miniapp-gaps-and-demo-video/task-8-fairdraw-vitest.txt` exactly (same 31 test names).
|
||||
|
||||
### 2. Crypto primitives untouched (byte-for-byte)
|
||||
`git show 14025ed --numstat -- src/lib/fairdraw.ts` -> `160 0` (160 insertions, **0 deletions**). `git show ... | grep '^-'` -> NONE. `commit()`, `reveal()`, `verifyCommit()` (exported as `verify`), and `drawOutcome()` have zero deleted/modified lines; the diff is purely additive (new types, guards, `hashParticipants`, `validateReveal`). CONFIRMED untouched.
|
||||
|
||||
### 3. validateReveal enforces all 4 conditions (code read, src/lib/fairdraw.ts:261-291)
|
||||
- (a) same-`drawId` commit must exist: `if (commits.length === 0) return false;` ✓
|
||||
- (d) exactly one reveal (0 = not revealed, 2+ = double-reveal rejected): `if (reveals.length !== 1) return false;` ✓
|
||||
- (b) reveal strictly after commit: `if (theReveal.lamportTs <= commits[0].lamportTs) return false;` (earliest commit canonical, via `.sort`) ✓
|
||||
- (c) verify passes: `return verifyCommit(canonicalCommit.commitHash, revealPayload.seed, revealPayload.salt);` ✓
|
||||
Each has a real test that constructs a genuine violating scenario and asserts rejection:
|
||||
- no prior commit -> false; second reveal (regrind-seed) -> false; same-tick lamportTs (5==5) -> false; tampered seed -> false; plus canonical-earliest-commit tiebreak, two malformed-input guards, and cold-replayed-log happy path. All 4 are real, not tautological.
|
||||
|
||||
### 4. No overclaim anywhere in the diff
|
||||
`git show 14025ed | grep -iE "provabl|guarantee.*fair|cannot.*cheat|..."` -> only (i) line 395, the honest disclaimer `This is strictly weaker than "provably fair"`, and (ii) line 802, the REMOVAL of the old overclaim subtitle. No code/comment/test name/UI string added by this commit overclaims. CONFIRMED.
|
||||
|
||||
### 5. UI copy honestly weakened (RevealDraw.tsx:240)
|
||||
Before: `Commit-reveal verifiable draw, provably not rigged.`
|
||||
After: `Commit-reveal draw: re-rolling after the commit is published is auditable and rejected.`
|
||||
Genuinely weaker and accurate - not a reword. CONFIRMED.
|
||||
|
||||
### 6. cancel_resume proven (RevealDraw.test.tsx)
|
||||
Test "cancel_resume: the commit survives an independent readAll() taken between commit and reveal..." drives a real `append()`+`readAll()` round-trip, takes an independent mid-flight `readAll()` (simulating reload/other replica), then completes the reveal and asserts `validateReveal(finalLog, drawId) === true` over a fresh `readAll()`. A separate lib-level test validates against a `JSON.parse(JSON.stringify(...))` cold-replayed snapshot. Both pass. The commit-gating test also independently re-reads the log (not the component's in-memory phase) to confirm persistence before Reveal is enabled. CONFIRMED - no fixed sleeps; `waitFor` polls real DOM driven by awaited async work.
|
||||
|
||||
### 7. Scope compliance - no multiparty, no second-party hard gate
|
||||
No `webrtc`/`sync`/second-party-confirmation references in `fairdraw.ts` or `RevealDraw.tsx`. `validateReveal` depends only on the local log; `startDraw`/`revealDraw` require only the local identity (`initIdentity()`), no peer. Offline solo draw works. Module docstring explicitly states "NOT a multiparty commit protocol". CONFIRMED.
|
||||
|
||||
## remove-ai-slops / programming overfit pass (reviewer's own)
|
||||
- Tests construct genuine violating scenarios and assert behavior; none are deletion-only, tautological, implementation-mirroring, or "verify a removal" tests.
|
||||
- Type guards (`isFairDrawCommitPayload`/`isFairDrawRevealPayload` with `SHA256_HEX`) are boundary validation of replayed, untrusted log payloads - justified at the system boundary, not gratuitous parsing.
|
||||
- `hashParticipants`/`participantsHash` is spec-required (plan specifies the `{drawId, commitHash, participantsHash, committedAt}` payload shape); documented as audit-only metadata. Not unnecessary extraction.
|
||||
- `validateReveal` uses the structural `FairDrawLogEntry` interface instead of importing `StoredEventLogEntry`, keeping the module standalone - reasonable, not over-abstraction.
|
||||
No maintenance-burden, false-confidence, or scope-drift findings.
|
||||
|
||||
## checked artifact paths
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/lib/fairdraw.ts`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/lib/fairdraw.test.ts`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/fairdraw/RevealDraw.tsx`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/fairdraw/RevealDraw.test.tsx`
|
||||
- `.omo/evidence/fix-miniapp-gaps-and-demo-video/task-8-fairdraw-vitest.txt`
|
||||
- `.omo/plans/fix-miniapp-gaps-and-demo-video.md` (Todo 8 + success criteria)
|
||||
|
||||
## blockers
|
||||
None.
|
||||
|
||||
## NOTES (not tied to a Todo 8 success criterion - informational)
|
||||
- `src/lib/fairdraw.ts:21-23` carries a **pre-existing** docstring (outside this diff; the fairdraw.ts hunk starts at line 108) stating the verified seed "is provably not rigged after the fact." It is narrowly technically correct about the `verify()` primitive (post-hoc verification proves the revealed seed equals the committed one), and the new code explicitly adds the honest "strictly weaker than provably fair" disclaimer. The user-visible UI overclaim was removed. Not a blocker: it was not added by this fix, the plan's guardrail targets the fix's claims and UI copy (both clean), and the statement is defensible in its narrow scope. Optional follow-up: soften lines 21-23 for consistency with the new honest framing.
|
||||
- `validateReveal` is a pure auditable validator; the live UI reveal path uses `verify()` directly for the badge (as the plan specifies). The plan does not require the UI to call `validateReveal`; both acceptance criteria (validator exists + UI gates on commit publication) are satisfied.
|
||||
|
||||
## evidence gaps
|
||||
None - every Todo 8 acceptance criterion and guardrail was independently reproduced from the artifacts.
|
||||
@@ -0,0 +1,45 @@
|
||||
# Gate Review - Todo 9 (Health Post: signed case-relay-to-clinician loop)
|
||||
|
||||
- **recommendation:** APPROVE
|
||||
- **blockers:** none
|
||||
- **commit:** 9e1d153 (worktree `fix-miniapp-gaps-and-demo-video-wave1`)
|
||||
- **repro command:** `cd /home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1 && npx vitest run src/miniapps/healthpost --reporter=verbose`
|
||||
|
||||
## originalIntent
|
||||
Close GAP-8: Health Post had no case-relay-to-clinician loop, so the "untrained proxy reaches real care" half of its stated problem was unbuilt. Todo 9 asks for a signed `healthpost.referral` event (payload + guard + `postReferral()`/`extractReferrals()`) added **beside** the existing `postSymptomReport`/`extractSymptomReports` pair in `src/miniapps/healthpost/healthpostEvents.ts` (NOT a new `src/lib/` file), a "Send to clinician" button in `TriageChat.tsx` for `urgent_referral`/`needs_treatment` results, and a new `ReferralQueue.tsx` reading the log. Guardrails: do NOT change `classifyExam`'s WHO-IMCI tree/age validation; do NOT add a real network call.
|
||||
|
||||
## desiredOutcome
|
||||
A clinician-facing device, by replaying the same signed replicated Event Log (no new transport), sees open cases that a proxy relayed from a completed triage. An urgent/needs-treatment result exposes a working "Send to clinician" button that appends a real signed event; a home-care result never does; an incomplete exam never silently produces a referral.
|
||||
|
||||
## userOutcomeReview
|
||||
Delivered and reachable. `HealthPostScreen.tsx` renders `<SymptomTallyDashboard /> <TriageChat /> <ReferralQueue />` - the queue is live in the real component tree, not dead code. `TriageChat` exposes the button only for `{urgent_referral, needs_treatment}` and posts a real `append()`-backed event; `ReferralQueue` reconstructs open referrals purely from `useEventLogEntries()` via `extractReferrals`. The delivery path is the existing replicated signed log; no transport was added. The user-visible outcome matches the desired outcome.
|
||||
|
||||
## Verification performed (independent, reproduced)
|
||||
1. **Re-ran tests:** `npx vitest run src/miniapps/healthpost --reporter=verbose` -> **5 files, 20 tests, all passed** (duration ~1.0s). Matches the executor's claim exactly.
|
||||
2. **`src/lib/healthpost.ts` untouched:** `git diff --name-only 9e1d153^ 9e1d153` does NOT list `src/lib/healthpost.ts` (nor any `src/lib/*`). classifyExam's WHO-IMCI tree/age validation is unchanged. Confirmed.
|
||||
3. **Same-file mirror + no network:** `postReferral`/`extractReferrals` + `ReferralPayload`/`Referral`/`isReferralPayload`/`isTriageResult` are added inside `healthpostEvents.ts`, directly beneath `postSymptomReport`/`extractSymptomReports`. Only write path is `append()`. `grep -E 'fetch|XMLHttpRequest|axios|WebSocket|http'` over the healthpost diff -> no matches. Confirmed.
|
||||
4. **ReferralQueue wired:** `HealthPostScreen.tsx` imports and renders `<ReferralQueue />`. Reachable. Confirmed.
|
||||
5. **Button visibility logic (read the actual conditional):** `REFERRAL_ELIGIBLE_URGENCY = new Set(["urgent_referral","needs_treatment"])`; button block gated on `REFERRAL_ELIGIBLE_URGENCY.has(result.overallUrgency)`. `home_care` is not in the set, so the button genuinely does not render. The `home_care` test asserts `queryByTestId("triage-send-referral")` is not in the document. Confirmed.
|
||||
6. **MissingExamFieldError test:** mocked at the `classifyExam` call site via `vi.doMock("../../lib/healthpost.ts", ...)` spreading `...actual` and overriding only `classifyExam` to `throw new actual.MissingExamFieldError(["ageMonths"])` - the real exported class, not a faked result shape. `handleSubmit` catches it, sets `error`, leaves `result` undefined, so no result card / no referral button renders; test asserts `extractReferrals(await readAll())` has length 0. Zero referrals posted on error. Confirmed.
|
||||
7. **Malformed/forged payload test:** two cases exercise the real `isReferralPayload` guard - (a) a payload missing `triageResult` (so `isTriageResult` fails) is dropped to length 0; (b) a payload with `status: "closed"` (fails `p.status === "open"`) is dropped to length 0. Genuine guard rejection, not pass-through. Confirmed.
|
||||
|
||||
## remove-ai-slops / programming pass (performed directly over diff, tests, prod code)
|
||||
- **Tests:** 20 tests across 5 files; coverage is proportionate (unit post/extract, UI happy paths for both eligible urgencies, home_care exclusion, cold-replay reconstruction, unrelated-entry filtering, two forged-payload guard cases, honest error path). No deletion-only tests, no tautological tests, no implementation-mirroring beyond the normal guard assertions. The guard tests assert real boundary rejection (forged replicated-log payloads), which is legitimate given the verify-at-read pattern this project already uses for the event log. Not excessive.
|
||||
- **Production parsing/normalization:** `isTriageResult`/`isReferralPayload` validate a payload arriving from the replicated log (a cross-device system boundary), mirroring `eventlog.ts`'s verify-at-read discipline and the existing `isSymptomReportPayload`. This is boundary validation, not speculative over-extraction. No new abstraction/config/plugin layer. No dead code.
|
||||
- **Minor NOTE (not a blocker, no criterion violated):** `status` is always literally `"open"` at `postReferral` time, so the `status` field + its guard clause are mildly redundant for locally-authored events; they still correctly reject forged replicated payloads and match the plan's specified `status: "open"` payload shape. The plan's literal payload lists `createdAtLamportTs` as a field, but the implementation derives it from each entry's own `lamportTs` at extract time instead of signing a caller-supplied value - this is strictly more honest (uses the real append-order position) and the `Referral` interface still exposes `createdAtLamportTs`; the desired capability is satisfied. Neither item violates a stated success criterion.
|
||||
|
||||
## Code-review-report coverage check
|
||||
No separate executor code-review report artifact was provided to this gate beyond the done-claim prose and the vitest evidence file (`.omo/evidence/fix-miniapp-gaps-and-demo-video/task-9-healthpost-vitest.txt`). I therefore performed the skill-perspective overfit/slop check directly (above) rather than confirming a prior report's coverage; my direct check stands on its own evidence.
|
||||
|
||||
## Checked artifact paths
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/healthpost/healthpostEvents.ts`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/healthpost/TriageChat.tsx`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/healthpost/ReferralQueue.tsx`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/healthpost/HealthPostScreen.tsx`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/healthpost/TriageChat.test.tsx`
|
||||
- `/home/athapa/patriothacks-wt/fix-miniapp-gaps-and-demo-video-wave1/src/miniapps/healthpost/healthpostEvents.test.ts`
|
||||
- `git diff --name-only 9e1d153^ 9e1d153` (confirms `src/lib/healthpost.ts` absent)
|
||||
- vitest re-run output (5 files / 20 tests passed)
|
||||
|
||||
## evidence gaps
|
||||
None that block a stated success criterion.
|
||||
@@ -88,7 +88,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
## Todos
|
||||
> Implementation + Test = ONE todo. Never separate.
|
||||
|
||||
- [ ] 1. Water Watch: add pipe-graph leak localization + per-tap arrival-time countdown
|
||||
- [x] 1. Water Watch: add pipe-graph leak localization + per-tap arrival-time countdown
|
||||
What to do: add `src/miniapps/waterwatch/waterNetwork.ts` exporting `PipeNode`/`PipeEdge`/`PipeNetwork` types, a `DEFAULT_PIPE_NETWORK` constant (source -> junction -> tap tree with `flowSeconds` edge weights), and `buildIndex(net)` (sensorToNode map, parent map, children map, BFS depth). Add pure functions in `src/miniapps/waterwatch/waterWatchController.ts`: `localizeAnomaly(net, index, detectingSensorIds)` using lowest-common-ancestor over the flow tree (single sensor -> "corridor" candidate with low confidence; 2+ corroborating sensors -> "pinpoint" origin via folded LCA, high confidence) and `arrivalCountdowns(net, index, originNode, alertTimestampMs, nowMs)` using Dijkstra/BFS over `flowSeconds` from the origin to every tap, converting travel-time to a wall-clock ETA anchored on when the contaminant passed the origin. Extend `ChannelStatus` with optional `localization`/`countdowns` fields populated by `ingest()` only when state is `"alert"` (pass both corroborating sensorIds) or `"corroborating"` (pass the one sensorId) and a network is present. Render an origin banner + sorted per-tap countdown list + a "my tap" selector in `DeviceMonitor.tsx`.
|
||||
Must NOT do: build a real hydraulic/pressure simulator; change `cusum.ts`/`ewma.ts`/`corroboration.ts`'s detection logic; add a new event type (the network is a static config module, not seed/event data, unless you choose to seed it via a `seed.waterwatch.network` event mirroring `seed.resource.water` - either is acceptable, but do not invent a third write path).
|
||||
Closes: GAP-1
|
||||
@@ -99,7 +99,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: deep-low - a concrete graph algorithm (LCA + Dijkstra, worked example already given) the worker implements from evidence, no open trade-off
|
||||
Commit: Y | feat(waterwatch): add pipe-graph leak localization and per-tap arrival countdown
|
||||
|
||||
- [ ] 2. Fair Share: add a lexicographic survival floor before the CEEI solve
|
||||
- [x] 2. Fair Share: add a lexicographic survival floor before the CEEI solve
|
||||
What to do: add a signed `fairshare.floor` payload type `{resource, perAgentFloor}` with a type guard and `postFairshareFloor()`/reducer fold in `src/lib/fairshare.ts` (mirroring the existing `seed.resource.*` fold pattern at fairshare.ts:178-194), written via `append()` from a new admin-panel control. In `computeFairshareAllocation`, after building `agents`/`supply` (fairshare.ts:165-225): for each resource with a recorded floor, compute `floor = min(perAgentFloor, supply[r] / agents.length)`, pass `supplyVector[j] - agents.length * floor` (clamped to >=0) into the existing, unchanged `solveCeeiWaterFilling`, then set `allocation[agent][r] = floor + ceeiShare`. Add `floor: Record<FairshareResource, number>` to `FairshareAllocation`. Recompute `utilities` over the final (floor-inclusive) allocation.
|
||||
Must NOT do: change `solveCeeiWaterFilling`'s signature or its own internal math; let conservation break (floor + residual must always equal total supply - add an explicit assertion/test for this).
|
||||
Closes: GAP-2
|
||||
@@ -110,7 +110,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: unspecified-high - standard multi-file feature composing with an existing validated solver
|
||||
Commit: Y | feat(fairshare): add a per-resource survival floor ahead of the CEEI solve
|
||||
|
||||
- [ ] 3. Farms: add a grow-light kWh energy budget constraint to the LP
|
||||
- [x] 3. Farms: add a grow-light kWh energy budget constraint to the LP
|
||||
What to do: add `kWhPerM2: number` to `CropMaturityWindow` and `energyBudgetKwh?: number` to `SolveFarmsPlantingInput` in `src/lib/farms.ts`. Inside the existing plot/crop variable-build loop in `solveFarmsPlantingOptimizer`: when `energyBudgetKwh !== undefined`, add `constraints["energy"] = { max: input.energyBudgetKwh }` once, and add `variable["energy"] = crop.kWhPerM2` to every variable literal. Guard both new numeric fields with the existing `assertFiniteNumber` from `src/lib/validation.ts`. Add `totalEnergyKwh` to the `"optimal"` result (summed in the same `varMeta` loop that builds the schedule).
|
||||
Must NOT do: change the objective function, the GDD eligibility filter, or any downstream consumer (`applyFarmsForecastToFairshare`, `settleFarmsForecast`) - this is a 3-line addition inside the existing loop, not a rewrite.
|
||||
Closes: GAP-10
|
||||
@@ -121,7 +121,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: quick - a 3-line coefficient/constraint addition inside an existing loop, per the ultrabrain design's own "Quick effort" rating
|
||||
Commit: Y | feat(farms): add a grow-light kWh energy budget constraint to the planting LP
|
||||
|
||||
- [ ] 4. Tunnel Safety: wire live hazard detection into routing + add step-free/accessible routing
|
||||
- [x] 4. Tunnel Safety: wire live hazard detection into routing + add step-free/accessible routing
|
||||
What to do (two parts, same app): (a) In `ReportHazardForm`, reuse the existing `requestMotionPermission`/`subscribeToMotionExposure` capture from `src/lib/lightclockSensors.ts` to collect ~2s of `AccelerometerSample[]` on submit; extend `HazardReportPayload` with optional `accelSamples?: AccelerometerSample[]`, persisted through the existing `reportHazard` -> `append()` path. In `TunnelSafetyScreen.tsx`, build `accelerometerSamplesBySegment` from `computeHazardReports()` output and pass it into the existing `findRoute(TUNNEL_GRAPH, start, end, {...})` call (currently called with no samples), rendering `route.accelerometerCorroboration` as a badge in `HazardFeed`. (b) Add `stepFree?: boolean` to `TunnelSegment` and `accessibleOnly?: boolean` to `RouteOptions`; in `buildAdjacency`, skip any segment with `stepFree === false` when `accessibleOnly` is set. Mark stair segments in `TUNNEL_GRAPH`. Add an accessible-route toggle in `TunnelMap`'s controls driving `findRoute(..., {closedSegmentIds, accessibleOnly})`.
|
||||
Must NOT do: change `findRoute`'s core shortest-path algorithm or its closed-segment handling; require real device-motion hardware for the test (use synthetic `AccelerometerSample[]` fixtures).
|
||||
Closes: GAP-3
|
||||
@@ -132,7 +132,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: unspecified-high - two coordinated standard features (wiring existing dead code, adding a routing constraint) in one app
|
||||
Commit: Y | feat(tunnelsafety): wire live hazard detection into routing and add accessible-route support
|
||||
|
||||
- [ ] 5. Housing: add idle-space discovery + move the write surface into the resident-facing screen
|
||||
- [x] 5. Housing: add idle-space discovery + move the write surface into the resident-facing screen
|
||||
What to do: add a signed `housing.space.report` payload `{spaceId, location, capacity, idleHoursPerDay}` with a type guard, `reportIdleSpace()` (calls `append()`, mirrors `reportHazard`'s shape), and a `discoverAvailableSlots(entries): HousingSlot[]` reducer (replays via the project's existing `sortForReplay`, scales `capacity` by `idleHoursPerDay / 24`) in `src/lib/housing.ts`. Feed its output into `solveHousingAssignment` instead of only the admin-seeded demo slots. Add a `ReportSpaceForm` (mirroring `ReportHazardForm`'s shape) and a "Run assignment cycle" button to `FloorPlanScreen.tsx`, calling `recordHousingAssignmentCycle({residents, slots: discoverAvailableSlots(entries), preferences})` - moving this write surface out of `/admin`-only while keeping the existing read-only assignment view intact for when no new cycle has run yet.
|
||||
Must NOT do: change `solveHousingAssignment`'s MILP constraints (exactly-one-slot, capacity) or its fairness-debt rotation logic; remove the admin-seed path (keep it as the bootstrap/demo-fixture source, additive to the new resident-facing one).
|
||||
Closes: GAP-4
|
||||
@@ -143,7 +143,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: unspecified-high - standard multi-file feature (new event type + reducer + UI form) following an existing pattern
|
||||
Commit: Y | feat(housing): add resident-facing idle-space discovery and assignment-cycle trigger
|
||||
|
||||
- [ ] 6. Find Family: add real cross-device PSI transport, off by default
|
||||
- [x] 6. Find Family: add real cross-device PSI transport, off by default
|
||||
What to do: add `src/miniapps/findfamily/findFamilySync.ts` exporting `connectDirectorySync(room, directory, opts)`, built on `y-webrtc` exactly like `src/lib/assemblySync.ts` (same signaling/room pattern), carrying ONLY `SearchRequest`/`SearchResponse` (already blinded-point-only per `src/lib/findfamily.ts`'s DH-PSI protocol - never plaintext names) over an RTCDataChannel: the searching device sends its request, the responding peer runs `respondToSearch(request, localDirectory)` and returns the response. Wrap this as a `DirectoryChannel` (matching the existing injectable prop shape in `SearchScreen.tsx`) and pass it in behind a new "Search nearby devices" toggle, defaulting OFF (mirroring Assembly's `syncEnabled`/`hasRealtimeTransport()` off-by-default pattern), alongside the existing local-seed-only default.
|
||||
Must NOT do: ever transmit a plaintext name, the local `SEED_DIRECTORY` itself, or any Event Log write for this transport (per `directory.ts`'s own documented reasoning, the directory stays on-device); change `findfamily.ts`'s PSI math.
|
||||
Closes: GAP-7
|
||||
@@ -154,7 +154,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: unspecified-high - standard feature reusing an existing y-webrtc transport pattern verbatim
|
||||
Commit: Y | feat(findfamily): add off-by-default cross-device PSI search transport
|
||||
|
||||
- [ ] 7. Assembly: grant QV credit on the real lifecycle + sign ballots, with the demo-fixture exemption
|
||||
- [x] 7. Assembly: grant QV credit on the real lifecycle + sign ballots, with the demo-fixture exemption
|
||||
What to do (per the architect-validated design, adopted at the approval gate): (a) In `useAssemblyEngine.ts`, call `putResidentCredit(bound.governance, {proposalId, residentId, credits: DEFAULT_QV_CREDITS})` from `addResident()` (for every open proposal) and from `createProposal()` (for every existing roster member) - replacing the test-only call path (`putResidentCredit` currently has zero production callers; it lives in `src/lib/governance.ts`, not under `src/miniapps/assembly/`). Add `export const DEFAULT_QV_CREDITS = 9`. Gate QV ballot/delegate actions on roster enrollment, not just `myAccountId !== undefined` (`AssemblyScreen.tsx`'s current gate). (b) Add a `governance.qvBallot` payload type carried through `eventlog.append()` (`{proposalId, voterId, choice, credits}`), signed over its canonical content exactly like every other event; add `postQvBallot()`/`extractQvBallots()` in a new `src/lib/governanceEvents.ts` (mirroring `healthpostEvents.ts`'s payload-type-constant + type-guard + post/extract pair). `voterId` must equal `toAccountId(authorPubkey)` (`src/shell/accountId.ts`) - verified at READ time (mirroring `eventlog.ts`'s own verify-at-read pattern), never trusted from CRDT persistence. `useAssemblyEngine.castBallot` switches from `castQvBallot` (plain Y.Map write) to `postQvBallot`; `computeQvTally` itself (the pure reducer) is UNCHANGED, now fed from `extractQvBallots(useEventLogEntries())` instead of the CRDT-only `listQvBallots`. Proposals/roster/delegations stay in Yjs for live P2P editing - only the authority-bearing ballot moves onto the signed log.
|
||||
Demo-fixture exemption (adopted default, do not re-derive): because a single device holds exactly one Ed25519 keypair, strict `voterId === toAccountId(localPubkey)` verification would mean only the live local user's own ballot ever validates on one demo machine - breaking the seeded multi-resident demo roster. Scope the security claim to ballots cast LIVE through the UI by the local identity (these get verified and rejected if forged); the admin-seeded demo roster/credits/ballots remain clearly-labeled fixture data for the demo, exempt from the live-signing claim. Label this explicitly in code comments and in the admin seed panel, so it is never mistaken for a security guarantee.
|
||||
Must NOT do: change `computeQvTally`/`resolveEffectiveVoter`'s cycle-safety math; add any test asserting credit-GRANT integrity (self-issued credit forgery is a disclosed, explicitly out-of-scope residual risk for this todo - see Scope OUT); route ballots through `append()`'s Dexie table directly instead of through the existing `postQvBallot`/`extractQvBallots` pair.
|
||||
@@ -166,7 +166,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: deep-high - the demo-fixture-exemption trade-off and the CRDT-vs-signed-log authority split are correctness arguments from invariants, not evidence-settleable alone
|
||||
Commit: Y | fix(assembly): grant QV credit on the real resident/proposal lifecycle and sign ballots at the event log
|
||||
|
||||
- [ ] 8. Fair Draw: require a signed, published commit before reveal is possible
|
||||
- [x] 8. Fair Draw: require a signed, published commit before reveal is possible
|
||||
What to do (per the architect-validated design, adopted at the approval gate - append-to-log fix only, not multiparty): thread a `drawId` (`crypto.randomUUID()`) through the flow. Add `fairdraw.commit` (`{drawId, commitHash, participantsHash, committedAt}`) and `fairdraw.reveal` (`{drawId, seed, salt}`) payload types with type guards in `src/lib/fairdraw.ts`, both written via `append()`. In `RevealDraw.tsx`, `startDraw` must `await append({type: "fairdraw.commit", ...})` and reach the "committed" UI state ONLY after that append resolves (entry persisted, Lamport-ordered) - the reveal button stays disabled until a `readAll()` confirms the commit entry exists in the log. `revealDraw` must `await append({type: "fairdraw.reveal", ...})`, then run the existing `verify()`/`drawOutcome()` unchanged. Add a pure `validateReveal(log, drawId)` enforcing: a `fairdraw.reveal` for `drawId` is valid only if a `fairdraw.commit` with the same `drawId` and a strictly lower `lamportTs` exists; `verify(commitHash, seed, salt)` must pass; and a `drawId` that already has a reveal in the log rejects a second reveal (canonical-commit + one-reveal-per-draw rule).
|
||||
Must NOT do: build any multiparty entropy/commit protocol; add any acceptance criterion, test assertion, or UI copy claiming the draw is "provably fair" (the honest claim is: re-rolling is now auditable and a reveal without a prior published commit, or a second reveal for an already-revealed draw, is rejected - nothing stronger); require a second party's confirmation as a HARD gate (this would break the offline solo-draw case the demo still needs to work).
|
||||
Closes: GAP-6
|
||||
@@ -177,7 +177,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: deep-low - a complete state-machine design (rules, sequencing) is already specified; implementation needs care but no further open trade-off
|
||||
Commit: Y | fix(fairdraw): require a published signed commit before reveal, rejecting unpublished or double reveals
|
||||
|
||||
- [ ] 9. Health Post: add a signed case-relay-to-clinician loop
|
||||
- [x] 9. Health Post: add a signed case-relay-to-clinician loop
|
||||
What to do: add a `healthpost.referral` payload `{triageResult, overallUrgency, createdAtLamportTs, status: "open"}` with a type guard, `postReferral()` (calls `append()`), and `extractReferrals(entries)` in `src/miniapps/healthpost/healthpostEvents.ts` (mirroring the existing `postSymptomReport`/`extractSymptomReports` pair already in that file). In `TriageChat.tsx`'s `handleSubmit`, when `result.overallUrgency` is `"urgent_referral"` or `"needs_treatment"`, surface a "Send to clinician" button calling `postReferral(result)`. Add a `ReferralQueue.tsx` component beside the existing `SymptomTallyDashboard.tsx`, reading `extractReferrals(useEventLogEntries())`, so a clinician-facing device sees open signed cases - delivery rides the existing log-replication path, no new transport.
|
||||
Must NOT do: change `classifyExam`'s WHO-IMCI decision tree or its age-range validation; add a real network call for "sending" the referral (it is a signed event, delivered by the existing replicated-log sync, not a direct message).
|
||||
Closes: GAP-8
|
||||
@@ -188,7 +188,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: quick - a direct mirror of the existing postSymptomReport/extractSymptomReports pair, same file
|
||||
Commit: Y | feat(healthpost): add a signed case-relay-to-clinician referral event and queue
|
||||
|
||||
- [ ] 10. Light Clock: replace the fabricated light-input ramp with an honest two-state mapping, and surface actionable light-timing guidance
|
||||
- [x] 10. Light Clock: replace the fabricated light-input ramp with an honest two-state mapping, and surface actionable light-timing guidance
|
||||
What to do (two parts, same app): (a) In `src/lib/lightclockSensors.ts`, replace the continuous `activityToLightProxy` linear ramp with a two-state mapping: accelerometer magnitude above a movement threshold maps to the existing documented `DEFAULT_AWAKE_LUX` (250) constant, below it maps to `DEFAULT_ASLEEP_LUX` (0) - aligning the sensor path with the same documented assumptions the manual-log fallback already uses, instead of presenting a fabricated continuous curve as if it were measured light. (b) Add a pure `recommendLightTiming(trace, params)` function in `src/lib/lightclock.ts` that turns the existing `estimateDlmoHours` output into concrete advice (CBTmin approx DLMO + 7h; recommend bright-light exposure after CBTmin, avoidance before it), returning `{nextDlmoHour, seekLightWindow, avoidLightWindow}`. Render those windows in `LightClockScreen.tsx`'s status card beside the existing raw phase/amplitude values (do not remove the raw values, add the actionable ones alongside).
|
||||
Must NOT do: change the Hannay19 ODE port (`simulateHannay19`) itself; import anything from the allocator modules the existing `lightclockAllocatorIsolation.test.ts` forbids.
|
||||
Closes: GAP-9
|
||||
@@ -199,7 +199,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: unspecified-high - two coordinated changes (sensor input honesty + new derived-advice function) in one app
|
||||
Commit: Y | fix(lightclock): replace fabricated light-proxy ramp with an honest two-state mapping; add actionable light-timing guidance
|
||||
|
||||
- [ ] 11. Mentor: add real apprentice-to-mentor matching
|
||||
- [x] 11. Mentor: add real apprentice-to-mentor matching
|
||||
What to do: add `src/lib/mentorMatching.ts` with `MentorProfile`, `ApprenticeNeed`, `MentorMatch` types and a pure `matchApprenticesToMentors(mentors, needs)` function scoring candidate mentors by exact skill coverage, dependency coverage (reusing the existing criticality computation from `src/lib/mentor.ts`), and a deterministic account-id tie-break for ties. Add a `mentor.match` payload type with a type guard and `postMentorMatch()` in `src/miniapps/mentor/mentorEvents.ts` (mirroring the existing `mentor.skillReview` event pattern), written via `append()`. Feed mentor profiles/apprentice needs from existing Event Log entries in `MentorScreen.tsx`, rendering proposed matches alongside the existing at-risk skill cards.
|
||||
Must NOT do: change `computeSkillCriticality`/`rankAtRiskSkills` or the FSRS scheduling in `mentorSchedule.ts`; expand the fixed 5-node skill graph as part of this todo (that is a separate, larger content-authoring task, not a code-architecture gap).
|
||||
Closes: GAP-11
|
||||
@@ -210,7 +210,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: unspecified-high - a new scoring engine plus a signed event, standard multi-file feature
|
||||
Commit: Y | feat(mentor): add apprentice-to-mentor matching engine and signed match event
|
||||
|
||||
- [ ] 12. Sky: add a signed mood/morale-pulse event
|
||||
- [x] 12. Sky: add a signed mood/morale-pulse event
|
||||
What to do: add `src/lib/skyMorale.ts` with a `SkyMoralePulsePayload` type `{mood: enum, note?: string, postedAt: number}`, a type guard, validation (reject malformed `mood` values), and `postMoralePulse()` calling `append()`. In `SkyScreen.tsx`, add a compact pulse form (pick a mood, optional short note) and derive/display the latest pulse plus an aggregate mood count from `useEventLogEntries()` - never interpreting the free-text note beyond displaying it verbatim, never inventing a numeric sentiment score from it.
|
||||
Must NOT do: change the deterministic `DEFAULT_SKY_SCHEDULE` or the WebRTC presence wiring in `useSkyPresence.ts`; treat presence count as morale (they are separate signals).
|
||||
Closes: GAP-12
|
||||
@@ -221,7 +221,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: quick - a direct mirror of the existing skyMemoryWall.ts signed-event pattern
|
||||
Commit: Y | feat(sky): add a signed mood/morale-pulse event and aggregate display
|
||||
|
||||
- [ ] 13. The Climb: confirm no fix is needed (verification-only, no production code change)
|
||||
- [x] 13. The Climb: confirm no fix is needed (verification-only, no production code change)
|
||||
What to do: re-run the existing test suite for `src/lib/theclimb.ts` and `src/lib/theclimbCongestion.ts` to reconfirm the prior audit's MATCH verdict still holds after Todos 1-12 land (none of them touch this app). Record the bonus finding from research (the default `fairDrawTieBreaker` at `theclimb.ts:108-129` has the same unpublished-commit gap as Fair Draw, using `Math.random()` in-memory) as a named follow-up in a code comment at that exact location, pointing to this plan file, WITHOUT implementing the fix (explicitly out of scope per `Must NOT have`).
|
||||
Must NOT do: modify `computeWaveSchedule`, `simulateCongestion`, or `fairDrawTieBreaker`'s actual behavior - this todo only re-verifies and documents, it does not change the engine.
|
||||
Closes: (no GAP row - confirmation only, prevents regression from Todos 1-12 touching shared files)
|
||||
@@ -232,7 +232,7 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
Recommended task executor category: quick - a test re-run plus one documentation comment, no production code change
|
||||
Commit: Y | docs(theclimb): note the fair-draw-tie-breaker commit-publication gap as a follow-up
|
||||
|
||||
- [ ] 14. Restructure the demo video into a problem-first, 3-act narrative
|
||||
- [x] 14. Restructure the demo video into a problem-first, 3-act narrative
|
||||
What to do: in `e2e/demoVideoFull.e2e.mjs`, (a) replace the current solution-first intro card copy ("One identity. One signed ledger. No backend.") with a problem-first cold open stated before any UI appears (e.g. "One town. Thirteen disconnected services. No server, no central login - who do you trust when the water turns bad?"), following the Aurus/NagarDrishti technique cited in research. (b) Insert a title card between each of 3 acts, using the SAME visual grammar each time (Linear's repetition-as-signal technique): Act 1 "A crisis, verified twice" (water-watch, fair-share, tunnel-safety, find-family, in that order - reusing the one real existing causal chain: water-watch alert -> fair-share water re-solve -> ... -> tunnel-safety hazard -> find-family reunite); Act 2 "Running the town" (farms, housing, mentor, health-post, light-clock, the-climb); Act 3 "Who decides" (assembly, fair-draw, sky). Keep wallet-signature-verification and the upload-a-mini-app beat as a closing epilogue after Act 3 (they are not in `miniappRegistry.ts`'s 13 apps), before the outro card. (c) Update the tour's recorded beats so every fixed/added behavior from Todos 1-13 is actually visible on camera (e.g. Water Watch's new localization banner, Assembly's now-nonzero QV tally using the seeded fixture roster, Fair Draw's commit-then-reveal timing, Farms' energy readout, Sky's mood pulse, etc.) - this is why this todo is sequenced after all of Wave 1. Re-render the full video through the existing `playwright-recast` pipeline (unchanged tool, just a reordered/regrouped beat script) and extract+view real frames spanning the cold open, each act's title card, and the outro to confirm the restructuring actually rendered.
|
||||
Must NOT do: change the `recordAssemblySyncScene` two-device scene (intentionally left as a plain side-by-side capture); add a grep/word-count/pinned-narration-text test for the video's content - verification here is a structural/prose read plus a real render-and-view-frames pass, never an automated text assertion on narration copy.
|
||||
Closes: GAP-13
|
||||
@@ -245,13 +245,13 @@ Your next move: start execution now (`/ulw-execute fix-miniapp-gaps-and-demo-vid
|
||||
|
||||
## Final verification wave
|
||||
> Runs in parallel after ALL todos. ALL must APPROVE. Surface results and wait for the user's explicit okay before declaring complete.
|
||||
- [ ] F1. Plan compliance audit
|
||||
- [x] F1. Plan compliance audit
|
||||
Recommended task executor category: unspecified-high - confirm every todo 1-14 was implemented exactly as specified (no silent scope reduction or expansion), every `Must NOT have` guardrail held, every commit line matches what was actually committed.
|
||||
- [ ] F2. Code quality review
|
||||
- [x] F2. Code quality review
|
||||
Recommended task executor category: unspecified-high - `npm run lint` and `npm run build` (tsc -b && vite build) both exit 0 on the final tree; no new TypeScript `any`, no suppressed lint rule, no dead code left from a superseded approach.
|
||||
- [ ] F3. Real manual QA
|
||||
- [x] F3. Real manual QA
|
||||
Recommended task executor category: visual-engineering - drive the actual running app (`npm run dev`) through its real UI for at least 4 of the 13 fixes (one per app cluster: water-watch's countdown banner, assembly's non-zero tally, fair-draw's commit-then-reveal timing, the restructured video's 3-act title cards) and capture real screenshots/frames, not a code read.
|
||||
- [ ] F4. Ideal-state fidelity
|
||||
- [x] F4. Ideal-state fidelity
|
||||
Recommended task executor category: unspecified-high - map every IS-1/IS-2 row and every GAP-1..13 row to its delivering todo 1:1, confirm `npm run test` (the full vitest suite, not just the new tests) is green, and confirm no IS row is left unproven; any shortfall becomes a new `- [ ] N.` todo, never a note.
|
||||
|
||||
## Commit strategy
|
||||
|
||||
Reference in new issue
Block a user