| id | S.8 |
|---|---|
| title | Beads Runner Reliability |
| status | complete |
| branch | sprint/s-8-beads-runner-reliability |
| worktree | ../sc-compose-worktrees/sprint/s-8-beads-runner-reliability |
| target | sprint/s-7-path-normalization-contract |
Make the bounded-output process runner easier to reason about and test after its recent defect history, while preserving its host-neutral request/receipt contract and platform-specific containment strategy. This closes S-T8.
- S.7 is this branch's required
gh stackparent. There is no functional code dependency on S.1–S.7; the parent keeps this final PR incremental. - Phase-close dependency: S.1 through S.7 must be reviewed and CI-green before the S.8-top stack can merge atomically at phase close.
- The existing
process-wrapcontainment contract remains approved; a new process library or OS-containment policy requires ADR review.
crates/sc-composer-beads/src/runner.rscrates/sc-composer-beads/tests/runner_process_tree.rsdocs/architecture.mddocs/phase-S/sprint-s-8-beads-runner-reliability.md
- Private runner-state seams for capture completion, cap breach, contained termination, child-status collection, and reader join behavior.
- Deterministic unit tests for normal non-zero exits, stream cap breach, reader failure, and output completion ordering.
- Real supported-platform proof that Unix process groups and Windows Job Objects terminate contained descendant trees on cap breach; no shell.
- A documented unsupported-platform fallback that remains direct-child only.
- Preserve
CommandSpec,ProcessOutput,ProcessRunner, stable error markers, Beads stage receipt mapping, and direct argv execution. - Do not add Beads source/database dependencies, make the runner CLI-aware, or
expose foreign-language bindings from
sc-composer-beads. - Follow
CLAUDE.mdRule 11: only already-approvedprocess-wrapis allowed; the crate remains host-neutral with no CLI, adapter, ATM, or Beads source dependency. - Production-ready closure: every listed capture/containment state and its committed supported-platform proof must land in this sprint; partial platform coverage does not close S-T8.
// Private lifecycle state; public runner contract remains unchanged.
enum CaptureState {
Waiting,
OutputLimitExceeded,
Completed,
}The exact private representation may differ, but tests must prove the same lifecycle boundaries independently.
- New Beads CLI commands, formula semantics, real persistent pours, or a request/receipt schema revision.
- An unreviewed replacement for
process-wrapor a cross-platform process API change requiring an ADR.
- Normal exit status remains exactly the child's status.
- Cap breach returns the existing typed output-limit marker only after contained-child termination and capture-reader cleanup.
- A descendant retaining an output pipe cannot hang supported Unix or Windows runner paths.
- Runner unit and real pinned-
bdintegration tests pass on Linux, macOS, and Windows CI. - No shell, Beads source/database, CLI, adapter, or ATM dependency enters
sc-composer-beads.
# The phase plan added this branch directly on top of S.7.
git config rerere.enabled true
git config remote.pushDefault origin
git add crates/sc-composer-beads/src/runner.rs crates/sc-composer-beads/tests/runner_process_tree.rs docs/architecture.md docs/phase-S/sprint-s-8-beads-runner-reliability.md
git commit -m "refactor(beads): isolate bounded runner lifecycle"
gh stack submit --auto
gh pr ready <sprint-s-8-pr-number>
gh stack view --json
# The phase plan owns the sole final `gh stack merge` command.cargo fmt --all --checkcargo clippy -p sc-composer-beads --all-targets --all-features -- -D warningscargo test -p sc-composer-beadscargo test --workspacejust lintgit diff --check