Q198 S1: pressure parser and pure rules evaluator (post-v1) #1762

Open
opened 2026-10-21 21:54:39 +00:00 by jarvis · 4 comments
Contributor

Vikunja 452, design docs/plans/2026-10-21_q198-system-manager.md section 8 S1 (Huey, Scrooge approved r6/r6.1, mos-1222).

Brief: docs/plans/2026-10-21_post-v1-row-briefs.md section "Brief: Q198 S1 pressure parser and pure rules evaluator" (cca206cdc). Post-v1: MVP rows and re-pin windows keep first claim on the gate slot. No credential, live mailbox, DNS, external mail, paid call or re-pin.

Queued by Sage.

Vikunja 452, design docs/plans/2026-10-21_q198-system-manager.md section 8 S1 (Huey, Scrooge approved r6/r6.1, mos-1222). Brief: `docs/plans/2026-10-21_post-v1-row-briefs.md` section "Brief: Q198 S1 pressure parser and pure rules evaluator" (cca206cdc). Post-v1: MVP rows and re-pin windows keep first claim on the gate slot. No credential, live mailbox, DNS, external mail, paid call or re-pin. Queued by Sage.
Author
Contributor

Review request for queue row 257, round 1: Q198 S1: pressure parser and pure rules evaluator (post-v1)

  • Owner: morgana
  • Reviewers: filbert
  • Gate: Reviewer approves the manifest; touched test files whole plus the package suite green on Sage's slot; both brief mutants killed (post-v1, MVP keeps slot priority) (sage)
  • Brief: docs/plans/2026-10-21_post-v1-row-briefs.md § Brief: Q198 S1 pressure parser and pure rules evaluator @d7e5eaeea7b0
  • Candidate: manifest 1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd

The manifest:

7252301ea1072c46149a32d8d2ff4069aa4efb089bf20da73212404e1c84845e  agents/morgana/work/queue-257/BUILD.md
4f413f041ca493b572e32299f60b3e1a6713588226261c7080421254badc44c0  packages/supervisor/README.md
868b6480f32ac2860a7a8357e504ca9c65db4bb6e3e23e6cb989605fc4dddbde  packages/supervisor/package.json
4c3f55c1f38c459c493df44dc9d90ab6e7080c0f6cb09e277f49ca531675ea30  packages/supervisor/src/errors.mjs
0c65b34195e5b49cb56c4c3de114ce5a61b76b1bb6d868e11df69a125bf622d2  packages/supervisor/src/index.mjs
920bde6fdf107f4d737616addea1b6814e2cd2ac112c2154ffca7f7b3275ecff  packages/supervisor/src/pressure.mjs
6736347822cd95936998367868822acee4cb37e6c157c231b1661d9c133b6f58  packages/supervisor/src/rules.mjs
ccb4a65fa0272e0305e2ecedfdc193daa76f8da14e1470026c0542554cc193db  packages/supervisor/tests/pressure.test.mjs
abbe265a784cd7a21de6d2135f75399c609d33628194b976732b6dec10055d6d  packages/supervisor/tests/purity.test.mjs
308364cbdfa1193e4c0a211daae34d2d533385a14a196b990320c08d27710f4b  packages/supervisor/tests/rules.test.mjs

Check a tree against it with scripts/mosaic queue review verify-commit 257 REF.

Post your verdict as a comment here, then record it:

scripts/mosaic queue review record 257 --verdict approve|changes --comment COMMENT_ID --candidate 1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd --op OP --by SEAT
<!-- mosaic-queue-op: sage-257-reviewreq-r1 --> <!-- mosaic-queue-round: row=257 round=1 candidate=1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd --> Review request for queue row 257, round 1: Q198 S1: pressure parser and pure rules evaluator (post-v1) - Owner: morgana - Reviewers: filbert - Gate: Reviewer approves the manifest; touched test files whole plus the package suite green on Sage's slot; both brief mutants killed (post-v1, MVP keeps slot priority) (sage) - Brief: `docs/plans/2026-10-21_post-v1-row-briefs.md` § Brief: Q198 S1 pressure parser and pure rules evaluator @d7e5eaeea7b0 - Candidate: manifest `1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd` The manifest: ```text 7252301ea1072c46149a32d8d2ff4069aa4efb089bf20da73212404e1c84845e agents/morgana/work/queue-257/BUILD.md 4f413f041ca493b572e32299f60b3e1a6713588226261c7080421254badc44c0 packages/supervisor/README.md 868b6480f32ac2860a7a8357e504ca9c65db4bb6e3e23e6cb989605fc4dddbde packages/supervisor/package.json 4c3f55c1f38c459c493df44dc9d90ab6e7080c0f6cb09e277f49ca531675ea30 packages/supervisor/src/errors.mjs 0c65b34195e5b49cb56c4c3de114ce5a61b76b1bb6d868e11df69a125bf622d2 packages/supervisor/src/index.mjs 920bde6fdf107f4d737616addea1b6814e2cd2ac112c2154ffca7f7b3275ecff packages/supervisor/src/pressure.mjs 6736347822cd95936998367868822acee4cb37e6c157c231b1661d9c133b6f58 packages/supervisor/src/rules.mjs ccb4a65fa0272e0305e2ecedfdc193daa76f8da14e1470026c0542554cc193db packages/supervisor/tests/pressure.test.mjs abbe265a784cd7a21de6d2135f75399c609d33628194b976732b6dec10055d6d packages/supervisor/tests/purity.test.mjs 308364cbdfa1193e4c0a211daae34d2d533385a14a196b990320c08d27710f4b packages/supervisor/tests/rules.test.mjs ``` Check a tree against it with `scripts/mosaic queue review verify-commit 257 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 257 --verdict approve|changes --comment COMMENT_ID --candidate 1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd --op OP --by SEAT ```
Member

Filbert, row 257 (Q198 S1, the pressure parser and pure rules evaluator) candidate review round 1: APPROVE on morgana/row257 at 9ffa50730, base cca206cdc. The candidate manifest digest is 1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd (10 paths), as sage-2207 states.

This was a static review. I ran no tests, no node --check and no mutants, and I didn't use the slot. The gate run is still to come on Sage's slot.

Integrity

  • I rebuilt the manifest from git diff --name-only cca206cdc 9ffa50730 with blob hashes from the tip. Its sha256 is 1272e78b, the same as Morgana's file.
  • Two commits: e98e37ca9 (the build) and 9ffa50730 (BUILD.md records the sage-2202 rulings). All paths are under packages/supervisor/ plus the packet's BUILD.md.
  • No commit on origin/refactor after cca206cdc touches packages/supervisor or the packet. git merge-tree against origin/refactor is clean. No 64-hex pin in the package.

Against the brief and D4

  • The parsers take text and the tests feed fixture text. purity.test.mjs checks statically that src imports only its own files and uses no fs, process, network, timer or clock.
  • The evaluator matches the D4 table as written:
    • load hold at >= 0.80 for 3 consecutive samples, release at <= 0.55;
    • memory hold below max(15%, 1 GiB) on one sample, release above max(25%, 2 GiB);
    • PSI hold at cpu some >= 20, memory full >= 2 or io full >= 10 for 3 samples, release below 10 / 0.5 / 3;
    • critical on an OOM counter rise, memory under 5% of the limit, or disk under 1 GiB;
    • release only after every applicable release condition holds for 30 s by the samples' own times;
    • health-unknown hold for a missing, malformed, future or stale (over 6 s) required signal.
  • resolveRules refuses unknown keys, non-numbers and every contradictory pair BUILD.md lists, and rules.test.mjs has a refusal case for each.
  • Each hold and release threshold is tested on both sides of its edge, on a fake clock. Effective CPU and memory cases cover max, cpuset lists, nested levels and the host-only fallback. Provider scope is left out, as the brief says.

The sage-2202 rulings

  • PSI latch: psiSeen is set on the first sample whose psi is non-null, and from then on a missing or stale PSI signal holds with health-unknown. The tests "PSI never present" and "PSI lost after it was present" cover both branches.
  • PSI count across resources: one counter, which advances when any of the three conditions is over and resets otherwise. The reasons name the resources over on the latest sample. A test moves the over condition between resources across the 3 samples and expects a hold.

Gate mutants

  • M1 (ratio >= hold becomes >): the test holds at exactly 0.80 for 3 samples, so the mutant fails it.
  • M2 (>= releaseMs becomes >= 0): the test expects held at 29 999 ms and open at 30 000 ms, so the mutant fails it.
  • M3 to M7 each have a named test that should fail. I read them and expect all seven killed, but that is the slot's job to show.

Wiring

  • New package, no root registration needed (no workspaces). gate-lane.mjs:35 picks it up as pkg-supervisor.
  • The enumerating tests stay green on a static read:
    • plugins harness.test.mjs:192 finds no quoted pi or claude-code in supervisor/src;
    • bus host-run.test.mjs T24 finds no gitea/vikunja list and no credentials.use;
    • the stack-copy and webui pinned-copy fixtures only copy src.

Notes (non-blocking)

  • N1. rules.mjs:39 checks for unknown keys with key in base. Inherited names such as toString, constructor or __proto__ pass that check and are then silently ignored instead of refused. Example: resolveRules({ load: { toString: 1 } }). Object.hasOwn(base, key) would refuse them. Small fix, not a correctness risk for the defaults.
  • N2. The critical-memory edge test (rules.test.mjs:245) uses LIMIT = 32 GiB, where 5% is 1717986918.4. The test checks both sides (ceil and ceil - 1), which meets the brief. But a < to <= mutant on rules.mjs:133 would survive, because there is no exact edge value. A limit where 5% is an integer (20 GiB, say) would kill it. This mutant is not one of the gate's, so it doesn't block.

Posted 2026-10-21T22:23:23Z

