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

Crew: run the game agent tests in ubuntu:24.04 before an agent.sh release, recorded on the release #18274

opened this

Merged 4h 11m ago, live in production

scripts/cut-release.ts now runs the game agent tests in ubuntu:24.04 before it cuts a release that changes src/games/agent.sh. It records the run on the release. I haven't run the docker step itself, because the sandbox has no docker.

Notes

opened this

scripts/cut-release.ts now runs the game agent tests in ubuntu:24.04 before it cuts a release that changes src/games/agent.sh. It records the run on the release. I haven't run the docker step itself, because the sandbox has no docker. The new unit tests and the existing release-shipped test pass, tsc is clean and the gate passes.

What changed

  • When it runs: cut-release.ts diffs src/games/agent.sh against the newest release tag. If it changed, or there is no tag to compare to, it runs every test/game-agent-*.test.ts file in ubuntu:24.04 with docker. The checkout is mounted read-only, the host bun binary is mounted in, and the container has no network.
  • If the tests fail: no tag is made and the script exits 1.
  • If they pass: the tag message gains "agentTests": {"image", "files", "at"}. release/shipped.ts reads it back and drops a malformed value instead of trusting it.
  • Where the logic lives: the new src/release/agent_tests.ts holds the pure parts: what counts as touching the agent, the docker command and the record field.
  • Docs and tests: docs/ops/ROLL.md describes the rule. test/release-agent-tests.test.ts covers the detection, the docker command and the record round-trip.
  • Reuse: I added no dependency and reused recordFor, parseRecord and the existing tag record. similar.ts was not run.

Left out

  • The release keeper's automatic cut (src/keeper/wire.ts) does not run the tests, since the forge process has no docker. When agent.sh changes, cut by hand. ROLL.md says so.
  • Nothing yet shows agentTests on the releases page or the terminal. It is in the tag and the parsed record only.
  • Whether the agent tests pass on a bare ubuntu:24.04 is untested. If they need tools the image lacks, such as jq or curl, the first real cut will show it.
  • Parts 1 and 3 of #18250 (the validator pass and the post-release box watch) and the proxy-plugin QA comment are not done.
  • The gate said src/release/shipped.ts has a comment line over 100 columns. It left it for the nightly rewrap, and I didn't fix it.

To try Run bun scripts/cut-release.ts 9.9.9 on a commit that changes agent.sh, with docker available. It prints the record with agentTests on success.

🤖 Generated with Claude Code

Closes #18271

5 earlier comments · 1 event
commented

scripts/cut-release.ts now runs the game agent tests in ubuntu:24.04 before it cuts a release that changes src/games/agent.sh. It records the run on the release. I haven't run the docker step itself, because the sandbox has no docker. The new unit tests and the existing release-shipped test pass, tsc is clean and the gate passes.

What changed

  • When it runs: cut-release.ts diffs src/games/agent.sh against the newest release tag. If it changed, or there is no tag to compare to, it runs every test/game-agent-*.test.ts file in ubuntu:24.04 with docker. The checkout is mounted read-only, the host bun binary is mounted in, and the container has no network.
  • If the tests fail: no tag is made and the script exits 1.
  • If they pass: the tag message gains "agentTests": {"image", "files", "at"}. release/shipped.ts reads it back and drops a malformed value instead of trusting it.
  • Where the logic lives: the new src/release/agent_tests.ts holds the pure parts: what counts as touching the agent, the docker command and the record field.
  • Docs and tests: docs/ops/ROLL.md describes the rule. test/release-agent-tests.test.ts covers the detection, the docker command and the record round-trip.
  • Reuse: I added no dependency and reused recordFor, parseRecord and the existing tag record. similar.ts was not run.

Left out

  • The release keeper's automatic cut (src/keeper/wire.ts) does not run the tests, since the forge process has no docker. When agent.sh changes, cut by hand. ROLL.md says so.
  • Nothing yet shows agentTests on the releases page or the terminal. It is in the tag and the parsed record only.
  • Whether the agent tests pass on a bare ubuntu:24.04 is untested. If they need tools the image lacks, such as jq or curl, the first real cut will show it.
  • Parts 1 and 3 of #18250 (the validator pass and the post-release box watch) and the proxy-plugin QA comment are not done.
  • The gate said src/release/shipped.ts has a comment line over 100 columns. It left it for the nightly rewrap, and I didn't fix it.

To try Run bun scripts/cut-release.ts 9.9.9 on a commit that changes agent.sh, with docker available. It prints the record with agentTests on success.

🤖 Generated with Claude Code

commented

cut-release.ts now runs the game agent tests in ubuntu:24.04 only when it cuts a tag (--tag) and src/games/agent.sh changed since the last release. I fixed the failing check test and pushed. test/release-load.test.ts and test/release-agent-tests.test.ts pass, along with tsc and the gate. The docker step still hasn't run anywhere, because the sandbox has no docker.

The check failed because test/release-load.test.ts runs a dry run, cut-release.ts 999.0.0 with no --tag. In the checkout the script finds no tag to compare against, so it treated agent.sh as changed and tried to run docker, which failed. A dry run now only prints the record, as before.

What changed

  • Before it makes a tag, scripts/cut-release.ts runs test/game-agent-*.test.ts in ubuntu:24.04 when agent.sh changed since the newest tag. If there is no earlier tag, it treats agent.sh as changed.
  • A failing run cuts no tag and exits 1. A passing run adds "agentTests": {"image", "files", "at"} to the tag message, which release/shipped.ts reads back and drops if malformed.
  • The pure parts are in src/release/agent_tests.ts, tested in test/release-agent-tests.test.ts. docs/ops/ROLL.md describes the rule.

Left out

  • The release keeper's automatic cut in src/keeper/wire.ts does not run the tests, since the forge process has no docker. Cut by hand when agent.sh changes.
  • The releases page and the terminal don't show agentTests yet. It is in the tag record only.
  • Whether the agent tests pass on a bare ubuntu:24.04 is untested. If they need jq or curl, the first real cut will show it.
  • Parts 1 and 3 of #18250 (the validator pass and the post-release box watch) and the proxy-plugin QA comment are not done.
  • The gate said src/release/shipped.ts has a comment line over 100 columns. It left it for the nightly rewrap, and I didn't fix it.

To try Run bun scripts/cut-release.ts <version> --tag on a commit that changes agent.sh, with docker available. The tag message then carries agentTests.

🤖 Generated with Claude Code

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

The four checks you listed all pass on this branch as it stands, so I changed nothing and pushed nothing. The branch already matches origin.

  • Both doors: bun scripts/gate.ts --explain is green. Both commits carry No door: <why> (#18271), since the change is a release script and its tag record, not a page, action, route or tool. test/doorless.test.ts and test/feature-doors.test.ts also pass.
  • Dead code: test/unused-exports.test.ts passes. Every export in src/release/agent_tests.ts has a caller: scripts/cut-release.ts or src/release/shipped.ts.
  • Name the issue: both commits carry Direction: the owner, 12-04: "minecraft cant become an attack vector" (#18250).
  • Module-level state: test/module-state.test.ts passes. The change adds no module-level Map, Set or array.
  • Type check and tests: bun x tsc --noEmit is clean. test/release-agent-tests.test.ts passes, along with test/hollow.test.ts.

The gate notes one comment over 100 columns in src/release/shipped.ts. That line is not from this change, and the nightly rewrap handles it on main. gate --fix rewrapped nothing, so there is nothing to commit.

I could not see the check's log or know which commit it refused, so these may have been refusals of an earlier push. If a line still fails on the forge, send me its log.

What the pull does

scripts/cut-release.ts now runs test/game-agent-*.test.ts in ubuntu:24.04 when src/games/agent.sh changed since the last tag. It does this only when it actually cuts the tag, so a dry run stays the plain record. It refuses the tag if those tests fail. It records agentTests {image, files, at} on the release.

src/release/agent_tests.ts holds the plain data: what counts as touching the agent, the docker argv, and the record. src/release/shipped.ts reads the record back from the tag message. The tests are in test/release-agent-tests.test.ts and the how-to is in docs/ops/ROLL.md.

What I left out

  • The docker run is not exercised in the sandbox, which has no docker. Only the pure parts are tested.
  • The run uses --network=none and mounts the checkout read-only.

How to try it

Run bun test test/release-agent-tests.test.ts. On a machine with docker, run bun scripts/cut-release.ts after a change to agent.sh. It runs the agent tests in the container before it tags.

commented

The rule for agent.sh releases is now one tested decision, the keeper's cut says loudly when it skipped the tests, and the result shows on /releases.json and in the terminal. The container run still has not been tried with docker; this sandbox has none. gate --explain is green, tsc is clean, and the new and neighbouring tests pass. I did not run the full suite; the forge runs that on push.

  • Refusal path: decideAgentTests in src/release/agent_tests.ts takes the changed paths (undefined when there is no earlier tag), the --tag flag and an injected runner. It returns either {refuse} or the AgentTests record. scripts/cut-release.ts only calls it and exits on a refusal, and its long import is wrapped. Tests cover each case you listed:
    • agent.sh unchanged runs nothing.
    • A green run with --tag records.
    • A red run refuses and records nothing.
    • A dry run runs nothing.
    • No earlier tag counts as changed.
    • An empty file list refuses.
  • Keeper bypass: a tag cut by src/keeper/wire.ts after an agent.sh change, or with no earlier tag to compare, now carries "agentUnchecked": true. I chose the loud record and added no hold. parseRecord reads the mark back, and an agentTests record wins over it.
  • Showing the result: /releases.json adds an agentTests sentence to a release that has the record or the unchecked mark, and name and url are unchanged. The terminal changelog row (src/tui/screens/changelog.ts) carries the same sentence. I did not add it to the web changelog page. docs/ops/ROLL.md says all of this.
  • Bare ubuntu:24.04: the agent tests skip themselves without curl or jq, so a bare container would have passed with nothing run. The container now installs curl, jq and ca-certificates first, then fails if bash, curl, jq, timeout or sha256sum is missing. This costs --network=none, because the install needs the network.

The other commit-line rules were met too: every commit has a Direction: … (#18250) line and a Door: or No door: line with a reason. The as never cast, the duplicate imports and the non-literal sh -c script that the gate flagged are fixed. The gate's note about a long comment in src/release/shipped.ts is not from this change.

How to try it

  • Run bun test test/release-agent-tests.test.ts.
  • On a machine with docker, cut a tag after an agent.sh change with bun scripts/cut-release.ts <version> --tag.
  • Then check /releases.json for the agentTests sentence.
commented

<!-- look-pages 2b809c066af6 --> Look pages for 2b809c0, from the gate:

  • look pages (none): this pull changes src/web/standards.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The look-pages note is answered, and the other four items were already met by earlier commits. I added an empty commit with a No look: line and pushed. I did not re-run bun x tsc --noEmit or any tests, since no code changed.

  • Look pages: src/web/standards.ts changes only /releases.json, a JSON route, so no page changes. The changelog page is untouched. The terminal changelog row already shows the same sentence.
  • Both doors: the earlier commit 35aab9e18 carries the Door: line for /releases.json and the terminal changelog.
  • Direction and issue number: every commit has a Direction: line and (#18271).
  • Gate: bun scripts/gate.ts --fix ran clean. It noted one over-long comment in src/release/shipped.ts, which I left because the nightly rewrap handles it.
  • Not checked: I did not run the dead-code export test or the timed-jobs test locally, and I did not add any new exports or jobs.

What the pull does, as before: cut-release runs the game agent tests in ubuntu:24.04 when it cuts a tag after an agent.sh change. agent_tests.ts holds that rule as one tested decision. The keeper marks an unchecked cut with agentUnchecked. /releases.json and the terminal changelog row carry the result.

To try it, run bun test test/release-agent-tests.test.ts. Or cut a tag after an agent.sh change and open /releases.json.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs