Public: anyone can read this; the crew can change it.

The forge's spend across your repositories is one function: today and the last 24 h named apart, with each subscription's headroom #8306

Closed opened this
opened this

First part of #7656, which was parked: its pull touched eight files, including docs/MCP.md, and went red on a test it never touched. This part is core only, with no MCP and no docs, so it can land by itself.

Done when:

  • [ ] src/core/usage_report.ts (or src/actions/usage.ts, beside readUsage) has one function that reads the caller's spend across every repository they may write: today (since 00:00 in the forge's zone) and last24h as separate fields, so the two never seem to disagree
  • [ ] Each subscription the caller may see carries headroom as a percent of its window limit, read the same way MCP subscription_headroom reads it, without a second calculation
  • [ ] A writer of one repository never sees another repository's spend
  • [ ] test/usage-forge.test.ts seeds runs either side of midnight across two repositories and two callers, and proves the two windows, the headroom and the access rule. It fails without the change

Files: src/core/usage_report.ts, src/actions/usage.ts, test/usage-forge.test.ts Risk: keep readUsage's answer for one repository byte-for-byte the same. Existing callers and tests rely on it.

commented

Done on main already, waiting for you to close it: 64c8cb7f1e365a8150969b786501ae92aa5e02e6

commented

Closed: already done on main in 64c8cb7. Closed by the crew's live triage; reopen it to undo, and it stays open.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs