Skip to content

feat(gate): diagnose WHY a required check is Missing - #34

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/missing-cause-diagnosis
Jul 29, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
feat/missing-cause-diagnosis

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

CheckRun::Missing is the gate's most common stuck state and its least actionable — "nothing reported" says nothing about what to change.

Adds MissingCause with the five causes measured across the estate on 2026-07-29, each with a different remedy:

Cause Measured
NoSuchJob hypatia-scan (invented); codeql vs the real CodeQL
DeadActionPin 69 repos pinned a2ml-/k9-validate-action, both 404. An unresolvable uses: yields no check run, so the board reads green while the job never ran
ActionsPolicyRefusal allowed_actions: selected + empty patterns_allowed → startup_failure, zero jobs. A settings fault — no workflow edit fixes it
EmptyJobsMap 20 repos' e2e.yml — jobs: present, every block commented out
NotTriggeredOnPullRequest Dependabot: required on 25 repos, 10 check-runs on main, 0 on any PR head. Sampling main scores it healthy while every PR is unmergeable

Non-breaking — optional field with #[serde(default)]; RequiredCheck::new unchanged.

The invariant is re-tested, not assumed: a test asserts that for every cause, a diagnosed-missing check still cannot reach Green. A diagnosis is not a bypass.

Verified: cargo check clean; 21 tests pass (18 existing + 3 new).

🤖 Generated with Claude Code

CheckRun::Missing is the gate's most common stuck state and its least actionable:
'nothing reported' says nothing about what to change. Adds MissingCause with the
five causes measured across this estate on 2026-07-29, each with a different remedy:

  NoSuchJob                 no job emits that exact name -- invented, or case
                            differs (hypatia-scan; codeql vs the real CodeQL)
  DeadActionPin             the producing action repo is DELETED. An unresolvable
                            uses: ref yields NO check run rather than a red one,
                            so the board reads green while the job never ran.
                            69 repos pinned a2ml-/k9-validate-action, both 404.
  ActionsPolicyRefusal      allowed_actions=selected + empty patterns_allowed
                            refuses every non-GitHub uses: at parse time ->
                            startup_failure, zero jobs. A SETTINGS fault: no
                            workflow edit can fix it.
  EmptyJobsMap              jobs: present but every block commented out -> invalid,
                            zero jobs. Measured in 20 repos' e2e.yml.
  NotTriggeredOnPullRequest the job runs, but never on pull_request. Dependabot was
                            required on 25 repos and emitted 10 check-runs on main
                            (GitHub's managed dependabot-updates runner) and 0 on
                            any PR head -- sampling main scores it HEALTHY while
                            every PR is unmergeable.

Non-breaking: RequiredCheck gains an optional missing_cause with #[serde(default)],
so previously-serialised gates still deserialise and RequiredCheck::new is unchanged.

The load-bearing invariant is explicitly re-tested: a diagnosis is not a bypass.
A test asserts that for EVERY cause, a diagnosed-missing check still cannot reach
Green, and that diagnosing a gate never changes its state.

Verified: cargo check clean; 21 tests pass (18 existing + 3 new).

Co-Authored-By: Claude Opus 5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

Comment thread crates/squabble-core/src/gate.rs Resolved
@gitar-bot

gitar-bot Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved 1 resolved / 1 findings

Adds diagnostic capabilities to identify why required checks are missing across five specific failure causes, but detached doc comments and inline attributes on is_satisfied need to be corrected.

✅ 1 resolved
✅ Quality: Doc comment and #[inline] detached from is_satisfied

📄 crates/squabble-core/src/gate.rs:119-133
The new with_cause/remedy methods were inserted between is_satisfied's doc comment (lines 119-120: "A requirement is satisfied only by a bound run that passed. This is the single predicate the whole engine trusts...") and the #[inline] attribute (line 121) and the is_satisfied fn body (line 136). As a result, that doc comment and #[inline] now apply to with_cause (which even gets a second, contradictory doc comment on line 122), while is_satisfied — described as the engine's load-bearing predicate — is left undocumented and no longer inlined. Move the doc comment and #[inline] back to directly precede pub fn is_satisfied.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@hyperpolymath
hyperpolymath merged commit b8d9f31 into main Jul 29, 2026
38 of 43 checks passed
@hyperpolymath
hyperpolymath deleted the feat/missing-cause-diagnosis branch July 29, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant