GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time · Issue #3911 · developing-today/code

id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911

New issue
Copy link
New issue
Copy link
Closed
Closed
id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time#3911
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/claimedQueue worker lifecycle statesource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/in-progressQueue worker lifecycle statestatus/readyTriaged and ready for queued implementation workstatus/triagedTriaged and routed (see agent note)task/fixhas a fix task queuedtask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/assignedQueue worker lifecycle state

Description

@dezren39
dezren39
opened on Nov 1, 2026
Issue body actions

Summary

WaitingPool::restore (pkgs/id/crates/id-core/src/waiting.rs:312-326) applies a narrower duplicate guard than insert and park: it checks only by_key (already held). insert (waiting.rs:234, guard at :243-246) and park (waiting.rs:273, guard at :281-284) refuse a key that is already held, has arrived, or is sitting in the ready queue. restore checks none of the latter two, so a key the pool already knows is finished or ready-to-hand-out can be held a second time — and later handed out a second time. That is exactly the double hand-out class closed #2001 fixed for insert (which is why the ready_keys index exists, waiting.rs:170-176); the fix never reached restore.

restore is not a test-only path: the event store uses it for every hold. Mirror::hold (pkgs/id/src/event_store/waiting_rows.rs:241) calls pool.restore(...), Mirror::park (waiting_rows.rs:320) re-holds proof headers through it, and the reload-on-open loop (pkgs/id/src/event_store/mod.rs:1015) restores every waiting row through it.

Verified this run (laptop probe, current main 33aefa7)

Probe crate on the laptop (~/git/fleet/probe-2026-11-01-laneA-restoreguard/) #[path]-includes the real waiting.rs from the laptop clone at the same HEAD (md5 9654300d490a030f3f5513c79692e717, identical in both clones) and exercises WaitingPool<u32, &str>:

  • Case A — already-arrived key: arrived(10) then restore(author, 10, [99], ev) → the event is held (len=1, contains(10)=true); a later arrived(99) releases it, handing an already-applied event to the caller a second time. Control: insert of the same arrived key is ignored (len=0).
  • Case B — ready-queue key (id(waiting): WaitingPool::insert's duplicate guard misses the ready queue — the same key inserted twice before take_ready is handed out twice #2001 class): insert(author, 1, [], ev) (goes to the ready queue) then restore(author, 1, [99], ev2) → the same key is also held; arrived(99) releases the held copy and take_ready() returns the ready copy — the same key is handed out twice. Control: park of a ready key is ignored (len(held)=0).

Why it matters

The pool's contract is that a key is in exactly one state — held, ready, or arrived — and is handed out at most once. restore silently breaks that invariant for two of the three states:

  • An already-arrived (applied) event re-held via restore occupies per-author/total cap slots until its dependency happens to arrive or the 7-day age cap drops it, and if the dependency does arrive it is released and applied again.
  • A ready key re-held via restore can be handed out twice (once from the ready queue, once on release), the precise failure id(waiting): WaitingPool::insert's duplicate guard misses the ready queue — the same key inserted twice before take_ready is handed out twice #2001 closed for insert.
  • At the store layer, Mirror::hold's Held/Skipped decision keys off pool.contains(&id) after restore (waiting_rows.rs:242-262), so the phantom hold also writes/keeps a waiting row for an event that is not waiting.

Design constraint — one caller does this on purpose

Mirror::present_proof (waiting_rows.rs:288-301) marks a fork-proof header arrived via pool.arrived(...) and then deliberately re-holds it through restore (Mirror::park, waiting_rows.rs:313-323): a proof header never applies, so it is parked for good to keep its conflicts seen. A blind copy of insert's arrived-guard into restore would silently break that park (the header would never be re-held). The fix therefore has to separate the intents — e.g. restore guards the ready queue unconditionally (no caller parks a ready key on purpose) and the arrived case gets an explicit held-for-good route for proofs — rather than one shared guard pasted over all three entry points. This is also why this issue is filed-only, not a trivial self-solve.

Acceptance criteria

  • WaitingPool::restore can no longer hold a key that is in the ready queue, and a non-proof event whose key has already arrived is not re-held/re-released through the Mirror::hold path; the chosen guard shape is documented on restore like the other two entry points.
  • The fork-proof park still works: present_proof/park_proof keep a proof header held for good after its arrival, with a test pinning that behaviour (existing proof-header tests stay green).
  • Regression tests at the pool level, alongside test_restore_keeps_the_cap_and_ignores_a_key_already_held (waiting.rs:728): restore-after-arrived holds nothing and releases nothing when its deps later arrive; restore-of-a-ready-key holds nothing and the key is handed out exactly once.
  • The reload-on-open and Mirror::hold/park paths behave as before for genuinely waiting/parked events (existing waiting + waiting_rows tests stay green).

Dedup

Open/closed searches for "restore WaitingPool duplicate" and "waiting restore" (2026-11-01) return only #2001 (insert's ready-queue guard — closed, restore not covered), #1567 (total cap — closed), and #1730 (arrived-set growth — open, different defect). No issue covers restore's guard.

Activity

Next
  1. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-a
    • Session / ID: new-issue-creator-code-a cron run 2026-11-01 12:05 CST
    • Found via: filed this run
    • Task: Filed this issue: WaitingPool::restore (pkgs/id/crates/id-core/src/waiting.rs:312) guards only already-held keys, unlike insert/park which also refuse arrived and ready-queue keys — an already-applied event is re-held and released a second time, and a ready key is handed out twice (the id(waiting): WaitingPool::insert's duplicate guard misses the ready queue — the same key inserted twice before take_ready is handed out twice #2001 class). Verified with a laptop probe #[path]-including the real waiting.rs @33aefa7f (~/git/fleet/probe-2026-11-01-laneA-restoreguard/): restore-of-arrived held + released on its dep's arrival, restore-of-ready held + both copies handed out; insert/park controls ignored both. Note the design constraint in the issue: present_proof parks proof headers through restore on purpose, so the fix must separate intents — filed-only, not self-solved.
    • Expectation: effort s; done when restore can no longer hold a ready-queue key or re-release a non-proof arrived event, the proof-header park still works and is test-pinned, and pool-level regression tests cover restore-after-arrived and restore-of-ready.
    • Links: id(waiting): WaitingPool::insert's duplicate guard misses the ready queue — the same key inserted twice before take_ready is handed out twice #2001 (the insert-side guard this extends) · id(waiting): WaitingPool's arrived set grows with every event ever applied — +37 MB per 2M arrivals in a pool that reports itself empty, and no production caller ever reads it #1730 (arrived-set growth, different defect) · probe ~/git/fleet/probe-2026-11-01-laneA-restoreguard/
  3. dezren39
    added a parent issue on Nov 1, 2026
    • Design: reconstruction is admission, continued — carried state, checked succession, and every restore's guards (pkgs/id follow-on to #2898) #4000
  4. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Nov 1, 2026
  5. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · adopted as Phase 3a of design #4000

    • Agent: design architect (repo-design-architect-code), pass 34
    • Task: This issue is Phase 3a of design Design: reconstruction is admission, continued — carried state, checked succession, and every restore's guards (pkgs/id follow-on to #2898) #4000 (reconstruction is admission, continued). Triage: do NOT re-file, re-scope or split it; record the phase structure instead.
    • Decision recorded on Design: reconstruction is admission, continued — carried state, checked succession, and every restore's guards (pkgs/id follow-on to #2898) #4000 that binds this phase: restore gains the ready-queue guard unconditionally and the arrived guard on its hold path — AND the fork-proof park (present_proof / Mirror::park, which deliberately re-holds an arrived header for good) moves to an explicit held-for-good route (a park-style entry or named restore variant) in the same change. Do NOT copy insert's guard into restore verbatim without moving the proof caller: that silently un-parks proof headers and re-opens the conflict-visibility hole. Restore's capacity posture (larger-cap stores still open, excess drops) is unchanged. The store-row cleanup consequence for arrived/ready refusals on reload-on-open is yours to record at triage, per the design doc's open questions.
    • Outcome: Linked as a sub-issue of Design: reconstruction is admission, continued — carried state, checked succession, and every restore's guards (pkgs/id follow-on to #2898) #4000; labelled source/design-architect. Existing queued triage packet stands.
    • Links: Design: reconstruction is admission, continued — carried state, checked succession, and every restore's guards (pkgs/id follow-on to #2898) #4000, Design: reconstruction is admission — validate authority-bearing inputs where they are rebuilt (pkgs/id) #2898, Phase 3 (audit) of #4000 — closing reconstruction-admission inventory for pkgs/id #4001
  6. github-actions
    assigned
    dezren39
    on Nov 1, 2026
  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    on Nov 2, 2026
  8. 110 remaining items

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

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc (OpenChamber scheduled)
    • Session / ID: task 6238
    • Found via: scheduled-run timebox
    • Task: canonical PR fix(id): align waiting restore guards with live admission (#3911) #5516 is open and the strengthened stale-row regression is pushed at 26e7692. Three id-core focused tests passed. Event-store tests are still compiling/running in the existing local shell sh_5p6cqj6c; no result is claimed. No PR CI checks are reported; .github/ci-policy.md's expected PR coverage does not match the current workflow triggers, and existing follow-up ci(id): every main run builds the pkgs/id checks twice — the PR-tier matrix and the full flake check both run on push/schedule since the main-only trigger change #3045 tracks the id workflow trigger gap.
    • Expectation: resume from the preserved worktree, check the existing test shell before rerunning, verify the event-store tests and fresh PR checks, then complete if the criteria are met.
    • Links: fix(id): align waiting restore guards with live admission (#3911) #5516 · id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911
  11. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked verification update

    • Agent: queue worker (repo-worker-code), lane 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc (OpenChamber scheduled)
    • Session / ID: task 6238
    • Found via: completion of the existing local test shell after park
    • Task: shell sh_5p6cqj6c exited cleanly. All five focused cargo commands passed: 2 restore-guard pool tests, held-for-good pool test, arrived-hold stale-row test, proof-park reopen test, and stale-row reload test (6 tests total). PR fix(id): align waiting restore guards with live admission (#3911) #5516 remains OPEN at 26e7692. Fresh check query still reports only CodeRabbit skipping; no required PR CI checks are present. Task remains parked for a fresh scheduled claim after the existing delay.
    • Expectation: next claimant should use this test result, verify fresh PR state/checks, and complete or keep parked according to CI policy.
    • Links: fix(id): align waiting restore guards with live admission (#3911) #5516 · id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911
  12. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-z
    • Session / ID: task 6238
    • Found via: queue claim
    • Task: execution lane is opencode — handed to the opencode claimant, which launches a session bound to task 6238 for resume of the open PR fix(id): align waiting restore guards with live admission (#3911) #5516 work on issue id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911
    • Expectation: claimant session drives task 6238 to its terminal state
    • Links: task 6238
  13. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue 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
  14. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-i
    • Session / ID: task 6238
    • Found via: queue claim
    • Task: fix for issue id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911 handed off to the opencode execution lane; the laptop claimant launches the bound opencode session
    • Expectation: claimant session drives task 6238 to its terminal state
    • Links: issue id(waiting): WaitingPool::restore ignores the arrived and ready-queue duplicate guards — an already-applied or ready event is held again and handed out a second time #3911
  15. dezren39
    closed this as completedin ea6d79aon Nov 5, 2026
  16. dezren39
    added 2 commits that reference this issue on Nov 5, 2026

    Merge pull request #5516 from developing-today/queue/6238-3911-waitin…

    004b717

    id(waiting): update the #3911 mirror hold test to the release-only co…

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/claimedQueue worker lifecycle statesource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/in-progressQueue worker lifecycle statestatus/readyTriaged and ready for queued implementation workstatus/triagedTriaged and routed (see agent note)task/fixhas a fix task queuedtask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.