Skip to content

`lib/enabler.sh`'s handoff-recovery path is a second detector site for the rework record's `check-failure` and `human-change-request` classes and emits neither, so both classes undercount

Id: TD-PPagop-26082919 · Status: resolved · Filed: 2026-08-29 · Resolved: 2026-09-29 · Ref: #1943

What. Requirement 47 (docs/FLOW-SCHEMA.md, agent-ops#596) emits one rework record per repetition at each class’s own detector site. Two of the nine classes have a second site that was left unwired. handoff_complete_review (lib/handoff.sh) is the one gate-and-flip implementation the Reviewer’s handoff shares with the Enabler’s handoff-recovery path (requirement 34a), and lib/enabler.sh calls it too: it logs its own review-gate-checks-read from e_gate_checks_ok (lib/enabler.sh:715-717) and reaches its own e_rc_word == "dirty" reconciliation refusal (lib/enabler.sh:726-728), producing a warning in each case and no rework record. Only agent-cycle.sh’s Reviewer-handoff site emits either class.

Why it matters. The two counts a Phase 2 reader would naturally compute diverge silently: reducing review-gate-checks-read {ok: false} over the union log and reducing rework {class: "check-failure"} over the same log give different answers, with nothing in either stream saying why. human-change-request is the worse of the two, because the recovery path exists precisely for the pull request whose Reviewer round did not complete its own handoff — so the human change request most likely to be caught only by the Enabler is the one never recorded. D23’s whole discipline is that a repetition is an account rather than a guess, and a silently partial account is the failure mode it is trying to avoid.

Where. lib/enabler.sh — the handoff_complete_review block in the handoff-recovery sweep (around lines 697-745). Compare agent-cycle.sh:2866-2876 (rework_check_failure_fields) and agent-cycle.sh:2931-2937 (rework_human_change_request_fields) for the wired shape. docs/FLOW-SCHEMA.md currently discloses both omissions in its “check-failure” and “human-change-request” notes; those disclosures come out when this is fixed.

Suggested fix. Not simply “add the two calls” — the question that stopped this landing with agent-ops#596 has to be settled first: whether a recovery pass re-observing a condition an earlier round already recorded is a fresh repetition or the same one. If it is the same one, the fix is a dedup key rather than a second emission; if it is fresh, the two calls are mechanical and e_pr_url/e_gate_reason/e_rc_reason are already in scope (a repo/item for the entry being recovered has to be threaded in, or omitted the way rework_fields already omits absent keys). That question is the attribution arbitration docs/ROADMAP.md parks at Phase 2 with the rework panel (agent-ops#611), so this item is best resolved alongside it rather than before it.

A related judgement worth settling in the same pass: check-failure fires only when the required-check list could not be read (gate.checks_unreadable), never when a required check ran and came back red (gate.word == "dirty"). That is what the refined specification for agent-ops#596 asked for and docs/FLOW-SCHEMA.md now says so explicitly, but no class in the record covers a genuinely red check, and the class name invites the opposite reading.

Noticed while reviewing https://github.com/Poetic-Poems/agent-ops/pull/941 (issue #596), which introduced the record.

Migrated to https://github.com/Poetic-Poems/agent-ops/issues/1032.