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.
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(orsrc/actions/usage.ts, besidereadUsage) has one function that reads the caller's spend across every repository they may write:today(since 00:00 in the forge's zone) andlast24has separate fields, so the two never seem to disagreeheadroomas a percent of its window limit, read the same way MCPsubscription_headroomreads it, without a second calculationtest/usage-forge.test.tsseeds 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 changeFiles: 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.