gosalyn: C2-06 brief makes every M5 limit a replyLimits setting with Q219's numbers as defaults, the human's library.limits.set and mosaic limits replies, the M11 writer check, read at check time with per-key fallback to the default, the setup sheet's settings line, the settings and M11 tests, After C2-04, and the build held for Q29 (Q222, mos-1302, design df29550c9)

This commit is contained in:
jason.woltje committed 2026-10-22 11:11:35 -05:00
1 parent 33ac28398f
commit 467be26e35
1 file changed
+37 -14
+37 -14
View File
@@ -374,15 +374,20 @@ every agent-to-human message in a library business.
- Owner: an Opus 5.5 seat that Sage picks.
- Reviewer: Webby.
- After: C2-05a.
- After: C2-05a, and C2-04, since both change `organizationWriter.write`.
### Files owned
- `packages/library/src/guard.mjs` and its export.
- `packages/bus/src/broker.mjs`: the pre-check on `message.send` to `human`, and the page store beside the
web verbs (`:1516`, `:1521`).
- `packages/business/src/business.mjs`: `replyLimits` in `TOP_KEYS` (`:21`), any value accepted.
- `packages/business/src/organization.mjs`: the M11 check in `write` (`:177`), next to M9.
- `packages/cli/src/limits.mjs`: the `mosaic limits replies --file <json>` verb, which calls
`library.limits.set`.
- `packages/bus/src/broker.mjs`: the pre-check on `message.send` to `human`, the page store beside the
web verbs (`:1516`, `:1521`), and the human verb `library.limits.set`.
- `packages/bus/src/web.mjs`, only if the page store needs the fetched text passed out.
- Tests in `packages/library/tests` and `packages/bus/tests`.
- Tests in `packages/library/tests`, `packages/bus/tests`, `packages/business/tests` and
`packages/cli/tests`.
- `docs/case2/SETUP-SHEET.md`, the reply limits paragraph only (`:115-118` at aca16404c), so the sheet and
the guard land together (webby-0139 N1).
@@ -394,24 +399,42 @@ The guard as design 5.2 sets it out: the JSON body, the M5 limits, the checks an
whether to run. The page store keeps the last 20 broker fetches per session, 200 KB each, in memory,
dropped when the session ends.
The `idea` limits are 3 items per reply and 120 characters per item (Q219, mos-1299). The setup sheet's
limits paragraph says at most 3 ideas of up to 120 characters each and drops "You or Jason can ask for
lower limits", since Jason has set them.
Every M5 limit is a setting (Q222, mos-1302), as the design's ruling after r11 on reply limits sets
out: the seven `replyLimits` keys, their defaults and valid values. The defaults are 10 items, 1,200
characters of item text, 3 ideas of 120 characters (Q219, mos-1299), 300 for the other kinds, and
max(12, 25%) for a correction. The guard reads the business file on each check, not the broker's copy
from start. Each key that is missing, `null`, a string, a fraction, negative, below its minimum or above
its ceiling uses its default, and the guard has no path without a number. `library.status` shows the
limits in force and the keys that fell back. M11: only the human's `library.limits.set` changes them,
and `organizationWriter.write` refuses a changed `replyLimits` from any other actor with
`organization-reply-limits-human-only`. A refusal reason names the key and its value in force.
Tests: one pass and one refusal for each check in M5 and 5.2, each limit refused one past its boundary
and accepted at it, so 4 ideas and a 121-character idea refuse. Each goes through the runner's RESULT
path and through `send_message`, and once with a non-creative sender in a library business. The
`messages` count is unchanged on each refusal.
The setup sheet's limits paragraph gives the defaults, says they are settings that she or Jason can
change, and drops "You or Jason can ask for lower limits".
Tests: one pass and one refusal for each check in M5 and 5.2, each default limit refused one past its
boundary and accepted at it, so 4 ideas and a 121-character idea refuse. Each goes through the runner's
RESULT path and through `send_message`, and once with a non-creative sender in a library business. The
`messages` count is unchanged on each refusal. Settings tests: a changed value takes effect on the next
reply with no restart, in both directions. Each invalid value above, a non-object `replyLimits` and a
missing one use the defaults, and the business file still loads. M11 tests: the human's
`library.limits.set` works, and an out-of-range value refuses `invalid-request` with the file unchanged.
`library.limits.set` from an agent session refuses `human-required` and from the tester
`tester-refused`. The chief of staff's `organization.set`, the tester's `instances.set` and a direct
`write` with a changed `replyLimits` refuse, and the file and `changes.jsonl` are unchanged. A mutant
without the writer check fails.
### Out of scope
The runner retry and the runner's notices (C2-07). The Console's rendering (C2-10b). Any classifier of
prose. The idea-text residual is 360 characters per reply, closed by Jason in Q219 (design 5.1, 10 step 8).
prose. The idea-text residual is 360 characters per reply at the defaults, closed by Jason in Q219 (design
5.1, 10 step 8). Any change to the reply format waits for Jason's Q29.
### Gate
Webby approves the manifest. The library, bus and harness suites are green on Sage's gate, along with
every `scripts/test-*.sh`.
Webby approves the manifest. The library, bus, business, cli and harness suites are green on Sage's
gate, along with every `scripts/test-*.sh`. The build doesn't start until Mos relays Jason's answer to
Q29 (mos-1302).
---