Context
PR #2744 (issue #2502) ships the autonomous PR babysitting settling loop (src/background/pr-feedback-loop.ts). All three opt-in flags default off, and every external-effect seam has a fail-closed default:
_internals.evaluateCurrentHead returns null → every classified event is ambiguous and stays PENDING (no write-class action is ever authorized).
_internals.dispatchOversight / _internals.performAuthorizedAction default to fail-closed outcomes.
This was the invariant-4-compliant replacement for the original process.cwd() gh poll (removed in the Copilot review round). Two independent review ladders accepted it: the approved fix-plan's Wiring section (.agents/issue-traces/2502-pr-babysitting-loop/07-approved-plan.md §3) scopes only the pr-event-subscribers notify hook + monitor tick, and the acceptance checks validated the full pipeline via _internals seam injection.
Net effect: even with all three flags enabled, the loop is currently inert in production until a host wires the seams.
Requested change
At plugin init (or the first notify site, where ctx.directory is already available), inject production implementations:
evaluateCurrentHead(directory, repoFullName, prNumber) — resolve fresh head via the authenticated poll snapshot (getPRPollSnapshot(prNumber, repoFullName, directory)), returning null on failure (existing ambiguous → PENDING semantics preserved).
- Confirm
dispatchOversight / performAuthorizedAction defaults are the intended production paths, or wire host-aware equivalents.
- Add a test asserting the init-time wiring exists (so the seam can't silently regress to fail-closed-inert).
Acceptance
- With
pr_monitor.enabled + pr_monitor.auto_pr_feedback + pr_feedback_loop.enabled all set, a real monitor event can reach an authorized action and a visible terminal state (AC3's end-to-end shape, no seam injection).
- Without the flags, behavior is unchanged (fail-closed, no action).
Related: #2502, #2501 (PR #2741/#2744 review round).
Context
PR #2744 (issue #2502) ships the autonomous PR babysitting settling loop (
src/background/pr-feedback-loop.ts). All three opt-in flags default off, and every external-effect seam has a fail-closed default:_internals.evaluateCurrentHeadreturnsnull→ every classified event is ambiguous and stays PENDING (no write-class action is ever authorized)._internals.dispatchOversight/_internals.performAuthorizedActiondefault to fail-closed outcomes.This was the invariant-4-compliant replacement for the original
process.cwd()gh poll (removed in the Copilot review round). Two independent review ladders accepted it: the approved fix-plan's Wiring section (.agents/issue-traces/2502-pr-babysitting-loop/07-approved-plan.md§3) scopes only thepr-event-subscribersnotify hook + monitor tick, and the acceptance checks validated the full pipeline via_internalsseam injection.Net effect: even with all three flags enabled, the loop is currently inert in production until a host wires the seams.
Requested change
At plugin init (or the first notify site, where
ctx.directoryis already available), inject production implementations:evaluateCurrentHead(directory, repoFullName, prNumber)— resolve fresh head via the authenticated poll snapshot (getPRPollSnapshot(prNumber, repoFullName, directory)), returningnullon failure (existing ambiguous → PENDING semantics preserved).dispatchOversight/performAuthorizedActiondefaults are the intended production paths, or wire host-aware equivalents.Acceptance
pr_monitor.enabled+pr_monitor.auto_pr_feedback+pr_feedback_loop.enabledall set, a real monitor event can reach an authorized action and a visible terminal state (AC3's end-to-end shape, no seam injection).Related: #2502, #2501 (PR #2741/#2744 review round).