Skip to content

Commit deff224

Browse files
cliffhallclaude
andcommitted
docs: the Python audit fails when a server was not audited; name packages: write in the gate reference
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 2c81413 commit deff224

2 files changed

Lines changed: 24 additions & 15 deletions

File tree

‎.claude/skills/release/SKILL.md‎

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,31 @@ npm audit --audit-level=high
8282

8383
# Python: each server has its own lockfile. `uv` has no audit of its own in the
8484
# version pinned here, so the locked requirements go through pip-audit.
85-
# Exported to a file first, and stopped on a failed export: piped straight in,
86-
# a failed `uv export` hands pip-audit empty input, which it reports as clean.
87-
for s in fetch git time; do
88-
echo "== $s"
89-
REQ=$(mktemp)
90-
if (cd "src/$s" && uv export --frozen --no-emit-project --format requirements-txt) > "$REQ" \
91-
&& [ -s "$REQ" ]; then
92-
uvx pip-audit --require-hashes --disable-pip -r "$REQ"
93-
else
94-
echo "EXPORT FAILED for $s: nothing was audited" >&2
95-
fi
96-
rm -f "$REQ"
97-
done
85+
# Exported to a file first: piped straight in, a failed `uv export` hands
86+
# pip-audit empty input, which it reports as clean. The block runs in a
87+
# subshell that exits non-zero if any server could not be exported, so an
88+
# unaudited server cannot pass as an audited one.
89+
(
90+
unaudited=
91+
for s in fetch git time; do
92+
echo "== $s"
93+
REQ=$(mktemp)
94+
if (cd "src/$s" && uv export --frozen --no-emit-project --format requirements-txt) > "$REQ" \
95+
&& [ -s "$REQ" ]; then
96+
uvx pip-audit --require-hashes --disable-pip -r "$REQ"
97+
else
98+
echo "EXPORT FAILED for $s: nothing was audited" >&2
99+
unaudited="$unaudited $s"
100+
fi
101+
rm -f "$REQ"
102+
done
103+
[ -z "$unaudited" ] || { echo "NOT AUDITED:$unaudited" >&2; exit 1; }
104+
); echo "python audit complete: EXIT=$?"
98105
```
99106

100-
**This step is a report.** Read it; do not let a tool rewrite the tree.
107+
**This step is a report.** Read it; do not let a tool rewrite the tree. The
108+
`EXIT=` line says whether every Python server was audited, not whether the
109+
audit was clean: `pip-audit`'s findings are in the output above it.
101110

102111
⚠️ **Never `npm audit fix`**, with or without `--force`. `AGENTS.md`
103112
**Dependencies** rules it out: it resolves an advisory that has no upward

‎docs/quality-gate.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ covers: the repo-wide tooling and the guards that keep the gate itself honest.
8383
| `verify:typecheck-coverage` | A tracked TypeScript file lands in no `tsc` program |
8484
| `verify:dep-lockstep` | Two workspaces declare different ranges of a shared toolchain package |
8585
| `verify:no-test-retries` | A test declares a retry (Vitest's `retry`, a pytest rerun plugin or marker) |
86-
| `verify:action-pins` | A job that holds a credential (`id-token: write`, a secret other than `GITHUB_TOKEN`), or whose artifact such a job downloads, uses an action that is not pinned to a commit SHA with a `# vX.Y.Z` comment |
86+
| `verify:action-pins` | A job that holds a credential (`id-token: write`, `packages: write`, a secret other than `GITHUB_TOKEN`), or whose artifact such a job downloads, uses an action that is not pinned to a commit SHA with a `# vX.Y.Z` comment |
8787
| `test:scripts` | A guard's own unit tests fail. These include the workflow guard: a workflow invokes a `local:*` script, a CI job has no `timeout-minutes`, or `local:gate` is no longer exactly the lease wrapper around stages that include every check above |
8888

8989
## What is in neither tier

0 commit comments

Comments
 (0)