From 2773b01515809e1f6c63f0a5dd7f96b07145b385 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 23 Oct 2026 13:56:55 -0500 Subject: [PATCH] row 285: library.write joins ACTIONS and ROUTED in the business vocabulary and the broker under PRD 1.16 REQ-WAIT-3 and REQ-LIB-6, with a hard-waits test; BUILD.md records the r2 rebase, range-diff and drift check (#1790, sage-3578) --- agents/scrooge/work/queue-285/BUILD.md | 15 +++++++++++++++ packages/bus/src/broker.mjs | 4 ++++ packages/business/src/vocabulary.mjs | 7 +++++++ packages/business/tests/hard-waits.test.mjs | 7 +++++++ 4 files changed, 33 insertions(+) diff --git a/agents/scrooge/work/queue-285/BUILD.md b/agents/scrooge/work/queue-285/BUILD.md index 7b8216f1e..96846c878 100644 --- a/agents/scrooge/work/queue-285/BUILD.md +++ b/agents/scrooge/work/queue-285/BUILD.md @@ -205,6 +205,21 @@ Docs: - Run each fixture-importing suite whole: the business suite, the bus suite, the cli suite, `scripts/test-config.sh` and every `scripts/test-*.sh`, with TMPDIR under /mnt/storage/scratch/tmp. - Sage confirms the result against mos-1309 item 5. +## r2 rebase (sage-3578, 10-23) + +- Rebased 34ee4df7d onto origin/refactor 45dca69f6 as scrooge/row285-r2; the old branch is untouched and nothing was force-pushed. +- Commit map: 0e369895b to 9a77fff7a, 8c529fb4d to 115889e4a, 5f81d0da0 to aabfdfc60, d79cfe674 to 66e3c3d61, 34ee4df7d to cf8ba6ef4. +- `git range-diff 94c33a43c..34ee4df7d 45dca69f6..cf8ba6ef4` gives `=` on all five. `git patch-id --stable` is unchanged for the whole range (72cc8ef5) and for broker.mjs (caa0e756). merge-tree was clean. +- Drift 94c33a43c..45dca69f6 (262 commits). On this row's paths only broker.mjs (row 306), bus creative.test and cli launcher.test moved, and they merged clean. roles/, packages/business/ and contracts/ have no upstream change. Row 291 (4874d1e83) and row 308 (30e6bb680) touch the PRD, the requirements json and the tasks and bus requirements tests, which this row does not change. Row 306 touches broker.mjs, access-revoke.test, revoke-window.test and harness runner.mjs. +- New and changed upstream tests that read `roles/.json`: bus access-revoke, launcher-released, revoke-window, session-clear, session-compactions, sessions, thread-shares, chief-of-staff and creative. Bus chief-of-staff, creative and tester-writes import business tests/helpers.mjs, as do many cli, webui, harness and plugins tests. No 64-hex pin names a role file or broker.mjs. CREATIVE_KINDS has no reader at 45dca69f6. project-runtime.test pins vocabulary.mjs import-free; this row adds no import. +- Gate scope therefore grows: run the bus, business, cli, webui, harness and plugins suites whole, plus the scripts above. + +## Commit 3: library.write routed + +PRD 1.16 landed with row 291 (4874d1e83) and Jason's yes is mos-1354 Q32, so the hold on this commit is gone. `library.write` goes last in ACTIONS in both business/src/vocabulary.mjs and bus/src/broker.mjs, keeping bus hard-waits.test's order-sensitive ACTIONS equal VOCABULARY, and into ROUTED in both, so HARD_WAITS is unchanged. A new business hard-waits test (REQ-WAIT-3, REQ-LIB-6) checks it is in ACTIONS, routed and not GATED_ONLY. + +Open for review, not in scope: the PRD says library.write is granted to the six creative roles only. role.mjs checkCreative bounds what a creative role holds, but nothing refuses library.write in a non-creative role's withinRole. The brief asks only that the chief refuses it under an allowlist validator, and the chief has none. Flagged for Webby and Sage. + ## Results Not run. diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs index ba0d01a11..b787c8cf7 100644 --- a/packages/bus/src/broker.mjs +++ b/packages/bus/src/broker.mjs @@ -47,6 +47,8 @@ export const ACTIONS = Object.freeze([ 'policy.change', 'prd.approve', 'decision.resolve.technical', + // Row 285 (C2-08b, #1790): routed under PRD 1.16 REQ-WAIT-3 and REQ-LIB-6, below. + 'library.write', ]); // PRD 1.5 REQ-WAIT-3 (row 139, #1633): every action is a hard wait unless listed here, so a new // action stays one until a reviewed commit names it routed. Matches the business vocabulary's ROUTED. @@ -76,6 +78,8 @@ const ROUTED = new Set([ // PRD 1.7 REQ-COS-3 (row 194, #1692): the chief's hire and fire, within the bounds the broker checks. 'role.hire', 'role.fire', + // PRD 1.16 REQ-WAIT-3 and REQ-LIB-6 (row 285, #1790): a creative agent's library write. + 'library.write', ]); // REQ-WAIT-1's hard waits: always gated, and a raise for one goes to the human, cited or not. export const HARD_WAITS = Object.freeze(ACTIONS.filter((action) => !ROUTED.has(action))); diff --git a/packages/business/src/vocabulary.mjs b/packages/business/src/vocabulary.mjs index 1bc0e9144..8bd463c96 100644 --- a/packages/business/src/vocabulary.mjs +++ b/packages/business/src/vocabulary.mjs @@ -57,6 +57,10 @@ export const ACTIONS = Object.freeze([ "policy.change", "prd.approve", "decision.resolve.technical", + // Row 285 (C2-08b, #1790): a creative agent writes a supporting Markdown file in the human's library. + // Added as a hard wait and routed under PRD 1.16 REQ-WAIT-3 and REQ-LIB-6; role.mjs grants it within-role + // to the creative roles only. + "library.write", ]); // The actions that are not hard waits. PRD 1.5 REQ-WAIT-3: an action added @@ -91,6 +95,9 @@ export const ROUTED = Object.freeze([ // PRD 1.7 REQ-COS-3 (row 194, #1692): the chief's hire and fire, within the bounds the broker checks. "role.hire", "role.fire", + // PRD 1.16 REQ-WAIT-3 and REQ-LIB-6 (row 285, #1790): a creative agent's library write, within the + // bounds that paragraph names. + "library.write", ]); // The hard waits (PRD 1.5 REQ-WAIT-1): always gated, always the human's, diff --git a/packages/business/tests/hard-waits.test.mjs b/packages/business/tests/hard-waits.test.mjs index 7881c93c5..9ff377176 100644 --- a/packages/business/tests/hard-waits.test.mjs +++ b/packages/business/tests/hard-waits.test.mjs @@ -38,6 +38,13 @@ test("REQ-COS-3: role.hire and role.fire are routed, not hard waits", () => { for (const action of ["role.hire", "role.fire"]) assert.ok(ROUTED.includes(action) && !GATED_ONLY.includes(action), action); }); +// PRD 1.16 REQ-WAIT-3 and REQ-LIB-6 (row 285, #1790): library.write is in the vocabulary and routed. +test("REQ-WAIT-3: library.write is routed under REQ-LIB-6 (1.16), not a hard wait", () => { + assert.ok(ACTIONS.includes("library.write")); + assert.ok(ROUTED.includes("library.write")); + assert.ok(!GATED_ONLY.includes("library.write")); +}); + test("REQ-WAIT-3: every action is routed or a hard wait, never both, and the routed list names only actions", () => { for (const action of ROUTED) assert.ok(ACTIONS.includes(action), action); for (const action of ACTIONS) assert.notEqual(ROUTED.includes(action), GATED_ONLY.includes(action), action);