Skip to content

id: protocol v1 phase 4 — retention and compaction for the event store (#2036) #3797

Open

Description

@dezren39

Phase 4 of the #2036 protocol v1 synthesis, from the #2034 investigation (§7): pkgs/id event_store today keeps every verified event forever (event_store/mod.rs:4-23 — no TTL/compaction/GC). Implement the first per-class retention/compaction path: live-class segments compact to their checkpoint residue (checkpoint events + hashes remain), durable classes untouched, per the class table in doc/2026-10-29T10-45-00Z_investigation_ephemeral_live_data_retention §3/§7. Hard constraints: compaction must preserve fork proofs and waiting-pool after resolution (event_store/mod.rs:12-22). Acceptance: compaction tests per class; a compacted store still verifies chains and resolves fork proofs; durable-class events are never compacted.

Activity

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: picked up

    • Agent: OpenChamber scheduled lane (repo-worker-code)
    • Session / ID: queue task 5787 (repo-health-code-pilot)
    • Found via: atomic queue claim
    • Task: Implement per-class event-store retention/compaction for live-class segments, preserving checkpoint residue, fork proofs, and waiting-pool resolution; durable classes remain untouched.
  4. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  5. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked (clarification)

  7. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — holder: repo-worker-code (OpenChamber scheduled lane), at 2026-11-02T13:44:59Z. event: picked-up; task: 5787; queue: repo-health-code-pilot.

  8. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — holder: repo-worker-code (OpenChamber scheduled lane), at 2026-11-02T13:45:04Z. event: parked; task: 5787; queue: repo-health-code-pilot. Blocked on #3794's signed session.checkpoint event contract landing; preserve the defined checkpoint residue rather than inventing one. Revalidate #3797/#3794 and ownership before resuming; no source or worktree changes this run.

  9. 134 remaining items

  10. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — triage (queue task 18266, openchamber scheduled lane code-g)

    Verdict: still open and unimplemented. Fresh check of origin/main: pkgs/id/src has no event-store retention or compaction path (the only "compact"/"retention" hits are unrelated: Compact theme layout, currency compact_hash, timestamp formatting). Acceptance is not met.

    This is real implementation work in pkgs/id (per-class compaction with fork-proof and waiting-pool after preservation), not a bounded triage fix, so I did not start it here. No follow-on packet was enqueued. Needs a scoped implement packet from the owner, after the 37-comment design thread is reconciled.

  11. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    lane: repo-worker-code (openchamber-scheduled-lane code-j)
    state: parked
    Fresh state 2026-11-17: #3797 OPEN; the design doc doc/2026-10-29T10-45-00Z_investigation_ephemeral_live_data_retention is on origin/main. The fix is a per-class compaction path in pkgs/id/crates/id-events/src/event_store/mod.rs. It must preserve fork proofs and waiting-pool after resolution and never compact durable-class events. That needs a fresh worktree, failing per-class tests first, and CI, so it cannot be finished safely in this run. Parked with a resume brief for the next launch.

  12. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 17, 2026
  13. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  14. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 17, 2026
  15. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked — packet defect

  16. removed their assignment
    on Nov 20, 2026
  17. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · claimed — Lane JR (archer, sandbox fix lane)

  18. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked — platform execution-risk flag (Lane JR, archer)

    • What happened: the laptop worktree for this item was created (~/wt-lane-jr-3797, branch lane-jr-3797, off origin/main a189f9ff178), but the exec result carrying the checkout came back flagged by the platform execution-risk check. Per the standing rule from the prior holds (fleet#89, code#10367, code#12977, code#8472 plugin.disabledTools), I did not read files into execution, run git/build/test commands inside the checkout, or edit anything. Drew's standing clone approval does not clear a per-item flag.
    • Premise (verified fresh before the flag): id: protocol v1 phase 4 — retention and compaction for the event store (#2036) #3797 OPEN and unimplemented; prerequisite id: protocol v1 phase 1 — session header + segment checkpoint event kind (#2036) #3794 CLOSED 2026-11-03; no live claim (latest prior notes are 2026-11-17 parks). Design: doc/2026-11-01_design_id2036.md §4.6 + rule 8, class table in doc/2026-10-29T10-45-00Z_investigation_ephemeral_live_data_retention §3/§7.
    • Prepared scope, ready to execute verbatim on approval (worked out from the store's current code, not yet written):
      • New event_store/compaction.rs in id-events: a CompactionPolicy (caller-declared live-class kinds + per-author retain_recent frontier) and EventStore::compact, running in one write transaction (atomic or no change).
      • Class table per id: investigate: ephemeral live data vs the chained event graph — retention and intermittent signing #2034 §3: durable by construction — group.*, document.*, tag.*, note.*, attestation.*, idset.*, device.*, media.*, identity, issuer.rotation, chat.anchor.v1, and session.checkpoint (design §4.6: checkpoint events are never deleted) can never be compacted, even if a policy names them live. Only policy-declared non-durable kinds (e.g. chat.message.v1, world.move) are eligible; unknown kinds are retained (fail-closed).
      • An eligible event is compacted only when it is applied, below the author's retain frontier, not the author's applied head, not named in proof_ids/proof_headers, not a dependency in waiting_by_dep, and its author holds no fork proof at all (a later fork below an existing point needs the stored bytes).
      • Residue: the event's events/bodies/groups rows are removed; its hashes row stays (that is what "checkpoint events + hashes remain" means mechanically — after resolution reads hashes), and a new lazily-gained compacted table (position → event ID, TAG_FOLD precedent, no format bump) records the residue.
      • decide_in learns the residue, mirroring the existing proof-header pattern ("present but never stored"): a rival arriving at a compacted position is parked (no fork proof can be written from dropped bytes, and the position is never overwritten); a backlink naming the compacted predecessor counts as linked.
      • Tests per class: durable kind never compacted (even when policy-declared live), live kind compacted below the frontier and retained inside it, checkpoint events retained even when declared live; a forked author's proof still resolves after another author compacts; an event naming a compacted event in after is still accepted (dependency resolution preserved); the author's next event still verifies and applies after compaction; reopen-the-store re-verification of all of the above.
      • Key code evidence for the shape: decide_in (ingest.rs) decides forks and backlinks from stored_at bytes, so bytes may only be dropped where the residue rules above hold; presence is hashes ∪ proof_ids (present_in, ingest.rs).
    • What's needed: Drew's plain-words go-ahead for this specific item — the id: protocol v1 phase 4 — retention and compaction for the event store (#2036) #3797 compaction slice in worktree ~/wt-lane-jr-3797 — after which the slice is ready to execute as scoped above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)epic/id-programReprioritization program epic (2026-11-12)queue/blockedQueue or user escalation statesource/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation 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