feat(wake): W2 — three-cursor durable store + RECEIVED/CONSUMED ack-wrapper + watch-list schema #903
Reference in New Issue
Block a user
Delete Branch "feat/wake-store-ack-schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements W2 of the wake/heartbeat canon (EPIC #892) — the durable-queue "heart" — honoring the CONVERGED-DESIGN contracts exactly.
Piece → contract map
A2
store.sh— three-cursor durable store + drain libobserved_seq(detector-assigned monotonic int; this lib records/stores it) is the authoritative cursor; the durable pending-inbox retains until CONSUMED;consumed_seqadvances over a contiguous prefix.observed_seqis authoritative; source SHAs are descriptors, not the cursor.consumed_seqNEVER advances on enqueue / sender exit-0 / pane-paste — only on a consumer CONSUMED ack.class=digestREPLACES the pending cumulative-state entry (newest subsumes prior);actionable/humanAPPEND (never replaced). ALL classes land in the durable store — durability is never bypassed. Absent class ⇒ treated asactionable(fail-safe).{observed_seq, locators, class, emit_ts, hmac};hmacis an unsigned placeholder (HMAC signing is W3/A5, out of W2 scope).mvrename); all state under XDG (${XDG_STATE_HOME:-$HOME/.local/state}/mosaic/wake/).A4
ack.sh— RECEIVED / CONSUMED ack-wrapper (§2.2)wake_iddedups DELIVERY only (dup delivery = re-RECEIVE, never re-action); never advancesconsumed_seq.embedemits the one copy-run line meant to be embedded in each digest.Watch-list SCHEMA contract + Gate B manifest
framework/defaults/wake-watch-list.schema.json— repos, board files, lane anchors, per-class SLOs, source-paritywatchesinventory; SCHEMA only (operator supplies values), withschema_version.framework/tools/wake/manifest.txt— component semver + supported schema range (schema_min/schema_max) as Gate B. It is VERSION metadata only; path-ownership stays withframework-manifest.txt(Gate A) — the new paths are already framework-owned via the existingtools/**anddefaults/**globs, so no ownership edit was needed.RED-first evidence
Harness
framework/tools/wake/test-wake-store-ack.sh, wired intotest:framework-shell. Each invariant was proven to go RED when its contract point is mutated:consumed_seq→ "consumed_seq must NOT advance on enqueue"_atomic_write→ direct write → "target corrupted by a killed mid-write"A real bug was caught RED-first during development:
jq -eover an empty ledger returns exit 0, so the initialwake_iddedup false-positived on the first delivery (T4) — fixed to a count-based slurp check.Gates
shellcheckclean on all four scripts.verify-sanitized.shpasses; operator firewallgrep -niE 'jason|woltje|jarvis'= 0.pnpm test:framework-shellpasses end-to-end with the harness wired in as the final step.prettier --checkpasses on the schema + package.json (no TS changed).Out of W2 scope (not built)
detector (W4), digest renderer/HMAC signer (W3), FN-oracle/reconciler (W5), beacon (W6), installer (W7).
Part of #892
Record of Review — PR #903 W2 (wake store+ack+schema) AFTER union-rebase — full-40, supersedes prior
VERDICT: APPROVE (GO on CI terminal-green). Substance reviewer:
a9dead50(opus, all 8 contract criteria PASS vs CONVERGED-DESIGN §1.2/2.2/2.3/2.4; red-first T1-T7 reproduced; ack never-blocks-net verified). ≠ builder (mosaic-coder).REVIEWED-HEAD (full-40):
7575d42f011c2b9a82dd96d68c3340e0ddd58a55.Delta re-review (rebase) — PASS:
git diff 0f1a37ed 7575d42f -- tools/wake/ defaults/wake-watch-list.schema.json= EMPTY (W2 contract code BYTE-UNCHANGED). The only change from the substance-reviewed head is thegit merge origin/mainbringing #901 + the package.json UNION-resolution of thetest:framework-shellline — keeps BOTHagent-send.test.sh(#901) ANDwake/test-wake-store-ack.sh(this PR); neither dropped. Builder verified full chain green (agent-send 18/18 + wake 8-groups) + prettier clean. mergeable=true.★ CONSUMED gap semantics RATIFIED (reviewer + coordinator): gapless-contiguous-prefix over observed seqs = §1.2 contiguous-prefix + §2.2 cumulative-batch; strict one-at-a-time would CONTRADICT §2.2. Coalescing does not create false gaps (observed.set covers all classes). No change.
GO for id-11 at FULL-40
7575d42f011c2b9a82dd96d68c3340e0ddd58a55on CI terminal-green. Part of #892. Non-executor.GO — Gate-16 id-11 stamp, pinned to exact FULL head
7575d42f01. Basis: verbatim RoRs — substance APPROVE a9dead50 (all 8 contract criteria vs CONVERGED-DESIGN §1.2/2.2/2.3/2.4, red-first T1-T7 independently reproduced) + delta re-review 18877 (union-rebase: contract code byte-unchanged, package.json unions BOTH test entries). CONSUMED gapless-contiguous-prefix semantics RATIFIED (builder/Mos/reviewer concordant). CI terminal-green at head. W2 of EPIC #892 — the wake-canon heart. Named executor: Mos (id-11), squash pinned.