6.5 KiB
Row 122 / #1616 — Agent limits as settings
Base: f529cf485c (row130 included). Candidate
code is uncommitted in detached worktree /mnt/storage/src/mosaic-stack-rocko-122.
Sage posted design note as #1616 comment28516. Decision145 supersedes its
optional migration write: migration is print-only, and has no write helper.
Behavior and authority
launch.models is an explicit selection-key → provider/external-model table.
launch.limits has optional total, provider and exact provider/model counts.
Absence is unlimited, zero denies new launches, safe whole numbers have no
policy ceiling. The example and Jason's migration use editable four/four model
limits, not fallback limits inserted by code. Roles select table keys through
vars.model; harness selection and the shared execution.provider stay unchanged.
Other provider names route/count independently; aliases share exact tuple counts.
One organization writer validates the complete proposed document, checks the expected SHA-256 revision, saves exact previous bytes, fsyncs and atomically renames a candidate, and logs actor/hashes/field old/new values with prepared and committed receipts. A concurrent writer, unsafe/symlink file, stale revision, invalid document or uncertain receipt refuses. Host-start recovery can finish or abort a prepared receipt by hashes. A stale writer lock refuses until an operator verifies the old writer is gone; no automatic stale-lock deletion race.
The broker exposes human-only limits / limits.set using the existing proof. Role, reader and tester capabilities cannot write or forge the actor. CLI limits and Console Settings both go through that broker path. Console POST Settings requires send mode, named Host, verified identity, exact Origin, same-origin Fetch Metadata, bounded JSON and strict writable keys. No automatic retry. The form shows every configured limit, model table and role selection (held CTO included), keeps a failed draft and explicitly offers re-read. Existing GETs and preview remain reads. Launcher reloads policy on every serialized attempt and again after asynchronous checkout preparation; lowering limits keeps existing sessions, whose recorded exact tuple continues counting. Refusal logs name the hit; launch logs name harness/provider/model.
Migration and cut-over
See MIGRATION.md, migration-map.json and jason-migration.patch.json. Provider facts come from Mos via Sage sage-0254: both Claude entries use anthropic. The pure CLI prints the converted whole document without bus/config access, refuses unknown/ambiguous mappings, prints migrated input idempotently and never writes its input. The packet maps pm, cto and reviewer to opus; coder to sonnet. Only the two exact model limits four/four are added. No live file was read.
Jason's edit and the re-pin happen in one window Mos runs, with the PM run idle.
Settings public assets require Mos's landing go (decision123). No bus/Console unit, live organization file or shared wrapper was changed. Only a separate re-pin can make this candidate live (decision109).
Targeted builder gate (decision136)
Changed packages: business, bus, cli, harness, seat, webui. Importers of those
packages in current source: control-board, conversation, ledger, tasks. Run all
node test files in those ten packages; ledger is run directly despite lacking
package.json. Browser form coverage is part of webui, including the new
settings-form.test.mjs. Gate serializes files (--test-concurrency=1).
Exact affected shell readers:
- scripts/test-queue.sh syntax-checks and executes changed scripts/mosaic.
- scripts/test-task.sh invokes scripts/mosaic-task.mjs, which statically imports BusinessError/validateRoleDocument from changed business/src/index.mjs and transitively the changed validator and vocabulary.
scripts/test-discord.sh is an additional regression run for the existing connector command surface; it is not claimed as a direct reader of the patch. The other test-*.sh read unchanged config/auth/release/foundation/extension/ conductor/landing paths or scratch fixture trees, not the changed files.
DOCKER_HOST=unix:///nonexistent.sock throughout normal runs. Docker-required cases will be separately rerun with DOCKER_HOST unset if needed and recorded; no daemon/socket/volume changes. Slot granted by Sage sage-0259. Each mutant uses its own process group and whole-group SIGKILL on timeout; a timeout is not a kill. One recurrence of #258/#261/#262/#263 is noted; a second stops the gate.
Verification results
Final broad targeted gate passed all 13 steps. The late durability and migration audit changes were followed by complete business, bus and CLI reruns; those passing reruns replace their earlier logs in gate/results.json. The bus count increased by one for an integration check through runtime's real shared writer. All node cases below passed, with zero skips/failures.
| Node suite | Passed |
|---|---|
| business | 75 |
| bus | 158 |
| seat | 132 |
| harness | 81 |
| cli | 194 |
| webui (browser form included) | 112 |
| control-board | 124 |
| conversation | 182 |
| ledger (direct) | 86 |
| tasks | 92 |
Shell: queue 28 plus its 156 node tests; Discord 78 plus 183 node tests; task 98. Queue intentionally omits only the canonical-root verify/render checks in the detached worktree. Task ran with DOCKER_HOST unset and Docker server 29.7.2; all 98 cases ran, so no Docker branches were skipped. Queue, Discord, all node suites and mutants used DOCKER_HOST=unix:///nonexistent.sock. The worktree's mosaic-stack-rocko-122_default network existed after Docker and was removed successfully; no daemon/socket/volume changes.
Initial failures were fixture/expectation updates, not known flakes: harness's probe-model needed a table entry; shell.test's exact single-POST assertion needed the explicitly authorized Settings POST. First failure logs are retained under gate/-before-.log. The new runtime integration fixture initially lacked its disposable data directory, fixed before the final bus rerun. No recurrence of #258/#261/#262/#263 occurred.
All 33 mutants were killed, with no syntax/import-only kills, survivors or timeouts. See MUTANTS.md and mutants/results.json for individual sites, commands and logs. Every mutant used a separate process group; source was restored and all 43 candidate hashes were checked afterwards (manifest-check.txt). The post-run cwd/path-scoped node/chromium sweep found no runners before or after (sweep.log). Slot returned to Sage at 2026-10-15 01:04:27 UTC.
Candidate manifest SHA-256: 667441df2411db4c085ec6981d8c9c5f55578debc02a389a2f4df9283df775ae.