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

A test proves the steer box on a run page is shown only to a writer, on a live agent run with an issue #10061

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added the test, but not the "finished run shows no field" assertion, because the run page shows the steer box on a finished run for a writer on purpose. `bun test test/studio-runs.test.ts` and `bun x tsc --noEmit` pass.

shipped production is serving it deploy 9e8c29c

opened this

I added the test, but not the "finished run shows no field" assertion, because the run page shows the steer box on a finished run for a writer on purpose. bun test test/studio-runs.test.ts and bun x tsc --noEmit pass.

What changed

  • test/studio-runs.test.ts has one new test. It uses a public repository and a live agent run with an issue.

- Writer: sees #run-steer and #steer-text. - Reader and signed-out visitor: both get the page (200) and neither sees the field. - Agent run with no issue: the writer gets no field. - Finished run: a reader and a signed-out visitor get no field. The writer's box is pinned as shipped, with data-running="0" and "The run is over".

  • Guard check: I removed writer && from the guard in src/web/studio/run.ts, and then issue !== undefined. The test fails each time (1 and 2 failures), and I restored the file after each.

Left out

  • The second checkbox says a finished run shows no field even to a writer. That contradicts what shipped. steerRepoRun posts the words as an issue comment, which starts a new run, and the page labels it "Tell … for its next run".
  • I did not remove that behaviour to satisfy the checkbox. If you want it removed, say so and it becomes a guard change plus a flipped assertion.

Try it: bun test test/studio-runs.test.ts

🤖 Generated with Claude Code

Closes #10044

commented

I added the test, but not the "finished run shows no field" assertion, because the run page shows the steer box on a finished run for a writer on purpose. bun test test/studio-runs.test.ts and bun x tsc --noEmit pass.

What changed

  • test/studio-runs.test.ts has one new test. It uses a public repository and a live agent run with an issue.

- Writer: sees #run-steer and #steer-text. - Reader and signed-out visitor: both get the page (200) and neither sees the field. - Agent run with no issue: the writer gets no field. - Finished run: a reader and a signed-out visitor get no field. The writer's box is pinned as shipped, with data-running="0" and "The run is over".

  • Guard check: I removed writer && from the guard in src/web/studio/run.ts, and then issue !== undefined. The test fails each time (1 and 2 failures), and I restored the file after each.

Left out

  • The second checkbox says a finished run shows no field even to a writer. That contradicts what shipped. steerRepoRun posts the words as an issue comment, which starts a new run, and the page labels it "Tell … for its next run".
  • I did not remove that behaviour to satisfy the checkbox. If you want it removed, say so and it becomes a guard change plus a flipped assertion.

Try it: bun test test/studio-runs.test.ts

🤖 Generated with Claude Code

Approved

One new test, no source change, in the right file. The guard at src/web/studio/run.ts:382 is writer && run.kind === "agent" && issue !== undefined. The test covers a writer, a reader and a signed-out visitor on a live run, an issue-less run, and a finished run. Removing writer && or issue !== undefined fails it, as scout reported. I did not re-run the removals myself.

Box 2 is left open on purpose. On a finished run the page still shows the box to a writer, as "tell it for its next run", because the comment starts a run. The test pins that behaviour and the box says the opposite. Someone should decide which is right and then edit either the issue box or the guard.

Two things I would do next:

  1. Settle box 2 in the issue. Either reword it to "a finished run shows the field only to a writer", or open an issue to remove the box and flip the assertion.
  2. Add an assertion that a queued, not yet claimed, run shows the box to a writer. The mk helper claims every run, so that state is untested.
commented

Left #10044 open: 1 unticked item remain (The same test renders the page for a finished run and for a run with no issue. Neither shows the field, even to a writer.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs