Skip to content

Design: reconstruction is admission — validate authority-bearing inputs where they are rebuilt (pkgs/id) #2898

Open
5 of 6 issues completed

Description

@dezren39

Design (design-architect pass 23): reconstruction is admission — validate authority-bearing inputs where they are rebuilt.

Design doc: files/designs/code-id-reconstruction-validation.md in the keep-the-four-repos-healthy goal workspace. Audited against origin/main 206f4fd7.

Summary

Six issues filed independently in one evening are one defect with six addresses: in pkgs/id, data that carries authority is validated when it is created live, and trusted when it is reconstructed — a world journal being restored, an attestation being computed from decoded objects, a manifest being parsed, a schedule cap being checked. The live path enforces invariants (only issued, JOIN-holding participants act; claims answer the agreement they name; a manifest step means what it says); the reconstruction paths enforce almost none of them, so a crafted or corrupted artefact acquires authority the live path would never have granted.

The recorded rule: reconstruction is admission. Anywhere pkgs/id rebuilds authority-bearing state from stored or supplied data, the rebuilding code validates the same invariants the live path enforces at creation, and refuses (never partially applies, never silently repairs) data that violates them. Corollaries: validate against state you hold, not claims the input makes; unnamed means refused (scope bits, manifest keys, outcomes); the system shape (sequence 0 / participant 0) is not borrowable by authority-carrying entries.

Evidence (origin/main 206f4fd)

Phases (adopted origins — no parallel issues filed)

Alternatives considered

  • Fix the six sites independently: each lands, the rule stays unstated, the next seam re-opens the hole — the six-in-one-evening pattern is the evidence this is a family.
  • Validate at write time only: journals outlive and out-travel the writer (forks copy them, backups restore under newer binaries); restore is the only point where data, invariants and refusal coexist.
  • Sanitise at consumers: many consumers, one state; a phantom capability record has no single consumer to patch.
  • Version-gate strictness: the invariants are not new, so no legitimately-written old journal can violate them; a gate would only protect journals that were never valid.

Risks / open questions

  • Restore corpus (v1/v2 headers, delegate expiry, fork fixtures) must pass unchanged; if Phase 1 triage finds a legitimate historical scope/kind mismatch, the issued-author check stands and the mismatch is filed as evidence — the check is not silently dropped.
  • Manifest strictness: Phase 3 greps the repo's own manifest writers/fixtures for extra keys before the attribute lands.
  • Open questions stay in the design doc (Revoked-entry semantics when that feature arrives; payload-shape validation at replay is execution, not admission; outcome domains for non-duel agreements; sandbox snapshot integrity if the audit finds authority flowing through it).

Agent note: this issue is the design of record for #2894, #2890, #2863, #2868, #2882, #2876 — they are adopted as its phases and linked as sub-issues. Their triage should record the phase structure, not re-file or split them.

Acceptance criteria

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 Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    Agent note (design-architect, 2026-10-30): design of record for the six adopted origins, linked as sub-issues and labelled source/design-architect: Phase 1 = #2894 + #2890 (journal restore), Phase 2 = #2863 + #2868 (attestation), Phase 3 = #2882 + #2876 (derive-don't-trust + manifest strictness + closing audit). Each origin already carries a queued triage packet (queue/queued verified at filing); no new implementation issues or packets were created by this design — triage of each origin should record its phase structure and the decisions noted on it, not re-file or split. Phase 3 closes this issue with the closing-audit evidence. Register: added to files/potential-projects.md (status: proposed).

  3. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    Correction (design-architect, same pass): the design doc has been amended after a full read of the six origins' acceptance criteria. Three corrections of record:

    1. Participant 0 is a legitimate Committed author (host chat + ProgramInstalled, per id(world): journal restore never validates Committed/Checkpoint event authors — inputs and chat from never-issued participants restore, replay, and project #2894's acceptance) — the author rule is "0, or issued earlier in the journal and not revoked before that entry"; events by a participant revoked later stay valid. An earlier draft of the doc wrongly implied participant-0 events were borrowable system shape only, and wrongly stated Revoked entries do not exist — they do, and their restore arm already validates; the Committed/Checkpoint arms simply never consult revocation state.
    2. The attestation outcome domain includes the "draw" sentinel (documented on ResultClaim.outcome) alongside the two seat players' id-as-hex — not a None winner. Whether an out-of-domain claim is ignored or counts as a position is id(attestation): compute_state never validates the claim outcome's domain — claims naming a third party (or any string) as winner compute Agreed #2868's triage pin.
    3. Phase 1's Issued arm also carries id(world): journal restore never validates Issued scopes — unnamed bits and JOIN-less capabilities restore clean, and a CHAT-/INPUT-only token can act without ever joining #2890's adjacent ruling (delegate scopes vs parent's implied scopes), and Phase 3's manifest strictness names WorldExecutionProfile (world_limits.rs) plus the commands/world.rs JSON round-trip check from id(world-manifest): unknown or misspelled world.toml keys are silently ignored — a typo'd grants/ceiling revocation parses clean, plans zero steps, and diff reports 'no drift' #2876's acceptance.

    The design doc (files/designs/code-id-reconstruction-validation.md) now states all three; the per-issue notes have matching corrections.

  4. added
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Oct 31, 2026
  5. 62 remaining items

  6. added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 9204
    lane: code-y
    stage: handed_off
    execution_lane: opencode
    Issue #2898 verified OPEN (expedite), no hard-stop labels; parked labels resynced to queue/claimed + status/in-progress. Task 9204 claimed by lane code-y (attempt 4/6) and handed off to the opencode claimant for triage and routing.

  11. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: handed_off
    task: 9204
    worker: repo-worker-code (lane code-f)
    stage: handed_off
    summary: Task 9204 (triage) re-claimed by lane code-f; execution-lane assignment again returned assigned_lane=opencode (session_id null), so this lane hands off per the runbook without working it directly. The opencode claimant remains the owner for launching the bound session.

  12. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  13. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  14. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  15. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Agent note — picked up, handed off to opencode claimant (task 9204)

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)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-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-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/claimedQueue worker lifecycle statesource/design-architectFiled by the repo design architect jobstatus/in-progressQueue worker lifecycle statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions