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): wire quota ledger into PolicySession (#8301, slice 2) by dezren39 · Pull Request #14474 · 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 2 of #8301 (per-agent quota ledger). Slice 1 landed as #14329.

What

  • PolicySession charges through AgentQuotaLedger (per-(agent, world)) instead of a per-session spend counter.
  • RoleGrant carries the role name and the role's QuotaClass (budget + replenishment) in place of a bare quota.
  • PolicySession::new opens the ledger at a given now.
  • Exhaustion parks the agent; ParkEvent now names the replenishment time (replenishes_at), and the refusal detail carries it.
  • spend(now) and owner_summary(now) read spend after replenishment (AgentQuotaLedger::spend_at).

Tests

  • cargo test -p id-caps --lib: 287 passed (adds replenishing_quota_parks_naming_the_next_tick).
  • cargo fmt -p id-caps -- --check: clean.
  • cargo test -p id --test mcp_spike_e2e cannot build in this worktree: pre-existing id-store compile errors unrelated to this change (E0514/E0308 in id-store, untouched here). The e2e test was updated for the new RoleGrant/spend(now)/owner_summary(now) shapes but is unverified here.

Remaining for #8301

  • World-store persistence so leave/rejoin reopens the same ledger.
  • F12.10 (id: F12.10 fair scheduling and per-account quotas #1067) event-shape test.
  • Per-agent and per-role owner spend view wired to the world store.

Refs #8301 (not closing).

{
  "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-24T16:28:51Z",
    "session_id": "ses_e5df1b6e95fffeua7o6DHULZtH",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code-i-8301",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code-i-8301",
      "repo": "developing-today/code",
      "branch": "code-i/id-quota-ledger-8301",
      "sha": "8916bdb8709173164ce8dd4c19dbd3587f785ed0"
    },
    "auth_subject": "oc-code-08",
    "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): wire per-(agent, world) quota ledger into PolicySession (…
8916bdb
…#8301)

Slice 2 of #8301. PolicySession charges through AgentQuotaLedger instead
of a per-session spend counter. RoleGrant carries the role name and its
QuotaClass; the ledger is opened at session start. Exhaustion parks the
agent and the ParkEvent names the replenishment time. spend and
owner_summary read spend as of a given time.

Not in this slice: world-store persistence across leave/rejoin, the
F12.10 (#1067) event-shape test, and the per-agent owner view.
@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 30 minutes.

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: 536cc28f-130c-486a-8fcc-9f6085181830
Commits

Reviewing files that changed from the base of the PR and between 26795ce and 8916bdb.

Files selected for processing: 4

  • pkgs/id/crates/id-caps/src/agent_quota_ledger.rs
  • pkgs/id/crates/id-caps/src/mcp_policy.rs
  • pkgs/id/crates/id-caps/src/role_config.rs
  • pkgs/id/tests/mcp_spike_e2e.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 d2b8db2 into main Nov 24, 2026
2 checks passed

Uh oh!

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

@dezren39
dezren39 deleted the code-i/id-quota-ledger-8301 branch November 24, 2026 17:48
This was referenced Nov 24, 2026
id(phase-14): persist quota ledgers across sessions (#8301, slice 3) #14518
Merged
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.

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.