Skip to content

bug(source-control/babysit-prs): readiness gate resolves repo from CWD, silently scores wrong PR cross-repo #1086

Description

@kyle-sexton

Lane: babysit (cycle 36, amendment-round 16).

Triggering example: worker-59, babysitting kyle-sexton/autonomy-demo-scratch#59 (a personal repo, different owner than the main session's own checkout). Root-caused after this PR failed to reach READINESS_OK across 16 prior rounds despite being genuinely clean (state OPEN, mergeStateStatus:CLEAN/mergeable:MERGEABLE, CI green, 0 bot/human findings, 0 review threads, not behind base).

Observed: babysit-readiness-gate.sh's default --pr-only invocation path (loop.md §5.1.3-E) resolves owner/repo via gh repo view on the current working directory, not the actual target repo, and ignores FETCH_COMMENTS_OWNER/FETCH_COMMENTS_REPO. When the invoking session's CWD is a checkout of a different repository than the PR being gated (here: CWD was a melodic-software/claude-code-plugins checkout, target PR was kyle-sexton/autonomy-demo-scratch#59), the gate silently scores whatever PR number matches in the CWD's own repo instead — claude-code-plugins#59 has real claude[bot] findings, so the gate returned READINESS_BLOCKED (findings=1) against the wrong PR entirely, while the actual target PR (autonomy-demo-scratch#59) has zero findings.

Expected: the gate must resolve the target repo from an explicit --repo argument (or FETCH_COMMENTS_OWNER/FETCH_COMMENTS_REPO, consistent with the rest of the toolchain), never infer it from CWD when that CWD doesn't match the PR being gated.

Category: bug (behavioral — silent wrong-data scoring, not a crash; also a functional defect blocking this lane's own convergence on any PR in a repo other than the invoking session's CWD checkout).

Blast radius: this lane routinely dispatches workers across many repos (ci-workflows, claude-code-plugins, medley, standards, github-iac, dotfiles, ci-runner, and now a personal-owner repo) from a single orchestrator whose own CWD is one specific checkout. Any worker whose own worktree CWD doesn't end up as a true checkout of its own target repo (or that inherited a stale/wrong CWD) would hit this same silent misscoring — worth an audit of how many prior READINESS_BLOCKED verdicts this session may have been reporting against the wrong repo's PR-number collision, not the actual target.

Not a self-observation paper-cut: clears the "priority:high functional defect blocking this lane's own next cycle" carve-out in the intake throttle (rule 8b) — filed standalone rather than appended to the rolling sweep issue (#657).

Related, not duplicate: #475 (closed) covered a different failure mode of the same script — a hard exit 4 when FETCH_COMMENTS_OWNER/FETCH_COMMENTS_REPO are unset. This is a silent wrong-repo scoring bug on the CWD-inference path itself, which #475's fix did not address.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: highSignificant impact, or blocks an imminent release; staff this cycle.wayfind: designWayfind decision item: design-space or domain-model decision; human in the loop.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions