Skip to content

style: make rust-ci green on main (fmt, needless lifetime, dead fn) - #116

Merged
hyperpolymath merged 1 commit into
mainfrom
style/fmt-squabble-fight
Sep 30, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
style/fmt-squabble-fight

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Why

rust-ci / Cargo check + clippy + fmt is red on main (b12657f, #113). The fmt step fails first, so clippy never runs, and Cargo test, llvm-cov line coverage and Cargo audit are all skipped on every PR, #114 included. Nothing in CI has been testing this workspace.

What

  • cargo fmt --all (squabble-fight lib.rs + workflows.rs, squabble-cli fetch.rs, squabble-core moves.rs). Formatting only.
  • clippy::needless_lifetimes: workflows.rs uses_target now elides its lifetimes.
  • Removed fetch::run_with_greens. It has no caller: run_bundle already returns .greens, and that is what fight consumes.

Evidence (local, same commands as the workflow)

step rc
cargo check --locked --all-targets 0
cargo fmt --all -- --check 0
cargo clippy --locked --all-targets -- -D warnings 0
cargo test --workspace green (41 + 82 + 64 + 12)

Found by squabble verify-satisfied (stacked on #114), which initially reported #114 as done while this check was red. That was a gap in the evaluator, and it is fixed in that PR.

Merge before #114, so #114's CI is the first to actually run tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_0136eszqrQ53Kj7aBH1D4rXK

`rust-ci / Cargo check + clippy + fmt` is red on main (b12657f, #113):
- cargo fmt diffs in squabble-fight (lib.rs, workflows.rs), plus
  squabble-cli/fetch.rs and squabble-core/moves.rs;
- clippy::needless_lifetimes on workflows.rs `uses_target`;
- `fetch::run_with_greens` is never called: `run_bundle` already
  returns `.greens`, which is what `fight` consumes.

Because the fmt step fails, clippy, test, coverage and audit are all
skipped on every PR, so this also restores the rest of the pipeline.
Locally: check --locked, fmt --check and clippy -D warnings all rc=0;
workspace tests green.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136eszqrQ53Kj7aBH1D4rXK
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1acdcca1-9da8-4460-a541-846a99bd7c2b

📥 Commits

Reviewing files that changed from the base of the PR and between b12657f and 48c093e.

📒 Files selected for processing (4)
  • crates/squabble-cli/src/fetch.rs
  • crates/squabble-core/src/moves.rs
  • crates/squabble-fight/src/lib.rs
  • crates/squabble-fight/src/workflows.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath merged commit 8a6fdb8 into main Sep 30, 2026
51 checks passed
@hyperpolymath
hyperpolymath deleted the style/fmt-squabble-fight branch September 30, 2026 15:54
hyperpolymath added a commit that referenced this pull request Oct 1, 2026
…it 5 if not) (#119)

Adds `squabble verify-satisfied <owner>/<repo> <pr>`, one implementation
of "is this PR actually done?" for the D2 Stop hook and for humans. JSON
goes to stdout and a readable list to stderr. **Exit 5** means agent
work remains; 0/2/3/4 keep their existing meanings.

> ⚠ **Stacked on #114** (base `fix/rollup-neutral-skipped-pass`). When
#114 merges, retarget this PR to `main` before merging. Otherwise GitHub
closes it when the base branch is deleted.

## What counts as done

| # | Condition | Agent item when unmet |
|---|---|---|
| 1 | Not `CONFLICTING`; mergeability computed; not draft; not `BEHIND`
| resolve in-file / re-run / mark ready / update |
| 2 | No required context `Failed` or `Missing`. `Pending` is fine;
skipped/neutral satisfy but are listed as **evidence-free** | fix the
check or the ruleset |
| 2b | No **red non-required** check, unless a PR-body line names it
**with an issue link** (the 2026-09-15 ruling: a finding becomes an
issue, not a blocker, but someone must have looked). An acknowledged red
moves to notes and is still shown | fix it, or file an issue and name it
in the body |
| 3 | Zero unresolved review threads (outdated ones count); no
review-bot `CHANGES_REQUESTED`; no review bot still pending | act on or
resolve; wait for the bot |
| 4 | Code-scanning alerts the PR introduces | **not evaluated yet** and
said so in `notes` → #117 |
| 5+6 | Automerge armed with SQUASH wherever GitHub allows arming | arm
/ re-arm with squash |
| 7 | Every `[.rules[].type]` on the base, not just required checks.
`merge_queue` refuses rather than passing vacuously; unknown types go to
notes | — |

**Held by a human** (listed, not agent work): human approval, a required
deployment, and a CLEAN PR, which GitHub refuses to arm automerge on, so
it waits for a human merge. Change requests made only by review bots are
agent work, not human-held.

## Shared rules, so `fetch` and `verify-satisfied` can't disagree
- `CheckRun::from_github` maps rollup vocabulary. An unknown completed
conclusion is `Failed`.
- `CheckRun::for_context` decides a required context from **all**
same-named runs, and the worst run wins. Both readers used first-match
before, so a passing twin could mask a failing one depending on rollup
order.

## Evidence
- Tests: core 103, cli 44, forge 16, plus the rest, all green. Mutants
killed: first-match ordering (2 red), the non-required loop disabled
(1), the link requirement dropped (1), the context match dropped (1),
digit-after-`#` dropped (1), `ctx_done = true` in pagination (2).
- **Live control 1, both arms** (#114): with no acknowledgement it exits
**5** naming `rust-ci / Cargo check + clippy + fmt`. After a body line
citing #116 it exits **0**, and the acknowledged red is still shown in
notes.
- **Live control 3** (standards#1076): exit 5, correctly (Debt ratchet
red on main; `SonarCloud Code Analysis` required but never emitted →
standards#1081).
- **Live control 4** (hypatia#883, another session's PR, read only):
exit 5 with the same 5 unresolved threads an independent GraphQL count
finds.
- The "armed + required pending ⇒ exit 0" arm is **unit-tested only**; I
found no live PR in that state to exercise it.

## Not in this PR
- No SPARK mirror for D1. `done.rs` is a policy table over forge facts
with no state machine or invariant; the proof obligations live in
`gate_machine`, which #114 mirrors. (#115 tracks getting gnatprove into
CI at all.)
- Check 4 and inherited-vs-new red checks → #117. The positive control
is launch-scaffolder#46's `hardcoded_tmp` alert.
- `~/.claude/hooks/apps-ack-gate.sh` is a second implementation of this
question → #118.

## Inherited red
- `rust-ci / Cargo check + clippy + fmt` is red on `main` (b12657f):
unformatted `squabble-fight`, a `needless_lifetimes` in
`workflows.rs:628`, and a dead `run_with_greens`. Cured by #116; merge
order **#116 → #114 → this**. Checked locally with #116's fix applied
temporarily: this branch's own code passes `clippy -D warnings` and
`rustfmt --check`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0136eszqrQ53Kj7aBH1D4rXK

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
hyperpolymath added a commit that referenced this pull request Oct 1, 2026
## What

`parse_rollup` mapped `SKIPPED` and `NEUTRAL` check conclusions to
`CheckRun::Failed`. GitHub's ruleset treats both as a **met**
requirement, so squabbler reported a failing gate on PRs GitHub would
merge. This is a prerequisite for `verify-satisfied` (D1), which must
agree with GitHub on what "satisfied" means.

**Owner ruling (2026-09-30):** add a new variant, `CheckRun::Skipped`,
rather than folding these into `Passed`. It satisfies the ruleset but
carries no evidence.

## Changes

- `squabble-core/src/gate.rs`
  - new `Skipped` variant;
  - `is_satisfied` = `Passed | Skipped`;
- new `Gate::evidence_free()` lists checks that were satisfied without
evidence, so consumers can report them separately;
- also moves a pre-existing misplaced doc comment and `#[inline]`, which
had been attached to `with_cause`.
- `squabble-cli/src/fetch.rs`: `SKIPPED | NEUTRAL => Skipped`, plus a
test.
- `spark/src/gate_machine.{ads,adb}`: the mirror, via `Satisfies()`. The
`Evaluate` postcondition and loop invariant are restated over it.

## Evidence

- **SPARK:** `gnatprove -P squabble_gate.gpr -j0 --level=2` proves
**10/10** checks.
- Mutant (body reverted to `/= Passed`): the loop invariant fails, so
the mutant is killed.
- **Rust:** `cargo test --workspace`, all green.
- Mutant (`is_satisfied` = `Passed` only):
`a_skipped_check_satisfies_but_is_listed_as_evidence_free` fails, so the
mutant is killed.
- **JSON output:** serde emits `"skipped"`. The CLI has no
human-readable gate table, so there is no render site to change.

## Known gap

No CI workflow runs `gnatprove`, so the SPARK proof is local evidence
only. I'll file a follow-up issue for it.

## Inherited red

- `rust-ci / Cargo check + clippy + fmt` is red on `main` itself
(b12657f): unformatted `squabble-fight` + a clippy `needless_lifetimes`
+ a dead `run_with_greens`, none introduced here. Cured by #116, which
should merge before this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0136eszqrQ53Kj7aBH1D4rXK

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
hyperpolymath added a commit that referenced this pull request Oct 31, 2026
…145)

## What this is

`fight` learns one bit about a red check: that it *is* red. It then
attributes the red from the **shape of the workflow** — a `CodeBuild`
workflow becomes `EscalateToExpert{DispatchFix}`, a `Security` workflow
becomes a scan, a reusable becomes an upstream owner. That attribution
is only sound when the policy actually ran.

A job that died in runner setup, provisioning or lock resolution is not
a finding about the code, and handing it to a fixer invents work nobody
can do. This PR makes that class nameable, and adds the harness needed
to prove it builds.

## 1. `squabble-core::execution` — where a run stopped

Five outcomes an estate report must keep distinct, plus a fail-closed
non-answer:

| class | meaning |
|---|---|
| `NotStarted` | no job exists (zero-job `startup_failure`) —
attribution stays with `startup`/`zero-job`, not re-derived here |
| `PreflightFailed{step}` | a declared setup/provisioning step (or
GitHub's implicit `Set up job`) concluded failure: **provisioning, not a
finding** |
| `PrerequisiteMissing{step}` | a declared tool/credential/config step
failed, so the policy step could not run |
| `PolicyStepFailed{step}` | a policy step ran and failed — tells you
*where*, never *why* |
| `Verified{step}` | the job passed **and** a policy step recorded
success |
| `Unclassified{reason}` | one of five reasons; never a guess |

- **Step vocabulary is host-supplied** (`execution_taxonomy.a2ml`),
never compiled in; matching is **exact** after trimming, because this
repository already paid once for abbreviation drift.
- **Ordering**: preflight before prerequisite before policy, so nothing
later can mask an earlier stop.
- **No path to green**: constructs no `CheckRun`, proposes no `Move`,
calls no `evaluate()`, drops no required context.

`tests/aspect_tests.sh` gained **Aspect 5**, asserting those structural
properties on the module's non-test, non-comment source — no toolchain
needed.

## 2. `squabble phase <job.json>` — offline entry point

Exit `0` (a classification was produced) or `2` (tool failure). There is
deliberately **no exit code that means green**. Outside
`squabble-contract/1.0.0`; the pinned surface is untouched.

## 3. `scripts/local-verify.sh` + planted controls

Runs every gate CI runs into one `$TMPDIR` bundle, writes nothing into
the repo. `tests/local_verify_test.sh` proves the harness's own
vocabulary with planted failures in both directions (31 checks, no Rust,
no network, no token).

## Evidence, as measured — updated after CI ran

| claim | status |
|---|---|
| `Cargo check --workspace --all-targets --locked` | **PASSES on CI**
(latest: `43af3b5`) — the new modules *and their test code* type-check |
| `scripts/local-verify.sh`, `tests/local_verify_test.sh`, Aspect 5,
contract conformance | **executed here**, 31/31 controls pass |
| the 31 new unit tests | **type-checked, never executed** — `Cargo fmt`
fails before the `Cargo test` job starts |
| `cargo fmt --all -- --check` | **FAILS, inherited from `main`** — 0
files of this PR deviate; see below |
| `clippy -D warnings` | never reached (downstream of fmt) |
| anything about live GitHub | read through the API for the report;
**not** exercised by this PR |

### The fmt failure is inherited, not introduced here — measured

`cargo fmt` is red on this PR, but not because of this PR. `main` is not
fmt-clean, and every branch cut from it inherits the failure — #116
fixed the same thing on 2026-09-30 and it came back within a month.

Measured with rustfmt output reconstructed from #144 (which real `rustup
run stable cargo fmt` produced; the reconstruction reproduces all eight
of #144's files byte-for-byte except one hunk that is not a formatting
change):

| count | files |
|---|---|
| **0** | files added or modified **by this PR** that deviate from
rustfmt output |
| **7** | workspace members inherited unformatted from `main` — repaired
by #144 (and identically by #143) |
| **3** | further unformatted files outside the workspace that `cargo
fmt --all` cannot see (two `contracts/proven-tests` fixtures, and
`verification/squabble-creusot/src/model.rs`, which root `Cargo.toml`
`exclude`s) |

So the sequence is: **#144 or #143 merges first → this branch rebases →
`fmt` passes here with no further edits → `clippy` and the 31 unit tests
execute for the first time.** Tracked as #147 (which also records that
#143 and #144 duplicate each other's reformatting and only one should
land).

An earlier version of this section claimed the formatter available here
disagreed with the repository's, and left the residue for the owner to
finish with one command. That reasoning was wrong: it calibrated against
`main`, which is itself unformatted, so it read pre-existing violations
as intent. Corrected in `43af3b5`, and the three layouts it had wrongly
"adjudicated" are reverted.

## What this does not do

No required context dropped, renamed or reconciled. No policy,
allow-list, ruleset or pin touched. No issue or PR closed. No test
weakened.

## Where it goes next

`docs/reports/estate-integration/2026-10-31-ci-diagnosis-coverage.adoc`
carries the role/ownership map, eight gaps (G-1…G-8), the owner-handoff
table for inaccessible settings, and six proposals kept separate from
what is implemented. Two matter for this class and are **labelled, not
claimed**: **P-1** (route `PreflightFailed`/`PrerequisiteMissing` away
from `EscalateToExpert{DispatchFix}`) and **P-2** (fetch step evidence
for *red* checks). Both wait on a green compile-plus-test run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
hyperpolymath pushed a commit that referenced this pull request Nov 14, 2026
Suite proven-cicd-and-workflows#116 moved the stamp under the SPDX line, so the
workflow linter's line-1 SPDX check passes. PROVEN_SHA now pins the #116 merge
commit 4d033a09d5a3934a9210e1c03f9f31641ebc763c. The body is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7ZmtZ4ckfkqVkmVcrgH
hyperpolymath added a commit that referenced this pull request Nov 14, 2026
## Summary

Pilot install of the stamped `[email protected]` workflow
from proven-cicd-and-workflows. The suite is pinned at
`4d033a09d5a3934a9210e1c03f9f31641ebc763c` (the merge of #116). **Shadow
only**: the workflow collects raw and proven coverage and uploads one
`proven-coverage` artifact. It judges nothing, gates nothing and changes
no rulesets. The owner chose cicd-squabbler as the pilot repo.

**Expected to fail CI until the lock entries below land.**

## Changes

- `.github/workflows/proven-coverage-collect.yml`: stamped copy,
byte-exact apart from the `PROVEN_SHA` local-next line.
- `.gitignore`: adds `.proven-coverage/` (the collector's local output).

## Evidence

- `scripts/proven-stamp.sh check` (suite) → `ok: ... matches its stamp`.
- Local collector run on this checkout, Rust only:
  - raw: 14518 / 16464 lines, 88.18%
  - proven: 0 / 16464 lines
  - both report-meta sidecars written
- The proven run is empty because the repo has no `prop_*` tests and no
proptest/quickcheck dependency. That is an honest shadow result: nothing
here counts as proven evidence yet.

## Blockers, not fixed here

1. **Lock Sync Gate goes red.** `scripts/check-lock-sync.sh` reports
`UNLISTED WORKFLOWS`. Unlisting a workflow means GitHub refuses the run
at startup.
- Under `workflows:`, add
`.github/workflows/proven-coverage-collect.yml` with:
     - `actions/checkout@3d3c42e5…`
     - `dtolnay/rust-toolchain@683b588c…`
     - `taiki-e/install-action@cfdb7ed4…`
     - `erlef/setup-beam@54075bcc…`
     - `actions/setup-node@949feb24…`
     - `actions/upload-artifact@cf430e03…`
- Under `dependencies:`, add new records for
`taiki-e/install-action@cfdb7ed4…` and `actions/setup-node@949feb24…`.
Each needs `owner_id` / `repo_id` from the API.
- Lock repins belong to the **Tsunami-breaker**, so `actions.lock` is
deliberately not edited in this PR.
2. ~~`workflow-linter.yml` SPDX check~~ **Resolved.**
proven-cicd-and-workflows#116 moved the stamp to line 2 under the SPDX
line, and this PR is repinned to 0.1.1 at `4d033a0`.

## RSR Quality Checklist

- [x] No banned language patterns
- [x] SPDX header present on line 1
- [x] No secrets, credentials, or `.env` files
- [ ] Tests pass: not run; the change adds a workflow only
- [x] SPDX line check: line 1 matches

Commit is unsigned: this cloud session has no signing key.

https://claude.ai/code/session_0136P7ZmtZ4ckfkqVkmVcrgH

---
_Generated by [Claude Code](https://claude.ai/code)_
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