Repository navigation
dev-lead: no deferred/out-of-scope outcome for review threads — a valid finding dev-lead defers stays unresolved forever and blocks merge #2045
Description
Summary
When dev-lead decides a bot review-thread finding is valid but out of scope for the PR, it replies with a skip note ("Valid, but deferring — out of scope") and the thread stays unresolved forever. Under required_review_thread_resolution that blocks merge, and no automated actor can clear it.
Evidence — PR #1953
Five Codex threads on scripts/canary_report.sh (lines 215, 362, 446, 466, 619) each got a dev-lead reply on 2026-10-01 such as:
Valid, but deferring — out of scope for this PR. … requires a per-case identifier in the telemetry …
None was resolved, and no tracking issue was opened or referenced for the deferred work. A maintainer resolved them by hand on 2026-10-03 to unblock the PR. The deferred findings themselves are still untracked:
emit_token_recordwrites noduration_ms, so the latency bar has no real data.- Fixed-judge calls are not excluded from controlled arms. This needs a generator/judge role field in telemetry.
- Per-file parse/filter failures in the shared
_collect_one_artifactare not propagated. - Controlled comparisons do not require paired cases. This needs a per-case id in telemetry.
- Fallback-estimated cache usage is not treated as insufficient. This needs a measured/estimated provenance flag.
Root cause
The design is internally consistent, but it has no outcome for a deferred finding on a review thread:
prompts/dev-lead/fix-reviews.mdallows the<!-- dev-lead:addressed -->marker plus a verified<!-- dev-lead:claim … -->only on a genuine fix. A skip note must carry no marker.scripts/dev-lead-fix-reviews.sh(resolve_addressed_bot_threads) resolves only:- bot threads with a verified addressed claim;
- outdated bot threads.
- Agents are forbidden from calling
resolveReviewThread.
PR issue comments already have the missing outcome. disposition=out-of-scope ref=#<n> requires the tracking issue to exist, and once verified the harness clears the comment (#1813, AC6: one tracking issue per repo). Review threads have no equivalent.
#1743 / PR #1799 does not cover this. It handles false positives, and only after a marker-less human maintainer posts a "no change needed" reply. A deferral is a real finding that should be tracked, not dismissed.
Proposed fix
Add a deferred outcome for bot-originated review threads that mirrors the issue-comment out-of-scope disposition.
-
Prompt. On a bot thread whose finding is valid but out of scope, dev-lead replies with a deferral marker, e.g.
<!-- dev-lead:deferred ref=#<n> -->, where#<n>is the repo's single deferred-findings tracking issue. dev-lead opens or reuses that issue and appends the finding with a link to the thread. -
Harness. Resolve a bot thread when all of these hold:
- its latest our-account reply carries exactly one deferral marker;
refnames an issue that exists and is open;- that issue's body or comments link the thread or the originating comment.
It runs on no-commit passes too, because a deferral produces no commit.
-
Guards.
- Bot threads only. Never resolve a marker-less maintainer thread ([Phase 4] Close the maintainer review-gate gap — dev-lead PRs cannot be blocked by the owner (shared identity + agent-resolved threads) #1415).
- A strictly newer maintainer "required" disposition (
acv_latest_maintainer_disposition) withholds resolution, as in [#1621 S2] Verify the addressed-marker against the pushed diff + honour maintainer dispositions #1692 AC4. - Fail closed on an unparseable marker or an unverifiable
ref.
Acceptance criteria
- A bot thread with a verified
deferred ref=#nreply is resolved by the harness on both commit and no-commit passes. - Each of these leaves the thread open:
- a missing or nonexistent
ref; - a
refto a closed issue; - a tracking issue that does not mention the thread;
- more than one marker.
- a missing or nonexistent
- Maintainer (marker-less human) threads are never resolved by this path.
- Deferrals funnel into one tracking issue per repo, matching AC6 for issue comments.
- bats coverage for each case above.
- As part of this work, open a tracking issue for the five feat: implement issue #1951 — [Phase 2] Canary go/no-go report: compare deep-tier cost, cache-read cost and latency by model from token-usage artifacts #1953 deferrals listed above.
Generated by Claude Code
Activity
don-petry commentedon Oct 3, 2026
Dev-Lead Implementation Plan
Issue: #2045 — dev-lead: no deferred/out-of-scope outcome for review threads
Scope
Add a verified deferred outcome for bot-originated review threads (
<!-- dev-lead:deferred ref=#<n> -->), resolved by the harness on commit and no-commit passes once the referenced tracking issue exists, is open, and links the thread.Implementation Checklist
scripts/lib/deferred-thread-verify.sh(new, puredtv_*helpers): parse exactly one deferral marker →ref; find the latest our-account reply; decide whether a tracking issue (open, not a PR) mentions the thread (thread node id, originating comment URL, ordiscussion_r<databaseId>).scripts/dev-lead-fix-reviews.sh: newresolve_deferred_bot_threads, which:acv_post_marker_clear);acv_latest_maintainer_disposition);gh api;It is wired next to
resolve_dispositioned_comments(outside the Follow-up to #1609 (slice 2): gate dev-lead thread resolution on the pass having advanced the PR head #1617 head-advance gate) in fix-reviews, fix-bot-comment and review-changes. The bot-thread enumeration is shared withresolve_addressed_bot_threads.prompts/dev-lead/fix-reviews.md: document the deferral reply. It reuses the single per-repo tracking issue (AC6, shared without-of-scope) and appends the finding with the thread link..github/workflows/lint.yml: add the new bats file to the repo-specific list.Tests to Write
tests/dev-lead/unit/test_deferred_thread_verify.bats: the pure parser, the mention matcher and the issue-state checks. Cases: missing ref, bad ref, more than one marker, closed issue, PR instead of issue, no mention.tests/dev-lead/unit/test_fix_reviews.bats: harness cases.Test Command
bats tests/dev-lead/unit/(+bash .dev-lead/scripts/dev-lead-lint.sh)don-petry commentedon Oct 3, 2026
Dev-Lead: Progress (in progress — not yet durable)
Plan execution (this workspace)
scripts/lib/deferred-thread-verify.sh(dtv_*). It parses<!-- dev-lead:deferred ref=#<n> -->, finds our latest reply, and checks that the tracking issue is open, is an issue (not a PR), and links the thread.resolve_deferred_bot_threadsinscripts/dev-lead-fix-reviews.sh, wired outside the Follow-up to #1609 (slice 2): gate dev-lead thread resolution on the pass having advanced the PR head #1617 head-advance gate in fix-reviews, fix-bot-comment and review-changes. The bot-thread enumeration is now shared withresolve_addressed_bot_threads.prompts/dev-lead/fix-reviews.mddocuments the deferral reply. It funnels into the singledev-lead: deferred review findingsissue, which is shared with issue-commentout-of-scope.Notes
PRRT_…) or the originating comment'sdiscussion_r<id>anchor.don-petry commentedon Oct 3, 2026
Dev-Lead: Implementation Complete — PR #2049
The implementation for issue #2045 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
415e2ede18ff66f0c93b85dea27400be4f976f93main: 6 file(s), +861/-38 linesReview 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 #2045 — dev-lead: no deferred/out-of-scope outc…
fix: handle command substitution failures under set -euo pipefail in …
feat: implement issue #2045 — dev-lead: no deferred/out-of-scope outc…
fix: handle command substitution failures under set -euo pipefail in …
fix(reviews): fail closed on tracker-comment pagination errors, split…
feat: implement issue #2045 — dev-lead: no deferred/out-of-scope outc…
fix: handle command substitution failures under set -euo pipefail in …
fix(reviews): fail closed on tracker-comment pagination errors, split…
fix(reviews): make deferred-thread resolution work and recover on fai…
fix(reviews): count an unreadable edit time as a failure; require a c…
fix(reviews): record resolve-failed as a non-quota hold; a malformed …
fix(reviews): reason-aware hold dedup and an accurate resolve-failed …
fix(dev-lead): fail closed on partial deferral snapshots; retry fix-b…
fix(dev-lead): key resolve-failed retry markers to the pushed head (#…
fix(dev-lead): retry deferral resolution failures on failed passes too (
fix(dev-lead): stop on a non-advancing thread cursor; never retitle h…
feat: implement issue #2045 — dev-lead: no deferred/out-of-scope outc…
fix(dev-lead): trusted-author tracker links; no auto-merge after a fa…
fix(dev-lead): trusted-author tracker links; no auto-merge after a fa…
fix(dev-lead): an issue-comment listing that is not a list no longer …
fix(dev-lead): disposition a fixed bot issue comment, and sweep claim…