Skip to content

consult: pr-type review cannot resolve MERGED PRs by any route — SPIR review phase structurally blocked post-merge #1531

Open

Description

@waleedkadous

Found by the spir-1470 builder during its post-merge review phase (Spec 1470). (Body rewritten after the builder retracted one claim — see the correction comment below for the history.)

The defect

Merged PRs are invisible to the pr-type consult, on every resolution route. Porch's review phase emits a 'pr' consultation; consult's PR lookup appears to be open-PR-only:

  • --type pr (by branch) → No PR found for branch: builder/spir-1470, exit 1, no file
  • --type pr --issue 1528 → No PR found for issue #1528, exit 1, no file

…while gh pr list --state all finds #1528 instantly. Verified across four runs (codex and claude, both routes). The failure itself is loud and correct (exit 1, no verdict file written) — an earlier claim here that consult exited 0 writing empty files was a builder display-pipe misdiagnosis, retracted; do not go hunting that bug.

Structural consequence: SPIR's review phase wants a pr-type review at a moment when the PR may already be merged and thus unfindable. Any project that merges before its review phase completes hits this. Not a 1470 quirk.

Fix direction

Belt and braces: teach consult's PR resolution --state all (a merged PR is still perfectly reviewable as a diff), AND have porch pass the recorded pr_history number to the review-phase consultation rather than making consult re-derive it from a branch. Whether SPIR's review phase should run pre-merge is a bigger protocol question — out of scope here.

Field resolution for Spec 1470

Architect ruling: the review-phase consultation was treated as satisfied by the project's 24 completed review rounds, recorded in the review artifact (not falsified in status.yaml); the phase was closed through porch's honest mechanics rather than by hand-writing verdict files.

Activity

  1. added
    area/consult
    on Aug 19, 2026
  2. changed the title [-]consult: pr-type review cannot find merged PRs (branch lookup misses --state all) and exits 0 writing EMPTY verdict files[/-] [+]consult: pr-type review cannot resolve MERGED PRs by any route — SPIR review phase structurally blocked post-merge[/+] on Aug 19, 2026
  3. waleedkadous commented on Aug 19, 2026

    @waleedkadous
    ContributorAuthor

    Two corrections from the builder's follow-up verification (misdiagnosis was its own display piping, honestly self-reported):

    1. The empty-verdict-file half of this issue is WRONG — strike it. consult exits 1 and writes no file at all. The failure is loud and correct; there is no silent false-success and nothing for porch's scoring to mis-read.
    2. The --issue workaround also fails: --type pr --issue 1528 → 'No PR found for issue [Spec 1470] Automatic builder context refresh at porch phase boundaries #1528', exit 1. The lookup appears to be open-PR-only on every route, so there is currently no workaround short of running the review consult pre-merge.

    Sharpened statement of the real defect: SPIR's review phase emits a pr-type consultation, but a project that merges before its review phase completes has no findable PR — a protocol-level chicken-and-egg, not a 1470 quirk.

    Fix direction (architect): both halves, belt and braces — teach consult's PR resolution --state all (a merged PR is still perfectly reviewable as a diff), AND have porch pass the recorded pr_history number to the review-phase consultation instead of making consult re-derive it from a branch. Whether SPIR's review phase should run pre-merge is a bigger protocol question; keep it out of this fix.

    Field resolution for Spec 1470: review-phase consultation ruled satisfied by the project's 24 completed review rounds (architect ruling, recorded in the review artifact); phase advanced rather than blocked.

  4. waleedkadous commented on Aug 19, 2026

    @waleedkadous
    ContributorAuthor

    Second half of the gap, verified by the spir-1470 builder: porch has no way to record an unrunnable consultation. porch verify --skip is explicitly scoped to the verify phase (index.ts:1250-1252) and refuses in review; force-advance triggers on iteration ceilings, but iterations only increment when a verdict round completes — with no verdict files, porch next re-emits the same consultation task forever and nothing ever reaches a ceiling. That is what turns a consult lookup bug into a permanently parked project. The fix for this issue should therefore cover both: (1) consult resolving merged PRs, and (2) porch offering an honest 'consultation unrunnable — record and advance' path (architect-authorized, recorded in status.yaml as skipped-with-reason, never as completed). Spec 1470 itself is left PARKED at review/iteration-1 by architect ruling — deliberately, as a true record: the feature is merged and verified, the review artifact carries the ruling, and this issue explains the machinery stop.

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

    area/consult

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions