Repository navigation
Commit npm lockfiles; make installs lock-exact and script-free - #2700
Merged
Merged
Conversation
- Regenerates both locks from the verified dependency graph under --ignore-scripts; differs from the long-standing local locks only by dropping stale extraneous entries - Un-ignores them so installs become reproducible and reviewable
- Switches install:theme-deps to `npm ci --ignore-scripts`, closing the unlocked nested install that consuming sites reach through the root package's postinstall - Ships theme/package-lock.json in the root npm package so that nested install stays lock-exact for GitHub-npm consumers - Adds install:safe for CI: locked, script-free root install plus the two reviewed lifecycle steps (hugo-extended rebuild, theme deps) - Workflows fail when installation changes a committed lock or runs without one (npm ci refuses a missing or drifted lock)
- Keeps the committed locks aligned across version stamping; without this, the pre-push set:version:git-info run would leave the locks one install away from drift
- Resolves the zizmor unpinned-uses findings; each pin is the current v6 tag SHA, cross-checked against the tag refs
…emantics - Changelog entry recast per the content-placement rules: user-facing postinstall change under Other changes, committed-locks/CI half in a new For-maintainers list, both citing the PR - Extends the postinstall setup note with the lock-exact, script-free semantics, giving that fact a current-state docs home
- Netlify's automatic install now runs script-free (NPM_FLAGS), with the reviewed lifecycle steps and a lock-drift check prepended to the build commands; previously the deploy path bypassed both controls - Anchors the .gitignore lock negations to the two committed locks; the bare pattern un-ignored locks at every depth - Retires the fossilized Dockerfile (Hugo 0.111); its unlocked install predates the workspace layout and fails against the locked postinstall
- The lock-only regeneration pruned netlify-cli's 27 vendored platform entries; any real npm install re-records them, so Netlify's auto-install tripped the new lock-drift check. The restored entries byte-match the pre-regeneration lock, leaving installs drift-free (verified: repeated install/ci runs leave the lock unchanged)
…heck - _install:safe:post: positional name for install:safe's after-ci phase (hook-inert underscore form; a literal postinstall:safe would be an npm auto-hook, silently skipped under ignore-scripts) - _diff:check:locks joins the _diff:check family; the three call sites use the name
- Replaces the lock-scoped diff with the existing _diff:check: at the check point nothing legitimate touches tracked files, so any change (lock or otherwise) should fail loudly rather than pass a lock-only filter
- Committed .npmrc turns on strict-allow-scripts: script-enabled installs and rebuilds now fail on any script-bearing package not covered by allowScripts (red-proven: uncovered tree fails with ESTRICTALLOWSCRIPTS listing all 7) - allowScripts pins [email protected] as the one reviewed script runner (Hugo upgrades re-approve via npm approve-scripts) and denies the netlify-cli-vendored set - The rebuild passes --ignore-scripts=false so install:safe works under user-level ignore-scripts hardening, where the rebuild would otherwise silently no-op
- Nothing references it (deploys run on Netlify's own runner; no scripts, docs, or CI invoke the CLI) and it dominated the dependency tree: the lock shrinks from 1350 to 175 packages, and hugo-extended becomes the only third-party install-script bearer, so the allowScripts denies retire - The regenerated lock is install-stable (repeated installs leave it unchanged) and re-verified: no IOC-family package at any version, all registry entries sha512-pinned
…files - Neuters Netlify's automatic install (--dry-run: resolution only, no tree writes, no bin linking), closing the window where a drifted manifest could plant executables on PATH before any check runs; _netlify:prepare now brackets install:safe with pristine-tree checks, and lock drift fails inside npm ci - _status:check replaces _diff:check at the install sanity points: git diff is blind to staged and untracked files, so a payload that stages itself passed; red-proven on modified, untracked, and staged inputs - Restores the Dockerfile pending its lock-safe update: docker-compose and the contributing guide reference it - Changelog: "script-free" overwrote the reviewed hugo-extended exception; now "unreviewed dependency scripts are disabled"
- Replaces the inline node wrapper; a script file dodges cmd.exe quoting on Windows (the scrollspy bash precedent) since git status has no --exit-code mode
- Retires _diff:check and _status:check: two similar checks invited misuse, and the diff form is blind to staged and untracked files (the k8s/istio/node ecosystems' strict tree checks settle the same way) - The is: predicate namespace keeps it out of check:* suite globs; strict semantics at the regen points means ci:prepare/ci:post now also require a clean tree, the accepted local trade-off
- perl's default output layer writes CRLF on Windows; with eol=lf normalization the regenerated files then show modified in git status (bytes differ, normalized content equal) — the strict is:clean-tree check surfaced this latent nondeterminism that git diff had masked
- `! git status ... | grep .` is POSIX-portable inside bash, avoids double quotes (cmd.exe-to-bash safety on Windows), and prints the offending paths on failure; the helper file retires
- The piped form died in cmd.exe, which owns `|` before bash exists; the capture-once form has no cmd metacharacters, one git call, and prints the offending paths on failure
- The scratch-site harnesses pin their own theme config, which Hugo lets an inherited HUGO_THEME override, so every such test failed from a worktree checkout (surfaced by `npm run wt -- test`); each spawn now drops the variable
- make-site.sh scratch sites get the same npm floor + engine-strict as the repo: their allowScripts keys silently no-op on npm < 11.16 (node 24.0 bundled 11.3, so engines.node alone doesn't cover it) - hugoEnv becomes a function so late process.env mutations stay visible to spawns
chalin
marked this pull request as ready for review
August 7, 2026 20:43
This was referenced Aug 8, 2026
Closed
chalin
added a commit
to chalin/docsy
that referenced
this pull request
Aug 12, 2026
Prove from the committed manifests, locks, .npmrc, and workflows alone that the hardening invariants (docsy#2700, docsy#2702, docsy#2712) still hold: registry + integrity coverage, non-registry allowlist, campaign IOC denylist, install-script inventory with a lock-matching allowScripts pin, locked script-free install commands, and credential-isolated workflow installs. Wired into test:full via _test:full:post.
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.
Makes every wired dependency-install path of the repository itself (workflows, Netlify builds, and the
postinstall-driven theme install that consuming sites reach) lock-exact, with unreviewed dependency scripts disabled, as part of hardening after the August 2026 npm supply-chain campaign (jaredwray/cacheable#1692). The smoke tests' scratch consumer sites intentionally keep installing as real consumers do.package.json(install:safe,install:theme-deps,allowScripts) and.npmrc, then the two workflows andnetlify.toml; the locks and the rest follow from those.npm ci --prefixon npm 11 is lock-exact: fails hard on a missing or drifted lock, no fallback to the root lock. The theme lock therefore ships in the root npm package, whosepostinstallneeds it. (On consumer machines that nested install is protected by its--ignore-scriptsflag alone: npm never packs.npmrc, so the repo'sstrict-allow-scripts/engine-strictlayers don't travel.)npm ci(EUSAGE) and the diff step; the Netlify one caught a real defect (a non-install-stable lock) on its first run.package@versionpairs is present; no IOC-family package name at any version.sha512-integrity-pinned; the only non-registry resolutions are the two commit-SHA-pinned git deps already inpackage.jsonand workspace links. (Dropping netlify-cli, which nothing referenced, shrank the lock from 1350 to 175 packages.)npm rebuild, and pinned as the soleallowScriptsentry under the committed.npmrc'sstrict-allow-scripts(red-proven: an uncovered script-bearing tree fails withESTRICTALLOWSCRIPTS).install:safetree:ci:preparenpm ci→ Hugo build