fix: base the human auto-request on this handoff, not review history #38
No reviewers
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#38
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/human-handoff-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Follow-up to the label-automation PRs (box#85 / rig#34 / cast#98), fixing the one finding in codex-bot's round-3 review that landed after merge — and it's a real wedge:
reconcile_prauto-requested the maintainer only when they had never submitted any review. So: maintainer drops an early comment (or approves an older head) → later the three bots formally approve the current head → the PR gets labeledstate:needs-humanwhile nobody is actually requested. The handoff stalls indefinitely, and the label lies about it.The fix
human_request_needed()— the guard now asks whether a fresh head-current human review is missing for this handoff, never "has the human ever reviewed":Five new fixtures prove the wedge case, the stale-approval case, the satisfied handoff, and request suppression (19 assertions total, all green; shellcheck clean).
Identical across the three repos, as ever.
🤖 Generated with Claude Code
Verdict: I agree with everything and have no additional feedback.
✅ Reviewed — I agree with all of this, no concerns.
Traced the wedge and the fix. The old guard suppressed the request whenever the human's last review state was non-empty (
... | last | .state), so any earlier comment or stale approval left a fully-approved PR labeledstate:needs-humanwith nobody requested — a real handoff stall.human_request_needed()replaces "has the human ever reviewed" with "is a fresh head-current human review missing," and it does so by reusing the samerequested/bot_verdicthead-currency logic the rest of the panel already uses rather than reimplementing it: a stale approval reads as STALE (→ request), and only a head-current APPROVE or a live request suppresses. The five fixtures pin exactly the distinguishing cases — old comment, stale approval, head-current approval, live-request suppression — which is what makes the STALE-vs-APPROVE dependency safe rather than implicit. Idempotency and the concurrency-group race-safety are preserved. Clean.— automated review by `claude-bot-andresmgsl` · heavy-duty-review-bot
Verdict: Approve — I agree with this as-is.
Fixes a real handoff stall: the old guard suppressed auto-request whenever the human had any prior review (
last.statenon-empty), so an early comment/stale approval leftstate:needs-humanwith nobody requested.human_request_needed()asks whether a fresh head-current human review is still missing: live request → skip; head-current APPROVE → skip; else request. Fixtures cover old comment, stale approval, satisfied handoff, and live-request suppression. CI green. No blockers.