@biffo/cli 0.402.0 → 0.403.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_skeletons/plugin-template/.github/workflows/ci.yml +4 -0
- package/_skeletons/plugin-template/.github/workflows/release.yml +4 -0
- package/_skeletons/plugin-template/scripts/py-dependency-audit-classification.test.sh +24 -0
- package/_skeletons/plugin-template/scripts/py-dependency-audit.sh +23 -3
- package/_skeletons/sibling-template/.github/workflows/ci.yml +4 -0
- package/_skeletons/sibling-template/.github/workflows/deploy.yml +4 -0
- package/_skeletons/sibling-template/scripts/py-dependency-audit-classification.test.sh +24 -0
- package/_skeletons/sibling-template/scripts/py-dependency-audit.sh +23 -3
- package/package.json +1 -1
|
@@ -29,6 +29,10 @@ concurrency:
|
|
|
29
29
|
|
|
30
30
|
env:
|
|
31
31
|
PYTHON_VERSION: '3.13'
|
|
32
|
+
# uv reads UV_PYTHON (or .python-version), never PYTHON_VERSION: without this an
|
|
33
|
+
# unpinned setup-uv resolves the newest CPython (3.15 on 2026-10-10), where
|
|
34
|
+
# pip-audit segfaults and the greenlet stack fails (biffo-plugin-marketing#218).
|
|
35
|
+
UV_PYTHON: '3.13'
|
|
32
36
|
# Matches biffo-template's own root ci.yml NODE_VERSION (#2009) — the
|
|
33
37
|
# `frontend` job below is the only consumer of this in the skeleton today.
|
|
34
38
|
NODE_VERSION: '22'
|
|
@@ -71,6 +71,10 @@ permissions:
|
|
|
71
71
|
|
|
72
72
|
env:
|
|
73
73
|
PYTHON_VERSION: '3.13'
|
|
74
|
+
# uv reads UV_PYTHON (or .python-version), never PYTHON_VERSION: without this an
|
|
75
|
+
# unpinned setup-uv resolves the newest CPython (3.15 on 2026-10-10), where
|
|
76
|
+
# pip-audit segfaults and the greenlet stack fails (biffo-plugin-marketing#218).
|
|
77
|
+
UV_PYTHON: '3.13'
|
|
74
78
|
|
|
75
79
|
jobs:
|
|
76
80
|
release:
|
|
@@ -43,6 +43,13 @@ FAILURES=0
|
|
|
43
43
|
cat > "$STUB_DIR/uv" <<'STUB'
|
|
44
44
|
#!/usr/bin/env sh
|
|
45
45
|
if [ "$1" = "run" ] && [ "$2" = "pip-audit" ]; then
|
|
46
|
+
# A crash scenario: nothing on stdout, a fatal error on stderr, the shell's
|
|
47
|
+
# status for a process killed by SIGSEGV -- what pip-audit did on CPython
|
|
48
|
+
# 3.15 (biffo-plugin-marketing#218).
|
|
49
|
+
if [ -n "${PIPAUDIT_STUB_CRASH:-}" ]; then
|
|
50
|
+
echo "Fatal Python error: Segmentation fault" >&2
|
|
51
|
+
exit 139
|
|
52
|
+
fi
|
|
46
53
|
cat "$PIPAUDIT_STUB_OUTPUT"
|
|
47
54
|
exit 0
|
|
48
55
|
fi
|
|
@@ -274,6 +281,23 @@ _stage_clean
|
|
|
274
281
|
_run dev
|
|
275
282
|
_assert_exit "clean run unaffected" 0
|
|
276
283
|
|
|
284
|
+
# 8. pip-audit CRASHES (a segfault before any output) on every attempt. Must
|
|
285
|
+
# fail closed (INCONCLUSIVE, exit 2), and the failure must carry the exit
|
|
286
|
+
# status and the first stderr line -- with stderr and the status discarded,
|
|
287
|
+
# a crash read exactly like a registry fault and the diagnosis went looking
|
|
288
|
+
# at the network (biffo-plugin-marketing#218).
|
|
289
|
+
_init_repo "26.1.2" "26.1.2" pip
|
|
290
|
+
_stage_finding pip 26.1.2
|
|
291
|
+
PIPAUDIT_STUB_CRASH=1
|
|
292
|
+
export PIPAUDIT_STUB_CRASH
|
|
293
|
+
_run dev
|
|
294
|
+
unset PIPAUDIT_STUB_CRASH
|
|
295
|
+
_assert_exit "pip-audit crash fails closed" 2
|
|
296
|
+
_assert_output_contains "crash names the tree as unaudited" "INCONCLUSIVE"
|
|
297
|
+
_assert_output_contains "crash reports pip-audit's exit status" "pip-audit last exited 139"
|
|
298
|
+
_assert_output_contains "crash names it as a signal, not a network fault" "killed by signal 11"
|
|
299
|
+
_assert_output_contains "crash carries the first stderr line" "Fatal Python error: Segmentation fault"
|
|
300
|
+
|
|
277
301
|
# ============================================================================
|
|
278
302
|
# uv WORKSPACE MEMBERS (#2120). The export and the classification must read
|
|
279
303
|
# the SAME lockfile. `uv export` run inside a workspace member resolves the
|
|
@@ -198,9 +198,21 @@ audit_deps() {
|
|
|
198
198
|
extra="$2"
|
|
199
199
|
lockfile_relpath="$3"
|
|
200
200
|
|
|
201
|
+
last_rc=""
|
|
202
|
+
last_err=""
|
|
201
203
|
for attempt in $(seq 1 "$attempts"); do
|
|
204
|
+
# stderr and the exit status are kept, not discarded: with them thrown away
|
|
205
|
+
# (`2>/dev/null`), a pip-audit that segfaulted on CPython 3.15 before
|
|
206
|
+
# printing a byte read exactly like a registry that returned junk
|
|
207
|
+
# ("no parseable JSON output"), and the fix went looking at the network
|
|
208
|
+
# (biffo-plugin-marketing#218, 2026-10-10). Only the first lines of stderr
|
|
209
|
+
# are reported, and only when the JSON is unusable.
|
|
210
|
+
err_file="$(mktemp)"
|
|
202
211
|
# shellcheck disable=SC2086
|
|
203
|
-
out="$(uv run pip-audit -f json $extra 2
|
|
212
|
+
out="$(uv run pip-audit -f json $extra 2>"$err_file")"
|
|
213
|
+
rc=$?
|
|
214
|
+
err_head="$(head -n 5 "$err_file" | tr '\n' ' ' | cut -c1-400)"
|
|
215
|
+
rm -f "$err_file"
|
|
204
216
|
# Stamped when the advisory source answered, not when the run started —
|
|
205
217
|
# pip-audit queries PyPI/OSV live, so its verdict is time-dependent in the
|
|
206
218
|
# same way pnpm audit's is (#1269). Without the stamp a pass cannot be
|
|
@@ -269,11 +281,19 @@ audit_deps() {
|
|
|
269
281
|
return 0
|
|
270
282
|
fi
|
|
271
283
|
|
|
272
|
-
|
|
284
|
+
last_rc=$rc
|
|
285
|
+
last_err=$err_head
|
|
286
|
+
echo "${label}: attempt ${attempt}/${attempts} produced no parseable JSON output (pip-audit exited ${rc}${err_head:+; stderr: ${err_head}})."
|
|
273
287
|
[ "$attempt" -lt "$attempts" ] && sleep "$((attempt * 3))"
|
|
274
288
|
done
|
|
275
289
|
|
|
276
|
-
|
|
290
|
+
# An exit status above 128 is a signal: the tool crashed (139 is SIGSEGV),
|
|
291
|
+
# which is a broken interpreter or package, not a network fault -- say so,
|
|
292
|
+
# so nobody re-runs it hoping the registry recovers.
|
|
293
|
+
if [ -n "$last_rc" ] && [ "$last_rc" -gt 128 ]; then
|
|
294
|
+
echo "::error::${label}: pip-audit was killed by signal $((last_rc - 128)) (exit ${last_rc}) on every attempt -- it crashed before printing anything. Check which Python uv resolved (an unpinned setup-uv picked CPython 3.15 on 2026-10-10, where pip-audit segfaults); a .python-version or UV_PYTHON pins it.${last_err:+ stderr: ${last_err}}"
|
|
295
|
+
fi
|
|
296
|
+
echo "::error::${label}: could not produce parseable output after ${attempts} attempts (pip-audit last exited ${last_rc:-unknown}${last_err:+; stderr: ${last_err}}). Advisory scanning was NOT performed for this tree, so this is INCONCLUSIVE and BLOCKS — a gate that cannot see its input must not report clean (#1269, #591). If this is a missing tool rather than a network fault, the fix is to declare it: biffo-plugin-ideation rode this path on every run, permanently green while scanning nothing."
|
|
277
297
|
inconclusive=$((inconclusive + 1))
|
|
278
298
|
return 0
|
|
279
299
|
}
|
|
@@ -27,6 +27,10 @@ concurrency:
|
|
|
27
27
|
env:
|
|
28
28
|
NODE_VERSION: '22'
|
|
29
29
|
PYTHON_VERSION: '3.13'
|
|
30
|
+
# uv reads UV_PYTHON (or .python-version), never PYTHON_VERSION: without this an
|
|
31
|
+
# unpinned setup-uv resolves the newest CPython (3.15 on 2026-10-10), where
|
|
32
|
+
# pip-audit segfaults and the greenlet stack fails (biffo-plugin-marketing#218).
|
|
33
|
+
UV_PYTHON: '3.13'
|
|
30
34
|
# Defence in depth for the class of bug in #322: an interactive Terraform
|
|
31
35
|
# prompt on a CI runner has no stdin to read and blocks until the job is
|
|
32
36
|
# killed. Every invocation also passes -input=false explicitly and a drift
|
|
@@ -34,6 +34,10 @@ permissions:
|
|
|
34
34
|
|
|
35
35
|
env:
|
|
36
36
|
NODE_VERSION: '22'
|
|
37
|
+
# uv reads UV_PYTHON (or .python-version), never PYTHON_VERSION: without this an
|
|
38
|
+
# unpinned setup-uv resolves the newest CPython (3.15 on 2026-10-10), where
|
|
39
|
+
# pip-audit segfaults and the greenlet stack fails (biffo-plugin-marketing#218).
|
|
40
|
+
UV_PYTHON: '3.13'
|
|
37
41
|
TERRAFORM_VERSION: '~> 1.9'
|
|
38
42
|
# Defence in depth for the class of bug in #322: an interactive Terraform
|
|
39
43
|
# prompt on a CI runner has no stdin to read and blocks until the job is
|
|
@@ -43,6 +43,13 @@ FAILURES=0
|
|
|
43
43
|
cat > "$STUB_DIR/uv" <<'STUB'
|
|
44
44
|
#!/usr/bin/env sh
|
|
45
45
|
if [ "$1" = "run" ] && [ "$2" = "pip-audit" ]; then
|
|
46
|
+
# A crash scenario: nothing on stdout, a fatal error on stderr, the shell's
|
|
47
|
+
# status for a process killed by SIGSEGV -- what pip-audit did on CPython
|
|
48
|
+
# 3.15 (biffo-plugin-marketing#218).
|
|
49
|
+
if [ -n "${PIPAUDIT_STUB_CRASH:-}" ]; then
|
|
50
|
+
echo "Fatal Python error: Segmentation fault" >&2
|
|
51
|
+
exit 139
|
|
52
|
+
fi
|
|
46
53
|
cat "$PIPAUDIT_STUB_OUTPUT"
|
|
47
54
|
exit 0
|
|
48
55
|
fi
|
|
@@ -274,6 +281,23 @@ _stage_clean
|
|
|
274
281
|
_run dev
|
|
275
282
|
_assert_exit "clean run unaffected" 0
|
|
276
283
|
|
|
284
|
+
# 8. pip-audit CRASHES (a segfault before any output) on every attempt. Must
|
|
285
|
+
# fail closed (INCONCLUSIVE, exit 2), and the failure must carry the exit
|
|
286
|
+
# status and the first stderr line -- with stderr and the status discarded,
|
|
287
|
+
# a crash read exactly like a registry fault and the diagnosis went looking
|
|
288
|
+
# at the network (biffo-plugin-marketing#218).
|
|
289
|
+
_init_repo "26.1.2" "26.1.2" pip
|
|
290
|
+
_stage_finding pip 26.1.2
|
|
291
|
+
PIPAUDIT_STUB_CRASH=1
|
|
292
|
+
export PIPAUDIT_STUB_CRASH
|
|
293
|
+
_run dev
|
|
294
|
+
unset PIPAUDIT_STUB_CRASH
|
|
295
|
+
_assert_exit "pip-audit crash fails closed" 2
|
|
296
|
+
_assert_output_contains "crash names the tree as unaudited" "INCONCLUSIVE"
|
|
297
|
+
_assert_output_contains "crash reports pip-audit's exit status" "pip-audit last exited 139"
|
|
298
|
+
_assert_output_contains "crash names it as a signal, not a network fault" "killed by signal 11"
|
|
299
|
+
_assert_output_contains "crash carries the first stderr line" "Fatal Python error: Segmentation fault"
|
|
300
|
+
|
|
277
301
|
# ============================================================================
|
|
278
302
|
# uv WORKSPACE MEMBERS (#2120). The export and the classification must read
|
|
279
303
|
# the SAME lockfile. `uv export` run inside a workspace member resolves the
|
|
@@ -198,9 +198,21 @@ audit_deps() {
|
|
|
198
198
|
extra="$2"
|
|
199
199
|
lockfile_relpath="$3"
|
|
200
200
|
|
|
201
|
+
last_rc=""
|
|
202
|
+
last_err=""
|
|
201
203
|
for attempt in $(seq 1 "$attempts"); do
|
|
204
|
+
# stderr and the exit status are kept, not discarded: with them thrown away
|
|
205
|
+
# (`2>/dev/null`), a pip-audit that segfaulted on CPython 3.15 before
|
|
206
|
+
# printing a byte read exactly like a registry that returned junk
|
|
207
|
+
# ("no parseable JSON output"), and the fix went looking at the network
|
|
208
|
+
# (biffo-plugin-marketing#218, 2026-10-10). Only the first lines of stderr
|
|
209
|
+
# are reported, and only when the JSON is unusable.
|
|
210
|
+
err_file="$(mktemp)"
|
|
202
211
|
# shellcheck disable=SC2086
|
|
203
|
-
out="$(uv run pip-audit -f json $extra 2
|
|
212
|
+
out="$(uv run pip-audit -f json $extra 2>"$err_file")"
|
|
213
|
+
rc=$?
|
|
214
|
+
err_head="$(head -n 5 "$err_file" | tr '\n' ' ' | cut -c1-400)"
|
|
215
|
+
rm -f "$err_file"
|
|
204
216
|
# Stamped when the advisory source answered, not when the run started —
|
|
205
217
|
# pip-audit queries PyPI/OSV live, so its verdict is time-dependent in the
|
|
206
218
|
# same way pnpm audit's is (#1269). Without the stamp a pass cannot be
|
|
@@ -269,11 +281,19 @@ audit_deps() {
|
|
|
269
281
|
return 0
|
|
270
282
|
fi
|
|
271
283
|
|
|
272
|
-
|
|
284
|
+
last_rc=$rc
|
|
285
|
+
last_err=$err_head
|
|
286
|
+
echo "${label}: attempt ${attempt}/${attempts} produced no parseable JSON output (pip-audit exited ${rc}${err_head:+; stderr: ${err_head}})."
|
|
273
287
|
[ "$attempt" -lt "$attempts" ] && sleep "$((attempt * 3))"
|
|
274
288
|
done
|
|
275
289
|
|
|
276
|
-
|
|
290
|
+
# An exit status above 128 is a signal: the tool crashed (139 is SIGSEGV),
|
|
291
|
+
# which is a broken interpreter or package, not a network fault -- say so,
|
|
292
|
+
# so nobody re-runs it hoping the registry recovers.
|
|
293
|
+
if [ -n "$last_rc" ] && [ "$last_rc" -gt 128 ]; then
|
|
294
|
+
echo "::error::${label}: pip-audit was killed by signal $((last_rc - 128)) (exit ${last_rc}) on every attempt -- it crashed before printing anything. Check which Python uv resolved (an unpinned setup-uv picked CPython 3.15 on 2026-10-10, where pip-audit segfaults); a .python-version or UV_PYTHON pins it.${last_err:+ stderr: ${last_err}}"
|
|
295
|
+
fi
|
|
296
|
+
echo "::error::${label}: could not produce parseable output after ${attempts} attempts (pip-audit last exited ${last_rc:-unknown}${last_err:+; stderr: ${last_err}}). Advisory scanning was NOT performed for this tree, so this is INCONCLUSIVE and BLOCKS — a gate that cannot see its input must not report clean (#1269, #591). If this is a missing tool rather than a network fault, the fix is to declare it: biffo-plugin-ideation rode this path on every run, permanently green while scanning nothing."
|
|
277
297
|
inconclusive=$((inconclusive + 1))
|
|
278
298
|
return 0
|
|
279
299
|
}
|