Skip to content

feat: --from-step retry, pause-on-failure UI, and step log segmentation#37

Merged
peterp merged 4 commits intomainfrom
pp-retry-from
Mar 9, 2026
Merged

feat: --from-step retry, pause-on-failure UI, and step log segmentation#37
peterp merged 4 commits intomainfrom
pp-retry-from

Conversation

@peterp
Copy link
Member

@peterp peterp commented Mar 9, 2026

Closes #35

Changes

--from-step and --from-start for machinen retry

  • machinen retry --from-step 3 skips steps 1–2 and re-runs from step 3 onwards
  • machinen retry --from-start re-runs from the first run: step
  • Step numbers are 1-based, matching the UI

Pause-on-failure UI improvements

  • Shows the last 20 lines of step output below the tree when paused, matching the end-of-job failure summary quality
  • Press Enter to retry directly from the paused terminal (syncs workspace + writes retry signal)
  • Ctrl+C to abort

DTU step log segmentation

  • The DTU now tracks the currently in-progress step and uses it as fallback when the runner sends output on the Job-level feed
  • Failing/paused steps now get properly named log files (Run-assertion-test.log) instead of opaque UUID files

Testing

  • All CLI tests pass (181 tests, 14 files)
  • All DTU tests pass (28 tests, 2 files)
  • Manually verified with retry-proof workflow

peterp added 4 commits March 9, 2026 18:32
Allows rewinding to an earlier step when retrying a paused runner:
- --from-step <N>: skip steps before N, re-run from step N onwards
- --from-start: re-run all run: steps from the beginning

Each wrapped step embeds a 1-based index matching the tree UI and
checks a from-step signal file on entry. Steps below the target
exit 0 (skip), the matching step deletes the signal and continues.

Closes #35
When a step pauses on failure, the tree UI now shows:
- Last 20 lines of step output below the tree (assertion errors,
  code context, etc.) matching the end-of-job summary quality
- Press Enter to retry directly from the paused terminal
- Ctrl+C to abort

The step log is resolved via sanitized name with fallback to the
most recently modified .log file (the DTU writes logs under feed
UUIDs that differ from timeline record IDs).
The runner sends step output via the Job-level feed (Job UUID as
recordId), which the DTU couldn't map to a step name. Now the
timeline handler tracks the currently in-progress step, and
writeStepOutputLines falls back to it when the feed recordId has
no direct mapping. This gives failing/paused steps their own
properly named log files (e.g. Run-assertion-test.log) instead of
an opaque UUID file.

Also adds Enter-to-retry: pressing Enter in the terminal while
paused triggers a workspace sync and retry signal directly.
@peterp peterp merged commit ef005e5 into main Mar 9, 2026
10 checks passed
peterp added a commit that referenced this pull request Mar 16, 2026
feat: --from-step retry, pause-on-failure UI, and step log segmentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate retry behavior: does retrying re-run setup steps?

1 participant