docs: briefs for Q198 S1 and email rows E01, E03-E07 (post-v1; mos-1222, mos-1223)

E12 and E14 wait to be queued until their WAIT-row and S5 prerequisites exist.
This commit is contained in:
2026-10-21 16:54:13 -05:00
parent f437973d79
commit cca206cdce
@@ -0,0 +1,89 @@
# Post-v1 row briefs: Q198 S1 and the READY email rows
Sage, 2026-10-21. These rows are post-v1. MVP rows (Vikunja 414 and 416) and re-pin windows keep first claim
on Sage's gate slot (mos-1221, mos-1225). The owner may build and run static checks while the slot is busy.
Tests still run only on a CLEAR. Owners come from seats that v1 doesn't need. Sage names the owner and the
reviewer when a row starts.
Every row here has the same boundaries:
- No test or run touches `~/.mosaic-dev`, `~/.config/mosaic-dev`, the live units, a slot file, .53 or .54.
- No credential, live mailbox, DNS, external mail, paid call or re-pin. Network is off in tests.
- Gate TMPDIR comes from `mktemp -d /mnt/storage/scratch/tmp/gXXXXXX`, never /tmp.
- New dependencies are exact-pinned, and BUILD.md records their license and advisory review.
- Design notes go in `agents/<seat>/work/queue-<row>/BUILD.md`.
## Brief: Q198 S1 pressure parser and pure rules evaluator
Source: `docs/plans/2026-10-21_q198-system-manager.md`, section 8 row S1, with the signals and thresholds in
section 4 (D4). Huey designed it, and Scrooge approved r6 and r6.1 (mos-1222, Vikunja 452).
Build a parser for the pressure inputs D4 names (`/proc/loadavg`, `MemAvailable`, cgroup memory current, max
and events, CPU, memory and I/O PSI, effective CPU count and memory limits from cpuset and cgroup as well as
the host). Also build a pure evaluator that takes a sequence of timestamped samples and returns hold or release
with a reason. Parsers take file text as input, and tests feed fixture text. Nothing reads `/proc` or
`/sys` in a test.
The evaluator implements the D4 table exactly:
- The hold thresholds, with "for 3 samples" where the table says so.
- The release thresholds. Release needs all applicable low thresholds held for 30 seconds.
- `health-unknown` hold when a required signal is missing or older than 6 seconds.
- The critical-pressure row.
It refuses contradictory settings. Provider scope (429, quota) belongs to S3 and S5, not here.
Not in this row: a live sampler, any process or timer, the bus, the Console, admission records or
enforcement. Those are S2 and S3.
Tests: synthetic load, memory, PSI and missing-signal cases. Each threshold is tested on both sides of its
edge. Hysteresis uses a fake clock. Effective CPU and memory limit cases cover cgroup v2 `max`, cpuset lists
and a host-only fallback. No builds and no real pressure generation.
## Gate: Q198 S1
The reviewer approves the manifest. On Sage's slot, every touched test file passes whole, along with the
suite of the package that holds the module. Two mutants must be killed: one that moves a hold threshold
across its edge, and one that releases before the 30 seconds pass.
## Brief: E01 mail PRD addendum draft and schemas
Source: `docs/plans/2026-10-21_email-plan.md`, "Ordered build rows", row E01. Della wrote the plan, and Ludwig
approved it (ludwig-0005, Vikunja 460, mos-1223). The deliverable and the acceptance tests are the ones in
that row.
The PRD addendum is a draft. Its wording goes to Mos first, then Jason. It doesn't change
`docs/prd/mosaic-stack.md` until Jason approves it. The schemas live in `packages/mail/schemas/`. Core
mail-source registration (`packages/plugins/src/kinds.mjs`) stays unchanged (WAIT Q4).
## Brief: E03 mail ledger, state and quotas
Source: email plan row E03, after E01. Deliverable and acceptance tests as written there. No dependency on
live grants.
## Brief: E04 bounded MIME parsing and quarantine
Source: email plan row E04, after E01. Deliverable and acceptance tests as written there. The MIME
dependency gets the Q7 license and advisory review in BUILD.md.
## Brief: E05 Graph source module against a test-local registry
Source: email plan row E05, after E01, E03 and E04. Offline only. `packages/plugins/src/kinds.mjs` stays
unchanged until the E01 addendum is approved and Q4 is answered. The existing plugin suite passes.
## Brief: E06 IMAP source module
Source: email plan row E06, after E05's test-local shared contract. No core registration. The IMAP
dependency gets the Q7 review.
## Brief: E07 address and rule evaluator
Source: email plan row E07, after E01, E03 and E04. Pure evaluation only, with no org-file activation and no
delivery privilege.
## Gate: email rows
The reviewer approves the manifest. On Sage's slot, the row's named tests pass whole, along with the mail
package suite and any existing suite whose files the row touches. The reviewer names the mutants from the
row's acceptance tests at manifest approval.
E12 and E14 are READY in the plan, but their prerequisites include WAIT rows (E08, E13) and Q198 D13-D15
(S5). Sage queues them once those rows exist, so the queue never marks them startable early.