Skip to content

feat: run halt command process#932

Draft
a5c-ai[bot] wants to merge 3 commits into
stagingfrom
plan/issue-880
Draft

feat: run halt command process#932
a5c-ai[bot] wants to merge 3 commits into
stagingfrom
plan/issue-880

Conversation

@a5c-ai

@a5c-ai a5c-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Links #880

Summary

  • Adds .a5c/processes/issue-880-run-halt-command.mjs as an executable Babysitter process definition for implementing babysitter run:halt.
  • Adds .a5c/processes/issue-880-run-halt-command.inputs.json with concrete issue inputs, target files, tests, docs, quality commands, acceptance criteria, and non-goals.

Planned phases

  • Read issue Add 'babysitter run:halt' command for sealing divergent runs #880 and related recovery context.
  • Run Phase 0 reuse audit and trace CLI/journal/state call paths.
  • Design the manual-seal CLI contract, including final-status semantics and audit fields.
  • Author failing CLI regression tests before implementation.
  • Implement the command wiring, handler, journal append, state rebuild, and docs in a bounded loop.
  • Run verification, code review, documentation, and final acceptance gates.

Expected tasks

  • Extend CLI registration, positionals, flag parsing/types, usage, command exports, and dispatch.
  • Add a handler near existing recovery commands that uses appendEvent and rebuildStateCache.
  • Record manual_seal_reason, command source, requested status, prior state, and pending-effect summary.
  • Cover dry-run, JSON output, supported final statuses, already-terminal rejection, state rebuild, and visibility through status/events.

Quality gates

  • npm run build:sdk
  • targeted CLI run tests for packages/sdk/src/cli/__tests__/cliRuns.test.ts
  • npm run test:sdk
  • npm run verify:metadata
  • reviewer gates for journal invariants, audit trail, completionProof semantics, docs, and scoped diff.

@a5c-ai a5c-ai Bot changed the title feat: plan run halt command feat: run halt command process Jun 5, 2026
@tmuskal tmuskal linked an issue Jun 5, 2026 that may be closed by this pull request
@a5c-ai

a5c-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Author

Implemented the planned babysitter run:halt changes from issue #880 and pushed commit c860eefb4 to plan/issue-880.

Summary:

  • Added CLI wiring, parsing, dispatch, usage, and handler support for babysitter run:halt <runDir> --reason <text> [--final-status halted|completed|failed] [--json] [--dry-run].
  • Implemented manual terminal sealing via appendEvent, defaulting to RUN_HALTED, with explicit RUN_COMPLETED/RUN_FAILED support.
  • Recorded audit fields including manual_seal_reason, sealedBy, requested status, prior lifecycle state/event, and pending effects summary.
  • Rebuilt state with manual_seal after mutation, rejected already-terminal runs without mutation, and preserved completionProof only for completed manual seals.
  • Added CLI regression coverage and updated CLI/reference/recovery docs and prompt templates.

Verification:

  • npm run build:sdk passed.
  • npm run test --workspace=@a5c-ai/babysitter-sdk -- --run src/cli/__tests__/cliRuns.test.ts passed: 62 tests.
  • npm run test:sdk passed: 2080 tests, 9 skipped.
  • npm run verify:metadata still fails due to unrelated pre-existing .agents/plugins/marketplace.json metadata: expected babysitter version 5.0.1-staging.28347f861706, found undefined. That file was left unstaged.

@a5c-ai

a5c-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Author

Implemented the planned run halt process on plan/issue-880.

Summary:

  • Added babysitter run:halt <runDir> --reason <text> [--final-status halted|completed|failed] [--json] [--dry-run].
  • Wires command parsing, dispatch, usage, and docs for manual run sealing.
  • Appends audited terminal events via appendEvent, records manual seal reason/source/prior state/pending effects, and rebuilds state with manual_seal.
  • Added CLI regression coverage for required reason, invalid statuses, dry-run behavior, default halted seal, failed/completed seals, terminal-run rejection, state rebuild, and event visibility.

Verification:

  • git diff --check passed for the scoped files.
  • npm run build:sdk passed.
  • npm run test:sdk -- --run src/cli/__tests__/cliRuns.test.ts passed.
  • npm run test:sdk passed: 146 files passed, 1 skipped; 2080 tests passed, 9 skipped.
  • npm run verify:metadata failed on pre-existing local metadata drift in .agents/plugins/marketplace.json: expected babysitter version 5.0.1-staging.28347f861706, found undefined. That file is unrelated to this implementation and was left unstaged.

Commit pushed: c860eefb4 feat(sdk): add run halt command.

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.

Add 'babysitter run:halt' command for sealing divergent runs

2 participants