47 lines
2.6 KiB
Plaintext
47 lines
2.6 KiB
Plaintext
limits: a daily token quota for the account the stack uses, and bus schema 3h to 3i (row 126, #1620)
|
|
|
|
The business file can name the account claude-code launches use,
|
|
`launch.account` = {name, credential}. `name` is an identifier and
|
|
`credential` names one login set's environment variables, never a value.
|
|
`launch.limits.tokens.daily.<account>` = {limit, since, reset, timeZone}
|
|
sets a daily quota for that account. A daily key that isn't the account's
|
|
name refuses the business read.
|
|
|
|
The new plug-in limit-check/daily-quota (interface 2, pure) starts a day at
|
|
the first instant at or after `reset` on that local date in `timeZone`. Across
|
|
DST that makes a 23- or 25-hour day, and a reset in a skipped hour starts at
|
|
the gap's end. It counts the account's known records of all four kinds since
|
|
the later of the day start and `since`, and counts unknown turns apart.
|
|
|
|
The launcher refuses account-credential-missing, account-credential-ambiguous
|
|
and account-is-credential (an account name equal to a session credential's
|
|
value). Messages name variables, never values. The account rides mayLaunch,
|
|
bindLaunch, the usage records, mustStop and the launch record. A pi launch
|
|
has no account, records NULL, and no daily quota covers it. `mosaic limits`
|
|
and the Console's Settings show one fixed line when a daily row shows:
|
|
"Daily quotas count only this stack's own use of the account, not its use
|
|
anywhere else."
|
|
|
|
Bus schema 3h to 3i: 3h reserved usage_records.account as
|
|
CHECK (account IS NULL). The new step 3h-3i.sql rebuilds the table in one
|
|
transaction, keeping every row's seq and the sqlite_sequence value, and
|
|
recreates the three append-only triggers byte-identical. sqlite_master
|
|
differs from 3h only in the account line. A 3h engine refuses a 3i store.
|
|
packages/bus/tests/account-migration.test.mjs covers all three, with a
|
|
step that fails partway and leaves 3h intact. 3i goes live only through
|
|
`stack-release.sh activate ... --migrate` with Jason present; the activate
|
|
path takes the pre-migrate backup, and the way back is restoring it
|
|
(agents/dewey/work/queue-126/MIGRATION.md). Mos's go mos-0835, six
|
|
conditions, each with its check in the packet's BUILD.md.
|
|
|
|
The public/ change in bus.js (the daily line under the token-limit table)
|
|
carries Mos's decision 123 go mos-0833 on the +/- digest 03e6d9da...ba78,
|
|
unchanged at landing.
|
|
|
|
Owner Dewey, brief docs/plans/2026-10-14_prd-1.2-build.md, "Daily quota for
|
|
the credential the stack uses today". Review round 2 rebases the round 4
|
|
build onto 1df04f52f (row 167). Reviewer: Filbert approve 29068 on review
|
|
round 1 (manifest d18314f7...8e65).
|
|
|
|
Nothing live.
|