Skip to content

Extend fetch_pr_review_context with PR-repair fields and an intent-level PR-state/checks/log path #861

Closed

Description

@jflowers

Context

/uf.fix-ci (#858, openspec/changes/uf-fix-ci/) pins its Phase 1
mechanical fetches as raw gh command prose — a documented
deviation
from constitution VI (Deterministic Execution),
recorded in that change's design D1 and proposal Principle VI
assessment — because no existing plugin tool covers them:

  • fetch_pr_review_context (from the
    fetch-pr-review-context change) returns review-dispatch
    fields only. It lacks state, mergeable, mergeStateStatus,
    headRepository, and baseRepository, so it cannot drive
    PR-repair eligibility (open vs CLOSED/MERGED, conflicted/behind
    detection, fork-aware remote resolution).
  • No tool wraps gh pr checks <N> --json name,state,link or
    gh run view <run-id> --log-failed.

The uf-fix-ci change deliberately does not extend the plugin
layer in scope (one command + scaffold mirror + docs); this
issue is the named extraction follow-up bound by reference in
its proposal's Dependencies section.

Ask

  1. Add the PR-repair fields to the fetch_pr_review_context
    payload: state, mergeable, mergeStateStatus,
    headRepository, baseRepository (derive baseRepository
    from the PR url — gh pr view --json rejects
    baseRepository as an unknown field; verified 2026-10-28).
  2. Expose the check-suite fetch (gh pr checks <N> --json name,state,link) and the failed-run log fetch (gh run view <run-id> --log-failed) through the same intent-level path.
  3. Once available, re-route /uf.fix-ci Phase 1 (canonical
    command + scaffold mirror) through the tool and retire the
    raw-gh deviation note in design D1.

Motivation

Constitution VI: mechanical fetch steps (PR state, checks,
failure logs) should execute through tested tools, not
re-reasoned bash prose. Field validity verified against gh
CLI: gh pr view --json rejects baseRepository;
gh pr checks <N> --json name,state,link returns
name/state/link with states such as SUCCESS, SKIPPED, NEUTRAL.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions