You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Source: CodeRabbit review of PR #8144 (task 14249, issue #5656). The PR's packet acceptance is met and verified by targeted tests; the four findings below are adjacent hardening the review surfaced. Each was dispositioned as follow-up work at merge time rather than expanding PR #8144.
Range sync does not deliver device-operation bodies (PR fix(id/event-store): honor settled device authority in tag clears (#5656) #8144 thread 4522516137, ingest.rs ~291-308). A fresh peer receiving an Admin-device grant through range sync stores only the header and never populates DEVICE_OPS, so its default view can retain a claim a directly-ingesting peer hides. Sync must deliver the committed device-operation body and run it through the receiving peer's ingest flow.
DEVICE_OPS rows leak when held events expire (thread 4522516148, ingest.rs ~309). A stream of signed device events with missing dependencies can repeatedly fill and expire the waiting pool; each expiry leaves a DEVICE_OPS row, growing disk use beyond the waiting-pool limit. Delete the row when a held event expires or is dropped; keep rows for stored events and for held events that are released.
Device operation is not written in the ingest transaction (thread 4522516157, ingest.rs ~313-338). If the process stops or the second write fails after ingest_event commits, the device operation is lost: a missing grant blocks an authorized clear, a missing revocation can let a revoked device hide another author's claim. Write the device operation in the ingest transaction before resolution, including duplicate and waiting paths.
Upgraded stores have no DEVICE_OPS rows for pre-change grants (thread 4522516168, mod.rs ~668-675). Admin-device clears can leave claims visible until the original bodies are supplied again. Provide a recovery path from verified grant/revocation bodies, or explicitly report when recovery is not possible.
Acceptance: each item either lands with tests covering the named scenario, or is closed with evidence the scenario cannot occur.
Triage verdict for #8160 (checked fresh this shift, 2026-11-17): real, still-open work — routed as a scoped follow-on fix packet.
Work kind: task/small_fix (bounded 4-item hardening bundle, each item testable). Priority: priority/normal (kind/bug in the id event store; no expedite signal). Effort: effort/m (four items, each needs a scenario test).
Fresh evidence: PR fix(id/event-store): honor settled device authority in tag clears (#5656) #8144 is MERGED (2026-11-10T14:24Z); the follow-ups were dispositioned at its merge and none has landed since. On origin/main c4404b8, pkgs/id/crates/id-events/src/event_store/ingest.rs still shows the item-3 pattern — record_device_op (~line 239) opens its own write transaction after ingest commits (call sites ~lines 218-223) — and there is no device_ops.remove anywhere in ingest.rs, so the item-2 expiry cleanup is absent. No post-fix(id/event-store): honor settled device authority in tag clears (#5656) #8144 event-store commit mentions DEVICE_OPS hardening for this issue.
First concrete step for the fix: item 3 (write the device op inside the ingest transaction, including duplicate and waiting paths) — it underpins items 1 and 2; then item 2 (delete the row on held-event expiry/drop), item 1 (range sync delivers bodies through the receiver's ingest flow), item 4 (recovery path from verified bodies, or an explicit not-possible report).
Acceptance check: per the issue — each item lands with tests covering its named scenario, or is closed with evidence the scenario cannot occur; targeted id-events tests pass.
Follow-on packet enqueued: dedupe_key repo-health:v1:fix:developing-today/code:issue:8160 (kind small_fix, priority 30, status queued at 2026-11-17T03:46Z; dedupe checked this shift against the live queue).
Parked awaiting test verification; all implementation work is durable. Lane any-c took this task direct under runbook 1b: the lane record showed the opencode assignment with session_id null (binding cleared 2026-11-17T10:25Z via expire_leases), so the assignment was flipped direct with the exclusion reason recorded.
State at park:
PR fix(id-events): DEVICE_OPS hardening — in-transaction writes, expiry cleanup, sync delivery, upgrade recovery (#8160) #11283 OPEN (branch queue/20078-8160-device-ops at c7e98fe, pushed): 3 files in pkgs/id/crates/id-events (ingest.rs, mod.rs, waiting_rows.rs), +491/-51. The PR body maps all four items to mechanisms and names the new tests (waiting-path row written + removed on expiry; row kept and grant applied on release; range-sync batch records the op + bad device body refused; recovery rebuilds a deleted row and reports a header-only event unrecoverable).
Verification launched by the prior supervisor is still queued behind the laptop fleet build lock: cargo test -p id-events --lib, logging to /tmp/lane-id-events-test.out on the laptop (0 bytes at park time; the build-lock queue has multiple 30-60 minute waiters today — the lock, not the code, is the constraint).
Resume: read /tmp/lane-id-events-test.out. If the id-events lib tests are green, merge PR #11283 and complete task 20078 as fixed_merged with the PR as evidence. If the log is still empty, rerun cargo test -p id-events --lib in worktree ~/git/fleet/queue-20078-8160-device-ops through the build lock. If tests fail, the failing names point at the item to fix in the same worktree.
All four items are landed on main via PR #11265 (merged 4fdbd89, 2026-11-17T12:11Z) plus its follow-up commits (d57a650 ingest hardening, 6a8ea29 recovery/sync gaps, 3a9d1a6 warning scope, b5691b9 held-drop ownership). Verified fresh today against origin/main bcb79c8:
Range sync delivers device-op bodies — the receiver's batch ingest decodes each delivered body's device op and records it in the batch transaction; loopback test test_range_sync_ingests_device_operation_body_on_receiver.
Expiry cleanup — every drop of a held-but-not-stored event goes through waiting_rows::drop_held, which removes the DEVICE_OPS row in the same transaction (expiry, reload rebuild, pool-full, stale-row paths); test_expiring_a_held_event_removes_its_device_operation_row.
Ingest atomicity — store_device_op writes inside the ingest transaction for stored, duplicate (late body), waiting and parked paths; the old own-transaction record_device_op is deleted; test_a_device_operation_body_on_a_duplicate_attaches_in_the_same_transaction, test_a_held_device_operation_is_written_with_its_event_and_kept_when_released.
Upgrade recovery — EventStore::open runs recover_device_ops from retained verified bodies (stored + held), one-shot meta flag, warning when recovery is incomplete; test_open_recovers_device_operation_from_a_retained_verified_body, test_open_recovers_device_operation_for_a_held_event.
Verification on a fresh laptop worktree of origin/main: cargo test -p id-events --lib — 327 passed, 0 failed, 2 ignored.
Also closed duplicate PR #11283 (lane code-d's parallel implementation) after diffing it against this merged canonical work; salvage note with the item-by-item comparison is on #11265. Closing #8160 as completed.
Activity
developing-today commentedon Nov 10, 2026
CODE-2409
dezren39 commentedon Nov 17, 2026
state: triaged
lane: any-b, worker: repo-worker-code, task 18592
Triage verdict for #8160 (checked fresh this shift, 2026-11-17): real, still-open work — routed as a scoped follow-on fix packet.
pkgs/id/crates/id-events/src/event_store/ingest.rsstill shows the item-3 pattern —record_device_op(~line 239) opens its own write transaction after ingest commits (call sites ~lines 218-223) — and there is nodevice_ops.removeanywhere in ingest.rs, so the item-2 expiry cleanup is absent. No post-fix(id/event-store): honor settled device authority in tag clears (#5656) #8144 event-store commit mentions DEVICE_OPS hardening for this issue.repo-health:v1:fix:developing-today/code:issue:8160(kind small_fix, priority 30, status queued at 2026-11-17T03:46Z; dedupe checked this shift against the live queue).20 remaining items
dezren39 commentedon Nov 17, 2026
agent-note:v1
state: parked
task: 20078 (queue repo-health-code-pilot, worker repo-worker-code, lane any-c)
Parked awaiting test verification; all implementation work is durable. Lane any-c took this task direct under runbook 1b: the lane record showed the opencode assignment with session_id null (binding cleared 2026-11-17T10:25Z via expire_leases), so the assignment was flipped direct with the exclusion reason recorded.
State at park:
Resume: read /tmp/lane-id-events-test.out. If the id-events lib tests are green, merge PR #11283 and complete task 20078 as fixed_merged with the PR as evidence. If the log is still empty, rerun cargo test -p id-events --lib in worktree ~/git/fleet/queue-20078-8160-device-ops through the build lock. If tests fail, the failing names point at the item to fix in the same worktree.
dezren39 commentedon Nov 17, 2026
agent-note:v1
state: done
task: 20078 (queue repo-health-code-pilot, worker repo-worker-code, lane code-f, origin openchamber-scheduled-lane)
All four items are landed on main via PR #11265 (merged 4fdbd89, 2026-11-17T12:11Z) plus its follow-up commits (d57a650 ingest hardening, 6a8ea29 recovery/sync gaps, 3a9d1a6 warning scope, b5691b9 held-drop ownership). Verified fresh today against origin/main bcb79c8:
test_range_sync_ingests_device_operation_body_on_receiver.waiting_rows::drop_held, which removes the DEVICE_OPS row in the same transaction (expiry, reload rebuild, pool-full, stale-row paths);test_expiring_a_held_event_removes_its_device_operation_row.store_device_opwrites inside the ingest transaction for stored, duplicate (late body), waiting and parked paths; the old own-transactionrecord_device_opis deleted;test_a_device_operation_body_on_a_duplicate_attaches_in_the_same_transaction,test_a_held_device_operation_is_written_with_its_event_and_kept_when_released.EventStore::openrunsrecover_device_opsfrom retained verified bodies (stored + held), one-shot meta flag, warning when recovery is incomplete;test_open_recovers_device_operation_from_a_retained_verified_body,test_open_recovers_device_operation_for_a_held_event.Verification on a fresh laptop worktree of origin/main:
cargo test -p id-events --lib— 327 passed, 0 failed, 2 ignored.Also closed duplicate PR #11283 (lane code-d's parallel implementation) after diffing it against this merged canonical work; salvage note with the item-by-item comparison is on #11265. Closing #8160 as completed.