Skip to content

shepherd check: carry acceptance ignores .state and .head.sha in the payload it already fetched #419

Description

@evanharmon1

Invariant

Whenever check accepts a carried verdict, every fact it relies on is proved
against the same PR payload it just fetched — the PR is open, its head is the
state head, and its base still matches what the carry recorded.

Current violation (observed 2026-08-11)

The carry-acceptance path in check re-fetches the pull request to revalidate
the base after a retarget (PR #410 shepherd round 4), but reads only
.base.ref and .base.sha from that response. The same payload already
carries .state and .head.sha. So if the PR closed, or another push landed,
after the earlier provider_head check but before this fetch, check accepts
and emits a clean result for a head the PR has left — or for a PR that is no
longer open — despite holding the evidence that says otherwise.

Narrow window and fail-open, which is why it was P2 rather than blocking:
the payload proving the problem is already in hand, so the fix is reading two
more fields, not another request.

Verify

rg -n -A12 'carry_pr_payload=' \
  ai/skills/universal/shepherd/assets/check-codex-cloud-review.sh

If that block reads only .base.ref / .base.sha and never .state or
.head.sha, this is still open.

Found by the current-head Codex review of #410 (comment 3759562087), settled
by filing because that PR had reached its shepherd round cap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions