Skip to content

Spec: see, follow and Stop a machine's Commands from the CLI - #778

Merged
JacobStephens2 merged 30 commits into
mainfrom
issue-711
Oct 18, 2026
Merged

JacobStephens2 merged 30 commits into
mainfrom
issue-711

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the CLI for seeing, following and stopping this machine's Commands across every repository in logs.dir.

Command log + atomic Command record
  Pass → dispatched Run / Spec run → Ticket Runs → Base fixes
  status → live stages, age, recent outcomes, history and idle Passes
  show   → full tree, Session logs and latest events
  logs   → raw Command / Session logs, optionally followed
  stop   → SIGTERM → existing cleanup → triage or --requeue

Records retain process start identity, Harness, Model, Effort, stage history, Ticket blockers and outcomes. History falls back to Activity logs and then current-layout Session logs. README documents the version 1 status/show JSON. Stop refuses ended Commands and individual Ticket Runs, records who requested it, and waits for cleanup.

Closes #711

Evidence

  • Before: main has no machine status, show, logs or Stop commands; operators find processes and logs manually.
    After: binary integration tests exercise live Runs, nested Pickup/Spec/Ticket trees, idle Passes, historical recovery, naming, Session selection, log following, and Stop labels and cleanup.
  • Before the review fix: stop widgets#20 preserved unfinished Ticket work on origin/issue-21 but printed only Issue branch left: issue-20. The reviewer’s stop_reports_retained_ticket_branches reproduction failed (exit 101).
    After: the identical reproduction passed (exit 0). Stop reuses status's tree reader to report retained branches and pull requests recursively, including Ticket Runs and Base fixes. The regression remains in tests/stop.rs.
  • Standards review also consolidated Command stamp parsing used by history, naming and Session lookup.
  • Passing local Linux checks: full cargo test; cargo fmt --check; cargo clippy --all-targets -- -D warnings; cargo test --test stop --test status --test show_logs (39 tests); cargo test --bin thirdshift logs:: (24 tests). The full run began during review; the focused checks ran after the corrections in b958ff6.

Test seams: the thirdshift binary against real Git and fake GitHub/Harnesses; the existing recorder effects seam for write failure, concurrency and process identity; the existing in-memory Claim seam for Stop endings. The Stop regression observes CLI output and retained work on fake origin.

Unaddressed findings

  • Standards: none. The P3 possible Duplicated Code finding was addressed and its correction reviewed.
  • Spec: none. The P2 omitted child-resource finding was reproduced, fixed and its correction reviewed.
  • Security: none identified. Single-session guidance review of the pinned diff f3133466986c6dd465939ddf190a643b212f06c6...HEAD and supporting code covered Stop process identity and signaling, record and Stop-request files, log paths, interruption and Claim cleanup, and Session-tail parsing. All 39 CLI tests in stop, status and show_logs, plus 24 logs:: unit tests, passed across isolated offline Linux runs; one CLI fixture needed the installed Node binary added to the sandbox before its successful rerun. macOS received source review only, including comparison with Apple’s process identity declarations and signal wrapper.

Review coverage: both independent reviewers read all 36 changed files, including supporting standards and ADRs, and reread all five files changed by the corrections. Unread changed files: none. Intentionally unread generated output: none. Both reports include their final files-read lists.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

The binary can be rolled back; retained Command records and logs stay on disk. A Stop already requested has lasting effects on the running Command and its issue labels.

Blast Radius: machine

Status spans configured repositories. Stop targets one verified Command process and its existing interruption tree; changes also touch shared recording, Claim ending and Run/Spec Delivery transitions.

Built with codex · gpt-6.1-sol · high

Tickets

Record live Runs and add machine-wide status
Record Passes and show idle Passes in status
Preserve Command history alongside Pass stages, nested dispatches and idle reasons. Record completion times for both Passes and dispatched work, and retain binary coverage for their history.
Combine Pass stages, dispatch records and idle status with independently written child Run records. Keep same-process dispatches in dispatched and child processes in children, preserving each child's dispatch context.
Show recent and historical Commands in status
Preserve child Run and Spec Ticket trees in recent and complete Command history. Retain completion times and history provenance, and cover completed child trees alongside historical filtering.

Validation: cargo check --all-targets; cargo fmt --check; cargo clippy --all-targets -- -D warnings; cargo test (1,902 passed, two ignored).
Record child Runs and Spec runs in Command status
Add show and logs for named Commands
Add thirdshift stop for live Runs
The Spec Stop test added on issue-774 intermittently lost its interruption markers because the fake CLI died before its script handled TERM, letting process cleanup kill the script. Reuse the stop-signal handler already used by the other session fakes so Claude waits for its script.

Delay the test handler beyond a cleanup poll to make premature fake exit reproducible while retaining every assertion. Verified the delayed handler fails before the fix, then passes ten stress iterations; the full hash:4/4 shard (498 tests), all eight Stop tests, formatting and diff checks pass locally on Linux.
Stop for Spec runs, Pickup runs and Passes
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 18, 2026 22:39
@JacobStephens2
JacobStephens2 merged commit b54c9ef into main Oct 18, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-711 branch October 18, 2026 23:00
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 19, 2026
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.

Spec: see, follow and Stop a machine's Commands from the CLI

1 participant