Severity: High · Domain: CI / hooks
Merges 4 git-hook / CI hygiene findings under one tracking item.
Sub-findings rollup
| # |
Description |
Location |
| 1 |
pre-commit uses unquoted $STAGED_RS + grep; files with spaces or glob characters get word-split |
scripts/hooks/pre-commit:25-30 |
| 2 |
The openapi-sha check in pre-commit only calls shasum; no fallback on sha256sum-only environments (typical Linux dev boxes) |
scripts/hooks/pre-commit (openapi-sha section) |
| 3 |
CLAUDE.md and scripts/hooks/ describe a pre-push hook, but no such file exists in the repo — docs and reality disagree |
CLAUDE.md, scripts/hooks/ |
| 4 |
.secrets.baseline exists but CI never calls detect-secrets; only pre-commit soft-warns |
.github/workflows/, .secrets.baseline |
Why merged
All four are git-hook / CI hygiene items concentrated in scripts/hooks/ + .github/workflows/; a single sweep is more efficient than 4 separate PRs.
Combined fix plan
- NUL-delimited xargs for the rustfmt staged-files loop:
git diff --cached --name-only --diff-filter=ACM -z \
| grep -z '\.rs$' \
| xargs -0 -r rustfmt --check --edition 2021
- shasum / sha256sum interop:
sha256() { command -v sha256sum >/dev/null && sha256sum "$@" || shasum -a 256 "$@"; }
pre-push file: either actually implement pre-push and commit it to scripts/hooks/pre-push (preferred — runs cargo clippy --workspace --all-targets -- -D warnings + openapi/SDK drift), or delete its description from CLAUDE.md.
- Wire detect-secrets into CI: add
.github/workflows/secrets.yml running detect-secrets scan --baseline .secrets.baseline; fail the PR on diff.
Tests
scripts/tests/pre-commit-spaces.sh: stage with space.rs containing bad formatting; the hook rejects.
scripts/tests/pre-commit-sha-fallback.sh: mock shasum out of PATH → openapi check still runs.
pre-push file exists + CI assertion.
- A deliberate secret-bearing commit makes the secrets workflow fail.
Severity: High · Domain: CI / hooks
Merges 4 git-hook / CI hygiene findings under one tracking item.
Sub-findings rollup
pre-commituses unquoted$STAGED_RS+grep; files with spaces or glob characters get word-splitscripts/hooks/pre-commit:25-30pre-commitonly callsshasum; no fallback onsha256sum-only environments (typical Linux dev boxes)scripts/hooks/pre-commit(openapi-sha section)CLAUDE.mdandscripts/hooks/describe apre-pushhook, but no such file exists in the repo — docs and reality disagreeCLAUDE.md,scripts/hooks/.secrets.baselineexists but CI never callsdetect-secrets; onlypre-commitsoft-warns.github/workflows/,.secrets.baselineWhy merged
All four are git-hook / CI hygiene items concentrated in
scripts/hooks/+.github/workflows/; a single sweep is more efficient than 4 separate PRs.Combined fix plan
pre-pushfile: either actually implementpre-pushand commit it toscripts/hooks/pre-push(preferred — runscargo clippy --workspace --all-targets -- -D warnings+ openapi/SDK drift), or delete its description fromCLAUDE.md..github/workflows/secrets.ymlrunningdetect-secrets scan --baseline .secrets.baseline; fail the PR on diff.Tests
scripts/tests/pre-commit-spaces.sh: stagewith space.rscontaining bad formatting; the hook rejects.scripts/tests/pre-commit-sha-fallback.sh: mockshasumout ofPATH→ openapi check still runs.pre-pushfile exists + CI assertion.