GeezerVison is showing github.com — id(phase-14): persist quota ledgers across sessions (#8301, slice 3) by dezren39 · Pull Request #14518 · developing-today/code
Conversation
dezren39
commented
Nov 24, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Slice 3 of #8301 (per-agent quota ledger). Slice 2 (#14474) is merged.
What
QuotaLedgerStore (host-side, in id-caps): owns every per-(agent, world) ledger across sessions. First open grants the role's budget; later opens reopen the persisted ledger (spend kept, current budget/cadence adopted). Snapshot/restore via the ledger list, so host restarts keep every spend.
PolicySession::open_stored / close: sessions draw their ledger from the store and hand it back on leave/shutdown; rejoining never resets a budget.
- Owner views on the store:
spend_for_agent (per agent) and spend_by_role (per role); both read-only, never advancing the replenishment clock.
- F12.10 (id: F12.10 fair scheduling and per-account quotas #1067) event-shape test (
ledger_events_keep_the_f12_10_consumed_shape): per-action quota_charged parity with v1, RefusedQuota{axis} + park event naming the replenishment tick on exhaustion, and exact serialized field sets for Quota, AuditEvent, ParkEvent (bridge/audit shapes unchanged).
Tests
cargo test -p id-caps --lib: 294 passed (287 pre-existing + 7 new: 5 store, session leave/rejoin, F12.10 shape).
cargo fmt -p id-caps -- --check: clean. Clippy: no new warnings in touched code.
cargo test -p id --test mcp_spike_e2e not runnable here: pre-existing id-store compile errors, untouched by this change (same as slice 2).
Closes #8301.
{
"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-24T17:59:47Z",
"session_id": "ses_e5df15b3e6effeKXHKhtq4xPJt",
"lane": null,
"host": "amd",
"worktree": "/home/user/git/code-slice3",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/git/code-slice3",
"repo": "developing-today/code",
"branch": "slice3-8301-quota-ledger",
"sha": "b6e078a98267cca50face6e791ec142e09228112"
},
"auth_subject": "oc-code-07",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Per-agent quota ledgers now survive leave/rejoin and host restarts:
QuotaLedgerStore owns every per-(agent, world) ledger across sessions,
PolicySession opens from the store and hands its ledger back on close,
and the store serves per-agent and per-role owner spend views. The
F12.10-consumed event shape is pinned by a test: per-action
quota_charged parity with v1, RefusedQuota plus a park event naming
the replenishment tick on exhaustion, and exact field sets for Quota,
AuditEvent and ParkEvent.
Tests: cargo test -p id-caps --lib: 294 passed (287 pre-existing + 7 new).
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 17 seconds.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
138b607d-9fea-466d-91e5-be437a4982b3
Commits
-
Reviewing files that changed from the base of the PR and between 647c06e and b6e078a.
Files selected for processing: 2
-
pkgs/id/crates/id-caps/src/agent_quota_ledger.rs
pkgs/id/crates/id-caps/src/mcp_policy.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 24, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|