From a28967e78aa8cb7dbd73c01443e4aa771aa05e51 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 22 Oct 2026 11:53:10 -0500 Subject: [PATCH] duckworth: row 239 b1 code review (duckworth-0168) --- .../duckworth/work/row239/REVIEW-code-b1.md | 90 +++++++++++++++++++ docs/SESSIONS.md | 1 + 2 files changed, 91 insertions(+) create mode 100644 agents/duckworth/work/row239/REVIEW-code-b1.md diff --git a/agents/duckworth/work/row239/REVIEW-code-b1.md b/agents/duckworth/work/row239/REVIEW-code-b1.md new file mode 100644 index 000000000..e87928ee8 --- /dev/null +++ b/agents/duckworth/work/row239/REVIEW-code-b1.md @@ -0,0 +1,90 @@ +# Row 239 (#1745) b1 code round: Duckworth review (duckworth-0168) + +Subject: Honker's honker/row239 b0c28366f (one commit on design d1 5da5f28f6), base aca16404c. 15 paths, +BUILD.md blob 146135166. Static read only: git reads, nothing run. +Drift: the local origin/refactor is still aca16404c, so there is no drift on any manifest path. + +**Verdict: APPROVE.** No blockers. C1 and C2 from duckworth-0165 are met. + +## Conditions from the design round + +- **C1 met.** + - webui bus.mjs:79 puts `outcome-unknown-revoked` in OPEN, so a direct answer is + `{code:'outcome-unknown', sent:'unknown'}`. + - T6 asserts launch POST 503, `outcome-unknown`, sent `unknown`, and no "Nothing changed". + - M3f drops the OPEN entry. sendOutcome then answers sent false with the raw code, which T6's deepEqual + catches. +- **C2 met.** + - organization.mjs write() sets `revoked = true` only after `beforeWrite()` returns. + - The catch wraps the whole `withLock(...)` call, so errors from fn and from withLock's finally (rmSync + of the lock, syncDir) are both marked. + - It is structural, and no test was required. + +## Code + +- **Order under the lock.** recover, `:188` revision check, projects-protected, both validations, + beforeWrite, then prepare through commit. + - A refusal before beforeWrite revokes nothing and is unmarked. + - A `credential-revoke-failed` from beforeWrite itself is unmarked, because `revoked` is still false. + - Both match the design. +- **commit()** keeps the early check and passes beforeWrite through. The comment says that beforeWrite + must not write the business (N1). +- **instanceSettings** takes an injected writer, defaulting to `organizationWriter({dir, rolesDir})`. + runtime.mjs passes none. +- **broker #organizationFail.** + - The `-revoked` mapping is checked first. + - `revision-conflict` with the mark becomes `revision-conflict-revoked`, and anything else marked + becomes `outcome-unknown-revoked`. + - Unmarked errors map as before. +- **The fire.failed notice** adds the tokens sentence when the code ends in `-revoked`. +- **CLI.** REASONS has both texts. EXIT has `outcome-unknown-revoked` 1, and busExit's default is 2, so + M3g dies. +- **Console.** AGENT_REASONS has both texts. A closed request's refusal reaches them through reasonFor at + `/api/agent/request`. +- **channel-proof re-pins.** transport.mjs and webui bus.mjs. Both edits are EXIT, OPEN and STATUS + entries only, with no proof or transport change, and each re-pin is commented. + - My grep found no other `path + 64-hex` pin on the changed source files in any `packages/*/tests/*`. + +## Tests and mutants (read, not run) + +- **T1** (injected writer, hand edit inside write, before the lock). It expects revision-conflict + unmarked, no revoke call, the edit's bytes and no new receipt. + - It kills M1, because commit() would call the spy before write. + - It kills M2, because without `:188` the revoke runs and the write lands over the edit. +- **T2** (barrier edit at prepared). The `:221` recheck refuses with the mark, one revoke call, the edit's + bytes and an aborted receipt. It kills M3a. +- **T3** (barrier throw at prepared, for fire and delete). The error is marked, there is one call with the + right `how`, and the file is unchanged. + - A revoke that throws `credential-revoke-failed` is unmarked, with no receipt. The fixture writes the + file without the writer, so `receipts(g)` starting at `[]` holds. + - It kills M3a. +- **T4 and T4b** (fake org). Covered: the fire job's code and notice, the synchronous fire, a delete for + each code with and without the mark, and the plain code with no sentence. These kill M3b and M3e. +- **T5** (CLI closed delete) kills M3c. **T6** (Console) kills M3d and M3f. **transport.test** kills M3g. +- The kill rule ("a failed assertion in the named test, not a load error") is stated. + +## Notes (non-blocking) + +- **N1.** broker.mjs fire.failed: `code.endsWith('-revoked')` would also match `access-revoked`. A fire + job runs on a system context, so that code can't reach it today. An explicit pair + (`revision-conflict-revoked`, `outcome-unknown-revoked`) would say what it means. This is at Honker's + discretion. +- **N2.** The mark needs `e instanceof Error`, so a non-Error throw goes unmarked. Every throw on this + path is an Error, so this is only a note. +- **N3.** The STATUS 503 for `outcome-unknown-revoked` can't be reached while the code is in OPEN. Honker + says so in BUILD.md, and it is harmless. +- **N4.** A direct `revision-conflict-revoked` in the Console says "Nothing changed." That is true (the + file is unchanged), and no human path reaches it directly. BUILD.md says so. +- **N5. First-run reds to watch** (mos-1272: the author places them): + - T2's spy services `[]` for sec-1. The fixture's sec-1 has no credentials, so `[]` is expected. + - T3's delete calling revoke once with no services. beforeWrite is set whenever revoke is given, so + one call is expected. + +## Gate + +As BUILD.md states: +- The touched files run whole. +- The business, bus, cli and webui suites run. +- Every `scripts/test-*.sh` runs. +- M1-M3g are killed by assertion in the named tests. +- Sage's CLEAR is required. If row 253 lands first, rebase and rerun every touched test whole. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 22649df27..dfb437a2d 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1504,3 +1504,4 @@ are never rewritten or removed; corrections are new entries. 2026-10-22T16:44Z | Duckworth (Opus 5.5) | row 239 (#1745) design d1 static review, Honker 5da5f28f6 (duckworth-0165) | APPROVE with C1 (sendOutcome OPEN for outcome-unknown-revoked) and C2 (mark outside withLock's finally); Q1-Q3 answered, N1-N5 | 2026-10-22T16:46Z | Duckworth (Opus 5.5) | row 275 (#1780) early look, Morgana r2 4d2888471 (duckworth-0166) | B1 viewer.test:105-108 bob open/send answer thread-not-owned (red on base); mos-1311 C3 confirmed: both user-principal flips match design 4.3 :125/:139; N1-N3 | 2026-10-22T16:47Z | Duckworth (Opus 5.5) | row 275 r3 957a9bfe0 check (duckworth-0167) | B1 cleared, N1 met, N2 left to 193a; no open early-look findings | +2026-10-22T16:53Z | Duckworth (Opus 5.5) | row 239 (#1745) b1 code round, Honker b0c28366f (duckworth-0168) | APPROVE; C1/C2 met; T1-T6 and M1-M3g kills read; N1-N5; static only |