This was generated by AI on operator direction.
Lane: work (issue-execution loop) · Category: operational (correctness/safety gap)
Observation
Surfaced by review on #1299 (which closes #704). #704 anchored babysit-prs's Worker Contract and Worker Prompt Template so a dispatched worker never relies on cwd persisting across tool calls. That protects the worker itself — but not the subagent the worker is required to dispatch.
plugins/source-control/reference/review-discipline.md mandates a finding-extractor subagent whenever a single PR comment carries 3+ findings ("MANDATORY subagent dispatch for multi-finding comments"). Its verbatim dispatch prompt substitutes only <PR>, <COMMENT_ID>/<REVIEW_ID>, and <BRANCH>, and its ALLOWED scope reads:
- `Read` / `Grep` / `Glob` against the repo working tree
- `Bash` for git inspection (`git show`, `git log`, `git diff`) — NEVER state-mutating
No worktree path, no anchoring rule. So the extractor can read and grep the session's default checkout, return per-finding evidence from the wrong branch, and have that ledger consumed as the parent worker's D1–D4 result — precisely the failure #566/#702/#704 exist to prevent, one dispatch level down.
Why it was deferred rather than folded into #1299
review-discipline.md is the plugin-scope shared seam, consumed by both /source-control:babysit-prs and /source-control:pull-request's monitor phase. #704's brief is scoped to babysit-prs's Worker Contract; changing the shared seam widens blast radius into a second lane whose usage needs its own review. The gap also predates #1299 rather than being introduced by it.
Suggested direction (not yet evaluated)
Add a <WORKTREE> substitution slot to the extractor dispatch prompt carrying the absolute worktree path, and state the same anchoring rule the #704 contract now uses — absolute worktree-prefixed paths for Read/Grep/Glob, git -C <worktree> for the git-inspection commands. Verify the pull-request monitor lane, which does its own gh pr checkout rather than using a dedicated worktree, is either covered by the same wording or explicitly exempted.
Related
This was generated by AI on operator direction.
Lane: work (issue-execution loop) · Category: operational (correctness/safety gap)
Observation
Surfaced by review on #1299 (which closes #704). #704 anchored
babysit-prs's Worker Contract and Worker Prompt Template so a dispatched worker never relies on cwd persisting across tool calls. That protects the worker itself — but not the subagent the worker is required to dispatch.plugins/source-control/reference/review-discipline.mdmandates a finding-extractor subagent whenever a single PR comment carries 3+ findings ("MANDATORY subagent dispatch for multi-finding comments"). Its verbatim dispatch prompt substitutes only<PR>,<COMMENT_ID>/<REVIEW_ID>, and<BRANCH>, and its ALLOWED scope reads:No worktree path, no anchoring rule. So the extractor can read and grep the session's default checkout, return per-finding evidence from the wrong branch, and have that ledger consumed as the parent worker's D1–D4 result — precisely the failure #566/#702/#704 exist to prevent, one dispatch level down.
Why it was deferred rather than folded into #1299
review-discipline.mdis the plugin-scope shared seam, consumed by both/source-control:babysit-prsand/source-control:pull-request's monitor phase. #704's brief is scoped tobabysit-prs's Worker Contract; changing the shared seam widens blast radius into a second lane whose usage needs its own review. The gap also predates #1299 rather than being introduced by it.Suggested direction (not yet evaluated)
Add a
<WORKTREE>substitution slot to the extractor dispatch prompt carrying the absolute worktree path, and state the same anchoring rule the #704 contract now uses — absolute worktree-prefixed paths forRead/Grep/Glob,git -C <worktree>for the git-inspection commands. Verify thepull-requestmonitor lane, which does its owngh pr checkoutrather than using a dedicated worktree, is either covered by the same wording or explicitly exempted.Related
implement-dispatchinstance of this defect class