@biffo/cli 0.298.8 → 0.298.10

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.
@@ -85,6 +85,25 @@ jobs:
85
85
  # measure.
86
86
  - name: Error-branch coverage
87
87
  run: uv run python scripts/error_branch_coverage.py --check --coverage coverage.json
88
+ - name: Routing smoke test — self-test
89
+ if: ${{ !cancelled() }}
90
+ # scripts/routing-smoke-test.sh is distributed here too, verbatim,
91
+ # via shared-files.json's `files` — but a plugin repo has no
92
+ # deploy.yml and no CDN of its own to smoke-test the way the sibling
93
+ # skeleton's deploy.yml does post-deploy. Until #1710, that meant
94
+ # this file had NO caller anywhere in this skeleton's CI, despite
95
+ # shipping 8 real scenarios (good deploy, CDN no-op, prefix
96
+ # mismatch, bare-path-broken, unreachable/fail-closed, unset-prefix
97
+ # fail-closed, unset-base-url fail-closed, root-sibling unproven) —
98
+ # exactly the #1413 zero-caller shape, invisible to
99
+ # scripts/guard-self-test-wiring.sh because that audit only reaches
100
+ # this template repo's own root-level scripts/, never
101
+ # _skeletons/**. This is that caller, same reasoning as the
102
+ # Core-revision preflight self-test below: it proves the script
103
+ # itself still catches the three recorded CDN routing failures and
104
+ # fails CLOSED when it cannot tell, against a stubbed curl, even
105
+ # though nothing in this repo ever runs it for a REAL deployment.
106
+ run: sh scripts/routing-smoke-test.test.sh
88
107
  - name: Core-revision preflight — self-test
89
108
  if: ${{ !cancelled() }}
90
109
  # scripts/core-revision-preflight.sh (biffo-template#1604) is
@@ -100,6 +119,53 @@ jobs:
100
119
  # py-dependency-audit.sh already carry as inert-but-verified copies
101
120
  # in a Python-only or JS-only sibling.
102
121
  run: sh scripts/core-revision-preflight.test.sh
122
+ - name: Guard self-test wiring — this repo's own scripts/*.test.sh
123
+ if: ${{ !cancelled() }}
124
+ # Level-3 self-audit (biffo-template#1710): the template repo's own
125
+ # scripts/guard-self-test-wiring.sh globs its OWN root-level
126
+ # scripts/*.test.sh with `find -maxdepth 1`, so it structurally
127
+ # cannot reach a skeleton's copy of that discipline — which is
128
+ # exactly how routing-smoke-test.test.sh sat in this file with zero
129
+ # callers, undetected, until #1710. Rather than teach that script to
130
+ # walk into _skeletons/** (which would require editing it, and would
131
+ # still only cover the TEMPLATE repo, never a repo already
132
+ # scaffolded from this skeleton), this repo checks ITSELF, so a
133
+ # plugin generated from this skeleton fails closed from birth if a
134
+ # future *.test.sh guard is added here with no run: line anywhere.
135
+ # Residual: this step protects repos generated FROM this skeleton
136
+ # going forward; it does not give biffo-template's own CI a way to
137
+ # verify a skeleton's wiring before it is ever scaffolded out — that
138
+ # remains scripts/guard-self-test-wiring.sh's gap, tracked as the
139
+ # named residual on #1710.
140
+ run: |
141
+ set -eu
142
+ guards=$(find scripts -maxdepth 1 -type f -name '*.test.sh' | sort)
143
+ if [ -z "$guards" ]; then
144
+ echo "FAIL: found 0 scripts/*.test.sh — an empty discovery is not a vacuous pass." >&2
145
+ exit 1
146
+ fi
147
+ missing=0
148
+ for g in $guards; do
149
+ name=$(basename "$g")
150
+ found=0
151
+ for wf in .github/workflows/*.yml .github/workflows/*.yaml; do
152
+ [ -f "$wf" ] || continue
153
+ if grep -v '^[[:space:]]*#' "$wf" | grep -q "$name"; then
154
+ found=1
155
+ fi
156
+ done
157
+ if [ "$found" -eq 1 ]; then
158
+ echo "OK: $name has a caller in .github/workflows/"
159
+ else
160
+ echo "MISSING CALLER: $name has no run: line anywhere in .github/workflows/" >&2
161
+ missing=1
162
+ fi
163
+ done
164
+ if [ "$missing" -ne 0 ]; then
165
+ echo "FAIL: at least one scripts/*.test.sh guard has zero callers." >&2
166
+ exit 1
167
+ fi
168
+ echo "PASS: every scripts/*.test.sh guard in this repo has a caller."
103
169
  - uses: codecov/codecov-action@v5
104
170
  if: always()
105
171
  with:
@@ -259,6 +259,59 @@ jobs:
259
259
  # is missing, against a stubbed curl. Without this caller the script
260
260
  # is the #1413 zero-caller class the instant it lands.
261
261
  run: sh ../../scripts/core-revision-preflight.test.sh
262
+ - name: Guard self-test wiring — this repo's own scripts/*.test.sh
263
+ if: ${{ !cancelled() }}
264
+ working-directory: .
265
+ # Level-3 self-audit (biffo-template#1710): the template repo's own
266
+ # scripts/guard-self-test-wiring.sh globs its OWN root-level
267
+ # scripts/*.test.sh with `find -maxdepth 1`, so it structurally
268
+ # cannot reach a skeleton's copy of that discipline — which is
269
+ # exactly how the plugin skeleton's routing-smoke-test.test.sh sat
270
+ # unwired, undetected, until #1710 (this skeleton's own copy IS
271
+ # correctly wired above; this step is what keeps the NEXT one from
272
+ # repeating that). Explicit `working-directory: .` overrides this
273
+ # job's `defaults.run.working-directory: services/api`, because the
274
+ # scripts and workflows being audited live at the repo root, not
275
+ # under services/api. Rather than teach the template's script to
276
+ # walk into _skeletons/** (which would still only cover the
277
+ # TEMPLATE repo, never a repo already scaffolded from this
278
+ # skeleton), this repo checks ITSELF, so a sibling generated from
279
+ # this skeleton fails closed from birth if a future *.test.sh guard
280
+ # is added with no run: line anywhere. Residual: this step protects
281
+ # repos generated FROM this skeleton going forward; it does not
282
+ # give biffo-template's own CI a way to verify a skeleton's wiring
283
+ # before it is ever scaffolded out — that remains
284
+ # scripts/guard-self-test-wiring.sh's gap, tracked as the named
285
+ # residual on #1710.
286
+ run: |
287
+ set -eu
288
+ guards=$(find scripts -maxdepth 1 -type f -name '*.test.sh' | sort)
289
+ if [ -z "$guards" ]; then
290
+ echo "FAIL: found 0 scripts/*.test.sh — an empty discovery is not a vacuous pass." >&2
291
+ exit 1
292
+ fi
293
+ missing=0
294
+ for g in $guards; do
295
+ name=$(basename "$g")
296
+ found=0
297
+ for wf in .github/workflows/*.yml .github/workflows/*.yaml; do
298
+ [ -f "$wf" ] || continue
299
+ if grep -v '^[[:space:]]*#' "$wf" | grep -q "$name"; then
300
+ found=1
301
+ fi
302
+ done
303
+ if [ "$found" -eq 1 ]; then
304
+ echo "OK: $name has a caller in .github/workflows/"
305
+ else
306
+ echo "MISSING CALLER: $name has no run: line anywhere in .github/workflows/" >&2
307
+ missing=1
308
+ fi
309
+ done
310
+ if [ "$missing" -ne 0 ]; then
311
+ echo "FAIL: at least one scripts/*.test.sh guard has zero callers." >&2
312
+ exit 1
313
+ fi
314
+ echo "PASS: every scripts/*.test.sh guard in this repo has a caller."
262
315
 
263
316
  security-secrets:
264
317
  name: Secret Scan
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.298.8",
3
+ "version": "0.298.10",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/scripts/verify.sh CHANGED
@@ -600,6 +600,49 @@ skip() {
600
600
  # inconclusive instead. So the check DOES run, and only a genuine
601
601
  # "the binary named in the script is not there" signature in its own output
602
602
  # is reclassified -- a real lint/type/format finding still reads as FAILED.
603
+ #
604
+ # ## Why the signature is pnpm's own diagnosis, not a generic shell phrase
605
+ # (biffo-template#1712)
606
+ #
607
+ # The pattern used to also match a plain `sh: 1: <x>: not found$` / bare
608
+ # `command not found` -- generic shell phrasing ANY subprocess a check shells
609
+ # out to can print verbatim while the check itself fails for a real,
610
+ # unrelated reason (a linter reporting on a missing optional plugin binary in
611
+ # the same run where it also reports a genuine lint violation, say). Because
612
+ # the grep runs over the check's WHOLE captured stdout+stderr, that unrelated
613
+ # line was enough to reclassify a real FAILED as INCONCLUSIVE -- discarding
614
+ # the actual finding (the FAILED branch is the only one that prints the
615
+ # tail) and printing "run pnpm install" as the fix for a toolchain that was
616
+ # never missing.
617
+ #
618
+ # It is tempting to narrow this to pnpm's OWN recursive-exec vocabulary --
619
+ # `ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL` / `Command "<x>" not found` -- on the
620
+ # theory that those strings are pnpm's, not a subprocess's. Measured directly
621
+ # against the pnpm this repo actually pins (`packageManager` in
622
+ # package.json, 9.15.9) that theory is false for the #1497 case this file
623
+ # exists to catch: a plain `pnpm run format:check` in a fresh worktree with
624
+ # no `node_modules` prints neither string. It prints `sh: 1: prettier: not
625
+ # found` (the shell's own generic message, exactly the phrase this section
626
+ # is otherwise removing) followed by a line pnpm itself always adds when a
627
+ # script fails with no local `node_modules`:
628
+ #
629
+ # WARN Local package.json exists, but node_modules missing, did you mean to install?
630
+ #
631
+ # Confirmed by direct experiment, not by reading pnpm's source: this WARN
632
+ # line appears whenever the invoked script exits non-zero AND node_modules
633
+ # is absent -- regardless of *why* the script failed (a missing binary, or a
634
+ # real assertion failure in a script that needed no installed binary at
635
+ # all) -- and it never appears when node_modules is present, or when the
636
+ # script succeeds. So within THIS elif (already gated on a non-zero exit) it
637
+ # is the precise signal for "this failure happened in a directory this file
638
+ # has already decided (see the `have_script` comment above) it will not
639
+ # pre-flight-refuse to attempt" -- unlike `command not found`/`: not found$`,
640
+ # it is pnpm's own text, never a phrase an unrelated subprocess can emit on
641
+ # its own, so it cannot be tripped by noise elsewhere in the captured
642
+ # output. `ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL` and pnpm's own
643
+ # `Command "<x>" not found` are kept alongside it for the recursive-workspace
644
+ # invocation shape neither this repo's checks nor a direct experiment could
645
+ # exercise, but which the original #1497 report described.
603
646
  run_check_js() {
604
647
  name="$1"
605
648
  shift
@@ -612,7 +655,7 @@ run_check_js() {
612
655
  PASSED="$PASSED $name"
613
656
  LAST_CHECK_SECONDS=$(($(date +%s) - start))
614
657
  printf ' \033[32mOK\033[0m %-16s %ss\n' "$name" "$LAST_CHECK_SECONDS"
615
- elif grep -qE 'ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL|Command "[^"]*" not found|: not found$|command not found' \
658
+ elif grep -qE 'ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL|Command "[^"]*" not found|node_modules missing, did you mean to install' \
616
659
  "/tmp/biffo-verify.$$"; then
617
660
  INCONCLUSIVE="$INCONCLUSIVE $name"
618
661
  printf ' \033[33mINCONCLUSIVE\033[0m %-16s %ss - dependencies not installed\n' \