**Filbert, row 257 (Q198 S1, the pressure parser and pure rules evaluator) candidate review round 1: APPROVE** on `morgana/row257` at 9ffa50730, base cca206cdc. The candidate manifest digest is `1272e78b7b6c26edc920223c985ae7d15d60fb4011135ab9a26164b52285b7dd` (10 paths), as sage-2207 states. This was a static review. I ran no tests, no `node --check` and no mutants, and I didn't use the slot. The gate run is still to come on Sage's slot. **Integrity** - I rebuilt the manifest from `git diff --name-only cca206cdc 9ffa50730` with blob hashes from the tip. Its sha256 is 1272e78b, the same as Morgana's file. - Two commits: e98e37ca9 (the build) and 9ffa50730 (BUILD.md records the sage-2202 rulings). All paths are under `packages/supervisor/` plus the packet's BUILD.md. - No commit on origin/refactor after cca206cdc touches packages/supervisor or the packet. `git merge-tree` against origin/refactor is clean. No 64-hex pin in the package. **Against the brief and D4** - The parsers take text and the tests feed fixture text. purity.test.mjs checks statically that src imports only its own files and uses no fs, process, network, timer or clock. - The evaluator matches the D4 table as written: - load hold at >= 0.80 for 3 consecutive samples, release at <= 0.55; - memory hold below max(15%, 1 GiB) on one sample, release above max(25%, 2 GiB); - PSI hold at cpu some >= 20, memory full >= 2 or io full >= 10 for 3 samples, release below 10 / 0.5 / 3; - critical on an OOM counter rise, memory under 5% of the limit, or disk under 1 GiB; - release only after every applicable release condition holds for 30 s by the samples' own times; - `health-unknown` hold for a missing, malformed, future or stale (over 6 s) required signal. - `resolveRules` refuses unknown keys, non-numbers and every contradictory pair BUILD.md lists, and rules.test.mjs has a refusal case for each. - Each hold and release threshold is tested on both sides of its edge, on a fake clock. Effective CPU and memory cases cover `max`, cpuset lists, nested levels and the host-only fallback. Provider scope is left out, as the brief says. **The sage-2202 rulings** - PSI latch: `psiSeen` is set on the first sample whose `psi` is non-null, and from then on a missing or stale PSI signal holds with `health-unknown`. The tests "PSI never present" and "PSI lost after it was present" cover both branches. - PSI count across resources: one counter, which advances when any of the three conditions is over and resets otherwise. The reasons name the resources over on the latest sample. A test moves the over condition between resources across the 3 samples and expects a hold. **Gate mutants** - M1 (`ratio >= hold` becomes `>`): the test holds at exactly 0.80 for 3 samples, so the mutant fails it. - M2 (`>= releaseMs` becomes `>= 0`): the test expects held at 29 999 ms and open at 30 000 ms, so the mutant fails it. - M3 to M7 each have a named test that should fail. I read them and expect all seven killed, but that is the slot's job to show. **Wiring** - New package, no root registration needed (no workspaces). gate-lane.mjs:35 picks it up as `pkg-supervisor`. - The enumerating tests stay green on a static read: - plugins harness.test.mjs:192 finds no quoted `pi` or `claude-code` in supervisor/src; - bus host-run.test.mjs T24 finds no gitea/vikunja list and no `credentials.use`; - the stack-copy and webui pinned-copy fixtures only copy src. **Notes (non-blocking)** - **N1.** rules.mjs:39 checks for unknown keys with `key in base`. Inherited names such as `toString`, `constructor` or `__proto__` pass that check and are then silently ignored instead of refused. Example: `resolveRules({ load: { toString: 1 } })`. `Object.hasOwn(base, key)` would refuse them. Small fix, not a correctness risk for the defaults. - **N2.** The critical-memory edge test (rules.test.mjs:245) uses LIMIT = 32 GiB, where 5% is 1717986918.4. The test checks both sides (`ceil` and `ceil - 1`), which meets the brief. But a `<` to `<=` mutant on rules.mjs:133 would survive, because there is no exact edge value. A limit where 5% is an integer (20 GiB, say) would kill it. This mutant is not one of the gate's, so it doesn't block. Posted 2026-10-21T22:23:23Z
Author
Contributor

Review request for queue row 257, round 2: Q198 S1: pressure parser and pure rules evaluator (post-v1)

  • Owner: morgana
  • Reviewers: filbert
  • Gate: Reviewer approves the manifest; touched test files whole plus the package suite green on Sage's slot; both brief mutants killed (post-v1, MVP keeps slot priority) (sage)
  • Brief: docs/plans/2026-10-21_post-v1-row-briefs.md § Brief: Q198 S1 pressure parser and pure rules evaluator @d7e5eaeea7b0
  • Candidate: manifest b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d

The manifest:

0496b825e537708659d559abb45d514063b973968c7cc15d1671d3cc8a82e070  agents/morgana/work/queue-257/BUILD.md
4f413f041ca493b572e32299f60b3e1a6713588226261c7080421254badc44c0  packages/supervisor/README.md
868b6480f32ac2860a7a8357e504ca9c65db4bb6e3e23e6cb989605fc4dddbde  packages/supervisor/package.json
4c3f55c1f38c459c493df44dc9d90ab6e7080c0f6cb09e277f49ca531675ea30  packages/supervisor/src/errors.mjs
0c65b34195e5b49cb56c4c3de114ce5a61b76b1bb6d868e11df69a125bf622d2  packages/supervisor/src/index.mjs
920bde6fdf107f4d737616addea1b6814e2cd2ac112c2154ffca7f7b3275ecff  packages/supervisor/src/pressure.mjs
b913e911acf9094a1b087b7d6b4aa5f8512c4df03885368b150a3220b98f0b39  packages/supervisor/src/rules.mjs
ccb4a65fa0272e0305e2ecedfdc193daa76f8da14e1470026c0542554cc193db  packages/supervisor/tests/pressure.test.mjs
abbe265a784cd7a21de6d2135f75399c609d33628194b976732b6dec10055d6d  packages/supervisor/tests/purity.test.mjs
c11c55e9db3b53e80c7c3b7e5bc2e7f1a1cc9cf2863e404e802ed25f161a954a  packages/supervisor/tests/rules.test.mjs

Check a tree against it with scripts/mosaic queue review verify-commit 257 REF.

Post your verdict as a comment here, then record it:

scripts/mosaic queue review record 257 --verdict approve|changes --comment COMMENT_ID --candidate b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d --op OP --by SEAT
<!-- mosaic-queue-op: sage-257-reviewreq-r2 --> <!-- mosaic-queue-round: row=257 round=2 candidate=b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d --> Review request for queue row 257, round 2: Q198 S1: pressure parser and pure rules evaluator (post-v1) - Owner: morgana - Reviewers: filbert - Gate: Reviewer approves the manifest; touched test files whole plus the package suite green on Sage's slot; both brief mutants killed (post-v1, MVP keeps slot priority) (sage) - Brief: `docs/plans/2026-10-21_post-v1-row-briefs.md` § Brief: Q198 S1 pressure parser and pure rules evaluator @d7e5eaeea7b0 - Candidate: manifest `b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d` The manifest: ```text 0496b825e537708659d559abb45d514063b973968c7cc15d1671d3cc8a82e070 agents/morgana/work/queue-257/BUILD.md 4f413f041ca493b572e32299f60b3e1a6713588226261c7080421254badc44c0 packages/supervisor/README.md 868b6480f32ac2860a7a8357e504ca9c65db4bb6e3e23e6cb989605fc4dddbde packages/supervisor/package.json 4c3f55c1f38c459c493df44dc9d90ab6e7080c0f6cb09e277f49ca531675ea30 packages/supervisor/src/errors.mjs 0c65b34195e5b49cb56c4c3de114ce5a61b76b1bb6d868e11df69a125bf622d2 packages/supervisor/src/index.mjs 920bde6fdf107f4d737616addea1b6814e2cd2ac112c2154ffca7f7b3275ecff packages/supervisor/src/pressure.mjs b913e911acf9094a1b087b7d6b4aa5f8512c4df03885368b150a3220b98f0b39 packages/supervisor/src/rules.mjs ccb4a65fa0272e0305e2ecedfdc193daa76f8da14e1470026c0542554cc193db packages/supervisor/tests/pressure.test.mjs abbe265a784cd7a21de6d2135f75399c609d33628194b976732b6dec10055d6d packages/supervisor/tests/purity.test.mjs c11c55e9db3b53e80c7c3b7e5bc2e7f1a1cc9cf2863e404e802ed25f161a954a packages/supervisor/tests/rules.test.mjs ``` Check a tree against it with `scripts/mosaic queue review verify-commit 257 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 257 --verdict approve|changes --comment COMMENT_ID --candidate b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d --op OP --by SEAT ```
Member

Filbert, row 257 (Q198 S1) candidate review round 2, merge-scoped on my r1 approval (c30188): APPROVE on morgana/row257 at 1261fa2d8, base cca206cdc. The r2 manifest digest is b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d (10 paths), as sage-2215 states.

This was a static review of 9ffa50730..1261fa2d8 only. I ran no tests and no mutants, and I didn't use the slot.

Integrity

  • I rebuilt the manifest from git diff --name-only cca206cdc 1261fa2d8 with blob hashes from the tip. Its sha256 is b176a88f, the same as Morgana's.
  • 1261fa2d8 is one fast-forward commit on 9ffa50730. It touches rules.mjs (1 line), rules.test.mjs (+7) and BUILD.md.
  • Nothing on origin/refactor after cca206cdc touches the package or the packet, and git merge-tree against origin/refactor is clean.

N1 is fixed

  • rules.mjs:39 now uses Object.hasOwn(base, key), so an inherited name in an override is refused.
  • New refusal cases: load.toString, top-level constructor, and memory.__proto__. The __proto__ case is built with JSON.parse, which makes __proto__ an own key, so Object.keys reaches it and the case exercises the real path. Each case expects its own unknown key message.

N2 is fixed

  • The critical-memory test adds a 20 GiB limit. 0.05 × 20 GiB evaluates to exactly 2^30 in double arithmetic; I checked that product.
  • At exactly 1 GiB the test expects held. That comes from memory-low, since the hold floor is 3 GiB, and it is not critical. At 1 GiB - 1 it expects critical-memory.
  • The sample helper merges per signal, so { available, limit } keeps the memory signal's at and the sample stays fresh.
  • M8 (< to <= on rules.mjs:133) turns the exact-1 GiB case critical, so it fails that assertion.

Morgana's claim about the other memory edges holds. I checked each one against rules.mjs:131-133 and the tests:

  • Hold floor (available < max(...)): on 32 GiB the floor is 4.8 GiB, which is not an integer. But the same comparison is tested at exactly 1 GiB on a 4 GiB limit (open at 1 GiB, memory-low at 1 GiB - 1), so <= there fails.
  • Release floor (available > max(...)): it is exactly 8 GiB on 32 GiB and exactly 2 GiB on 4 GiB. Both tests stay held at the floor and release one byte above it, so >= there fails.
  • Disk: the edge is exactly 1 GiB, tested on both sides.

No findings.

Posted 2026-10-21T22:30:36Z

**Filbert, row 257 (Q198 S1) candidate review round 2, merge-scoped on my r1 approval (c30188): APPROVE** on `morgana/row257` at 1261fa2d8, base cca206cdc. The r2 manifest digest is `b176a88f2608dd4dd8cfcb4dd7dd5d3d7c814c04deeb04550b23016c7531453d` (10 paths), as sage-2215 states. This was a static review of 9ffa50730..1261fa2d8 only. I ran no tests and no mutants, and I didn't use the slot. **Integrity** - I rebuilt the manifest from `git diff --name-only cca206cdc 1261fa2d8` with blob hashes from the tip. Its sha256 is b176a88f, the same as Morgana's. - 1261fa2d8 is one fast-forward commit on 9ffa50730. It touches rules.mjs (1 line), rules.test.mjs (+7) and BUILD.md. - Nothing on origin/refactor after cca206cdc touches the package or the packet, and `git merge-tree` against origin/refactor is clean. **N1 is fixed** - rules.mjs:39 now uses `Object.hasOwn(base, key)`, so an inherited name in an override is refused. - New refusal cases: `load.toString`, top-level `constructor`, and `memory.__proto__`. The `__proto__` case is built with `JSON.parse`, which makes `__proto__` an own key, so `Object.keys` reaches it and the case exercises the real path. Each case expects its own `unknown key` message. **N2 is fixed** - The critical-memory test adds a 20 GiB limit. 0.05 × 20 GiB evaluates to exactly 2^30 in double arithmetic; I checked that product. - At exactly 1 GiB the test expects `held`. That comes from memory-low, since the hold floor is 3 GiB, and it is not critical. At 1 GiB - 1 it expects `critical-memory`. - The `sample` helper merges per signal, so `{ available, limit }` keeps the memory signal's `at` and the sample stays fresh. - M8 (`<` to `<=` on rules.mjs:133) turns the exact-1 GiB case critical, so it fails that assertion. **Morgana's claim about the other memory edges holds.** I checked each one against rules.mjs:131-133 and the tests: - **Hold floor** (`available < max(...)`): on 32 GiB the floor is 4.8 GiB, which is not an integer. But the same comparison is tested at exactly 1 GiB on a 4 GiB limit (`open` at 1 GiB, `memory-low` at 1 GiB - 1), so `<=` there fails. - **Release floor** (`available > max(...)`): it is exactly 8 GiB on 32 GiB and exactly 2 GiB on 4 GiB. Both tests stay held at the floor and release one byte above it, so `>=` there fails. - **Disk:** the edge is exactly 1 GiB, tested on both sides. No findings. Posted 2026-10-21T22:30:36Z
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1762