Skip to content

fix(gate): an ignored check must not hold the PR via mergeable_state either - #9820

Merged
JSONbored merged 4 commits into
mainfrom
fix/ignored-checks-unstable-hold
Jul 29, 2026
Merged

fix(gate): an ignored check must not hold the PR via mergeable_state either#9820
JSONbored merged 4 commits into
mainfrom
fix/ignored-checks-unstable-hold

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

The gap #9813 left open

gate.ignoredCheckRuns excluded the check from LoopOver's own CI aggregate — but mergeable_state is GitHub's computation, not ours, and it stays unstable while the check exists at all. derivePrDisposition holds unconditionally on unstable. So the ignore was only half-effective: the check no longer failed the gate, and the PR was held anyway.

Caught live within minutes of flipping the config on the ORB. JSONbored/loopover#9816, a shin-core PR — the exact contributor this was meant to unblock:

agent.action.label | verdict=success; mergeable_state is unstable —
                     non-required check(s) not passing: "Contributor trust"

Gate green, review good, held anyway.

The fix

Dismiss an unstable state only when the ignore list fully explains it — all three must hold:

  1. at least one ignored run concluded non-passing,
  2. our aggregate found no non-required failure, and
  3. ciState !== "failed".

Any other unstable cause still holds, and the flag never rescues a PR held for a different reason (guardrail hit, migration collision, advisory hold) — both pinned by invariant tests. An ignore must never mask a real failure, so if some other check is also red the hold stands.

Also: the un-itemized unstable message was useless

Second point raised while reviewing this. When the aggregate can't itemize the culprit, the reason read:

mergeable_state is unstable — a non-required check or status is not passing

No check name, no next step — it just restates the state. GitHub never says why a PR is unstable, and our aggregate can legitimately fail to itemize it: a commit status rather than a check-run, a check from an app whose page we couldn't read, or a run that appeared after CI was sampled. The message now names that ambiguity and points at the one place the answer always exists (the PR's Checks tab), in both the audit reason and the public comment.

Tests

5 new disposition cases: the live regression, "any other unstable cause still holds", "absent flag is byte-identical", "never rescues a differently-held PR", and the positive case (the PR becomes approvable again). 494 pass across the touched files; tsc, docs-drift, dead-source-files, engine-parity green.

…either

gate.ignoredCheckRuns (#9813) excluded the check from LoopOver's own CI
aggregate, but mergeable_state is GITHUB's computation and stays "unstable"
while the check exists at all -- and derivePrDisposition holds unconditionally
on unstable. So the ignore was half-effective: the check no longer failed the
gate, and the PR was held anyway. Observed live on #9816
immediately after the config flip, reason "mergeable_state is unstable --
non-required check(s) not passing: Contributor trust".

Dismiss an unstable state ONLY when the ignore list fully explains it: at least
one ignored run concluded non-passing, our aggregate found no non-required
failure, and ciState is not failed. Any other unstable cause still holds, and
the flag never rescues a PR held for a different reason.

Also make the un-itemized unstable message actionable. It used to say only "a
non-required check or status is not passing" -- no check name, no next step.
GitHub never says why, and the aggregate can legitimately fail to itemize it (a
commit status rather than a check-run, an unreadable app page, a run that
appeared after CI was read). Name that ambiguity and point at the Checks tab.
@loopover-orb

loopover-orb Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-29 12:49:17 UTC

5 files · 1 AI reviewer · 2 blockers · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This PR closes the gap left by #9813: an ignored check no longer fails the CI aggregate, but GitHub's own `mergeable_state` stays `unstable` while the check exists at all, so `derivePrDisposition` held unconditionally. The fix threads a new `unstableExplainedByIgnoredChecks` flag through `agent-actions.ts` → `pr-disposition.ts`, computed as a three-part conjunction (an ignored run is non-passing, no other non-required failure exists, and `ciState !== "failed"`), which correctly narrows dismissal to only the case the ignore list fully explains. The logic is traced end-to-end correctly: `unstableHolds` replaces all three prior `mergeable === "unstable"` checks (heldForManualReview, heldForUnstableMergeState, commentMergeStateHeld) consistently, and the invariant tests verify the flag doesn't rescue a PR held for a different reason (guardrailHit). The secondary change improving the un-itemized unstable message is a reasonable, low-risk UX improvement.

Nits — 5 non-blocking
  • src/settings/agent-actions.ts:1120-1121 — the ternary is a dense single line combining four conditions; consider extracting to a small named helper for readability given how load-bearing this boolean is.
  • src/settings/pr-disposition.ts:68 (per external brief) — the `9816` PR-number reference is fine as a doc comment but has no behavioral role; just confirm it doesn't drift if the referenced PR context changes.
  • The two undetailed FAILED checks (validate-tests, validate) on a branch 6 commits behind default cannot be attributed to this diff from what's visible — worth a rebase to rule out drift as the cause before merging.
  • Consider a short named constant/type for the `{name, appSlug, conclusion}` triple shape reused across `advisoryCheckHold`, `ignoredCheckNonPassing`, and `nonRequiredCheckFailures` in agent-actions.ts to reduce duplication (nit-level, not required for this PR).
  • The CI_PASSING_CONCLUSIONS export in backfill.ts is a clean minimal change; no issue there.

Concerns raised — review before merging

  • No linked issue detected: No closing reference or linked issue number was found in the PR metadata/body. — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue: This repo's maintainer focus manifest requires every PR to reference a tracked issue. — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected: No closing reference or linked issue number was found in the PR metadata/body. — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue: This repo's maintainer focus manifest requires every PR to reference a tracked issue. — Link the relevant issue (for example `Closes #123`) before opening the PR.

Decision drivers

  • ❌ Code review — 2 blockers (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 14 registered-repo PR(s), 13 merged, 345 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 14 PR(s), 345 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is registered but has no active allocation in the current snapshot.
  • Public profile languages: not available
  • Official Gittensor activity: 14 PR(s), 345 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 3 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Decision record
  • action: hold · clause: missing_linked_issue
  • config: 8e2c0abbc5a0a614552b6ce182c730a948eed48c74286eb57dbf28eb931c5565 · pack: oss-anti-slop · ci: failed
  • record: 0d7e00c8afc7c3dec31a988b2f32f73febd211b33297e21307598b66851ced6e (schema v5, head 24e0005)

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.10%. Comparing base (9d7f567) to head (96e5d71).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/queue/processors.ts 0.00% 1 Missing ⚠️
src/settings/agent-actions.ts 66.66% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9820      +/-   ##
==========================================
+ Coverage   91.59%   94.10%   +2.50%     
==========================================
  Files         915      815     -100     
  Lines      112700    63095   -49605     
  Branches    27077    21968    -5109     
==========================================
- Hits       103229    59375   -43854     
+ Misses       8144     2645    -5499     
+ Partials     1327     1075     -252     
Flag Coverage Δ
backend 94.10% <75.00%> (-1.49%) ⬇️
control-plane ?
engine ?
rees ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/github/backfill.ts 96.00% <100.00%> (ø)
src/settings/pr-disposition.ts 100.00% <100.00%> (ø)
src/queue/processors.ts 94.72% <0.00%> (-0.03%) ⬇️
src/settings/agent-actions.ts 98.23% <66.66%> (-0.35%) ⬇️

... and 280 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 29, 2026
…either

gate.ignoredCheckRuns (#9813) excluded the check from LoopOver's own CI
aggregate, but mergeable_state is GITHUB's computation and stays "unstable"
while the check exists at all -- and derivePrDisposition holds unconditionally
on unstable. So the ignore was half-effective: the check no longer failed the
gate, and the PR was held anyway. Observed live on #9816
immediately after the config flip, reason "mergeable_state is unstable --
non-required check(s) not passing: Contributor trust".

Dismiss an unstable state ONLY when the ignore list fully explains it: at least
one ignored run concluded non-passing, our aggregate found no non-required
failure, and ciState is not failed. Any other unstable cause still holds, and
the flag never rescues a PR held for a different reason.

Also make the un-itemized unstable message actionable. It used to say only "a
non-required check or status is not passing" -- no check name, no next step.
GitHub never says why, and the aggregate can legitimately fail to itemize it (a
commit status rather than a check-run, an unreadable app page, a run that
appeared after CI was read). Name that ambiguity and point at the Checks tab.
@JSONbored
JSONbored force-pushed the fix/ignored-checks-unstable-hold branch from 24e0005 to 118588e Compare July 29, 2026 12:19
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 96e5d71 Commit Preview URL

Branch Preview URL
Jul 29 2026, 12:32 PM

@JSONbored
JSONbored merged commit f5320e1 into main Jul 29, 2026
10 checks passed
@JSONbored
JSONbored deleted the fix/ignored-checks-unstable-hold branch July 29, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant