Skip to content

Make a dispatched stage's output file the completion signal#12

Draft
Pijukatel wants to merge 1 commit into
mainfrom
claude/shepherd-issue-8-mgxnft
Draft

Make a dispatched stage's output file the completion signal#12
Pijukatel wants to merge 1 commit into
mainfrom
claude/shepherd-issue-8-mgxnft

Conversation

@Pijukatel

Copy link
Copy Markdown

What we're solving

Issue #8: on harnesses that dispatch subagents in the background, the orchestrator could report the verify/explore stages as still running while their output files were already written to .shepherd/ — the run stalled until a human nudged it. The spec never said how a stage dispatch completes, so this failure was fully spec-compliant.

How

  • Stage dispatch gains a completion-signal clause: dispatch prefers blocking; when backgrounded (or fanning reviewers out in parallel), the stage's output file on disk is the authoritative completion signal at every dispatch site. File presence is the floor; formats that define a terminal marker (ledger verdict line, VERDICT: line) also require it, so a parallel round completes only when every reviewer's file is present and carries its verdict. Overwrite-in-place re-dispatches (architect revision, criteria re-run) compare a content hash recorded in _progress.md at dispatch time — never mtime/size alone. Disk is checked before any status claim, on every turn, not only at resume; no idle-polling machinery.
  • Hard rules pins the invariant: never report a dispatched stage as still running, and never end a turn waiting on one, without first checking its output file on disk.
  • Contract test test_dispatched_stage_completion_is_disk_based anchors the durable phrases (shown red against the unmodified spec, green after).

Alternatives considered

  • Mandating blocking-only dispatch — rejected: can't be honored on background-only harnesses and fights the parallel reviewer fan-out.
  • A polling/monitor protocol — rejected as over-engineered; a single disk-is-the-signal invariant closes the failure.

Run evidence (shepherd pipeline)

  • Fulfillment: all 11 success criteria MET.
  • Reviews: staff-review PASS (after 5 fix rounds: marker scoping, overwrite-in-place stale-read, fingerprint hash-only, wording); final reviewers thermonuclear and ponytail-review both PASS with zero findings.
  • Oracle: python -m pytest tests/ -q → 1 failed, 86 passed — baseline-consistent (the 1 failure is pre-existing and environmental: the active shepherd run's own gitignored .shepherd/config.json trips test_repo_does_not_duplicate_shipped_config_files; baseline before the change was 1 failed / 85 passed, the +1 pass is the new contract test). SKILL.md at 444/450 lines.

Closes #8

🤖 Generated with Claude Code

https://claude.ai/code/session_01C7GxHEth3pHrT2EFeytsaq


Generated by Claude Code

An orchestrator could report stage agents as still running while their
output files were already written, stalling the run until a human nudged
it (#8). The spec never said how dispatch completes.

Stage dispatch now prefers blocking dispatch and treats the stage's
output file on disk as the authoritative completion signal everywhere,
including parallel reviewer fan-outs: presence is the floor, formats
with a terminal marker also require it, and overwrite-in-place
re-dispatches compare a content hash recorded at dispatch time. A Hard
rules pin forbids claiming a stage is still running without checking
disk first, and a contract test anchors the rule.

Closes #8

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7GxHEth3pHrT2EFeytsaq
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.

Shepherd stuck waiting for Shepherd verify stage and Shepherd explore stage

3 participants