DD-469: Delivery preparation — durable fake-host effect ledger #13
Labels
No labels
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:fire
svd:go
svd:hold
svd:respec
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/attention-mind-mcp#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Scope and authority
DD-469. Independent preparatory subset of delivery #7, under accepted ADR 0002 and implementation slices, which explicitly permit coordinated delivery preparation after durable commands. Operator asks to leave recovery #6 paused today and progress other tickets. This ticket covers the isolated test host only; it does not bypass any recovery gate or complete #7.
Pin the portable Attention contract and conformance corpus at mind-spec commit
3da6a263e6ae. Base implementation is merged queries #5, commitdfcec304d08a. Delivery intent, notification effect, disposition and business completion remain distinct. No new portable contract decision is made here.Blocked by
None. Durable commands #4 and queries #5 are complete. This test fixture neither opens the provider store nor implements the recovery protocol. Full delivery #7 and packaged acceptance #8 retain their recovery dependencies.
Deliverables
Build a reusable test-only fake delivery host outside the public MCP surface. Use disposable SQLite storage for an observable durable synthetic effect ledger. Provide explicit control of time, whether a durable deduplication guarantee applies, its fixed deadline, and response loss after a committed synthetic effect. These are harness controls, not public tools or production notification adapters.
An applicable guarantee reuses the same opaque intent-level adapter key across retries and restart and records no second effect within the original deadline. Do not silently extend that deadline. Keys and minimal metadata must distinguish queue, recovery generation and host context as well as intent. Reject conflicting reuse rather than treating changed context/payload as a valid replay. Without a guarantee the fixture must truthfully expose that duplicates are possible, rather than manufacturing exactly-once evidence; future provider logic must then leave an ambiguous effect unknown. The fixture itself grants no permission to retry a delivery_begin result.
Store only synthetic opaque identifiers, fixed outcome/control metadata and a request fingerprint if needed. Do not persist candidate/render content. Declare finite ledger limits and deterministic refusal without partial effect at capacity; define cleanup and nondecreasing time across ordinary restart so expiry cannot be undone by clock rollback. Keep this fixture separate from the provider's writer and erasure obligations.
Acceptance
Boundaries and completion
Changes are test support, its meaningful tests and narrowly scoped fixture documentation. No ADR, contract/schema/pin, provider runtime or public CLI/MCP changes; no credentials, real notifications, deployment or storage migration. Do not close #7, #8 or parent epic #1 from this work. Do not change #6's HOLD, four blockers or consumed rework cap.
Link the implementing PR, exact commit, fixture behavior and validation evidence here. ADR-related merges remain subject to mind-spec ratification; this ticket does not request any ADR change.
⏸ SVD architect gate: dev/attention-mind-mcp#13 dd-469-delivery-preparation-durable-fake-host-effect-ledger
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
standard· dispatch effortmediumRun:
20261116T020455Z-20121574Held because: CLEAN but 4 open risk(s) (1 verification · 3 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
Change: Create a test-only module, tests/fake_delivery_host.py. It is outside the wheel, which packages only src/attention_mind_mcp, and it imports no provider internals. Its FakeDeliveryHost uses underscore-private controls (_create, _guarantee_us, _effect_limit, _key_limit, _clock_us, _fault, _lose_response), mirroring store.py:85-91. The guarantee and limits are persisted when the ledger is created and fixed for its life. The SQLite connection mirrors store.py:107-120: WAL, synchronous=FULL, verified pragmas. The transaction() BEGIN IMMEDIATE context manager mirrors store.py:264-292. There is deliberately no flock writer guard, so several processes can race through BEGIN IMMEDIATE. A persisted non-decreasing clock floor mirrors store.py:337-351, and it commits even on refusals because results are returned, not raised (commands.py:171-172). There are three tables: host_config, dedup_keys and effects. dedup_keys holds the binding hash of (queue, generation, host, intent, intent deadline), a payload fingerprint, guaranteed_until_us = min(first_now + guarantee_us, intent_deadline) and an active/expired state; its tombstone CHECK mirrors store.py:221-228. effects is the append-only synthetic effect ledger. No payload column exists. send() runs these steps in order: clock; validate; cleanup tombstones (never deletes); intent expired / seven-day cap; then, under a guarantee, key_conflict, guarantee_expired, replay or capacity preflight, then insert; without a guarantee, always insert a durable=0 effect. A _checkpoint('before_effect_commit') runs before COMMIT and a _checkpoint('after_effect_commit') runs after it (commands.py:262-265). ResponseLost is raised after commit. read_ledger(root) opens the database read-only via URI. A main child entry mirrors the test_commands.py:889-904 SERVER script: clock file, stdin attempt, gate/go files, armed/barrier/SIGSTOP fault, and a lose-response exit code 75. tests/test_fake_delivery_host.py carries UNIT/TRANSPORT markers (test_commands.py:37-38). It includes a Barrier race (test_commands.py:200-230), a kill-and-retry test mirroring test_commands.py:1101-1149 and the server() reap at test_commands.py:931-970, and a private-surface test mirroring test_commands.py:876-886. docs/testing/fake-delivery-host.md documents usage and the evidence boundary.
Files:
tests/fake_delivery_host.py·tests/test_fake_delivery_host.py·docs/testing/fake-delivery-host.mdDecision: accept the 4 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-dd-469-delivery-preparation-durable-fake-host-effect-ledger.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-dd-469-delivery-preparation-durable-fake-host-effect-ledger.md✅ SVD architect gate: dev/attention-mind-mcp#13 dd-469-delivery-preparation-durable-fake-host-effect-ledger
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
unclassified· dispatch effortunclassifiedRun:
20261116T020455Z-20121574Files:
tests/fake_delivery_host.py·tests/test_fake_delivery_host.py·docs/testing/fake-delivery-host.mdWrite-set divergence: present table wins. 0 sourceHashes vs 14-row table.
Decision: dispatch this spec (
svd:go)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-dd-469-delivery-preparation-durable-fake-host-effect-ledger.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-dd-469-delivery-preparation-durable-fake-host-effect-ledger.mdMeasured facts: Half-A run
20261116T020455Z-20121574and its amended-spec recheck are CLEAN: zero blocking findings, no degraded or inconclusive lenses. The three-file write set istests/fake_delivery_host.py,tests/test_fake_delivery_host.py, anddocs/testing/fake-delivery-host.md; deployedclassify_diffreturns T0. The exact pristine basedfcec304d08apassed all 394 tests on voyager (Darwin, Python 3.14.5), with zero known failures. The command wasuv run --locked python3 -m pytest --basetemp /private/tmp/attention-dd469-coordination/fake-host-base-pytestin an isolated detached checkout.Buckets: already decided — ADR 0002 and the implementation-slices plan permit this coordinated preparatory subset after durable commands. Verification — source hashes, marker reader, packaging exclusion, baseline and amended-spec lenses checked. Genuinely open — no contract decision remains. The conservative fixture choices are bounded permanent key tombstones, a separate fixture document, and transport markers only for actual CLI process checks; these resolutions are in Agent Adjustments. The recheck's two nits merely confirm the measured baseline and that those decisions are already resolved.
Ruling: GO for this test-only preparation. No source/runtime, ADR, contract, dependency, credentials, deployment or recovery change is approved. Recovery #6 remains HOLD with its consumed cap, and #7/#8 remain incomplete. The coordinator's latest packet bba664e2 describes proposed recovery proofs awaiting operator approval; it neither changes nor blocks #13.
Drafted line: approve the existing three-file spec and dispatch with the registry defaults, preserved worktree, and an empty known-failure floor. Before merge, independently execute the spec checks at the reviewed head, inspect the actual diff/hygiene, and read native exact-head CI. No merge while those checks are red or missing.
Delegation: operator granted “file tickets”, “merge T4”, “label/de-label svd:go”, and “continue svd and batch-svd (with auto-gate), where possible to progress the project”; later restricted work to our own repo and directed “sidestepped for today? proceed with other ticets?”. ADR merges still require mind-spec exact-head ratification. Acting as attention-mind-mcp under delegation
operator-ownrepo-dd469-20261116.spec-verify-dispatch Half B for dev/attention-mind-mcp#13 dd-469-delivery-preparation-durable-fake-host-effect-ledger completed integration verify.
8d8516ba37python3 -m pytestfails collection here withNo module named 'attention_mind_mcp'. The package is not installed in the Nix python.uv run --lockedcollected and ran the tests, so this is an environment limit only.codex-svd ship --run-id 20261116T020455Z-20121574 --confirm-merge)Completed the independent test-only preparation in PR #14, merged as
5375725434c7after own detached-checkout execution, independent review, and native exact-head Linux validation passed. The changes add a durable synthetic effect ledger, its retry/crash/concurrency/expiry/capacity tests, and a short fixture guide. Local evidence: 29 fixture tests, 359 unit tests and 64 transport tests passed; Ruff and mypy passed. Native validation: https://ci.groupthink.asia/repos/76/pipeline/9/1 . Final ruling: #14 (comment) .Only #13 is complete. Recovery #6 remains HOLD with its consumed attempt cap. #7, #8 and the epic remain open; this preparation does not complete their dependency edges or establish production delivery, Forget/restore, packaged acceptance or deployment readiness.