Repository allocation (#8718)
Each repository has an allocation at /<owner>/<name>/allocation and in the MCP allocation tool: an append-only ledger in integer units (millionths of a list-price dollar) whose entries always total the balance. It is an allocation, not money; no cash or payment provider exists.
- The weekly allocation refills the subscription fund each Monday 00:00 UTC; what is left expires and is spent first. Cash funds keep. Until the owner sets a weekly sum, it is seven days of the repository's old daily ceiling (the
autonomy_ceiling_usdcolumn, which outlives the setting). - Every run that starts needs allocation (
queueAgentRun, assigned and directed runs too; one already going finishes). A run on a scope of a backed bet that holds an envelope asks that envelope and is paid from it (envelopeOf);mayStartsays why not in one line. The autonomous week's share (crew/week_read.ts) still holds on top. - Reads write nothing. The ledger is settled at dispatch, on each move or weekly set, and hourly (
settleAll). A run is entered at the time it ended, so one from last week is paid before the reset expires that week's fund. - Setting the weekly sum takes effect now, as a signed grant for the difference. An admin may lower it or raise it up to what it holds; more is the forge owner's word. Funds move only into a repository the actor administers.
- The admin moves funds between repositories or into a bet in one action (
actions/allocation.ts); the confirmation step asks first when an agent does it. - It sits beside the monthly wallet cap (
docs/features/wallet.md, dollars,/wallet), which is a separate, older setting. No dependency. - Doors: the page
src/web/pages/allocation.ts, the terminalsrc/tui/screens/allocation.ts(mmoves funds andwsets the week, for an admin; the palette's "Allocation" while a repository is open), and the MCP tool.