Repository navigation
Description
Story
As a maintainer relying on required_review_thread_resolution as the real merge gate,
I want thread resolution to be performed only by the harness, never by the model,
so that the deterministic guards in dev-lead-fix-reviews.sh are authoritative instead of advisory.
Parent: #1621 (see its "Root cause" section). Story 1 of 2.
The bypass
prompts/dev-lead/fix-reviews.md § "Resolving a thread" hands the model the raw mutation:
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_NODE_ID"}) { thread { isResolved } } }'The model has a shell and this snippet, so it can resolve any thread directly — bypassing resolve_addressed_bot_threads(), resolve_actor_outdated_threads(), review_thread_is_agent_authored (#1415) and the fail-closed re-read. The surrounding prose rules ("Never resolve a thread you did not fix") are instructions to a model, and on petry-projects/.github PR #1044 they were not followed.
Acceptance Criteria
- The
resolveReviewThreadmutation and its example are removed fromprompts/dev-lead/fix-reviews.md. The prompt's contract becomes: reply with the addressed-marker; the harness resolves. The same removal is applied to any other dev-lead prompt that hands the model this mutation — checkprompts/dev-lead/fix-bot-comment.mdandprompts/dev-lead/review-changes.md, which also reference it. - The reply instruction is unchanged and remains mandatory: name the file(s)/function(s) changed and how the change addresses the concern, ending with
<!-- dev-lead:addressed -->, stamped only on a genuine addressed reply and never on a skip note. - The prompt states explicitly that the model must not call
resolveReviewThread(orunresolveReviewThread) under any circumstance, and that resolution is the harness's responsibility — so the rule is legible rather than merely absent. - The existing marker-ownership rules survive verbatim in behaviour: marker-less human threads are still never resolved ([Phase 4] Close the maintainer review-gate gap — dev-lead PRs cannot be blocked by the owner (shared identity + agent-resolved threads) #1415); bot threads and outdated threads still resolve through the harness paths that already handle them.
- A prompt-coverage assertion fails if any
prompts/dev-lead/*.mdreintroduces aresolveReviewThreadmutation. Wire it into the existing prompt-coverage suite (tests/dev-lead/integration/test_prompt_coverage.sh). - A bats case asserts that after a
fix-reviewspass the only resolutions observed come from the harness code path — i.e. no resolution occurs for a thread whose latest reply is not an our-account addressed-marker. shellcheck --severity=warning -xstays clean and the suites are registered in the existing lint/bats jobs.
Tasks / Subtasks
- Remove the resolve mutation + example from
fix-reviews.md; auditfix-bot-comment.mdandreview-changes.mdfor the same (AC: test issue from agent #1) - Add the explicit "never call resolveReviewThread — the harness resolves" statement (AC: Add @claude delegation, auto-merge, and rebase handling #3)
- Confirm the reply/marker instruction is untouched (AC: Go-live improvements for PR review agent #2)
- Add the prompt-coverage assertion forbidding the mutation in dev-lead prompts (AC: feat: add Copilot engine support via REVIEW_ENGINE toggle #5)
- Add the bats case for harness-only resolution (AC: feat: feature ideation framework — adversarial proposer/challenger/synthesizer #6)
- shellcheck + suite registration (AC: Workflow should skip no-op PRs in MAX_PRS count #7)
Dev Notes
- Do not change
scripts/dev-lead-fix-reviews.shin this story. Its guards are already correct; this story only stops the model routing around them. Verification of the marker's truth is Story 2 and must not be pulled forward — that is what makes this pass small enough to finish insideACTION_TIMEOUT_SEC. - The harness resolve paths that remain authoritative:
resolve_actor_outdated_threads()(~L347, consultsreview_thread_is_agent_authored),resolve_bot_outdated_threads()(~L524),resolve_addressed_bot_threads()(~L624, requires our-account + addressed-marker, re-reads state, fails closed). - dev-lead: resolve review threads it has addressed — unresolved 'Applied in…' threads silently block merge via required_review_thread_resolution #1547 is why the marker exists — it made the harness able to resolve threads the agent had addressed. This story does not undo dev-lead: resolve review threads it has addressed — unresolved 'Applied in…' threads silently block merge via required_review_thread_resolution #1547; it removes the second, unguarded path that grew alongside it.
- Expect the removal to be small. If the pass starts approaching the action budget, push what exists and split rather than losing the work (Measure and tune the dev-lead action budget: #1609 died 1s over ACTION_TIMEOUT_SEC and lost all its work — near-miss alerting + checkpoint push before tuning the number #1619).
References
prompts/dev-lead/fix-reviews.md§ "Resolving a thread"scripts/dev-lead-fix-reviews.sh,scripts/lib/maintainer-review-thread-gate.shtests/dev-lead/integration/test_prompt_coverage.sh,tests/dev-lead/unit/test_fix_reviews.bats- Parent dev-lead resolves review threads without addressing them — unfixed findings merge through the thread-resolution gate #1621; origin of the marker dev-lead: resolve review threads it has addressed — unresolved 'Applied in…' threads silently block merge via required_review_thread_resolution #1547; maintainer-thread guard [Phase 4] Close the maintainer review-gate gap — dev-lead PRs cannot be blocked by the owner (shared identity + agent-resolved threads) #1415
Activity
github-actions commentedon Sep 7, 2026
Thanks for the detailed write-up and for tying this back to the specific incident on PR #1044 — the acceptance criteria are clear and the scope is well-bounded. Before work begins: beyond the three prompts called out (
fix-reviews.md,fix-bot-comment.md,review-changes.md), have you confirmed via a full grep ofprompts/dev-lead/that no other files in that directory also expose theresolveReviewThreadmutation, so the audit scope in AC #1 is complete?don-petry commentedon Sep 7, 2026
Dev-Lead Implementation Plan
Issue: #1691 — [#1621 S1] Harness-only thread resolution: remove the model's resolveReviewThread path
Scope
Remove the
resolveReviewThreadGraphQL mutation from the dev-lead review prompts and make the contract "reply with the addressed-marker; the harness resolves", so the deterministic guards indev-lead-fix-reviews.share the sole resolution path. No change toscripts/dev-lead-fix-reviews.sh(its guards are already correct — Story 2 scope).Implementation Checklist
prompts/dev-lead/fix-reviews.md— remove theresolveReviewThread(input:…)mutation + example; add explicit "must not call resolveReviewThread/unresolveReviewThread — the harness resolves" statement; preserve the marker-ownership scope (bot vs marker-less human) as description of harness behaviour; keep the reply/addressed-marker instruction untouchedprompts/dev-lead/fix-bot-comment.md— same removal + prohibitionprompts/dev-lead/review-changes.md— same removal + prohibitiontests/dev-lead/integration/test_prompt_coverage.sh— stop requiring the resolve mutation; add an assertion that FAILS if anyprompts/dev-lead/*.mdreintroduces aresolveReviewThread(/unresolveReviewThread(mutationTests to Write
tests/dev-lead/unit/test_fix_reviews.bats— a case asserting that after afix-reviewspass, the only resolutions come from the harness path: a thread whose latest reply is not an our-account addressed-marker is NOT resolved (AC feat: feature ideation framework — adversarial proposer/challenger/synthesizer #6)Test Command
bats tests/dev-lead/unit/ && bash tests/dev-lead/integration/test_prompt_coverage.sh(plusbash .dev-lead/scripts/dev-lead-lint.sh)don-petry commentedon Sep 7, 2026
Dev-Lead: Progress (in progress — not yet durable)
Plan Execution (intended)
resolveReviewThreadmutation + example fromfix-reviews.md,fix-bot-comment.md,review-changes.md; each now states the model must not callresolveReviewThread/unresolveReviewThreadand that resolution is the harness's job (contract: reply with the addressed-marker; the harness resolves).test_prompt_coverage.sh: section 4 no longer requires the resolve mutation (now requires "harness resolves" + a "must not call resolveReviewThread" statement); added a new assertion that fails if anyprompts/dev-lead/*.mdreintroduces aresolveReviewThread(/unresolveReviewThread(invocation (AC feat: add Copilot engine support via REVIEW_ENGINE toggle #5).test_fix_reviews.bats: added a harness-only-resolution case — on a head-advancing (gate-open)fix-reviewspass, a bot thread whose latest reply lacks our-account addressed-marker is left unresolved (AC feat: feature ideation framework — adversarial proposer/challenger/synthesizer #6).Local check output (provisional — not the pushed run)
Files touched (this workspace, not yet pushed)
prompts/dev-lead/fix-reviews.md,prompts/dev-lead/fix-bot-comment.md,prompts/dev-lead/review-changes.mdtests/dev-lead/integration/test_prompt_coverage.sh,tests/dev-lead/unit/test_fix_reviews.batsNotes
scripts/dev-lead-fix-reviews.shis intentionally unchanged (its guards are already authoritative — Story 2 scope). Both affected suites are already registered intest-dev-lead.yml(AC Workflow should skip no-op PRs in MAX_PRS count #7), so no workflow change was needed.don-petry commentedon Sep 7, 2026
Dev-Lead: Implementation Complete — PR #1699
The implementation for issue #1691 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
3cc4132fd4b4692aa20865f8b68ea8e21de604b8Review happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.
feat: implement issue #1691 — [#1621 S1] Harness-only thread resoluti…
feat: implement issue #1735 — Bot-acknowledged threads are permanentl…