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

opened this

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.

Notes

opened this

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 the preview tool use. It already carries run_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.ts and src/tui/screens/pull.ts.
  • How-to: docs/features/preview-start-failure.md.
  • Tests: test/preview-start-output.test.ts starts real fixtures with startProcess.
    • 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: tsc is clean, the gate reports 32 of 32 rules satisfied, and design-lint is clean. The new tests and the pull, TUI and hollow/doorless suites I ran pass. scripts/fast.ts named 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: servingWords and readRunLog, plus the existing disclosure component.
[
 {"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"}
]

Closes #17892

14 earlier comments
commented

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 the preview tool use. It already carries run_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.ts and src/tui/screens/pull.ts.
  • How-to: docs/features/preview-start-failure.md.
  • Tests: test/preview-start-output.test.ts starts real fixtures with startProcess.
    • 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: tsc is clean, the gate reports 32 of 32 rules satisfied, and design-lint is clean. The new tests and the pull, TUI and hollow/doorless suites I ran pass. scripts/fast.ts named 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: servingWords and readRunLog, plus the existing disclosure component.
[
 {"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"}
]
commented

<!-- 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
commented

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.ts extracts the cause and the last start lines. src/web/pages/pull-start.ts renders them on the web page, and src/tui/screens/pull.ts renders them in the terminal.
  • Docs and tests: the how-to is docs/features/preview-start-failure.md. test/preview-start-output.test.ts has 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.ts is only a note. --fix left 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"}]
commented

<!-- look-pages 638708ae4951 --> Look pages for 638708a, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

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: 638708ae4 names /, 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 a No door: line explaining that this extends the existing screen rather than adding a new one.
  • Test input: test/preview-start-output.test.ts has no as never, and bun x tsc --noEmit is clean.
  • Issue number: the Direction: commit 07d4bc9fe carries (#17892).
  • Dead code: test/unused-exports.test.ts passes. START_LINES is exported only because that test imports it, and the unused-exports test does not flag it, so I left it.
  • Gate: bun scripts/gate.ts reports 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.

commented

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.ts imported ../../core/pulls.ts twice. I merged changedSentences into the first import and removed the second.
  • What I ran:
    • test/dup-imports.test.ts now passes.
    • bun x tsc --noEmit is clean.
    • bun scripts/gate.ts --fix changed nothing.
    • test/preview-start-output.test.ts and 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.ts holds the start-failure lookup.
    • src/web/pages/pull-start.ts renders the strip under the checks line on the web pull page.
    • src/tui/screens/pull.ts shows 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

commented

<!-- look-pages c8fe7a0cc2fa --> Look pages for c8fe7a0, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

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 a No door: line explaining that this extends the existing screen rather than adding a new one.
  • Test input: test/preview-start-output.test.ts has no as never, and tsc was clean on the previous head.
  • Issue number: the Direction: commit carries (#17892).
  • Dead code: test/unused-exports.test.ts passes.
  • Gate and tests: bun scripts/gate.ts reports no failures at c8fe7a0. test/preview-start-output.test.ts and test/unused-exports.test.ts pass, 8 tests in all. I did not rerun tsc at c8fe7a0.

The branch is level with origin.

commented

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.

commented

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"}]
commented

<!-- look-pages e1547613bf7a --> Look pages for e154761, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

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.ts has no as never.
  • Issue number: the Direction: commit carries (#17892).
  • Dead code: test/unused-exports.test.ts passed earlier on this branch.
  • Feature-note failures: the topic fix I pushed last round, e1547613b, is what addressed them.
commented

<!-- look-pages 2811eb098c2b --> Look pages for 2811eb0, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

<!-- look-pages a9c121944a85 --> Look pages for a9c1219, from the gate:

  • look pages (named): this pull changes src/web/pages/pull-start.ts, src/web/pages/pull.ts; a commit names /
commented

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.ts renders 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.ts now asserts the exact servingWords sentence.
  • 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.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs