Make a dispatched stage's output file the completion signal#12
Open
Pijukatel wants to merge 5 commits into
Open
Make a dispatched stage's output file the completion signal#12Pijukatel wants to merge 5 commits into
Pijukatel wants to merge 5 commits into
Conversation
jirispilka
pushed a commit
that referenced
this pull request
Jul 20, 2026
Stacked on #12. #12 handles "file is on disk but the orchestrator didn't notice" — the missed-notification case. This adds the other direction: when the output file never appears (the dispatched agent died rather than just running slow), an absent file after several turns or a human check-in is a stall to surface and offer to re-dispatch, not another "still running" repeat. Extends #12's contract test with the new phrase. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014weQJCVrR4rakMvnSgMVm4
Issue #8: on harnesses that background subagent dispatch, the orchestrator reported the verify/explore stages as still running while their output files were already on disk, stalling the run until a human nudged it. The spec never said how a stage dispatch completes. A stage's output file on disk is now the authoritative completion signal, independent of dispatch mode (blocking/background) and site (single or parallel fan-out); a terminal-marker format also requires its VERDICT line, and an overwrite-in-place re-dispatch compares a content hash, not mtime/size. A hard rule pins that the orchestrator never reports a dispatched stage as still running without checking disk first. Rebased onto current main; completion clause trimmed to fit the 500-line SKILL.md cap. Closes #8. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014weQJCVrR4rakMvnSgMVm4
jirispilka
force-pushed
the
claude/shepherd-issue-8-mgxnft
branch
from
July 20, 2026 19:33
bae7c7b to
cfa61d2
Compare
Stacked on #12. #12 handles the file-is-on-disk-but-unnoticed case (missed notification). This adds the other direction: when the output file never appears because the dispatched agent died rather than running slowly, an absent file after several turns or a human check-in is a stall to surface and offer to re-dispatch, not another "still running" repeat. Extends #12's contract test with the new phrase. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014weQJCVrR4rakMvnSgMVm4
jirispilka
marked this pull request as ready for review
July 20, 2026 19:39
jirispilka
self-requested a review
July 20, 2026 19:39
jirispilka
reviewed
Jul 20, 2026
jirispilka
left a comment
Collaborator
There was a problem hiding this comment.
I'll test it together with this fix: #17
The silent-stall rule leaned on "if dispatch status exists ... report running only when explicitly active and stalled only when terminal" — as vague as the "after several turns" trigger it replaced (per @Pijukatel's review). Replace it with the honest, observable rule: an absent output file means only "not done" — report status unknown, offer to wait or re-dispatch, and never fabricate "still running"/"stalled" from turn count or a human check-in. Nets the skill from 500 to 499 lines and drops two now-redundant contract asserts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.mdat dispatch time — never mtime/size alone. Disk is checked before any status claim, on every turn, not only at resume; no idle-polling machinery.test_dispatched_stage_completion_is_disk_basedanchors the durable phrases (shown red against the unmodified spec, green after).Alternatives considered
Run evidence (shepherd pipeline)
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.jsontripstest_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