Skip to content

The review-gate unreadable-checks streak never escalates from the Enabler's complete_handoff path

Id: TD-PPagop-26081603 · Status: resolved · Filed: 2026-08-16 · Resolved: 2026-08-16 · Ref: #479

Requirement 31c’s node-health streak (TD-PPagop-26081404) exists so a gh degraded enough to fail a required-checks read is reported once, loudly (review-gate-checks-degraded), rather than as one per-item warning piling up unremarked. It is wired at exactly one call site: the Reviewer’s own ready handoff in agent-cycle.sh, which logs the bookkeeping event (review-gate-checks-read) and then calls review_gate_unknown_streak_verdict / review_gate_degraded_since (lib/review-gate.sh) to decide whether this node’s run has crossed review_gate_unknown_streak_after.

lib/handoff.sh’s handoff_complete_review (agent-ops#440) now runs the same review gate from a second call site — the Enabler’s complete_handoff recovery path — and that site logs the same review-gate-checks-read bookkeeping event on every evaluation, but does not call either streak function. So a run of consecutive unreadable-checks failures that happens to land entirely on complete_handoff evaluations (rather than ordinary Reviewer handoffs) never earns the one loud review-gate-checks-degraded escalation — each evaluation still warns individually (enabler asked for the handoff on … to be completed, but it is not safe to hand off: …), which is the per-item noise the streak exists to replace.

The consequence is bounded: complete_handoff only runs when an Enabler engagement explicitly recovers a stalled-but-Reviewed draft, which is rare relative to ordinary Reviewer handoffs, and every bookkeeping event still lands in the log — nothing is lost, only the louder aggregate signal a sufficiently degraded node would otherwise earn. A node degraded enough to matter will very likely also fail ordinary Reviewer-path reads in the same window, which does escalate.

Suggested fix: factor the streak-and-escalate sequence (review_gate_unknown_ streak_verdict, review_gate_degraded_since, the review-gate-checks-degraded log call and its stderr echo) into one small helper — in agent-cycle.sh itself, since it reads log_file/node_name and is Script bookkeeping, not gate logic — and call it from both the Reviewer’s own handoff and the Enabler’s complete_handoff block wherever handoff_complete_review reports gate.checks_unreadable: true, rather than only the former.

Referenced from: requirement 31c/32b, docs/IMPLEMENTATION-PIPELINE-SPEC.md; lib/handoff.sh’s handoff_complete_review; agent-cycle.sh’s Reviewer and Enabler complete_handoff blocks.