GeezerVison is showing github.com — [pkgs/id] B16 ScopedLedger reserve() never reclaims expired open reservations: OverCap deadlock (B20/B21 prune-on-full) · Issue #14207 · developing-today/code
[pkgs/id] B16 ScopedLedger reserve() never reclaims expired open reservations: OverCap deadlock (B20/B21 prune-on-full) #14207DescriptionSummary
ScopedLedger::reserve() counts expired-but-still-open reservations against every scope cap and never reclaims them inline, so a ledger whose caps are pinned by expired open entries refuses all new work with BudgetError::OverCap until some out-of-band caller remembers to drive close_expired() + prune(). B20 (DedupLedger::observe) and B21 (RequestCoordinator::observe) both prune expired entries when full and only then return LedgerFull; B16 has no equivalent recovery path.
Where
pkgs/id/crates/id-sync/src/federation/slices/b16_fanout_budget.rs
ScopedLedger::reserve() (168-231): cap check at 205-215 uses held + spent with no expiry filtering, and the function body contains no close_expired/prune call (verified by grep: those symbols appear only at 293/308 definitions).
close_expired() (293-304) and prune() (308-314, only drops closed tombstones) are separate manual steps.
- Contrast:
b20_request_identity.rs:295-299: observe() prunes when full, then returns LedgerFull only if still full.
b21_result_dedup.rs:324-330: same prune-on-full pattern.
Reproduction (code-level)
- Ledger with cap 10 on one scope/dimension.
reserve(id1, {Work:10}, scopes, expires_at=10, now=0) -> Ok (pins 10 held).
- Advance to
now=20 without calling close_expired.
reserve(id2, {Work:1}, scopes, expires_at=30, now=20) -> Err(OverCap), even though id1 expired at 10 and its 10 units are unusable. Recovery requires an explicit close_expired(20) first; reserve never does it.
- The only in-repo callers of
close_expired are the B16 integration tests (crates/id-sync/tests/federation_b16.rs:234,580); no production loop drives it.
Expected vs actual
- Expected: like B20/B21, a full/over-cap
reserve first reclaims what is already expired (close expired opens, then check caps), and only then refuses with OverCap — or documents that the caller must drive close_expired before every reserve.
- Actual: expired open entries pin caps indefinitely; new work deadlocks with
OverCap until manual intervention.
Dedupe
Notes
- No fix, PR, or queue task in this run. Read-only finding; filing only.
- Worktree: token-owned scratch at origin/main 3078b78 (no source changes made).
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T08:25:04Z",
"session_id": "ses_e5df3609f58ffeUvxjS5HuBph3",
"lane": null,
"host": "amd",
"worktree": "/home/user/git/fleet/improvement-issue-creator-code-20261124T081610Z-fc35359a",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/git/fleet/improvement-issue-creator-code-20261124T081610Z-fc35359a",
"repo": "developing-today/code",
"branch": null,
"sha": "307d78b2087100e01e158cd4780555aa77a16e03"
},
"auth_subject": "oc-code-06",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activitydeveloping-today commented on Nov 24, 2026 developing-today-fleet commented on Nov 24, 2026 Independent verification note (ITEM-WORK-203 lane, 2026-11-24 ~18:34Z) for the PR #14389 shepherd:
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|