Public: anyone can read this; the crew can change it.

Crew: an adversarial validator pass before merge on risky pulls (box agent, game door, auth, print path) #18262

opened this in answer to

Merged 9h 28m ago, live in production

Part 1 of #18250 is done: a pull that touches a risky path now gets an adversarial review. Parts 2 and 3 and the mineflayer QA addendum are not built. I ran the gate, tsc, and the review-related tests (56 pass, including the new test).

Notes

opened this

Part 1 of #18250 is done: a pull that touches a risky path now gets an adversarial review. Parts 2 and 3 and the mineflayer QA addendum are not built. I ran the gate, tsc, and the review-related tests (56 pass, including the new test). I did not run the whole suite or scripts/fast.ts's 380 files. That is the forge check's job.

What changed

  • src/crew/risky.ts (new) names the risky areas from a pull's changed paths:
    • the box agent: src/games/agent.sh, fetch.sh, agent_sh.d.ts;
    • the game door: src/games/door|hold|lend|heal*.ts and src/http/games_*.ts;
    • sign-in or permissions: src/auth/, contract.json, src/contract*, permit*.ts;
    • release scripts: cut-release.ts, release-*.ts, src/release/;
    • a print path: any path with a print segment.
  • When a pull touches any of these, the review brief (src/crew/brief.ts) adds an adversarial section. It says read-only, fresh context, break it. It lists the failure shapes from the overnight findings: busy loops, a restart while people are online, an error reaching every player, a false printed statement. Each finding must name the breaking input, and one you can show is a change request.
  • src/crew/run_prompt.ts computes the areas from the same changed-file list that already decides the design review.
  • The findings are the review's own line comments and verdict, so they post as a review with no new route.
  • test/crew-risky.test.ts covers the matching and the brief text. docs/features/adversarial-review.md is the how-to. There is no new screen, so the commit carries a No door: line.

Choices and what I left out

  • I reused the existing review run as the validator instead of adding a second reviewer. That run is already read-only and starts with a fresh context. The cost is that a risky pull gets one review, not two.
  • Running the game agent tests in ubuntu:24.04 before an agent.sh release, and recording the result on the release (part 2), is not built. My sandbox has no container runtime. The how-to says so.
  • Watching the box after an agent.sh release (part 3) is not built either. It needs the agent check-in and CPU signals, and those did not fit this run. The how-to says so.
  • The mineflayer player-level QA for each forge-velocity pin is not built. It needs a throwaway box and a linked test account from the owner.
  • The path patterns are my judgment, not a list from the issue. src/release/ is currently empty, and "print path" is a loose match on the word print.

Try it

  1. Open a pull that edits src/games/agent.sh.
  2. When its review run starts, read the prompt. It should say "This pull touches the box agent … break it".
  3. A pull touching only src/web/pages/home.ts should not get that paragraph.

Closes #18250

2 earlier comments
commented

Part 1 of #18250 is done: a pull that touches a risky path now gets an adversarial review. Parts 2 and 3 and the mineflayer QA addendum are not built. I ran the gate, tsc, and the review-related tests (56 pass, including the new test). I did not run the whole suite or scripts/fast.ts's 380 files. That is the forge check's job.

What changed

  • src/crew/risky.ts (new) names the risky areas from a pull's changed paths:
    • the box agent: src/games/agent.sh, fetch.sh, agent_sh.d.ts;
    • the game door: src/games/door|hold|lend|heal*.ts and src/http/games_*.ts;
    • sign-in or permissions: src/auth/, contract.json, src/contract*, permit*.ts;
    • release scripts: cut-release.ts, release-*.ts, src/release/;
    • a print path: any path with a print segment.
  • When a pull touches any of these, the review brief (src/crew/brief.ts) adds an adversarial section. It says read-only, fresh context, break it. It lists the failure shapes from the overnight findings: busy loops, a restart while people are online, an error reaching every player, a false printed statement. Each finding must name the breaking input, and one you can show is a change request.
  • src/crew/run_prompt.ts computes the areas from the same changed-file list that already decides the design review.
  • The findings are the review's own line comments and verdict, so they post as a review with no new route.
  • test/crew-risky.test.ts covers the matching and the brief text. docs/features/adversarial-review.md is the how-to. There is no new screen, so the commit carries a No door: line.

Choices and what I left out

  • I reused the existing review run as the validator instead of adding a second reviewer. That run is already read-only and starts with a fresh context. The cost is that a risky pull gets one review, not two.
  • Running the game agent tests in ubuntu:24.04 before an agent.sh release, and recording the result on the release (part 2), is not built. My sandbox has no container runtime. The how-to says so.
  • Watching the box after an agent.sh release (part 3) is not built either. It needs the agent check-in and CPU signals, and those did not fit this run. The how-to says so.
  • The mineflayer player-level QA for each forge-velocity pin is not built. It needs a throwaway box and a linked test account from the owner.
  • The path patterns are my judgment, not a list from the issue. src/release/ is currently empty, and "print path" is a loose match on the word print.

Try it

  1. Open a pull that edits src/games/agent.sh.
  2. When its review run starts, read the prompt. It should say "This pull touches the box agent … break it".
  3. A pull touching only src/web/pages/home.ts should not get that paragraph.
commented

I've made both changes @sentinel asked for, opened issues for the unbuilt parts, and removed the forge pull claim. I ran bun x tsc --noEmit, bun scripts/gate.ts --fix and the tests in test/crew-risky.test.ts and test/brief-host-door.test.ts, and all pass. The forge's full check hasn't run yet.

What changed

  • Wiring test: test/crew-risky.test.ts now builds the review prompt with taskPrompt and reason: "review". With risky: ["the box agent"] the prompt contains the adversarial paragraph. Without risky, or with an empty list, it does not. Deleting adversarialLines(input.risky ?? []) in brief.ts now fails this test.
  • Print path: the pattern in src/crew/risky.ts now matches only files under src/ or scripts/, and skips .md and .test.ts. Negative cases cover docs/features/print-sheet.md, test/print-x.test.ts and src/web/print.md.
  • Sign-in or permissions: permit*.ts now has to be under src/, and src/contract* skips test files. Negative cases cover test/permit-x.test.ts, docs/permit.ts and src/contract.test.ts. src/auth/permit.test.ts still triggers the pass because everything under src/auth/ does. I kept that on purpose, since auth tests are close to auth code.
  • The forge pull claim was false. The CLI has forge pulls, which lists pulls, and no forge pull. The how-to now says the review appears on the pull page and over the API, and adds no screen or action of its own. The commit says No door: <why> for the both-doors rule.

Not built, now tracked

  • #18271: run the game agent tests in ubuntu:24.04 before an agent.sh release.
  • #18272: watch the box after an agent.sh release.

Both are linked to #18250 as blockers and named in the how-to.

The gate notes an over-long comment line in src/crew/brief.ts. It wasn't mine, and the nightly rewrap on main handles it.

commented

A pull that changes the box agent, the game door, sign-in or permissions, a release script or a print path now gets an adversarial reviewer brief. The reviewer stays read-only, is told to break the change, and posts each finding as a line comment, which makes it a change request.

src/crew/risky.ts maps the changed paths to these areas. brief.ts adds the adversarial paragraph to the review prompt when the list is not empty.

What to look at:

  • The brief's wording. It says "this review is the adversarial one". The earlier "read twice" was dropped because a risky pull gets one review, not two.
  • What counts as risky.
    • Test files (*.test.ts) never count, in any area, so the permission, contract and release rules all treat tests the same way.
    • A print path counts only under src/ or scripts/, never a .md file, and now includes files directly there such as src/print.ts and scripts/print.ts.
    • permit*.ts counts only under src/.
  • Tests. test/crew-risky.test.ts covers the matching and its negative cases (docs, tests, the release and permit test files). It also builds the review prompt with taskPrompt: the adversarial paragraph appears with risky set and not without it. Deleting the wiring line in brief.ts fails that test.
  • How-to. docs/features/adversarial-review.md says the review shows on the pull page and over the API. There is no forge pull terminal command, so that claim was removed. The commits say No door: because the change is only the reviewer's brief, with no page, action or route of its own.

Not built here, and linked to #18250:

  • #18271: run the game agent tests in ubuntu:24.04 before an agent.sh release.
  • #18272: watch the box after such a release.

Before pushing, bun x tsc --noEmit, bun scripts/gate.ts --fix, and the tests in test/crew-risky.test.ts and test/brief-host-door.test.ts all passed. The full check runs on push.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs