Skip to content

Make jobs recoverable and log handling scalable - #4

Merged
magetsu002 merged 6 commits into
mainfrom
fix/job-recovery-and-log-streaming-v1
Jul 26, 2026
Merged

Make jobs recoverable and log handling scalable#4
magetsu002 merged 6 commits into
mainfrom
fix/job-recovery-and-log-streaming-v1

Conversation

@magetsu002

Copy link
Copy Markdown
Owner

This PR improves job recovery and log handling across Chronosphere.

What changed

  • persists each subprocess PID, process-group ID, startup token, and start time in a private runtime sidecar;
  • validates recovered process identity before sending signals, protecting against PID reuse;
  • reconciles jobs marked as running when an engagement or MCP session starts;
  • restores control of valid jobs that survived a restart and marks dead or mismatched jobs accurately;
  • supports safe TERM/KILL cancellation for recovered jobs, not only jobs started in the current session;
  • replaces whole-file log tailing with bounded seek-from-end reads;
  • replaces whole-file grep with buffered, byte-bounded streaming and capped results;
  • handles large lines and non-UTF-8 output without unbounded memory use;
  • adds subprocess, process-group, restart recovery, large-log, result-cap, and truncation tests;
  • expands doctor to report stale running jobs and orphaned runtime, status, SSH password, remote script, and log files;
  • adds repair support that removes disposable artifacts and archives orphan logs safely.

No command-library expansion or TUI redesign is included.

Validated with formatting, Clippy, the full locked test suite, and a locked release build.

@magetsu002
magetsu002 marked this pull request as ready for review July 26, 2026 19:11
@magetsu002
magetsu002 merged commit c8dd14f into main Jul 26, 2026
1 of 2 checks passed
@magetsu002
magetsu002 deleted the fix/job-recovery-and-log-streaming-v1 branch July 26, 2026 19:22
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.

1 participant