Skip to content

Design: reconstruction is admission, continued — carried state, checked succession, and every restore's guards (pkgs/id follow-on to #2898) #4000

Open
3 of 5 issues completed

Description

@dezren39

Summary

Design #2898 recorded the rule for pkgs/id — reconstruction is admission: authority-bearing data is validated when created live, so it must be validated where it is rebuilt. Its six origins were the journal seams known that evening. Four more instances have since been filed, in three shapes its phases did not cover — two of them in state that did not exist when #2898 was written:

#2898's closing-audit scope (sandbox snapshot, restore_program, petname persistence) names none of these surfaces; the transfers field did not exist then. This design is #2898's follow-on — the same pattern as #2497 following #1554 — and re-scopes none of its phases.

Full design doc: files/designs/code-id-restore-admission-followon.md in the keep-the-four-repos-healthy goal workspace. Audit baseline: origin/main 83709fac (all sites below read verbatim at HEAD this pass).

The contract

Every path into state is admission. State that arrives carried inside a reconstruction container is validated item-by-item with exactly the rules its standalone form is validated with, before it is installed. A succession predicate in an admission path is checked arithmetic: the successor of u64::MAX does not exist, so the entry is refused — never wrapped to 0, never a panic. And a reconstruction entry point applies the same guard set as the live entry points of the same structure; any deliberate relaxation is a named, separate route, not a silent property of the restore path.

Recorded decisions

  1. Carried transfers are validated by the standalone rules, with the standalone errors — per element, in list order, before assignment: no duplicate (handoff_id, direction); an import's new_owner_epoch is the checked successor of prior_owner_epoch; an export carries no new_owner_epoch (id(world): WorldCore::restore installs checkpoint-carried handoff transfers unvalidated — duplicate sides, non-advancing import epochs, and sequence-claiming transfer events all accepted, unlike the standalone entries #3942's acceptance); each transfer's event has sequence == 0 && participant_id == 0. Refusal aborts the whole restore. One shared per-transfer validation helper is preferred so the arms cannot drift a third time, but the contract is the equivalence, not the refactor. Replaying transfers through the standalone arms loses (the arms push replay events and bump counters; checkpoint transfers are already-applied state).
  2. Succession is checked_add, not saturating_add. Saturation would let MAX → MAX pass an advance check; it is the right idiom for counters that may sit at a cap (since_checkpoint) and the wrong one for a predicate whose job is that the value moved. The two filed sites are the whole core.rs inventory (grep-verified this pass); the closing audit greps the rest of pkgs/id.
  3. The waiting pool's guards are the pool's guards — with the proof park made explicit. restore gains the ready-queue guard unconditionally and the arrived guard on its hold path. The deliberate exception — present_proof re-holding an arrived fork-proof header for good so its conflicts stay seen — becomes an explicit held-for-good route (a park-style entry), not a borrowed missing guard. Copying insert's guard verbatim without moving the proof caller loses: it silently un-parks proof headers. restore's capacity posture (larger-cap stores still open; excess drops, never wedges) is unchanged.
  4. No wire-format or writer change. Live writers cannot produce any refused state — standalone validation is what they already pass, and id(world): WorldCore::restore installs checkpoint-carried handoff transfers unvalidated — duplicate sides, non-advancing import epochs, and sequence-claiming transfer events all accepted, unlike the standalone entries #3942's controls show a valid checkpoint restores Ok — so restore strictness is safe for every journal live code can write (Design: reconstruction is admission — validate authority-bearing inputs where they are rebuilt (pkgs/id) #2898's original strictness argument).

Alternatives that lose (in the doc): folding these into #2898's Phase 3 audit (a named bounded scope inside #2882/#2876; stretching it re-scopes their acceptance from a comment); a Phase 1 bound on the transfers list (no cap value is recorded anywhere — the closing audit dispositions it instead).

Phased breakdown

Open questions stay in the design doc (a bound on active handoffs — no recorded value, dispositioned by Phase 3b; snapshot-content equivalence — #2898 Phase 3's scope, cited not duplicated; store-row cleanup for arrived/ready refusals on reload — Phase 3a triage records it).

Related: #2898 (parent design — a follow-on note is posted there), #3870 (its phases 2–5 are untouched implementation work), #3231 (same crate, different gate — artifact parsed(), no field overlap). Not this design: #3963/#3964 (BoardGraph live-construction checks, no reconstruction surface); #2882's schedule arithmetic (a live-path check, stays in #2898's scope — Phase 2 here is restore succession predicates only).

🤖 Design architect pass 34 (2026-11-01), audit at origin/main 83709fac.

Activity

  1. added
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · design filed, pass 34

  3. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  4. 15 remaining items

  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: task 8331 · repo-fleet-monitor run 2026-11-03 18:12 CST
    • Found via: monitor reconciliation
    • Task: Claim evaporated — task 8331 returned to queued and unclaimed in repo-health-code-pilot after the holding run ended without a terminal verb (checkpoint stage: handed_off). Labels reset to the truth: queue/queued + status/needs-triage. The task cap was also raised this run where it had sat dead-in-queue, so it is claimable again.
    • Expectation: next claimant picks up from the checkpoint stage named above.
  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage findings

  7. added
    expediteImportant - do this very soon, before anything not expedited
    queue/queuedHas a queued task in the Supabase agent queue
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked-up
    queue: repo-health-code-pilot
    task: 9199 (triage, worker repo-worker-code, lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    by: openchamber-scheduled-lane
    at: 2026-11-04T07:11Z

    Issue #4000 is still OPEN and carries the expedite marker. A prior triage note for task 8331 says phases 1–2 are resolved, #3911 remains outstanding, and #4001 is gated; the queue claim evaporated before that routing was finalized. This run will freshly revalidate all phase issues and current main, then record the verdict and route without duplicating existing work.

  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged (live; routed; no duplicate packet)
    queue: repo-health-code-pilot
    task: 9199 (triage, worker repo-worker-code, lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    by: openchamber-scheduled-lane
    at: 2026-11-04T07:15Z

    Fresh revalidation: #4000 remains OPEN and expedite-labelled. Against current origin/main 8bb1e43, Phase 1 (#3942) is CLOSED and carried transfers are validated before installation; Phase 2 (#3736/#3961) is CLOSED and the succession checks use checked_add. Phase 3a (#3911) remains OPEN and queue-claimed/in-progress (task 6238); current WaitingPool::restore still checks only already-held keys and omits the arrived/ready guards. Phase 3b (#4001) remains OPEN and queue-parked (task 5934), gated on #3911.

    Verdict: the umbrella design remains live; keep #4000 open. The remaining work is already routed through active task 6238 and gated task 5934, so this triage did not enqueue a duplicate fix packet. No code changes or tests were made. Removed stale queue/triage claim labels; #4000 retains its expedite marker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)epicMeta-issue grouping multiple items (org Project Type=Epic)expediteImportant - do this very soon, before anything not expeditedkind/designA design proposal (design-architect): multi-step, phased, decision-bearingpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions