Files
Satyajit Sahoo 23aa697e26 feat(cli): show --step keys under the summary and view the screen and app log (#2015)
* feat(cli): show step keys under the summary and view the screen and app log

The --step and screen.pause() prompt now lists its keys below the live
summary, as --watch does, and the held step row uses a pause glyph.

Press s for the screen's accessibility tree or l for the attempt's app
log. Both open in a scrolling viewer on the alternate screen. The app log
is read from the worker during the hold through a new logs-request and
logs-reply message pair.

The mode without a terminal keeps its text.

* feat(cli): stop the terminal's Duration row while a step is held

The list reporter's Duration row counted wall time, so it kept ticking at
a --step prompt or a screen.pause(). The scheduler now reports when the
first hold opens and the last closes through a run-hold event, and the
row excludes that time, live and in the final summary.

report.json and the reports built from it keep wall time.

* feat(report): add run.durationMs without held time

The report only had the run's start and finish timestamps, so a run that
waited at a --step prompt or a screen.pause() looked as long as the wait.

run.durationMs is the run's duration with held time left out. The
terminal's final Duration row prints the same value. Markdown, the GitHub
comment, the HTML report, and telemetry read it in place of the timestamp
difference. startedAt and finishedAt still record wall time.

A simplification review also removed a few flags and options from the
step viewer and the hold path, and the docs keep each new fact in one
place.

* docs: trim the step viewer changeset and docs

The changeset is down to two sentences. The docs no longer say where the
keys are, since the terminal sample shows it, and the json reporter
section matches main again.

* fix(cli): print the viewer's text before the prompt is repainted

On p, the viewer closed first, so the live window was repainted and then
erased again for the printed text. That left a blank frame. The text is
now queued before the viewer closes, and the window is repainted once.

* fix(cli): number the step prompt by its trace position

The app log view numbered its lines by the recorder's step index, which
counts nested steps, while the prompt counted held steps only. A line
logged inside a nested step could show a different number than the
prompt.

The worker now sends each held step's position in the trace, so the
prompt, the app log view, and the trace page use one number.

The viewer's try blocks are removed too. Nothing received their rethrows,
and the guarded calls don't throw.

* fix(cli): count held time only while every running worker is held

With several workers, a screen.pause() in one test took the time other
tests spent running out of the run's duration. A run could read shorter
than one of its tests. An interval now counts as held only while every
running worker is held. The time limit keeps its rule.

Also from review:
- A routing state an older installed copy made is upgraded in place,
  so claimProcessOutput() no longer throws.
- The viewer holds writes only for terminal streams.
- Ctrl-Z closes the viewer and suspends.
- A failed screen read can be retried during the same hold.
- p is ignored while a read is pending.
- The app log view shows plain text, not Markdown code spans.
- The viewer's help row starts with q, and its headings use the
  redacted title and target.

* test(cli): cover an older dispatcher installed on the streams

The upgrade test seeded a state with no dispatchers. This one installs
an older copy's dispatchers first, then checks that writes are held
while the viewer is open.

The comment on that branch loses its FIXME prefix. It describes what the
code does.
2026-11-21 14:00:20 +01:00
..