Repository navigation
Pin what the build fetches, poll a share once not twice, and boot lighter - #17
Merged
Merged
Conversation
…hter (audit tier 5, X6/X8/P7/P8) X6 — supply chain. Every GitHub Action is pinned to a commit with the release in a comment; the workflow token is read-only except for the publish jobs. Both Dockerfiles pin node:22-alpine and the two nvidia/cuda images by digest, and fetch whisper.cpp by the commit b4938 pointed at rather than the tag. Each pin says how to bump it. X8 — TRUST_PROXY. `true` (the default, as before), `false`, or a list of addresses and CIDR ranges passed to Fastify's trustProxy, so an operator whose port 8080 is reachable from the LAN can stop a client there setting X-Forwarded-* itself. A list with a bad entry drops it and warns; a list with nothing usable trusts nobody and warns, never silently everybody. Unit tests prove the parsing and what Fastify does with each value; an integration test proves it reaches the real app through the Secure flag on the session cookie. P7 — boot and runtime. sharp and qrcode are loaded on first use (a shared loader for sharp, so the two services load it once); the entrypoint chowns node_modules only when its owner is wrong, and the image ships it owned by the default ids, so a default run never walks the 4,500 files; in polling mode the watcher polls at the rescan interval instead of min(rescan, 60 s) on top of the rescan, and says so in the log and status. The whisper probe at boot is left as it was. Boot to "listening" on this Mac: 812/236/230 ms before, 535/223/221 ms after; the covers module import went from ~26 ms to 5 ms and qr.js from 9 ms to 0. P8 — image size. WHISPER_MODELS chooses which models are baked in (default both, so the published image is unchanged) and WHISPER_DEFAULT_MODEL must be one of them or the build refuses with a plain sentence; the smoke test proves every binary with the smallest model shipped. better-sqlite3's SQLite source and the seven other platforms' prebuilt binaries are removed before the native-module check, which now proves the module loads with only what is kept. 868 MB → 833 MB (717 MB with one model). npm test: 1388 pass. Acceptance (selfpod:tier5-infra on port 8299): 63 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
antoine-debroye
changed the base branch from
ad/audit-tier5-statistics
to
main
October 9, 2026 22:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Tier 5 of the October audit (
doc/audit-2026-10-09.md): the infrastructure items X6, X8, P7 and P8. Stacked on #16.What changed
node:22-alpineandnvidia/cudabase images by index digest, and whisper.cpp by commit371b5a7(fetched withgit fetch --depth 1 <sha>, sinceclone --branchonly takes names). Top-levelpermissions: contents: read; the three publish jobs keeppackages: write. Each pin carries a comment saying how to bump it.TRUST_PROXY. Defaulttruekeeps today's behaviour;falseor a comma-separated list of IPs, CIDRs or proxy-addr range names narrows it. A bad entry is dropped with a warning naming it; a list with nothing usable trusts nobody and says so, never silently falls back to everyone. Documented in the README table and spec §9. Applied to the degraded-mode server as well as the main one.sharpandqrcodeload on first use (newsrc/lib/lazy-sharp.js;limitInputPixelspassed exactly as before). The entrypoint onlychown -Rsnode_moduleswhen its owner is actually wrong (checked on the directory and a file deep inside it, so an interrupted chown is finished, not skipped), and a failed chown is logged rather than swallowed. In polling mode the watcher now polls at the full rescan interval instead of every 60 s, so a share is stat'ed once per interval, not twice; the status line and health notice say so.WHISPER_MODELSbuild arg (default both, so the published image is unchanged;smallalone is 717 MB and refuses to build if the default model is not among those baked in).docker/trim-node-modules.mjsremovesbetter-sqlite3/depsand the seven other platforms' prebuilds, keeping the one the package itself loads, and fails the build loudly if that layout ever changes. 868 MB → 833 MB.How it was verified
npm test: 1405 pass, 0 fail (stacked on Finish the statistics: DST-safe midnights, history that outlives an episode, a fair comparison, and a whole-page show filter #16). New tests:TRUST_PROXYparsing for every form including the fail-safe, then the parsed value handed to a real Fastify instance (forged headers honoured only from the trusted range) and throughbuildApp(aSecurecookie only from the proxy address); watcher polling at the rescan interval with an injectablewatch../test/acceptance/run.sh selfpod:tier5-infra: 63 passed, 0 failed against the stacked image.PUID=1001;WHISPER_MODELS=smallalone refused with the reason;WHISPER_MODELS=small WHISPER_DEFAULT_MODEL=smallbuilds and smoke-tests.Known: the whisper probe at boot was deliberately left in place (the pass auto-triggers after the first scan anyway, and deferring it would delay the "recogniser cannot run" banner).
src/services/watcher.jsis treated as binary by git because of a pre-existing NUL in a string literal; usegit diff --textto read it.🤖 Generated with Claude Code