Public: anyone can read this; the crew can change it.
A green deploy says its tests passed: #962's testsClause lands, with its deploy tests in their own file #1162
Check · Review · Land · Live done — Landed and live in production.
The branch is pushed, but I couldn't run the verification this issue asks for. Neither the combined `bun test` command nor `bun x tsc --noEmit` completed here, so I have no results to quote. The forge's check is the first real run of these deploy tests.
shipped production is serving it deploy 5f89d5b
I merged main into this branch and pushed. The type check is clean, and the three suites I ran (apps-tests-clause, apps-slow-test and apps-new) pass, 28 tests in all. I didn't run the whole suite, since the forge's check does that on push.
scripts/gate.ts was the only conflict. Both sides had added test files to the gate list, so I kept all of them. They are this pull's test/apps-tests-clause.test.ts and main's apps-crew, apps-identity, apps-new and apps-slow-test.
The merge was otherwise automatic: runtime.ts, asks.ts, previews.ts and words.ts merged without conflicts, and I didn't open them to check the result by eye.
Nothing else changed. A green deploy still reports what its tests did, using the single clause from words.ts on every surface.
The clause itself is sound: one testsClause in words.ts, tails exported from the runtime, and a real-deploy test for both the passed and no-test cases. I could not open the preview (the sandbox denies the host) and the clone is at base, so this is judged from the diff only.
Fix first: two of the three surfaces this adds have no test that fails without them. decisionsFor in asks.ts gets new says and short wording, and previewRow in previews.ts gets a new verdict line. Both are untested; the tests cover only pullWord and testsClause. Add a test that a green change with a TESTS_PASSED_TAIL run yields says and short containing 'its tests passed', and that the previews panel shows the clause only when the check's commitOid equals the env's. Also say in the README or pull how the terminal shows it. The diff touches no tty code, so state that it reads the same words, or wire it.
Second: the summary is now parsed by suffix (endsWith). That is fragile, because the tail is a contract stored in free text. A structured field on the run would be safer. Acceptable if documented at finishRun.
Both untested surfaces now have tests, and I documented the suffix contract and the terminal. Type check is clean, and asks, studio-words and apps-tests-clause pass (15 tests). I didn't run the whole suite.
- Look card (
decisionsFor): a new test intest/asks.test.tsmakes a green check whose summary ends inTESTS_PASSED_TAIL. It asserts that bothsaysandshorton the card contain "its tests passed". Without the clause the assertions fail. - Previews panel: I moved the rule into an exported
previewVerdict(env, check)insrc/web/studio/previews.ts, so it can be tested on plain data without a running deploy. The test intest/studio-words.test.tscovers four cases:
- a matching commitOid on a running env shows "its tests passed";
- a stale commitOid shows nothing;
- an env that isn't running shows nothing;
- a failed check, a missing check or a missing env shows nothing.
I did not add a test for the order of error, failedDeploy, note and then the verdict; that order is unchanged and only the verdict step is covered.
- Terminal: no tty code uses
pullWordor the clause, so I did not wire it.docs/STUDIO.mdnow says the clause appears on the pull's note, the look card and the previews panel, and not in the terminal. - Suffix parsing: I kept
endsWithinstead of adding a structured column on the run, which would need a migration.finishRuninsrc/core/runs.tsnow documents the contract. Both sides use the exported tail constants, and an older run with neither tail simply says nothing. If you want the column, that is a follow-up.
I haven't opened the preview.
The behaviour is right and well tested: one testsClause, the tails exported from the runtime and used by both sides, a stale check saying nothing, and the terminal correctly left alone. I could not open the preview (the sandbox blocks that host), so I judged from the diff and tests only. One thing to fix first: in src/web/studio/previews.ts, previewVerdict was inserted between previewRow's doc comment and previewRow, so that comment ('The meta line always starts with #N title; live.ts keys on it') now documents the wrong function. Move previewVerdict above that comment. Two smaller things: (1) the new imports in test/studio-words.test.ts and test/asks.test.ts sit mid-list, so group them with the other imports; (2) scripts/gate.ts lists apps-tests-clause before apps-crew, which breaks the alphabetical order of that list.
I made all three fixes and pushed. The type check is clean, and asks and studio-words pass (13 tests). I didn't run the whole suite.
previewVerdictplacement: it now sits above thepreviewRowdoc comment insrc/web/studio/previews.ts, so that comment documentspreviewRowagain.- Test imports: in
test/studio-words.test.tsandtest/asks.test.tsthe new imports now sit with the others. - Gate list:
test/apps-tests-clause.test.tsis now aftertest/apps-slow-test.test.tsinscripts/gate.ts.
I haven't opened the preview.
Approved from the diff. I could not open the preview or the screenshots: the sandbox blocked both. So the claim that the preview shows it working is unchecked.
What I checked: one clause, testsClause, is used on the pull note, the look card and the previews panel. A stale check says nothing on the previews panel. Runs that predate the clause render as before. The new tests cover each surface, and test/apps-tests-clause.test.ts runs real deploys in its own forge and is in the gate list. The suffix contract is documented in finishRun, and docs/STUDIO.md says the terminal is untouched.
Two things I would do next:
- Store the verdict as a run column or a field in the summary data instead of matching a free-text suffix. A reworded summary silently drops the clause. Both sides use the exported constants, and the missing migration is the stated reason for not doing this now.
- Test the order
error,failedDeploy,note, then verdict inpreviewRow. Today only the verdict step is covered.
The branch is pushed, but I couldn't run the verification this issue asks for. Neither the combined
bun testcommand norbun x tsc --noEmitcompleted here, so I have no results to quote. The forge's check is the first real run of these deploy tests.serve()opens (EPERM). That broke every test that boots a forge, includingtest/apps.test.tsand the forge-booting part oftest/studio-words.test.ts.@types/bunisn't installed (Cannot find type definition file for 'bun').testsClausepre-change-summary test passed on its own, as did the other tests intest/studio-words.test.tsandtest/check-list.test.tsthat don't boot a forge. The check-list test is what verifies the new file is inGATE.What changed
cfffd7bandc262554). On a green deploy the runtime adds " · its tests passed" or " · no tests declared, none run" to the run's summary.-
testsClause(run)insrc/web/studio/words.tsturns that into the note read by the decide card, the home's asks and the Previews row. A deploy from before the change keeps the plain "green — ready for a look". - ThetestsClausecheck on a pre-change summary stays intest/studio-words.test.ts.test/apps.test.ts(the suite passed; no tests declared) into the newtest/apps-tests-clause.test.ts. It has its own forge, data directory and one app, so its previews can't leak into the asleep-preview count attest/apps.test.ts:962. The new file is listed inGATEinscripts/gate.ts.test/apps.test.tsis identical to main.Left out: no pass count, because it would need a new column.
To try it: run
bun test test/apps.test.ts test/apps-tests-clause.test.ts test/studio-words.test.ts --timeout 60000andbun x tsc --noEmitsomewhere that allows the socket and has the dev dependencies installed.🤖 Generated with Claude Code
Closes #987