From cfda602497884ce9a7afe49c5c5373363f7c9c66 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 14:15:07 +0000 Subject: [PATCH 1/5] feat(rules): SQ-TOOL-02 (Dependabot bun ecosystem) and the refs-missing signature for SQ-LOCK-02 Evidence from the rule reconciliation thread, with run URLs: - SQ-TOOL-02 (40th rule, FIX, config only): Dependabot misconfigured_tooling for Bun. MetaManifold-WebUI run 43225380901 /frontend; fixed by hand in MetaManifold-WebUI#330 (package-ecosystem npm to bun, one directory, other entries unchanged). Refers when the directory has a second lockfile or the repository has no matching ecosystem. Its check (the next Dependabot run) has not run yet for #330 and the row says so. - SQ-LOCK-02 also matches 'refs missing from the lockfile' (this-ssg run 43156768667). The this-ssg slsa-github-generator@f7dd8c54 case is listed in its refer-when: gh actions-lock is not yet shown to regenerate it, so the guard sends it to a referral until a live run proves it. - ADR 0004 mapping table: dependabot_ecosystem_mismatch, actions_lock_missing_ref, repository_map_stale (SQ-GEN-01) and generated_file_stale (referral). fmt, clippy -D warnings and the workspace tests pass (200 in squabble-core). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- .../squabble-core/data/first-line-rules.tsv | 3 +- crates/squabble-core/src/rules.rs | 35 +++++++++++++------ .../0004-first-line-rule-catalogue.adoc | 21 +++++++---- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/crates/squabble-core/data/first-line-rules.tsv b/crates/squabble-core/data/first-line-rules.tsv index cdad18e..df4aafe 100644 --- a/crates/squabble-core/data/first-line-rules.tsv +++ b/crates/squabble-core/data/first-line-rules.tsv @@ -18,7 +18,7 @@ # A new rule is added here and to ADR 0004 together, and the class counts in # the catalogue_shape test are updated with it. SQ-LOCK-01 FIX invalid lockfile pin: an actions.lock record keyed owner/repo@<40-hex> repeats that SHA as its ref Refresh scripts/check-lock-sync.sh from template main, then set each flagged ref to the highest full-semver tag at the SHA, else highest semver tag, else first tag, else a branch containing the commit The template lock-sync gate exits 0 and the failed workflow no longer reports invalid lockfile pin; scripts/check-lock-sync.sh needs GNU awk and mikefarah yq v4, and a missing tool means the check did not run, never a pass No tag or branch holds the SHA; tags tie; the lock also lacks entries -SQ-LOCK-02 FIX lockfile missing pin for an action called inside another action; or lockfile verification did not produce a result because a locked ref no longer resolves (unable to find version ); or a workflow bumped an action past its lock (stale lock, found statically) Regenerate the lock with gh actions-lock The lock-sync gate passes and the job starts The regenerated lock disagrees with the workflow YAML +SQ-LOCK-02 FIX lockfile missing pin for an action called inside another action; or lockfile verification did not produce a result because a locked ref no longer resolves (unable to find version ); or refs missing from the lockfile (check-lock-sync.sh: FAIL : refs missing from the lockfile: @); or a workflow bumped an action past its lock (stale lock, found statically) Regenerate the lock with gh actions-lock The lock-sync gate passes and the job starts The regenerated lock disagrees with the workflow YAML, or the missing ref is an action called inside a reusable workflow that gh actions-lock has not been shown to regenerate (this-ssg release.yml slsa-github-generator@f7dd8c54, run 43156768667) SQ-LOCK-03 FIX reusable-calling workflow ends with zero jobs; the lock records the callee's old owner_id after a transfer Repoint uses: to the canonical owner/name at a standards commit whose allowlist already covers metadatastician/standards/.github/workflows/*@* (8d1a2aa or later; governance / Allowlist Preflight reads the allowlist at the pinned commit), and relock with scripts/relock-standards-pin.sh from standards main Each record's owner_id equals the repository API owner id; the next run has jobs; check-allowed-actions.sh .github/workflows reports 0 gaps The pinned SHA is not reachable from the callee's default branch, or the callee is outside the estate, or no standards commit with that allowlist pattern is also free of pin-contract violations for the repository SQ-PIN-01 FIX a pinned reusable ends startup_failure on every push while a newer audited SHA runs green elsewhere Repin to the newest audited green SHA and update the closure rows and pinned-reusable-sources.json together The next push run has jobs No audited closure row exists for the target SHA, or the new SHA declares more secrets SQ-PIN-02 FIX the DEED lane fails unrecognised #-form on a literal the current ABNF admits: the repository pins an old standards SHA Bump every standards pin site in .github/workflows and scripts to one current SHA No pin site keeps the old SHA and validate-deed.sh passes at the new pin The newer linter rejects existing deed content; deed meaning is never edited @@ -26,6 +26,7 @@ SQ-PIN-03 FIX setup-bun fails on the GitHub API rate limit, or a setup-bun step SQ-PIN-04 FIX cargo install --git of the old panic-attacker name with no pin in a workflow Use hyperpolymath/panic-attack at the pin in gitbot-fleet bots/panicbot/canon/pin.toml No unpinned --git install remains The name maps to more than one repository SQ-PIN-05 FIX a workflow whose job is a cross-repository uses: //.github/workflows/.yml@ ends failure or startup_failure with zero jobs on every push Replace the caller with the inline-job form that rsr-template-repo main uses for the same workflow (it runs the gates from the pinned SHA without a cross-repository workflow_call) and keep actions.lock in sync The next push run is success with more than 0 jobs and the lock-sync gate passes The template has no inline form for that workflow, a required context name would change, the repository customised the caller on purpose, or the inline form still gives 0 jobs SQ-TOOL-01 FIX different nickel or yq versions across CI, Containerfile, mise and setup scripts One version everywhere, sha256-pinned (Nickel 1.18.0; yq v4.53.3) One version found; the installer verifies the sha256 No upstream checksums exist (state trust-on-first-download, never verified) +SQ-TOOL-02 FIX Dependabot fails with Dependabot detected that Bun is misconfigured ... This project has a bun.lock file but no package-lock.json, yarn.lock or pnpm-lock.yaml (type misconfigured_tooling, tool Bun): a dependabot.yml entry uses package-ecosystem npm for a directory that bun manages In .github/dependabot.yml change package-ecosystem from npm to bun for that directory only, and correct any comment that says npm supports bun.lock; leave every other entry and its schedule, limits, groups and ignores unchanged The next Dependabot run for that directory finishes without a misconfigured_tooling error The directory holds a second lockfile (bun.lock plus another), or the repository has no matching Dependabot ecosystem SQ-GEN-01 FIX estate-rules reports the committed REPOSITORY-MAP.adoc is stale Run bash scripts/gen-repo-map.sh . and commit the map tests/shape/repo_map_determinism_test.sh passes The map still differs after regeneration SQ-GEN-02 FIX a deed or k9 line is over 998 octets (K9-E006) Wrap the string or description, layout only deed_lint.js and k9-validate --strict pass A wrap would change a value (identifier, hash, URL) SQ-GEN-03 FIX a job with if: always() and needs: that downloads an artifact (actions/download-artifact without run-id) runs after a cancelled run and fails on the missing artifact (Hypatia WF029) Change the job condition to ${{ !cancelled() }} The workflow is valid YAML, the job still runs after failed or skipped needs, and it does not run in a cancelled run The job must run after cancellation on purpose, or the workflow is vendored or third-party diff --git a/crates/squabble-core/src/rules.rs b/crates/squabble-core/src/rules.rs index 6dd0616..bbfa426 100644 --- a/crates/squabble-core/src/rules.rs +++ b/crates/squabble-core/src/rules.rs @@ -51,7 +51,7 @@ use RuleClass::{Act, Fix, Noise, Owner, Refer}; /// here. const CATALOGUE_TSV: &str = include_str!("../data/first-line-rules.tsv"); -/// The 39 catalogue rows, in ADR 0004 order. +/// The 40 catalogue rows, in ADR 0004 order. /// /// The data file ships inside the crate, so a malformed row is a defect in /// this crate that a caller cannot repair. The catalogue never loads short: @@ -170,7 +170,9 @@ type LogMatcher = (&'static str, fn(&LogCtx) -> bool); static LOG_MATCHERS: &[LogMatcher] = &[ ("SQ-LOCK-01", |c| c.has("invalid lockfile pin")), ("SQ-LOCK-02", |c| { - c.has("lockfile missing pin for") || c.has("lockfile verification did not produce a result") + c.has("lockfile missing pin for") + || c.has("lockfile verification did not produce a result") + || c.has("refs missing from the lockfile") }), ("SQ-PIN-02", |c| c.has("unrecognised #-form")), ("SQ-PIN-03", |c| { @@ -180,6 +182,9 @@ static LOG_MATCHERS: &[LogMatcher] = &[ "Failed to fetch url https://api.github.com/repos/oven-sh/bun/git/refs/tags", )) }), + ("SQ-TOOL-02", |c| { + c.has("Dependabot detected that Bun is misconfigured") + }), ("SQ-RUN-01", |c| c.rate_limited()), ("SQ-RUN-03", |c| { c.http_5xx_after("gh: HTTP ") @@ -783,10 +788,11 @@ mod tests { assert!(lock.summary.contains("stale lock")); assert_eq!(lock.fix, "Regenerate the lock with gh actions-lock"); assert_eq!(lock.check, "The lock-sync gate passes and the job starts"); - assert_eq!( - lock.refer_when, - "The regenerated lock disagrees with the workflow YAML" - ); + assert!(lock.summary.contains("refs missing from the lockfile")); + assert!(lock + .refer_when + .starts_with("The regenerated lock disagrees with the workflow YAML")); + assert!(lock.refer_when.contains("slsa-github-generator")); assert_eq!(CATALOGUE[0].id, "SQ-LOCK-01", "ADR 0004 order is kept"); assert_eq!(CATALOGUE[CATALOGUE.len() - 1].id, "SQ-NOI-03"); for r in CATALOGUE.iter() { @@ -838,16 +844,16 @@ mod tests { #[test] fn shipped_catalogue_file_parses() { let parsed = parse_catalogue(CATALOGUE_TSV).expect("the shipped data file is well formed"); - assert_eq!(parsed.len(), 39); + assert_eq!(parsed.len(), 40); } #[test] fn catalogue_shape() { - assert_eq!(CATALOGUE.len(), 39); + assert_eq!(CATALOGUE.len(), 40); let uniq: HashSet<_> = CATALOGUE.iter().map(|r| r.id).collect(); - assert_eq!(uniq.len(), 39); + assert_eq!(uniq.len(), 40); let n = |c| CATALOGUE.iter().filter(|r| r.class == c).count(); - assert_eq!(n(Fix), 18); + assert_eq!(n(Fix), 19); assert_eq!(n(Act), 4); assert_eq!(n(Refer), 2); assert_eq!(n(Owner), 12); @@ -910,6 +916,15 @@ mod tests { ("SQ-OWN-09", "fatal: unable to access 'https://x/': The requested URL returned error: 401"), ("SQ-OWN-10", "Error: Private Key is in OpenSSH format"), ("SQ-OWN-10", "error:1E08010C:DECODER routines::unsupported"), + // this-ssg run 43156768667 and MetaManifold-WebUI run 43225380901. + ( + "SQ-LOCK-02", + "FAIL .github/workflows/release.yml: refs missing from the lockfile: slsa-framework/slsa-github-generator@f7dd8c54c2067bafc12ca7a55595d5ee9b75204a", + ), + ( + "SQ-TOOL-02", + "Error during file fetching; aborting: Dependabot detected that Bun is misconfigured in this repository. Running `bun` results in the following error: This project has a `bun.lock` file but no `package-lock.json`", + ), ]; for (id, log) in cases { assert!(ids(log, None).contains(id), "{id} should match {log:?}"); diff --git a/docs/decisions/0004-first-line-rule-catalogue.adoc b/docs/decisions/0004-first-line-rule-catalogue.adoc index 007cc6c..2ae6f6e 100644 --- a/docs/decisions/0004-first-line-rule-catalogue.adoc +++ b/docs/decisions/0004-first-line-rule-catalogue.adoc @@ -14,7 +14,7 @@ evidence from one or more repositories, not yet a verified general rule. When the implementation lands, its rule table in code is authoritative and this record lists the decisions behind it. -Amended 2026-11-13 (increment 2): seven rules and one widened rule were added +Amended 2026-11-13 (increment 2): eight rules and one widened rule were added from the evidence that the rule reconciliation thread sent after #156 merged (hypatia#1064). The rows quote that evidence; rows marked "reconstructed" have no run URL yet. @@ -71,10 +71,10 @@ holds, or when its check does not pass on the PR head. | No tag or branch holds the SHA; tags tie; the lock also lacks entries. | SQ-LOCK-02 | FIX -| `lockfile missing pin for @` (for example `actions/upload-artifact@bbbca2dd…`, called inside `upload-pages-artifact` v5.0.0); or `lockfile verification did not produce a result for this action. Unable to resolve action @, unable to find version ` (hypatia run 43137798791: a locked ref no longer resolves); or, found statically, a workflow bumped an action past its lock (stale lock: the same action is locked for that workflow at another ref). +| `lockfile missing pin for @` (for example `actions/upload-artifact@bbbca2dd…`, called inside `upload-pages-artifact` v5.0.0); or `lockfile verification did not produce a result for this action. Unable to resolve action @, unable to find version ` (hypatia run 43137798791: a locked ref no longer resolves); or `FAIL : refs missing from the lockfile: @` from `scripts/check-lock-sync.sh` (this-ssg run 43156768667); or, found statically, a workflow bumped an action past its lock (stale lock: the same action is locked for that workflow at another ref). | Regenerate the lock with `gh actions-lock` (CI `GITHUB_TOKEN` works); for a stale lock, in the PR that bumps the action. | The lock-sync gate passes and the job starts. -| The regenerated lock disagrees with the workflow YAML. +| The regenerated lock disagrees with the workflow YAML, or the missing ref is an action called inside a reusable workflow that `gh actions-lock` has not been shown to regenerate (this-ssg `release.yml`, `slsa-framework/slsa-github-generator@f7dd8c54`: a live run must prove it first). | SQ-LOCK-03 | FIX | A reusable-calling workflow ends with zero jobs; its lock records the callee's old `owner_id` after a repository transfer (standards: 6759885 to 297579217, same `repo_id` 1116521501). @@ -118,6 +118,12 @@ holds, or when its check does not pass on the PR head. | One version found; the installer verifies the sha256. | No upstream checksums exist (state trust-on-first-download, never "verified"). +| SQ-TOOL-02 | FIX +| Dependabot fails with `Dependabot detected that Bun is misconfigured in this repository ... This project has a bun.lock file but no package-lock.json, yarn.lock or pnpm-lock.yaml` (type `misconfigured_tooling`, tool Bun): a `dependabot.yml` entry has `package-ecosystem: npm` for a directory that Bun manages (MetaManifold-WebUI run 43225380901, `/frontend`). +| In `.github/dependabot.yml` change `package-ecosystem` from `npm` to `bun` for that directory only, and correct any comment that says npm supports `bun.lock`. Every other entry, and that entry's schedule, limits, groups and ignores, stays unchanged. Done by hand in MetaManifold-WebUI#330. +| The next Dependabot run for that directory finishes without a `misconfigured_tooling` error. Not yet run for #330. +| The directory holds a second lockfile (`bun.lock` plus another), or the repository has no matching Dependabot ecosystem. + | SQ-GEN-01 | FIX | estate-rules prints `FAIL: committed REPOSITORY-MAP.adoc is stale` and asks for `just repo-map`. | Run `bash scripts/gen-repo-map.sh .` and commit the map. @@ -319,7 +325,7 @@ and fix belongs to the squabbler. | Hypatia id | Squabbler rule | Note | `pages_not_enabled` | SQ-OWN-01 | one to one | `actions_lock_invalid_pin` | SQ-LOCK-01 | one to one -| `actions_lock_unresolvable_pin`, `actions_lock_stale` | SQ-LOCK-02 | one fix (regenerate the lock), three signatures +| `actions_lock_unresolvable_pin`, `actions_lock_stale`, `actions_lock_missing_ref` | SQ-LOCK-02 | one fix (regenerate the lock), four signatures; the this-ssg slsa-generator case is a referral until a live run proves the regeneration | `merge_ref_race` | SQ-NOI-02 | never a re-run; `none` when the PR is closed, a referral when it is open | `runner_cancelled` | SQ-NOI-01 | the squabbler's rule is narrower (a replaced head) | `api_rate_limit` | SQ-PIN-03, then SQ-RUN-01 | advice that defers to both @@ -329,6 +335,9 @@ and fix belongs to the squabbler. | `secret_or_variable_missing` | SQ-OWN-02 | the squabbler's row is the mirror ssh-key case | `app_key_wrong_format` | SQ-OWN-10 | owner | `always_after_cancel` (WF029) | SQ-GEN-03 | static fix +| `dependabot_ecosystem_mismatch` | SQ-TOOL-02 | config fix +| `repository_map_stale` | SQ-GEN-01 | one to one +| `generated_file_stale` | none | a referral: the squabbler never runs a command named in a log; each new generated file becomes its own row | `bench_regression` | SQ-OWN-11 | owner | `scanner_pin_drift` | SQ-OWN-12 | owner | `canon_lockstep` | SQ-CANON-01 | inline-copy case only; a pin change is owner-routed @@ -342,8 +351,8 @@ base). == Consequences -* 22 rules are first-line (18 `FIX`, 4 `ACT`), 2 are referrals, 12 are - owner-only and 3 are noise; 39 in all. Every rule names its check and its +* 23 rules are first-line (19 `FIX`, 4 `ACT`), 2 are referrals, 12 are + owner-only and 3 are noise; 40 in all. Every rule names its check and its referral condition. * A fix that changes code (`SQ-CODE-nn`) is first-line only when the code-fix guard passes on its diff, so a fix that could weaken a check never runs at From f4ec64c06da5fc8efd0a4bb3f0df4151c79bec62 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 14:20:11 +0000 Subject: [PATCH 2/5] feat(rules): SQ-GEN-04 (kyaml-format) and SQ-OWN-13..15 from the sweep evidence Evidence from the rule reconciliation thread, with run URLs: - SQ-GEN-04 (FIX): 'kyaml-format: is not KYAML' (quintessence run 43156792336). Fix is scripts/kyaml-format.sh , named in the rule and never taken from the log; needs mikefarah Go yq, and a missing yq means the check did not run. - SQ-OWN-13 (OWNER): 'gh: Repository rule violations found ... (HTTP 409)' (Apodeixis.jl run 43257204071). Disjoint from SQ-OWN-04 (the git GH013 form); a test pins that neither claims the other. - SQ-OWN-14 (OWNER): 'non-v8 UUID literal' / 'UUID check failed' (Apodeixis.jl run 43257204302). The squabbler never mints or rewrites a UUID. - SQ-OWN-15 (OWNER): Sonar 'Not authorized or organization not found' (lithoglyph run 43152462261). Never skip the Sonar step. - ADR 0004: rows, mapping table, counts (44 rules, 24 first-line). fmt, clippy -D warnings and the workspace tests pass (201 in squabble-core). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- .../squabble-core/data/first-line-rules.tsv | 4 ++ crates/squabble-core/src/rules.rs | 48 ++++++++++++++++--- .../0004-first-line-rule-catalogue.adoc | 34 +++++++++++-- 3 files changed, 77 insertions(+), 9 deletions(-) diff --git a/crates/squabble-core/data/first-line-rules.tsv b/crates/squabble-core/data/first-line-rules.tsv index df4aafe..f71185e 100644 --- a/crates/squabble-core/data/first-line-rules.tsv +++ b/crates/squabble-core/data/first-line-rules.tsv @@ -30,6 +30,7 @@ SQ-TOOL-02 FIX Dependabot fails with Dependabot detected that Bun is misconfigur SQ-GEN-01 FIX estate-rules reports the committed REPOSITORY-MAP.adoc is stale Run bash scripts/gen-repo-map.sh . and commit the map tests/shape/repo_map_determinism_test.sh passes The map still differs after regeneration SQ-GEN-02 FIX a deed or k9 line is over 998 octets (K9-E006) Wrap the string or description, layout only deed_lint.js and k9-validate --strict pass A wrap would change a value (identifier, hash, URL) SQ-GEN-03 FIX a job with if: always() and needs: that downloads an artifact (actions/download-artifact without run-id) runs after a cancelled run and fails on the missing artifact (Hypatia WF029) Change the job condition to ${{ !cancelled() }} The workflow is valid YAML, the job still runs after failed or skipped needs, and it does not run in a cancelled run The job must run after cancellation on purpose, or the workflow is vendored or third-party +SQ-GEN-04 FIX kyaml-format: is not KYAML (quintessence run 43156792336: build/container/compose.yaml) Run scripts/kyaml-format.sh and commit the layout change. The generator is named here and is never taken from the log; it needs mikefarah Go yq (Python yq corrupts the file) The output is KYAML and the repository kyaml check passes; a missing yq means the check did not run, never a pass The output is not KYAML, the formatter changes a value, or yq is not the mikefarah Go build SQ-CANON-01 FIX an instance's canon-lockstep job is an old inline copy and goes red on a canon release Run rsr-template-repo scripts/adopt-canon-lockstep.sh The canon-lockstep job passes with the lag notice The script refuses (lock coverage), or the pin itself must change (A2ML is never edited automatically) SQ-PERM-01 FIX Resource not accessible by integration at get-a-workflow-run in a job that uploads SARIF on a private repository Add actions: read to that job's permissions, with a comment that names the reason The upload step passes on a re-run The permission is already present, or the repository is public SQ-RUN-01 ACT a setup or download step fails with API rate limit exceeded and the same workflow passes on an adjacent commit Re-run the failed jobs once after the rate-limit reset, only if that commit is still the head The re-run passes It fails twice on the same commit, the log has no rate-limit text, or the step is not a setup or download step @@ -54,6 +55,9 @@ SQ-OWN-09 OWNER gh: Bad credentials (HTTP 401), or git returned error: 401, from SQ-OWN-10 OWNER actions/create-github-app-token fails with Private Key is in OpenSSH format, error:1E08010C:DECODER routines::unsupported, or Invalid keyData Report: the App private key secret holds a key in the wrong format; the owner generates a new private key for the App and saves the whole file, whose first line is -----BEGIN RSA PRIVATE KEY-----. Never put the key in chat (owner) (owner) SQ-OWN-11 OWNER a benchmark gate fails with a ratio over its limit (for example escape_hatches 2.053x, or 2.285x against a 2.0x limit) Report: a performance regression, or a limit that needs the owner judgement; never raise the limit (owner) (owner) SQ-OWN-12 OWNER the same scanner (panic-attack) is pinned at more than one commit across the estate workflows Report the sites that differ from the ruled pin (owner ruling D7: panic-attack 410a8f82, pons bca1ea28); the change goes through the standards applier, never a hand edit (owner) (owner) +SQ-OWN-13 OWNER a workflow push is refused by a repository ruleset: gh: Repository rule violations found / Code coverage checks require a pull request. (HTTP 409) (Apodeixis.jl run 43257204071, Publish the lane badges, red on its base too) Report: a ruleset requires a pull request for that push, so the workflow cannot push to the protected branch. The owner changes the workflow to open a PR or adjusts the ruleset. The squabbler never changes a ruleset and never pushes around one (owner) (owner) +SQ-OWN-14 OWNER : non-v8 UUID literal () / UUID check failed. Use ESTATE-UUID-V8 (ADR-008) (Apodeixis.jl run 43257204302, ./Project.toml) Report: an identifier needs the owner or the A7 identity process. The squabbler never mints, rewrites or retypes a UUID (owner) (owner) +SQ-OWN-15 OWNER SonarQube ERROR Fail to load the list of plugins installed on the server: Not authorized or organization not found, then sonar-scanner failed with exit code 3 (lithoglyph run 43152462261) Report: the Sonar token or organization is missing or wrong; the owner fixes the secret or the Sonar project. Never remove or skip the Sonar step (owner) (owner) SQ-NOI-01 NOISE Fork governance failed (deed=cancelled) on a head that a newer commit replaced Label superseded; read the newest head The newest head is not deed=cancelled deed=cancelled on the newest head SQ-NOI-02 NOISE couldn't find remote ref refs/pull//merge and the PR closed before the job started None: do not re-run a closed PR The PR API shows the PR closed The PR is still open (conflict or deleted ref) SQ-NOI-03 NOISE Inbox Steward ends startup_failure only on runs triggered by chatgpt-codex-connector[bot] None Count of startup failures by actor Inbox Steward becomes a required check diff --git a/crates/squabble-core/src/rules.rs b/crates/squabble-core/src/rules.rs index bbfa426..a41dd44 100644 --- a/crates/squabble-core/src/rules.rs +++ b/crates/squabble-core/src/rules.rs @@ -51,7 +51,7 @@ use RuleClass::{Act, Fix, Noise, Owner, Refer}; /// here. const CATALOGUE_TSV: &str = include_str!("../data/first-line-rules.tsv"); -/// The 40 catalogue rows, in ADR 0004 order. +/// The 44 catalogue rows, in ADR 0004 order. /// /// The data file ships inside the crate, so a malformed row is a defect in /// this crate that a caller cannot repair. The catalogue never loads short: @@ -198,6 +198,9 @@ static LOG_MATCHERS: &[LogMatcher] = &[ ("SQ-GEN-01", |c| { c.has("committed REPOSITORY-MAP.adoc is stale") }), + ("SQ-GEN-04", |c| { + c.has("kyaml-format:") && c.has("is not KYAML") + }), ("SQ-GEN-02", |c| { c.has("K9-E006") || (c.has("line is") && c.has("octets")) }), @@ -223,6 +226,15 @@ static LOG_MATCHERS: &[LogMatcher] = &[ || c.has("DECODER routines::unsupported") || c.has("Invalid keyData") }), + ("SQ-OWN-13", |c| { + c.has("gh: Repository rule violations found") + }), + ("SQ-OWN-14", |c| { + c.has("non-v8 UUID literal") || c.has("UUID check failed. Use ESTATE-UUID-V8") + }), + ("SQ-OWN-15", |c| { + c.has("Not authorized or organization not found") + }), ("SQ-NOI-01", |c| c.has("deed=cancelled")), ("SQ-NOI-02", |c| { c.has("couldn't find remote ref refs/pull/") @@ -844,19 +856,19 @@ mod tests { #[test] fn shipped_catalogue_file_parses() { let parsed = parse_catalogue(CATALOGUE_TSV).expect("the shipped data file is well formed"); - assert_eq!(parsed.len(), 40); + assert_eq!(parsed.len(), 44); } #[test] fn catalogue_shape() { - assert_eq!(CATALOGUE.len(), 40); + assert_eq!(CATALOGUE.len(), 44); let uniq: HashSet<_> = CATALOGUE.iter().map(|r| r.id).collect(); - assert_eq!(uniq.len(), 40); + assert_eq!(uniq.len(), 44); let n = |c| CATALOGUE.iter().filter(|r| r.class == c).count(); - assert_eq!(n(Fix), 19); + assert_eq!(n(Fix), 20); assert_eq!(n(Act), 4); assert_eq!(n(Refer), 2); - assert_eq!(n(Owner), 12); + assert_eq!(n(Owner), 15); assert_eq!(n(Noise), 3); assert!(rule("SQ-OWN-04").is_some()); for gone in [ @@ -925,6 +937,21 @@ mod tests { "SQ-TOOL-02", "Error during file fetching; aborting: Dependabot detected that Bun is misconfigured in this repository. Running `bun` results in the following error: This project has a `bun.lock` file but no `package-lock.json`", ), + // quintessence run 43156792336, Apodeixis.jl runs 43257204071 and + // 43257204302, lithoglyph run 43152462261. + ( + "SQ-GEN-04", + "##[error]kyaml-format: build/container/compose.yaml is not KYAML \u{2014} run scripts/kyaml-format.sh build/container/compose.yaml", + ), + ( + "SQ-OWN-13", + "gh: Repository rule violations found\nCode coverage checks require a pull request.\n (HTTP 409)", + ), + ("SQ-OWN-14", "./Project.toml: non-v8 UUID literal (7d8c4f3a-6a31-4f21-9c72-1d496dd2ad67)"), + ( + "SQ-OWN-15", + "ERROR Fail to load the list of plugins installed on the server: Not authorized or organization not found", + ), ]; for (id, log) in cases { assert!(ids(log, None).contains(id), "{id} should match {log:?}"); @@ -954,6 +981,15 @@ mod tests { assert_eq!(ids("gh: HTTP 599", None), vec!["SQ-RUN-03"]); } + #[test] + fn push_refusals_are_told_apart() { + // The git form is SQ-OWN-04, the gh API form is SQ-OWN-13; neither claims the other. + let git = "remote: error: GH013: Repository rule violations found for refs/heads/main."; + let api = "gh: Repository rule violations found\n (HTTP 409)"; + assert_eq!(ids(git, None), vec!["SQ-OWN-04"]); + assert_eq!(ids(api, None), vec!["SQ-OWN-13"]); + } + #[test] fn matcher_order_is_the_precedence() { let log = "Failed to fetch url https://api.github.com/repos/oven-sh/bun/git/refs/tags API rate limit exceeded"; diff --git a/docs/decisions/0004-first-line-rule-catalogue.adoc b/docs/decisions/0004-first-line-rule-catalogue.adoc index 2ae6f6e..ba6aa4e 100644 --- a/docs/decisions/0004-first-line-rule-catalogue.adoc +++ b/docs/decisions/0004-first-line-rule-catalogue.adoc @@ -14,7 +14,7 @@ evidence from one or more repositories, not yet a verified general rule. When the implementation lands, its rule table in code is authoritative and this record lists the decisions behind it. -Amended 2026-11-13 (increment 2): eight rules and one widened rule were added +Amended 2026-11-13 (increment 2): twelve rules and one widened rule were added from the evidence that the rule reconciliation thread sent after #156 merged (hypatia#1064). The rows quote that evidence; rows marked "reconstructed" have no run URL yet. @@ -142,6 +142,12 @@ holds, or when its check does not pass on the PR head. | The workflow is valid YAML, the job still runs after failed or skipped `needs`, and it does not run in a cancelled run. | The job must run after cancellation on purpose, or the workflow is vendored or third-party. A summary job that downloads nothing (`dogfood-summary`) is not this rule. +| SQ-GEN-04 | FIX +| `kyaml-format: is not KYAML — run scripts/kyaml-format.sh ` (quintessence run 43156792336, `build/container/compose.yaml`). +| Run `scripts/kyaml-format.sh ` and commit the layout change. The generator is named here and is never taken from the log; it needs mikefarah Go `yq` (Python `yq` corrupts the file). +| The output is KYAML and the repository's kyaml check passes. A missing `yq` means the check did not run, never a pass. +| The output is not KYAML, the formatter changes a value, or `yq` is not the mikefarah Go build. + | SQ-CANON-01 | FIX | An instance's `canon-lockstep` job is an old inline copy and goes red on a canon release although its pin is provenance. | Run rsr-template-repo `scripts/adopt-canon-lockstep.sh` (replaces only that job and `scripts/canon-pin-check.sh`). @@ -286,6 +292,24 @@ holds, or when its check does not pass on the PR head. | (owner) | (owner) +| SQ-OWN-13 | OWNER +| A workflow push is refused by a ruleset: `gh: Repository rule violations found` / `Code coverage checks require a pull request.` / `(HTTP 409)` (Apodeixis.jl run 43257204071, "Publish the lane badges"; red on its base too). The `git` form, `GH013`, is SQ-OWN-04. +| Report: a ruleset requires a pull request for that push, so the workflow cannot push to the protected branch. The owner changes the workflow to open a PR or adjusts the ruleset. The squabbler never changes a ruleset and never pushes around one. +| (owner) +| (owner) + +| SQ-OWN-14 | OWNER +| `: non-v8 UUID literal ()` / `UUID check failed. Use ESTATE-UUID-V8 (ADR-008)` (Apodeixis.jl run 43257204302, `./Project.toml`). +| Report: an identifier needs the owner or the A7 identity process. The squabbler never mints, rewrites or retypes a UUID. +| (owner) +| (owner) + +| SQ-OWN-15 | OWNER +| `ERROR Fail to load the list of plugins installed on the server: Not authorized or organization not found`, then `sonar-scanner` failed with exit code 3 (lithoglyph run 43152462261). +| Report: the Sonar token or organization is missing or wrong; the owner fixes the secret or the Sonar project. Never remove or skip the Sonar step. +| (owner) +| (owner) + | SQ-NOI-01 | NOISE | `Fork governance failed (deed=cancelled)` on a head that a newer commit replaced. | Label superseded; read the newest head. @@ -337,6 +361,10 @@ and fix belongs to the squabbler. | `always_after_cancel` (WF029) | SQ-GEN-03 | static fix | `dependabot_ecosystem_mismatch` | SQ-TOOL-02 | config fix | `repository_map_stale` | SQ-GEN-01 | one to one +| `kyaml_format` | SQ-GEN-04 | generator named in the rule +| `ruleset_blocks_push` | SQ-OWN-13 | owner +| `uuid_conformance` | SQ-OWN-14 | owner +| `sonar_not_authorized` | SQ-OWN-15 | owner | `generated_file_stale` | none | a referral: the squabbler never runs a command named in a log; each new generated file becomes its own row | `bench_regression` | SQ-OWN-11 | owner | `scanner_pin_drift` | SQ-OWN-12 | owner @@ -351,8 +379,8 @@ base). == Consequences -* 23 rules are first-line (19 `FIX`, 4 `ACT`), 2 are referrals, 12 are - owner-only and 3 are noise; 40 in all. Every rule names its check and its +* 24 rules are first-line (20 `FIX`, 4 `ACT`), 2 are referrals, 15 are + owner-only and 3 are noise; 44 in all. Every rule names its check and its referral condition. * A fix that changes code (`SQ-CODE-nn`) is first-line only when the code-fix guard passes on its diff, so a fix that could weaken a check never runs at From 48ae61db23580505e72b665231b78aeed0f9d062 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 14:21:18 +0000 Subject: [PATCH 3/5] fix(rules): do not write a literal private-key header in the SQ-OWN-10 text Hypatia's secret scan flagged two critical 'Secret found: Private Key' findings on #159, at the SQ-OWN-10 row in the data file and in ADR 0004. Both were the owner hint that quoted the PEM header line. They are text, not a key, but the scanner cannot tell, and the hint does not need the literal header. The rows now say the key is the RSA PEM form the App settings page produces, not an OpenSSH key. No baseline or ignore entry was added. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- crates/squabble-core/data/first-line-rules.tsv | 2 +- docs/decisions/0004-first-line-rule-catalogue.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/squabble-core/data/first-line-rules.tsv b/crates/squabble-core/data/first-line-rules.tsv index f71185e..10836db 100644 --- a/crates/squabble-core/data/first-line-rules.tsv +++ b/crates/squabble-core/data/first-line-rules.tsv @@ -52,7 +52,7 @@ SQ-OWN-06 OWNER a bot PR shows only external checks and no Actions runs: the wor SQ-OWN-07 OWNER analyze (actions, none) stays red while GitHub's default code-scanning setup is on Report: the owner turns default setup off; never work around it in a workflow (owner) (owner) SQ-OWN-08 OWNER a workflow ends startup_failure with 0 jobs and no check-runs or annotations while the byte-identical file with the same SHA pins succeeds in rsr-template-repo Report: the cause is repository-level (Actions policy, allowed-actions list, Pages setting); the owner reads the failed run's banner or Settings > Actions; never rewrite the workflow to chase it (owner) (owner) SQ-OWN-09 OWNER gh: Bad credentials (HTTP 401), or git returned error: 401, from a token the workflow uses Report: the token is invalid, expired or revoked and the owner rotates it. Never retry (a retry cannot succeed) and never swap in another credential. A 403 is not matched here: it can be a rate limit (SQ-RUN-01) or a missing permission (SQ-PERM-01) (owner) (owner) -SQ-OWN-10 OWNER actions/create-github-app-token fails with Private Key is in OpenSSH format, error:1E08010C:DECODER routines::unsupported, or Invalid keyData Report: the App private key secret holds a key in the wrong format; the owner generates a new private key for the App and saves the whole file, whose first line is -----BEGIN RSA PRIVATE KEY-----. Never put the key in chat (owner) (owner) +SQ-OWN-10 OWNER actions/create-github-app-token fails with Private Key is in OpenSSH format, error:1E08010C:DECODER routines::unsupported, or Invalid keyData Report: the App private key secret holds a key in the wrong format; the owner generates a new private key for the App and saves the whole file in the RSA PEM form that the App settings page produces (not an OpenSSH key). Never put the key in chat (owner) (owner) SQ-OWN-11 OWNER a benchmark gate fails with a ratio over its limit (for example escape_hatches 2.053x, or 2.285x against a 2.0x limit) Report: a performance regression, or a limit that needs the owner judgement; never raise the limit (owner) (owner) SQ-OWN-12 OWNER the same scanner (panic-attack) is pinned at more than one commit across the estate workflows Report the sites that differ from the ruled pin (owner ruling D7: panic-attack 410a8f82, pons bca1ea28); the change goes through the standards applier, never a hand edit (owner) (owner) SQ-OWN-13 OWNER a workflow push is refused by a repository ruleset: gh: Repository rule violations found / Code coverage checks require a pull request. (HTTP 409) (Apodeixis.jl run 43257204071, Publish the lane badges, red on its base too) Report: a ruleset requires a pull request for that push, so the workflow cannot push to the protected branch. The owner changes the workflow to open a PR or adjusts the ruleset. The squabbler never changes a ruleset and never pushes around one (owner) (owner) diff --git a/docs/decisions/0004-first-line-rule-catalogue.adoc b/docs/decisions/0004-first-line-rule-catalogue.adoc index ba6aa4e..848c308 100644 --- a/docs/decisions/0004-first-line-rule-catalogue.adoc +++ b/docs/decisions/0004-first-line-rule-catalogue.adoc @@ -276,7 +276,7 @@ holds, or when its check does not pass on the PR head. | SQ-OWN-10 | OWNER | `actions/create-github-app-token` fails with `Private Key is in OpenSSH format` (the 2026-11-13 canary runs 43286728126 and 43288768279 in standards), `error:1E08010C:DECODER routines::unsupported` or `Invalid keyData`. -| Report: the App private key secret holds a key in the wrong format; the owner generates a new private key for the App and saves the whole file, whose first line is `-----BEGIN RSA PRIVATE KEY-----`. The key is never put in chat. +| Report: the App private key secret holds a key in the wrong format; the owner generates a new private key for the App and saves the whole file in the RSA PEM form that the App settings page produces (not an OpenSSH key). The key is never put in chat. | (owner) | (owner) From f1e555a0686012a075d886d6bea4bf33043e6673 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 14:21:54 +0000 Subject: [PATCH 4/5] fix(rules): no UUID literal in the SQ-OWN-14 test string governance / UUID v7 conformance failed on #159: ./crates/squabble-core/src/rules.rs: non-v8 UUID literal. The SQ-OWN-14 log-signature test quoted the Apodeixis.jl run's real UUID. The matcher keys on the words 'non-v8 UUID literal', not on the value, so the test uses a placeholder. No UUID literal remains in crates or docs. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- crates/squabble-core/src/rules.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/squabble-core/src/rules.rs b/crates/squabble-core/src/rules.rs index a41dd44..aabada3 100644 --- a/crates/squabble-core/src/rules.rs +++ b/crates/squabble-core/src/rules.rs @@ -947,7 +947,7 @@ mod tests { "SQ-OWN-13", "gh: Repository rule violations found\nCode coverage checks require a pull request.\n (HTTP 409)", ), - ("SQ-OWN-14", "./Project.toml: non-v8 UUID literal (7d8c4f3a-6a31-4f21-9c72-1d496dd2ad67)"), + ("SQ-OWN-14", "./Project.toml: non-v8 UUID literal ()"), ( "SQ-OWN-15", "ERROR Fail to load the list of plugins installed on the server: Not authorized or organization not found", From 42cd821585b81b2beb2fa606cb8f1955d2155a0a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 15:00:27 +0000 Subject: [PATCH 5/5] feat(rules): SQ-OWN-16 (WF030), gh Server Error 5xx for SQ-RUN-03, S131 and shebang limit for SQ-CODE-03 Amendment 3 on top of #159 (stacked on its branch): - SQ-OWN-16 (OWNER, report only): a workflow force- or mirror-pushes to a forge gated on *_MIRROR_ENABLED with no source-visibility check (Hypatia WF030, static). Real example from the reconciliation thread: standards mirror-reusable.yml line 93 gate and line 144 git push --force gitlab main. The squabbler never edits a mirror workflow, pushes to a forge or changes a visibility setting. - SQ-RUN-03 also matches 'gh: Server Error (HTTP 5xx)': standards run 43446385277 logged 'gh: Server Error (HTTP 502)', which the 'gh: HTTP 5xx' matcher missed. A 404 in that form stays unmatched (test). - SQ-CODE-03 gains S131 (add a no-op *) ;; default, behaviour-neutral in shell) and the S7688 limits: [ ] to [[ ]] only in files with a bash shebang, refer when the test uses -a or -o or relies on word splitting. - ADR 0004: rows, mapping (mirror_without_visibility_guard), counts: 45 rules, 24 first-line. fmt, clippy -D warnings and the workspace tests pass (201 in squabble-core). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU --- .../squabble-core/data/first-line-rules.tsv | 5 +++-- crates/squabble-core/src/rules.rs | 16 ++++++++------ .../0004-first-line-rule-catalogue.adoc | 21 ++++++++++++------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/crates/squabble-core/data/first-line-rules.tsv b/crates/squabble-core/data/first-line-rules.tsv index 10836db..7be8684 100644 --- a/crates/squabble-core/data/first-line-rules.tsv +++ b/crates/squabble-core/data/first-line-rules.tsv @@ -35,11 +35,11 @@ SQ-CANON-01 FIX an instance's canon-lockstep job is an old inline copy and goes SQ-PERM-01 FIX Resource not accessible by integration at get-a-workflow-run in a job that uploads SARIF on a private repository Add actions: read to that job's permissions, with a comment that names the reason The upload step passes on a re-run The permission is already present, or the repository is public SQ-RUN-01 ACT a setup or download step fails with API rate limit exceeded and the same workflow passes on an adjacent commit Re-run the failed jobs once after the rate-limit reset, only if that commit is still the head The re-run passes It fails twice on the same commit, the log has no rate-limit text, or the step is not a setup or download step SQ-RUN-02 ACT a PR is blocked with required checks green under a strict ruleset and its base is behind the default branch Update the branch by merging the base; never rebase a branch the squabbler did not open The required checks pass on the new head Merge conflict, or still blocked on an up-to-date head -SQ-RUN-03 ACT a step fails on a transient host or API error: gh: HTTP 5xx, a git remote returning 5xx, Could not resolve host, or Failed to connect Re-run the failed job once, only if that commit is still the head The re-run passes It fails twice on the same commit, or the status is 401 or 403 (a token problem: SQ-OWN-09, or a rate limit: SQ-RUN-01) +SQ-RUN-03 ACT a step fails on a transient host or API error: gh: HTTP 5xx, gh: Server Error (HTTP 5xx), a git remote returning 5xx, Could not resolve host, or Failed to connect Re-run the failed job once, only if that commit is still the head The re-run passes It fails twice on the same commit, or the status is 401 or 403 (a token problem: SQ-OWN-09, or a rate limit: SQ-RUN-01) SQ-RUN-04 ACT gitleaks fails with fatal: ambiguous argument ^..: unknown revision or path not in the working tree, because a shallow checkout lacks the range base commit; trufflehog reports commits: 0 for the same range Re-run the failed job once, only if that commit is still the head The re-run passes and the scan covers more than 0 commits It fails twice on the same commit: refer with the suggestion fetch-depth: 0 on the scan checkout SQ-CODE-01 FIX a Rust readiness or integration test cannot find its binary under target/debug/build Use PathBuf::from(env!("CARGO_BIN_EXE_")); a code fix, first-line only when the code-fix guard passes cargo test --test readiness passes The fix would hit the code-fix unsafe list, the code is vendored or third-party, or the check does not pass on the PR head SQ-CODE-02 FIX Validate Hypatia Baseline fails on new code_safety findings Fix the code behind the finding; never touch .hypatia-baseline.json The baseline job passes with the baseline file unchanged The fix would hit the code-fix unsafe list, the code is vendored or third-party, or the check does not pass on the PR head -SQ-CODE-03 FIX Sonar S7688 or S7679 in shell scripts Make the mechanical edit; decline S1192 in test files, where repetition is a convention bash -n, shellcheck and the repository's shell tests pass The fix would hit the code-fix unsafe list, the code is vendored or third-party, or the check does not pass on the PR head +SQ-CODE-03 FIX Sonar S7688, S7679 or S131 in shell scripts Make the mechanical edit: for S7688 rewrite [ ] to [[ ]] only in files with a bash shebang (never /bin/sh or POSIX scripts); for S131 add a no-op default case *) ;;; decline S1192 in test files, where repetition is a convention bash -n, shellcheck and the repository's shell tests pass An S7688 test uses -a or -o or relies on word splitting, the fix would hit the code-fix unsafe list, the code is vendored or third-party, or the check does not pass on the PR head SQ-REF-06 REFER the DEED job fails could not read Username for https://github.com on a private repository Root cause: OTP 28 (28.3 and 28.5.0.8) miscompiles Hypatia.Rules.PinSites.walk/4; the template #328 shape only shifts memory layout. The fix is hyperpolymath/hypatia#1062. Never change the workflow to hide it DEED syntax passes on a private PR Always, until hypatia#1062 lands SQ-REF-08 REFER Repo self-tests fails in dismiss-code-scanning-alerts-test.sh with : is not a write permission after lines were added above a permissions: block that .github/code-scanning-dismissals.json keys by line number Suggest keeping the recorded line where it is: put new comments inline or below it; never re-key the dismissal (it must match the live Scorecard alert's start_line on main) The test reports 0 failed Always when the permission line itself must move or change (re-keying after Scorecard re-scans main is the owner's call) SQ-CODE-04 FIX an adapter prints a valid findings array but exits other than 0 or 1 and is reported as ran Accept arrays only for exit 0 or 1 (fleet-report-back.sh translate_or_error) Tests for exits 2, 3, 9 and 137 The fix would hit the code-fix unsafe list, the code is vendored or third-party, or the check does not pass on the PR head @@ -58,6 +58,7 @@ SQ-OWN-12 OWNER the same scanner (panic-attack) is pinned at more than one commi SQ-OWN-13 OWNER a workflow push is refused by a repository ruleset: gh: Repository rule violations found / Code coverage checks require a pull request. (HTTP 409) (Apodeixis.jl run 43257204071, Publish the lane badges, red on its base too) Report: a ruleset requires a pull request for that push, so the workflow cannot push to the protected branch. The owner changes the workflow to open a PR or adjusts the ruleset. The squabbler never changes a ruleset and never pushes around one (owner) (owner) SQ-OWN-14 OWNER : non-v8 UUID literal () / UUID check failed. Use ESTATE-UUID-V8 (ADR-008) (Apodeixis.jl run 43257204302, ./Project.toml) Report: an identifier needs the owner or the A7 identity process. The squabbler never mints, rewrites or retypes a UUID (owner) (owner) SQ-OWN-15 OWNER SonarQube ERROR Fail to load the list of plugins installed on the server: Not authorized or organization not found, then sonar-scanner failed with exit code 3 (lithoglyph run 43152462261) Report: the Sonar token or organization is missing or wrong; the owner fixes the secret or the Sonar project. Never remove or skip the Sonar step (owner) (owner) +SQ-OWN-16 OWNER a workflow force- or mirror-pushes to a forge, gated on a *_MIRROR_ENABLED variable, with no check of the source repository visibility anywhere in the file (Hypatia WF030, found statically: standards mirror-reusable.yml gates the job at line 93 and runs git push --force gitlab main at line 144; github-backup-mirror-reusable.yml too) Report: the owner decides the guard (refuse, or skip loudly, when the source is private and the forge copy is not confirmed private; escalate when the forge visibility cannot be read). The squabbler never edits a mirror workflow, never pushes to a forge and never changes a visibility setting (owner) (owner) SQ-NOI-01 NOISE Fork governance failed (deed=cancelled) on a head that a newer commit replaced Label superseded; read the newest head The newest head is not deed=cancelled deed=cancelled on the newest head SQ-NOI-02 NOISE couldn't find remote ref refs/pull//merge and the PR closed before the job started None: do not re-run a closed PR The PR API shows the PR closed The PR is still open (conflict or deleted ref) SQ-NOI-03 NOISE Inbox Steward ends startup_failure only on runs triggered by chatgpt-codex-connector[bot] None Count of startup failures by actor Inbox Steward becomes a required check diff --git a/crates/squabble-core/src/rules.rs b/crates/squabble-core/src/rules.rs index aabada3..a10e76b 100644 --- a/crates/squabble-core/src/rules.rs +++ b/crates/squabble-core/src/rules.rs @@ -11,7 +11,7 @@ //! rules have none and are left out of it: SQ-LOCK-03, SQ-PIN-01, SQ-PIN-04, //! SQ-PIN-05, SQ-TOOL-01, SQ-CANON-01, SQ-RUN-02, SQ-CODE-02, SQ-CODE-03, //! SQ-CODE-04, SQ-REF-08, SQ-OWN-03, SQ-OWN-05, SQ-OWN-06, SQ-OWN-07, -//! SQ-OWN-08, SQ-OWN-11, SQ-OWN-12 and SQ-NOI-03. Their evidence is the +//! SQ-OWN-08, SQ-OWN-11, SQ-OWN-12, SQ-OWN-16 and SQ-NOI-03. Their evidence is the //! workflow source, run metadata or PR state, not a log line. SQ-LOCK-01, //! SQ-PIN-03 and SQ-GEN-03 also have static detectors below. @@ -51,7 +51,7 @@ use RuleClass::{Act, Fix, Noise, Owner, Refer}; /// here. const CATALOGUE_TSV: &str = include_str!("../data/first-line-rules.tsv"); -/// The 44 catalogue rows, in ADR 0004 order. +/// The 45 catalogue rows, in ADR 0004 order. /// /// The data file ships inside the crate, so a malformed row is a defect in /// this crate that a caller cannot repair. The catalogue never loads short: @@ -188,6 +188,7 @@ static LOG_MATCHERS: &[LogMatcher] = &[ ("SQ-RUN-01", |c| c.rate_limited()), ("SQ-RUN-03", |c| { c.http_5xx_after("gh: HTTP ") + || c.http_5xx_after("gh: Server Error (HTTP ") || c.http_5xx_after("returned error: ") || c.has("Could not resolve host") || c.has("Failed to connect to") @@ -856,19 +857,19 @@ mod tests { #[test] fn shipped_catalogue_file_parses() { let parsed = parse_catalogue(CATALOGUE_TSV).expect("the shipped data file is well formed"); - assert_eq!(parsed.len(), 44); + assert_eq!(parsed.len(), 45); } #[test] fn catalogue_shape() { - assert_eq!(CATALOGUE.len(), 44); + assert_eq!(CATALOGUE.len(), 45); let uniq: HashSet<_> = CATALOGUE.iter().map(|r| r.id).collect(); - assert_eq!(uniq.len(), 44); + assert_eq!(uniq.len(), 45); let n = |c| CATALOGUE.iter().filter(|r| r.class == c).count(); assert_eq!(n(Fix), 20); assert_eq!(n(Act), 4); assert_eq!(n(Refer), 2); - assert_eq!(n(Owner), 15); + assert_eq!(n(Owner), 16); assert_eq!(n(Noise), 3); assert!(rule("SQ-OWN-04").is_some()); for gone in [ @@ -918,6 +919,8 @@ mod tests { "##[error]lockfile verification did not produce a result for this action. Unable to resolve action `dtolnay/rust-toolchain@v1`", ), ("SQ-RUN-03", "gh: HTTP 502 (https://api.github.com/graphql)"), + // standards run 43446385277, Rust coverage (playbook-to-recipe). + ("SQ-RUN-03", "gh: Server Error (HTTP 502)"), ("SQ-RUN-03", "fatal: unable to access 'https://git.sr.ht/x': The requested URL returned error: 503"), ("SQ-RUN-03", "fatal: unable to access 'https://x/': Could not resolve host: x"), ( @@ -970,6 +973,7 @@ mod tests { "gh: HTTP 404", "gh: HTTP 5", "gh: HTTP 5x2", + "gh: Server Error (HTTP 404)", "returned error: 403", ] { assert!(!ids(log, None).contains(&"SQ-RUN-03"), "{log}"); diff --git a/docs/decisions/0004-first-line-rule-catalogue.adoc b/docs/decisions/0004-first-line-rule-catalogue.adoc index 848c308..b21ca3e 100644 --- a/docs/decisions/0004-first-line-rule-catalogue.adoc +++ b/docs/decisions/0004-first-line-rule-catalogue.adoc @@ -14,7 +14,7 @@ evidence from one or more repositories, not yet a verified general rule. When the implementation lands, its rule table in code is authoritative and this record lists the decisions behind it. -Amended 2026-11-13 (increment 2): twelve rules and one widened rule were added +Amended 2026-11-13 (increment 2): thirteen rules and three widened rules (SQ-LOCK-02, SQ-RUN-03, SQ-CODE-03) were added from the evidence that the rule reconciliation thread sent after #156 merged (hypatia#1064). The rows quote that evidence; rows marked "reconstructed" have no run URL yet. @@ -173,7 +173,7 @@ holds, or when its check does not pass on the PR head. | Merge conflict, or still blocked on an up-to-date head. | SQ-RUN-03 | ACT -| A step fails on a transient host or API error: `gh: HTTP 5xx` (hypatia run 43358533401: `gh: HTTP 502` on an owner-wide GraphQL query), a git remote answering `returned error: 5xx`, `Could not resolve host`, or `Failed to connect to`. +| A step fails on a transient host or API error: `gh: HTTP 5xx` (hypatia run 43358533401: `gh: HTTP 502` on an owner-wide GraphQL query), `gh: Server Error (HTTP 5xx)` (standards run 43446385277: `gh: Server Error (HTTP 502)` while the coverage job read the workflow catalogue), a git remote answering `returned error: 5xx`, `Could not resolve host`, or `Failed to connect to`. | Re-run the failed job once, only if that commit is still the head. | The re-run passes. | It fails twice on the same commit, or the status is 401 or 403 (a token problem is SQ-OWN-09; a rate limit is SQ-RUN-01). @@ -197,10 +197,10 @@ holds, or when its check does not pass on the PR head. | The fix would hit the code-fix unsafe list (guard 6), the code is vendored or third-party, or the check does not pass on the PR head. | SQ-CODE-03 | FIX -| Sonar S7688 or S7679 in shell scripts. -| Make the mechanical edit. Decline S1192 in test files, where repetition is a convention. +| Sonar S7688, S7679 or S131 in shell scripts. +| Make the mechanical edit. For S7688 rewrite `[ … ]` to `[[ … ]]` only in files with a bash shebang, never in `/bin/sh` or POSIX scripts. For S131 add a no-op default case `*) ;;`, which changes nothing in shell. Decline S1192 in test files, where repetition is a convention. | `bash -n`, shellcheck and the repository's shell tests pass. -| The fix would hit the code-fix unsafe list (guard 6), the code is vendored or third-party, or the check does not pass on the PR head. +| An S7688 test uses `-a` or `-o` or relies on word splitting, the fix would hit the code-fix unsafe list (guard 6), the code is vendored or third-party, or the check does not pass on the PR head. | SQ-REF-06 | REFER | The DEED job fails `could not read Username for 'https://github.com'` on a private repository (checkout with `persist-credentials: false`, then an anonymous fetch). @@ -310,6 +310,12 @@ holds, or when its check does not pass on the PR head. | (owner) | (owner) +| SQ-OWN-16 | OWNER +| A workflow force- or mirror-pushes to a forge, gated on a `*_MIRROR_ENABLED` variable, with no check of the source repository's visibility anywhere in the file (Hypatia WF030, found statically). Standards `mirror-reusable.yml` gates the job at line 93 and runs `git push --force gitlab main` at line 144, with the same shape per forge (bitbucket 196, codeberg 248); `github-backup-mirror-reusable.yml` too. It fires on nothing in hypatia, gitbot-fleet or this repository. +| Report: the owner decides the guard (refuse, or skip loudly, when the source is private and the forge copy is not confirmed private; escalate when the forge visibility cannot be read). The squabbler never edits a mirror workflow, never pushes to a forge and never changes a visibility setting. Hypatia detects and refers it; this row only reports. +| (owner) +| (owner) + | SQ-NOI-01 | NOISE | `Fork governance failed (deed=cancelled)` on a head that a newer commit replaced. | Label superseded; read the newest head. @@ -365,6 +371,7 @@ and fix belongs to the squabbler. | `ruleset_blocks_push` | SQ-OWN-13 | owner | `uuid_conformance` | SQ-OWN-14 | owner | `sonar_not_authorized` | SQ-OWN-15 | owner +| `mirror_without_visibility_guard` (WF030) | SQ-OWN-16 | owner, report only; static detection | `generated_file_stale` | none | a referral: the squabbler never runs a command named in a log; each new generated file becomes its own row | `bench_regression` | SQ-OWN-11 | owner | `scanner_pin_drift` | SQ-OWN-12 | owner @@ -379,8 +386,8 @@ base). == Consequences -* 24 rules are first-line (20 `FIX`, 4 `ACT`), 2 are referrals, 15 are - owner-only and 3 are noise; 44 in all. Every rule names its check and its +* 24 rules are first-line (20 `FIX`, 4 `ACT`), 2 are referrals, 16 are + owner-only and 3 are noise; 45 in all. Every rule names its check and its referral condition. * A fix that changes code (`SQ-CODE-nn`) is first-line only when the code-fix guard passes on its diff, so a fix that could weaken a check never runs at