From 0c4b8dc231cc52f238b0e9352cf6e88a4df801af Mon Sep 17 00:00:00 2001 From: tegwick Date: Tue, 13 Oct 2026 23:23:10 +0200 Subject: [PATCH] STATE-WP-0098: inbox change-feed contract accepted (D1-D4); add T05 implementation Co-Authored-By: Claude Opus 5.5 Assistant: claude-code Assistant-Model: opus Assistant-Process: 356991@bnt-lap001 Assistant-Session: 5d99ea69-ed55-4a1e-8d97-f4f312db247f --- .custodian-brief.md | 10 +++---- WORK-RECORDS.md | 6 ++-- docs/inbox-change-feed-contract.md | 12 ++++---- .../STATE-WP-0098-hub-core-receipt-inputs.md | 29 +++++++++++++++++-- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/.custodian-brief.md b/.custodian-brief.md index 06a367a..9d6c802 100644 --- a/.custodian-brief.md +++ b/.custodian-brief.md @@ -2,18 +2,18 @@ # Custodian Brief — state-hub **Domain:** infotech -**Last synced:** 2026-10-13 21:09 UTC +**Last synced:** 2026-10-13 21:19 UTC **State Hub:** http://127.0.0.1:8000 *(adjust if running on a remote machine)* ## Active Workstreams ### Supply State Hub inputs that hub-core receipt tasks wait on -Progress: 0/4 done | workplan_id: `0c68970e-295b-57fc-ac70-e472ee3a7bc4` +Progress: 1/4 done | workplan_id: `0c68970e-295b-57fc-ac70-e472ee3a7bc4` **Open tasks:** -- · A5 topic-spine comparison packet `2197b8ae` -- · A4 work/repo UI caller inventory and owner asks `e6ef3381` -- · Inbox change-feed contract `17c424c9` +- ! Inbox change-feed contract `17c424c9` + *(wait: Founder decisions on tombstone retention, pre-retirement purge, broadcast delivery stamps and the additive migration (docs/inbox-change-feed-contract.md))* +- ► A4 work/repo UI caller inventory and owner asks `e6ef3381` - · Named single reader and parity window `077797c8` ### Route human gates and expose actionable owner returns diff --git a/WORK-RECORDS.md b/WORK-RECORDS.md index d6b7f04..330b9d5 100644 --- a/WORK-RECORDS.md +++ b/WORK-RECORDS.md @@ -399,7 +399,7 @@ | task | STATE-WP-0096-T03 | done | — | workplans/STATE-WP-0096-private-decision-dispatch.md | | task | STATE-WP-0097-T01 | done | — | workplans/STATE-WP-0097-unlinked-decision-supersession.md | | task | STATE-WP-0097-T02 | done | — | workplans/STATE-WP-0097-unlinked-decision-supersession.md | -| task | STATE-WP-0098-T01 | todo | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | -| task | STATE-WP-0098-T02 | todo | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | -| task | STATE-WP-0098-T03 | todo | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | +| task | STATE-WP-0098-T01 | done | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | +| task | STATE-WP-0098-T02 | progress | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | +| task | STATE-WP-0098-T03 | wait | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | | task | STATE-WP-0098-T04 | todo | — | workplans/STATE-WP-0098-hub-core-receipt-inputs.md | diff --git a/docs/inbox-change-feed-contract.md b/docs/inbox-change-feed-contract.md index 561e7d5..9fa11b9 100644 --- a/docs/inbox-change-feed-contract.md +++ b/docs/inbox-change-feed-contract.md @@ -1,6 +1,7 @@ -# State Hub inbox change-feed contract (draft) +# State Hub inbox change-feed contract -Status: **draft for review**. Not implemented. Deliverable of `STATE-WP-0098-T03`. +Status: **accepted** (founder, 2026-10-13: D1-D4 as recommended). Not yet +implemented; implementation is `STATE-WP-0098-T05`. Deliverable of `STATE-WP-0098-T03`. It is the State Hub input for `HUB-WP-0011-T01` (the first row of its "Dependency review — 2026-10-04" table). Date: 2026-10-13. @@ -206,10 +207,11 @@ whether that table is populated in the State Hub DB. Aliases are not in v1. `(message_id, revision, deleted_at)`. It must not keep the body. - **Hub-core never emits its own tombstones.** -### Open founder decisions +### Founder decisions (resolved 2026-10-13) -These are not settled by T08/T09. They must be answered before hub-core -implements against this contract. +The T08/T09 record did not settle these. The founder accepted all four +recommendations on 2026-10-13: 90-day tombstones (D1), no purge (D2), +delivery-stamp loss accepted (D3), migration approved (D4). - **D1 — Tombstone retention horizon.** *Recommend:* keep tombstones for 90 days, and at least twice the maximum consumer lag. A cursor older than the diff --git a/workplans/STATE-WP-0098-hub-core-receipt-inputs.md b/workplans/STATE-WP-0098-hub-core-receipt-inputs.md index 2f21aec..9cc1d01 100644 --- a/workplans/STATE-WP-0098-hub-core-receipt-inputs.md +++ b/workplans/STATE-WP-0098-hub-core-receipt-inputs.md @@ -56,9 +56,8 @@ companion section. A4 redirects stay behind the retained UI as rollback. ```task id: STATE-WP-0098-T03 -status: wait -needs_human: true -blocking_reason: "Founder decisions on tombstone retention, pre-retirement purge, broadcast delivery stamps and the additive migration (docs/inbox-change-feed-contract.md)" +status: done +needs_human: false priority: high state_hub_task_id: "17c424c9-4089-56d2-9057-42e34f13827b" ``` @@ -71,6 +70,26 @@ freshness. Deliver as `docs/inbox-change-feed-contract.md`. Any retention/ownership choice that the existing T08/T09 record does not settle goes to the founder before hub-core implements against it. +## Implement the inbox change feed + +```task +id: STATE-WP-0098-T05 +status: todo +priority: high +``` + +Implement `docs/inbox-change-feed-contract.md` as accepted on 2026-10-13: +- the additive migration: `inbox_revision_seq`, `revision` columns on + `agent_messages` and `message_receipts` with backfill, the per-transaction + revision trigger, and `message_tombstones` with its delete trigger +- `GET /messages/feed/snapshot` and `GET /messages/feed?after=v1:`, + with `source_time`, `high_water`, `source_instance`, 410 past the 90-day + horizon and 409 on another instance +- first-write-wins `archived_at` +- tests on PostgreSQL + +The deploy is a separate, confirmed step. + ## Named single reader and parity window ```task @@ -101,3 +120,7 @@ accepted by hub-core. - T03: `docs/inbox-change-feed-contract.md` drafted. A migration is required (no revision column on `agent_messages`/`message_receipts`, no tombstones). Four founder decisions are open. + +2026-10-13: the founder accepted contract decisions D1-D4 as recommended +(90-day tombstones, no purge, delivery-stamp loss accepted, migration +approved). T03 is done, and T05 holds the implementation.