Public: anyone can read this; the crew can change it.
A preview that does not start shows its last start lines and the cause on the pull page #17904
Merged 21h 8m ago, live in production
A pull whose preview stopped before answering now shows why under its checks line, and the last 20 lines of its start in a fold. I did not find the cause for trevato.dev, since my shell can only reach this app and its previews. Once this is live, its pull page should show the cause.
-
Reviews
Changes requested — before the latest pushThe design is sound: one source for the cause (servingWords), a plain-data module, an escaped pre inside the existing disclosure, an <a> for the log, no JavaScript needed, and nothing shown for running or unknown previews. Two things to fix in one round.
- (first) The wiring has no test. Every test calls startFailure/startFailureStrip directly. Nothing renders the pull page or the TUI pull screen with a failed preview, so deleting the lines in src/web/pages/pull.ts and src/tui/screens/pull.ts would leave the suite green. Add a test that renders the pull page for an open pull whose env status is failed and expects data-preview-cause and data-preview-start, and one that expects nothing for a running preview. Add the same for the TUI checks line.
- The timeout test asserts a loose regex (/1\s*s|within|ready|answer|listen/i) that nearly any sentence satisfies. Assert the real timeout words, for example the exact servingWords sentence for that fixture, so it fails if the words are lost.
Smaller: (a) the TUI folds startWords into redWords, which is the red-main/red-alone line; give it its own line or label so it does not read as a main-is-red note. (b) The TUI and the page each re-fetch the app record and runtime; if a helper exists for 'the env status of this pull's preview', use it. (c) The fixture is cast
as AppManifest; build a real manifest if one is easy.Box 4: the cause for trevato.dev was not found and the pull says so, which meets the conditional wording.
ApprovedSince e1547613b the head adds the wiring tests (pull page and terminal, failed and running), the exact timeout sentence assertion, and gives the failed start its own segment in the terminal checks line. Earlier asks are met: cause words come from servingWords (one source), lines are escaped, the how-to is filed under an existing heading, the terminal shows the same cause. The strip is a plain p plus the existing disclosure and a plain link, so it works with JavaScript off and without a mouse; the pre is focusable for keyboard scrolling.
Two things I would do next:
- Non-blocking: in test/preview-start-wiring.test.ts the negative terminal case waits on the clock (Date.now() > end - 18_500). It cannot flake red, but it adds about 1.5s; settle on a screen marker instead.
- Non-blocking: the lines are the tail of the whole deploy log, not just the process output (scout said so). Record where the process's own output starts, so a failure after a long install shows the process lines.
Boxes: the cause for trevato.dev was not found (scout could not reach it), and the pull says so, which is what box 4 asks.
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Drop the fixed wait from the wiring test (#17892) a9c1219
- Test the pull page and terminal wiring of a failed preview; the terminal gives it its own segment (#17892) 2811eb0
- File the start-failure how-to under an existing index heading (#17892) e154761
- Merge the duplicate pulls.ts import in the pull screen (#17892) c8fe7a0
- Pull page shows a failed preview's start output: terminal and gate lines 638708a
- Try: open a pull whose preview failed to start and read the cause and the last start lines under its checks line f0e5530
- Direction: a preview that did not start shows its cause and last start lines on the pull page (#17892) 07d4bc9
- Full suite red: test/flows-actions.test.ts (#17880) 9d6fa9d
- Full suite red: test/looks-owner.test.ts (#17878) ba55044
- The checkouts sweep leaves a running check's own TMPDIR (<run>.tmp) alone (su… (#17876) 8e4596d
- Flaky test: a jar is checked and in place before the up, readable, and the old AutoStopper is aside (#17874) 9c0dc23
- family-words reads src/ once, not once per sentence, and leaves SLOW (#17872) 49845bf
- Full suite red: test/security-floor-routes.test.ts (#17870) 27f5834
- An awaited Modrinth lookup waits for the one a sync already began, not "Mods:… (#17868) a544da9
- Full suite red: 3 files in check run 01m8xkn7yvvjtbd07e5qhk1rk4 (#17866) c4333e8
- Sentinel: snapshot-failed was degraded 33 minutes today: The last snapshot failed: list chunks/ failed after 5 attempts: an unexpected error has occurred. The newest that lande… (#17863) 5fa2c54
- Sentinel: cloud-watch:digitalocean/prod was degraded 39 minutes today: The forge could not read digitalocean/prod to check it for stray machines (no answer in time); it is not known to be cl… (#17861) de6ec9b
- Cloud account digitalocean/prod shows more than the forge made (#17857) 137546a
- Cloud account hetzner/prod shows more than the forge made (#17856) be9fa4e
- A repository can have its own account order, tried there without reordering the forge (#17843) 14bd626
14 earlier comments
A pull whose preview stopped before answering now shows why under its checks line, and the last 20 lines of its start in a fold. I did not find the cause for trevato.dev, since my shell can only reach this app and its previews. Once this is live, its pull page should show the cause.
- Cause words: the sentence comes from
servingWords, the one source the proxy page and thepreviewtool use. It already carriesrun_command.ts's hint (for example "not installed or not on PATH"), so the pull page cannot say something different. - Lines: read from the failed deploy run's log, which is redacted as written and again as read. The page renders them escaped, with a link to the whole log. The fold is hidden when there are no lines.
- Where it shows: only on open pulls whose preview is
failed. A running, starting or never-deployed preview shows nothing. - Terminal: the pull screen's checks line gets the cause and the last three lines.
- Code:
src/apps/start_output.ts(new) reads the status and the log.src/web/pages/pull-start.ts(new) renders the strip.- Both are wired into
src/web/pages/pull.tsandsrc/tui/screens/pull.ts.
- How-to:
docs/features/preview-start-failure.md. - Tests:
test/preview-start-output.test.tsstarts real fixtures withstartProcess.- A fixture that exits at once shows its lines and the cause. An env value it echoes is not shown.
- A fixture that never listens shows the timeout words.
- A hostile line is escaped and only the last 20 lines are kept.
- Running, unknown and missing previews show nothing.
- Checks run:
tscis clean, the gate reports 32 of 32 rules satisfied, anddesign-lintis clean. The new tests and the pull, TUI and hollow/doorless suites I ran pass.scripts/fast.tsnamed 3,032 files, so I ran no broader suite and left it to the forge's check. - Left out: the lines are the tail of the whole deploy log, not only the process's own output. A start that fails after a long install shows the last 20 lines of the run, ending with the
failed:line. I added no new data to the environment state to separate them. - Reused:
servingWordsandreadRunLog, plus the existingdisclosurecomponent.
[
{"go": "/<owner>/<app>/pulls/<n> for an open pull whose preview failed to start", "look": "under the checks line", "expect": "'The preview did not start: <cause>' and a fold 'Last N lines of its start' with the escaped lines and a 'Whole log' link", "ask": "Is the cause the same sentence the app page shows?"},
{"go": "a pull whose preview is running", "look": "under the checks line", "expect": "no start strip"}
]<!-- look-pages f0e5530dcb81 --> Look pages for f0e5530, from the gate:
look pages (none): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts but the forge could not trace the route of /, /docs, /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
A preview that failed to start now shows its cause and its last start lines on the pull page, under the checks line. The terminal pull screen shows the same.
The earlier check failed on commit-message rules, not on code. I added a new commit with No door:, Replaces: and Looks: / lines. The gate reported no failures after that; I did not rerun the full suite or tsc before pushing, only test/preview-start-output.test.ts, which passes.
- Code:
src/apps/start_output.tsextracts the cause and the last start lines.src/web/pages/pull-start.tsrenders them on the web page, andsrc/tui/screens/pull.tsrenders them in the terminal. - Docs and tests: the how-to is
docs/features/preview-start-failure.md.test/preview-start-output.test.tshas four tests. - No new terminal screen: the terminal side extends the existing pull screen, so the rule's wish for a new file is answered with a
No door:line. - Left alone: one comment line over 100 columns in
src/tui/screens/pull.tsis only a note.--fixleft it as is, and the nightly rewrap handles it on main.
To try it, open a pull whose preview failed to start and read the cause under its checks line.
[{"go":"/pulls/17904","look":"a pull whose preview failed to start, under its checks line","expect":"the cause and the last start lines appear, escaped"}]I changed nothing for this round, so nothing new is pushed; 638708ae4 is still the head. The comment is the look-pages note plus a list of the check's usual refusals. I went through each one against this pull and none applies.
- Look pages:
638708ae4names/, which is what the gate asked for. - Both doors: the terminal pull screen (
src/tui/screens/pull.ts) shows the same cause and last start lines as the web page. The pull has aNo door:line explaining that this extends the existing screen rather than adding a new one. - Test input:
test/preview-start-output.test.tshas noas never, andbun x tsc --noEmitis clean. - Issue number: the
Direction:commit07d4bc9fecarries(#17892). - Dead code:
test/unused-exports.test.tspasses.START_LINESis exported only because that test imports it, and the unused-exports test does not flag it, so I left it. - Gate:
bun scripts/gate.tsreports no failures.
The one thing still showing is the over-100-column comment note on src/tui/screens/pull.ts. It is non-blocking, and the nightly rewrap handles it on main.
A failed preview now shows its cause and the last lines of its start output on the pull page, and the same lines show on the terminal pull screen. This push fixes only the duplicate-import failure from the last check.
- The fix:
src/tui/screens/pull.tsimported../../core/pulls.tstwice. I mergedchangedSentencesinto the first import and removed the second. - What I ran:
test/dup-imports.test.tsnow passes.bun x tsc --noEmitis clean.bun scripts/gate.ts --fixchanged nothing.test/preview-start-output.test.tsand the dead-code test also pass.
- Not checked: I didn't run the full suite or the other checks you listed. The earlier commits already carry the door line, the issue number and the how-to in
docs/features/preview-start-failure.md. - What changed overall:
src/apps/start_output.tsholds the start-failure lookup.src/web/pages/pull-start.tsrenders the strip under the checks line on the web pull page.src/tui/screens/pull.tsshows the same lines in the terminal.
- Left out: no new log storage. The lines come from the start output the forge already keeps.
- To try: open a pull whose preview failed to start. The cause and the last start lines appear under its checks line, on the web and in the terminal.
[{"go":"/","look":"a pull whose preview failed to start","expect":"the cause and the last start lines under the checks line"}]
🤖 Generated with Claude Code
I changed nothing this round, so there is nothing new to push. This is the same comment as last time, now for head c8fe7a0, and nothing in it applies to this pull.
- Look pages: the gate resolves
/from a commit on this branch, so there is no failure. - Both doors: the terminal pull screen (
src/tui/screens/pull.ts) shows the same cause and last start lines as the web page. The pull has aNo door:line explaining that this extends the existing screen rather than adding a new one. - Test input:
test/preview-start-output.test.tshas noas never, andtscwas clean on the previous head. - Issue number: the
Direction:commit carries(#17892). - Dead code:
test/unused-exports.test.tspasses. - Gate and tests:
bun scripts/gate.tsreports no failures atc8fe7a0.test/preview-start-output.test.tsandtest/unused-exports.test.tspass, 8 tests in all. I did not reruntscatc8fe7a0.
The branch is level with origin.
The red on c8fe7a0 (run 01m8ydb48z6kb71025w5qe5v4r) is not the look-pages note: 4 of 2193 failed in the feature-note index tests ("a note naming an unknown topic is not listed, and the tree has none", "every note says its topic and its row, and the topic is a heading of the index", "no feature note is an orphan"; test/feature-orphans.test.ts).
Cause: docs/features/preview-start-failure.md says topic: Pulls and previews, which is not one of the ### headings in docs/features/README.md, so the note is listed nowhere. Fix, one line in its front matter:
topic: When something is wrong
(or Ship and undo if you'd rather file it with pulls; both are real headings). Don't add a new heading for one note. Then push; nothing else in the run's failures points at your code.
The feature-note index failures should be fixed. I changed topic: Pulls and previews to topic: When something is wrong in docs/features/preview-start-failure.md, as you suggested, and pushed.
test/feature-orphans.test.ts and test/feature-doors.test.ts now pass (11 tests), and bun scripts/gate.ts reports no failures. I did not rerun the rest of the suite; the forge's check does that on this push.
The four generic refusal items in the comment were already met. The terminal pull screen shows what the page shows, the test builds real input, Direction: carries (#17892), and the dead-code test passes.
[{"go":"/pulls/17904","look":"a pull whose preview failed to start, under its checks line","expect":"the cause and last start lines appear, escaped, and the terminal pull screen shows the same"}]I changed nothing this round and pushed nothing; the branch is level with origin at e1547613b. The comment repeats the earlier notes for this head, and the gate reports no failures.
- Look pages: this is information, not a failure. A commit on the branch names
/. - Both doors: the terminal pull screen shows the same cause and last start lines as the web page.
- Test input:
test/preview-start-output.test.tshas noas never. - Issue number: the
Direction:commit carries(#17892). - Dead code:
test/unused-exports.test.tspassed earlier on this branch. - Feature-note failures: the topic fix I pushed last round,
e1547613b, is what addressed them.
This is the gate's look-pages note for a9c1219, and it needs no action. A commit on this branch already names /, so the gate has no failure, and I pushed nothing new.
Everything from the last round is already on the branch at a9c1219.
- New tests:
test/preview-start-wiring.test.tsrenders the pull page and the terminal's pull screen with a failed and a running preview, four tests in all. - Exact assertion: the timeout test in
test/preview-start-output.test.tsnow asserts the exactservingWordssentence. - Terminal line: a failed start is its own segment in the terminal's checks line, no longer part of the red-main note.
The gate reported no failures at that head.
A pull whose preview stopped before answering now shows why under its checks line, and the last 20 lines of its start in a fold. I did not find the cause for trevato.dev, since my shell can only reach this app and its previews. Once this is live, its pull page should show the cause.
servingWords, the one source the proxy page and thepreviewtool use. It already carriesrun_command.ts's hint (for example "not installed or not on PATH"), so the pull page cannot say something different.failed. A running, starting or never-deployed preview shows nothing.src/apps/start_output.ts(new) reads the status and the log.src/web/pages/pull-start.ts(new) renders the strip.src/web/pages/pull.tsandsrc/tui/screens/pull.ts.docs/features/preview-start-failure.md.test/preview-start-output.test.tsstarts real fixtures withstartProcess.tscis clean, the gate reports 32 of 32 rules satisfied, anddesign-lintis clean. The new tests and the pull, TUI and hollow/doorless suites I ran pass.scripts/fast.tsnamed 3,032 files, so I ran no broader suite and left it to the forge's check.failed:line. I added no new data to the environment state to separate them.servingWordsandreadRunLog, plus the existingdisclosurecomponent.Closes #17892