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(phase-14): persist quota ledgers across sessions (#8301, slice 3) by dezren39 · Pull Request #14518 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@dezren39
id(phase-14): persist quota ledgers across sessions (#8301, slice 3)
b6e078a
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).
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit daa66cb into main Nov 24, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the slice3-8301-quota-ledger branch November 24, 2026 18:01
This was referenced Nov 24, 2026
id(phase-14): reconcile superseded #8301 slice-2 PR #14345 #14520
Closed
Wire the per-agent quota ledger into PolicySession (#8301 slice 2) #14345
Closed
id: auto-lift quota park when the ledger can admit again (proposal from #14345 divergence) #14559
Closed
id(phase-14) v3 step 3: agent-to-agent task delegation protocol (#6302) #10051
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

id(phase-14) v2 step 3: per-agent quota ledger (#6301)

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
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.