From 08020018f24ca1550008067506699fe3d71157d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 09:28:34 +0000 Subject: [PATCH] SQ-GEN-05: the fix and the check say the same thing about the full-history scan Follow-up to #163, which merged before this refinement. CodeRabbit's finding was right that the check read as any-one-of while the fix read as all three; the right rule is neither: the fix can only keep the non-PR triggers the scan already has, and at least one must remain (else it is a referral, already in the refer-when). Both columns, in the TSV and the ADR, now say that. 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 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/squabble-core/data/first-line-rules.tsv b/crates/squabble-core/data/first-line-rules.tsv index 4eef618..cc01f24 100644 --- a/crates/squabble-core/data/first-line-rules.tsv +++ b/crates/squabble-core/data/first-line-rules.tsv @@ -31,7 +31,7 @@ SQ-GEN-01 FIX estate-rules reports the committed REPOSITORY-MAP.adoc is stale Ru 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-GEN-05 FIX a gitleaks job on a pull_request run scans the full history (fetch-depth: 0, no range) and fails on a finding that is not in the PR's own commits (Hypatia WF031; gitbot-fleet run 43430810006: 551 commits scanned, 1 leak, verdict 1; the next run on the branch, 43438916211, passed) Scan base..head on pull_request and keep a full-history scan on schedule, workflow_dispatch and push to the default branch; never remove the full-history scan; report a finding that predates the PR to the owner gitleaks over base..head passes on the PR, the full-history scan is still triggered on schedule, dispatch or the default branch, and the older finding is reported, not hidden The finding is inside base..head (a real secret the PR adds), no full-history scan would remain, or the workflow is vendored or third-party +SQ-GEN-05 FIX a gitleaks job on a pull_request run scans the full history (fetch-depth: 0, no range) and fails on a finding that is not in the PR's own commits (Hypatia WF031; gitbot-fleet run 43430810006: 551 commits scanned, 1 leak, verdict 1; the next run on the branch, 43438916211, passed) Scan base..head on pull_request and keep the full-history scan on every non-PR trigger it already has (schedule, workflow_dispatch, push to the default branch); never remove it; report a finding that predates the PR to the owner gitleaks over base..head passes on the PR, the full-history scan still runs on each non-PR trigger it had before and at least one remains, and the older finding is reported, not hidden The finding is inside base..head (a real secret the PR adds), no full-history scan would remain, or the workflow is vendored or third-party 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 diff --git a/docs/decisions/0004-first-line-rule-catalogue.adoc b/docs/decisions/0004-first-line-rule-catalogue.adoc index 3853c6d..d51fb2c 100644 --- a/docs/decisions/0004-first-line-rule-catalogue.adoc +++ b/docs/decisions/0004-first-line-rule-catalogue.adoc @@ -150,8 +150,8 @@ holds, or when its check does not pass on the PR head. | SQ-GEN-05 | FIX | A gitleaks job on a `pull_request` run scans the full history (`fetch-depth: 0` and no range) and fails on a finding that is not in the PR's own commits. Seen in gitbot-fleet run 43430810006 (`scan / gitleaks`: 551 commits scanned, 1 leak, verdict 1); the next run on the same branch, 43438916211, passed. Detection is Hypatia WF031, a static workflow rule; this row only fixes it. -| Scan `base..head` on `pull_request`, and keep a full-history scan on `schedule`, `workflow_dispatch` and push to the default branch. Never remove the full-history scan. Report a finding that predates the PR to the owner; it is not hidden by the narrower range. -| `gitleaks` over `base..head` passes on the PR, the full-history scan is still triggered on schedule, dispatch or the default branch, and the older finding is reported. +| Scan `base..head` on `pull_request`, and keep the full-history scan on every non-PR trigger it already has (`schedule`, `workflow_dispatch`, push to the default branch). Never remove it. Report a finding that predates the PR to the owner; it is not hidden by the narrower range. +| `gitleaks` over `base..head` passes on the PR, the full-history scan still runs on each non-PR trigger it had before and at least one remains, and the older finding is reported. | The finding is inside `base..head` (a real secret that the PR adds), no full-history scan would remain, or the workflow is vendored or third-party. | SQ-CANON-01 | FIX