Skip to content

fix(pr-management-code-review): guard against a bot-only green rollup - #1299

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-code-review-real-ci-guard
Sep 20, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-code-review-real-ci-guard

Conversation

@potiuk

@potiuk potiuk commented Sep 20, 2026

Copy link
Copy Markdown
Member

Summary

  • pr-management-code-review's CI precheck treats statusCheckRollup.state == SUCCESS as green and puts APPROVE on the table. That state is not evidence CI ran: the rollup aggregates only completed check-runs, and fast bot checks (Mergeable, WIP, DCO, boring-cyborg) succeed unconditionally — so a PR whose real workflows are held in action_required awaiting first-time-contributor approval reports SUCCESS while nothing has been built, linted or tested.
  • The precheck's EXPECTED branch exists for exactly this case but never fires, because the state is not EXPECTED.
  • pr-management-triage already knows this. Its Real-CI guard is mandatory before any row classifies a PR as passing, and documents the same rollup behaviour. code-review had no equivalent.

Found by running a review pass over ~30 provider PRs in a large adopting project. Four PRs presented as green with no real CI run, and because each had a small diff they ranked high in the queue — the worst possible ordering, since a change nothing has verified is not a cheap review.

Type of change

  • Skill change (plugins/magpie-pr-management/skills/code-review/) — eval fixture added below

Test plan

  • prek run --files <changed> passes, including skill-and-tool-validate and the token-count check (docs/mode-economics.md regenerated via uv run --project tools/skill-token-count skill-token-count --write)
  • New eval case review-disposition/case-6-bot-only-rollup: a PR with rollup == SUCCESS whose only contexts are Mergeable and WIP, and whose diff reads as correct, must come out COMMENT rather than APPROVE. The suite's system-prompt.md is updated to carry the guard, so the case fails without this change.
  • review-disposition case count 5 → 6 and suite total 117 → 118 updated in the eval README

RFC-AI-0004 compliance

Prose and eval fixture authored with AI assistance; Generated-by: trailer on the commit, no Co-Authored-By:.

@potiuk potiuk added family:pr-management pr-management-* skills capability:fix Implement code change to resolve an issue labels Sep 20, 2026
The CI precheck in prerequisites.md treats `statusCheckRollup.state ==
SUCCESS` as green and puts APPROVE on the table. That state is not
evidence CI ran. The rollup aggregates only completed check-runs, and
fast bot checks (Mergeable, WIP, DCO, boring-cyborg) succeed
unconditionally, so a PR whose real workflows are held in
`action_required` awaiting first-time-contributor approval reports
SUCCESS while nothing has been built, linted or tested. The precheck's
`EXPECTED` branch, which exists for exactly this case, never fires,
because the state is not EXPECTED.

pr-management-triage already knows this: its Real-CI guard is mandatory
before any row classifies a PR as `passing`, and states the same rollup
behaviour. code-review had no equivalent.

Observed on four PRs in one review pass against a large adopting
project; each presented as green with no real CI run, and a small diff
ranked them high in the queue.

Adds a Real-CI guard to the precheck, cross-referencing triage's, and
extends Golden rule 8 so a PR whose real CI never ran is as ineligible
for APPROVE as one that fails. Also records that such a PR belongs
below every PR with a real run when ordering a queue, and that the
reviewer should say CI is unverified rather than predict its outcome.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the fix-code-review-real-ci-guard branch from 15aa634 to 3a890eb Compare September 20, 2026 22:58
@potiuk
potiuk merged commit ea264ed into apache:main Sep 20, 2026
10 checks passed
potiuk added a commit that referenced this pull request Sep 20, 2026
…1302)

check-doc-sync validates, among other things, each eval family's case and
suite counts in tools/skill-evals/evals/<family>/README.md and the family
line in tools/skill-evals/README.md. Its files: gate did not include that
tree, so adding or removing an eval case could not fire the check that
guards its count.

The gate covered the SKILL.md files but not the eval READMEs, which is why
this survives a normal dev loop: editing a skill and its evals in one
change runs the hook while the counts are still consistent, and the
follow-up run that touches only eval files skips it. CI runs --all-files
and fails instead.

Observed on #1299: a run scoped to the newly added eval fixture skipped
the hook locally, and CI reported "family 'pr-management-code-review' says
117 cases across 27 suites, disk has 118 across 27".

Adds tools/skill-evals/.* to the gate. Verified by introducing a count
mismatch and running prek against only tools/skill-evals/README.md: the
hook now fires and reports the drift, where before it was not selected.

Preferred over always_run: true, which would fix it as well but adds ~6s
to every prek invocation, and no hook in this config currently uses it.

Generated-by: Claude Opus 5
potiuk added a commit that referenced this pull request Sep 21, 2026
Three defects, found while doctoring a sandbox where `podman` worked by
hand but not through the gateway.

Backend discovery trusted `podman machine inspect` for the socket path.
That command renders the path from the *caller's* TMPDIR, not the
machine's, so a hook, agent, or launchd service whose TMPDIR differs is
told a path that does not exist and discovery reports no backend at all.
Only the basename is stable, so the finders now return candidate lists
and `discover` takes the first that exists, with the per-user temp
directory from `getconf DARWIN_USER_TEMP_DIR` as the second podman
candidate. `_docker_socket` gets the same shape: the context result and
the `~/.docker` fallback are now both candidates rather than either/or.

`CONTAINER_HOST` / `DOCKER_HOST` were committed in the baseline with a
project-relative `unix://./…` value. That can never have worked: a
`unix://` URL's authority is parsed as a host component, so `unix://./x`
dials `/.//x`, `unix://x` dials `/x/`, and `unix:x` dials `//`. Only
`unix:///abs/path` connects, and an absolute path is per-machine, so
both variables move out of the committed baseline and join the
`allowUnixSockets` pair in the gitignored `.claude/settings.local.json`.
The spec had recorded this as a resolved open question in favour of the
relative form, concluded from URL parsing rather than a connection; it
now records what actually happens.

The TMPDIR troubleshooting entry prescribed `env.TMPDIR` in project
settings to get a per-project scratch directory. Claude Code sets TMPDIR
itself when it builds the sandbox and that assignment wins, so the
setting is accepted and silently does nothing. The entry now says so,
and the doctor's probe 4 reports a shared session root as a pass instead
of sending the operator after a fix that cannot work. Probe 3 gains an
explicit check for a non-absolute value, because stripping `unix://`
leaves a relative path that stats fine and hides the real cause.

Also fixes an unrelated blocker found on the way: the touch overlay
polled `lsof -U -n` before the O(1) `signing_in_flight` check, and on a
loaded host that enumeration outlasts the signature it is meant to
observe, so the overlay never appeared and its test failed one run in
three. Asking the cheap question first keeps `lsof` out of the hot loop
on the wrapped path entirely.

Specs are synced to main: the two pr-management-code-review fixes
(#1299, #1300) are recorded in the family contract, the GitHub Copilot
harness from #1287 gets copilot-runtime.md, and .last-sync moves to the
current tip.

Generated-by: Claude Opus 5
@potiuk potiuk added the substrate:framework-dev Tool substrate: build / validate / eval the framework itself label Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue family:pr-management pr-management-* skills substrate:framework-dev Tool substrate: build / validate / eval the framework itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant