Skip to content

docs(charter): code_scanning ruleset-tool-mismatch = flagship v0.1 squabbler move - #10

Merged
hyperpolymath merged 1 commit into
mainfrom
docs/charter-code-scanning-deadlock-flagship
Jul 3, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
docs/charter-code-scanning-deadlock-flagship

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Adds the CodeQL-vs-Hypatia/Scorecard code_scanning ruleset deadlock to the v0.1 fight playbook as the flagship move.

Why

A branch ruleset's code_scanning rule lists a tool in code_scanning_tools that never uploads a per-PR SARIF analysis (Hypatia = gated via a status-check context, not a code-scanning upload; Scorecard = uploads 0 analyses estate-wide). The rule then waits forever, so every PR sticks on "Waiting for code scanning results from …". A permanent deadlock, not a transient failure.

Why it's the flagship

  • Confirmed + recurring in production the week of 2026-06-30 — deadlocked PRs on rsr-template-repo, standards, odds-and-sods-package-manager, and others.
  • Fully mechanical fix with a verifiable satisfaction condition: trim code_scanning_tools to only tools that upload SARIF per PR (CodeQL); gate the rest via required_status_checks contexts.
  • Already diagnosed/remediated on hypatia itself — see hypatia #470 and #473. Canonical provisioner git-scripts/scripts/branch-protection-apply.sh is now CodeQL-only, but stale live Base rulesets persist.

Docs-only change to docs/CHARTER.adoc. No code/scaffold changes.

🤖 Generated with Claude Code

…agship v0.1 move

The CodeQL-vs-Hypatia/Scorecard code_scanning ruleset deadlock is a
confirmed, recurring, production gate-deadlock class (rsr-template-repo,
standards, odds-and-sods-package-manager, week of 2026-06-30). It is fully
mechanical (trim code_scanning_tools to SARIF-uploading tools only), so it
is the ideal first squabbler fight move. Cross-refs hypatia #470/#473.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@hyperpolymath
hyperpolymath marked this pull request as ready for review July 3, 2026 22:15
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath enabled auto-merge (squash) July 3, 2026 22:15
@hyperpolymath
hyperpolymath merged commit f2f686f into main Jul 3, 2026
37 of 40 checks passed
@hyperpolymath
hyperpolymath deleted the docs/charter-code-scanning-deadlock-flagship branch July 3, 2026 22:16
hyperpolymath added a commit that referenced this pull request Jul 10, 2026
## Summary

#13 merged while its adversarial multi-angle review (8 independent
angles, each finding separately verified) was still running. This PR
applies **every confirmed finding** — three of them genuine fail-closed
violations — as the follow-up sweep.

## Changes

**Correctness / fail-closed integrity**

| Finding (angle) | Fix |
|---|---|
| A 200 whose body carries an estate error shape was recorded as an "ok"
verdict — the boj router unwraps cartridge failure envelopes into 200
bodies, so a hard miss (e.g. echidna without `ANTHROPIC_API_KEY`) looked
like success *(cross-file)* | `invoke()` now inspects 200 bodies for
`error` / `success:false` and returns them as failures |
| Absent `repo_root` defaulted to the daemon's CWD, silently grafting
whatever tree the server was launched from onto a fight for an unrelated
slug *(3 angles independently)* | New `plan_ungrounded()` — no
filesystem probed at all; every plan whose ground-truth is absent now
carries an explicit `ground-truth absent` blocker |
| A relative `repo_root` (CLI default `.`) was sent to experts that run
in their own working directories; panic-attack requires an absolute path
*(line-by-line)* | `summon()` canonicalizes first; on failure the call
is refused and recorded fail-closed |
| Routing let the obligation reroute away from the planner's chosen
specialist (HypatiaFleet+Scan → panic-attack) *(line-by-line)* | Routing
is now group-primary, with a test pinning it |
| `SQUABBLE_PORT` garbage silently fell back to 7741; `0` would bind an
ephemeral port the cartridge can't target *(line-by-line + altitude)* |
Malformed or zero port refuses to boot (exit 69); startup prints the
actually-bound address |
| The golden path (`just test`) never compiled the `boj` feature — a
break in `--summon` would ship silently *(cross-file)* | `just test` now
also runs the boj-feature tests |

**Evidence fidelity** *(altitude)*: `Report` gains typed
`expert_verdicts: Vec<ExpertVerdict>` (`#[serde(default)]`, back-compat)
— every expert call recorded verbatim (check, cartridge, tool, `ok` =
transport **and** body, honest meaning, full untruncated verdict).
Previously verdicts were spliced into evidence prose and cut at 400
chars — silent evidence loss.

**API robustness** *(altitude)*: `/api/v1/diagnose` accepts both the
bare `Gate` and a `{gate: …}` wrapper (no more opaque 422 for callers
generalising from `/api/v1/fight`).

**Docs / honesty (doctrine #10)** *(removed-behavior + cross-file +
reuse)*: fixed the stale "lives in squabble-cli" claim in `context.rs`;
the CLI doc now names `fight`/`--summon` and its network surface; the
App doc no longer claims a non-loopback "refusal" guard that never
existed; README no longer calls squabble-app a stub; `boj.rs` documents
the deliberate, feature-contained reversal of `fetch.rs`'s shell-out
stance.

**Simplifications**: `structural_scan` is a pure producer (clippy allow
dropped); the summon cfg-pair collapsed to inline cfg; fight's `USAGE`
shared with the top-level help; `FightRequest.repo_root:
Option<PathBuf>`.

**Refuted in verification (not applied):** the cartridge `domain:"ci"`
claim (laminar-mcp uses the identical value) and all efficiency
candidates (honest scale analysis at n≈5 escalations, loopback,
freshness-by-design).

## RSR Quality Checklist

### Required

- [x] Tests pass (43 default + 11 boj-feature tests)
- [x] Code is formatted (`cargo fmt --check` clean)
- [x] Linter is clean (clippy 0 findings, both feature configs)
- [x] No banned language patterns
- [x] No `unsafe` blocks without `// SAFETY:` comments (none)
- [x] No banned functions
- [x] SPDX license headers present on all new/modified source files
- [x] No secrets, credentials, or `.env` files included

### As Applicable

- [x] Documentation updated for user-facing changes (README status +
crate table)
- [x] No new dependencies

## Testing

Beyond the suites: live re-check of every fixed behavior — ungrounded
fight emits the honesty blocker instead of probing the CWD; both
diagnose shapes accepted; `SQUABBLE_PORT=0` refuses with exit 69; new
unit tests pin group-primary routing, body-error detection, back-compat
parsing, and the never-reads-CWD guarantee.

**Note:** commits unsigned (no signing key in this environment) —
owner/CI to sign.

## Screenshots

n/a

---
_Generated by [Claude
Code](https://claude.ai/code/session_01SUURnQUnzTXYftzWFs5pfZ)_
hyperpolymath added a commit that referenced this pull request Sep 4, 2026
Three real defects, all raised on review of this PR and all verified
against the source before changing anything.

1. `classify()` tested `steps.is_empty()` FIRST and returned
   `Vacuous { NoStepsRecorded }`. But an empty step list means the jobs
   API showed us nothing — it is not a report that the job ran nothing.
   Escalating it is a genuine false alarm, and it falsifies the
   undercount-never-false-alarm property the directive promises. This
   module exists to catch guards that answer a different question from
   the one their consumer needs; it had become one.

   The cause is removed, not merely bypassed. The empty case is an
   EXPLICIT early return, because `[].iter().all(..)` is vacuously true
   in Rust: deleting the arm would have let the empty case fall through
   to `AllStepsSkipped` and reach the identical wrong verdict under a
   different label. That is proven, not asserted — with the early return
   neutered, both new tests fail.

   `no-silent-skip` still holds: the host reports the uninspectable
   green on stderr, exactly as it already does for a fetch error.

   `AllStepsSkipped` is KEPT. A job that concluded success with every
   recorded step skipped enforced nothing, whether or not a signature
   matched. The directive's coverage note is corrected to say so rather
   than the code being bent to fit stale prose (Doctrine #10).

2. `job_id_from_details_url` cut the id on `/` only, so any details URL
   carrying `?check_suite_focus=true` (GitHub appends it routinely) or a
   `#step:` fragment failed to parse and the green was skipped without a
   word — a silent undercount by construction.

3. `Evidence.stub_rate` was hardcoded `1.0`, reporting stub evidence for
   jobs that genuinely ran. It is now measured. The signature match moved
   to `VacuitySignature::matches` so host and classifier ask the same
   question: `Evidence` is an input to `classify` while the cause is its
   output, so deriving the rate from the cause would have been circular.
   `Recommendation::from_evidence` does not read `stub_rate`, so the
   recommendation branch is unchanged.

Every new test proven able to fail by a planted break, reverted.
115 tests pass; clippy -D warnings clean; `just quality` green.

Note on witnesses: this repo's rust-ci workflow cannot run. It is pinned
at standards@5b1d0022, which does not exist upstream (404), so the run
dies at startup with jobs=0. Four more workflows here are pinned at
standards@7fdc2705, which exists but is reachable from no branch. Those
five reds are pre-existing on main — every blob is byte-identical to
origin/main — and are repaired by the pin sweep, not here. The local
runs above are therefore the only witnesses for this change.

Co-Authored-By: Claude Opus 5 <[email protected]>
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