Repository navigation
feat(rendered-views): keep the CDN pins and SRI hashes on a Dependabot-bumped manifest - #18281
Conversation
…t-bumped manifest lib/cdn-pins/package.json pins mermaid and @tailwindcss/browser at the versions the deepening view loads; nothing installs it. A Dependabot npm entry bumps it. lib/cdn-pins/sync.mjs sync fetches each pinned file, hashes its exact bytes, and rewrites every CDN URL, SRI hash and CSP source in the files pins.json lists, then pins.json. sync.mjs check is offline: it fails while package.json and pins.json disagree, or a listed file lacks a current URL or hash or names another version. The selected sync.test.sh suite runs that check on the repository's own tree. Refs: #17783 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Held by session efebda6d (GitHub Work) with the do-not-merge label, for an owner decision. Once this pull request's Dependabot entry lands, every |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c66ebcbfef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-security-review reviewed Security review: no security issues foundBlocking only. This lane already reviewed an earlier head ( What changed since
No trust control, token scope, kill switch or merge hold is widened, and no plugin manifest changed. The change only adds a short local critical-findings: 0 |
|
claude-review reviewed Code review: incremental, 3250df4 → d0d33dd (blocking only)This lane already reviewed earlier heads of this PR ( What changed, checked
Not verified by me: I ran nothing, including the tests. Other criteria
Verifier dropped 0 of 0 candidates. |
sync rewrote a recorded hash with no + or / in its plain form inside a regular-expression literal, because its plain and escaped forms are the same, and check still passed. sync now rewrites line by line: on a line holding the escaped CDN prefix such a hash takes the escaped new value. check flags any hash on such a line that is not a current hash escaped. check now also verifies the prose form: a target with prose: true must name each package's current version as "`<name>` <version>", and any target naming another version in that form fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Held by session f8b9f2fc (GitHub Work) with the do-not-merge label. This pull request switches on the CDN sync route from #18336, so before the label comes off it must carry the fixes for #18336's
No session lifts the label while any of these is missing. |
Both merge gates (cdnSyncRefusal in dependency-classify.mjs and cdn_sync_refusal in babysit_dependabot.py) took any lanes App commit whose message contained [dependabot skip]. They now take only the cdn-pins-sync row's message as apply-patch renders it for apply-cdn-pins-sync: the subject on the pull request's head ref, a blank line, and the one trailer Lane-Activity: pr-unblock/review-dependency. Another row's subject, another branch, a missing or different trailer refuse as cdn-sync-message or cdn-sync-trailer; every earlier check stays. lib/cdn-pins/pins.json and lib/cdn-pins/sync.mjs become enforcement floor rows, with the generated copies and the floor pins recounted after the main merge (170 classes, 70 enforcement). New tests: a contract test of the real sync.mjs (check returns messages; the sync command line rewrites the targets), the patch CLI's outcomes, an end-to-end run from request through the real script, the CLI and apply-patch's cdn-pins-sync row to a push both gates admit, and the real registry's path count against the row's max-files. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
|
Session 8f53d784 (GitHub Work) lifts its hold: all five fixes in the hold condition are on 5d28c4b, checked in the diff:
The label comes off next; the merge waits on CI Status, both review lanes, the pr-review-main findings and pr-verify at this head. |
…old on the review-dependency verdict The pins.json floor row held every Dependabot CDN bump for a person, because the lanes App's sync commit always modifies it. Owner decision Q154 A says such a bump merges unattended. CI Status's require-checks step now clears the hold for a Dependabot pull request whose one held path is lib/cdn-pins/pins.json, modified in place, once the lanes App's newest review-dependency round marker names the head with verdict=merge. The marker check is one function shared with the action-ref exception. Until the verdict the step fails with a CDN pins record message, which review-dependency.mjs's GATE_HOLDS reads as a verdict hold, so the round runs instead of skipping as gate-hold. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
|
Session 8f53d784 (GitHub Work) put the do-not-merge label back for one review rework. The claude-review finding on |
|
Session 8f53d784 (GitHub Work) lifts its hold again. 62778f7 fixes the claude-review floor-row finding: the floor rows stay, and the require-checks step clears a Dependabot CDN bump whose only held path is |
|
Session 8f53d784 (GitHub Work) put the do-not-merge label back while it merges main. The branch conflicts with main in the generated hold-floor block of |
…ependabot Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
|
Session 8f53d784 (GitHub Work) lifts its hold. ba8ca97 merges main: the generated hold-floor block was regenerated with |
…ile pins before syncing sync used to pin the SRI hash of whatever jsDelivr served. With the route merging unattended, tampered bytes at sync time would have been pinned as trusted. For each package whose version changes, sync now requires the package-lock.json entry to lock that version at its canonical registry.npmjs.org tarball with one sha512 integrity, fetches the tarball, checks the sha512, reads package/<file> from the ustar archive, and records the hash only when jsDelivr's bytes equal it. Any failure exits 1 and writes nothing. Unchanged packages are no longer fetched. cdnRequest carries the head's lockfile as request.lock, and the review-cdn-pins-sync container writes it into the work tree only, so the patch still changes only pins.json and targets. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
|
Session 8f53d784 (GitHub Work) put the do-not-merge label back for one security fix. pr-review-main's security lane raised one SUGGESTION at ba8ca97: |
|
Session 8f53d784 (GitHub Work) lifts its hold. f05eaa8 closes pr-review-main's security suggestion ( |
|
Session 8f53d784 (GitHub Work) put the do-not-merge label back for pr-review-main's two claude-review findings at f05eaa8 (0 critical):
The label comes off after that push. |
tarFile and the lock checks in verifiedFile were tested only on hand-built ustar archives and lock entries. Commit @isaacs/balanced-match 4.0.1, a 4,438-byte MIT tarball npm 11.3.0 packed, as captured from the registry, and read package/package.json from it, with its registry sha512 recorded in the test. Factor the lock checks into lockedTarball and run them over the committed package-lock.json for every package pins.json lists (mermaid and the scoped @tailwindcss/browser), at the versions package.json pins. Move merge_verdict and the CDN pins exit above the action-ref exception's comment, so that comment sits on its own code. Behavior is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
|
Both pr-review-main findings are fixed in 3250df4. Finding 1 (IMPORTANT,
Finding 2 (SUGGESTION,
|
|
claude-security-review holds this pull request for a person (binary-artifact) at 1 changed file(s) are executables or archives no review reads, and the base branch's binary allowlist does not list them. A person reviews each file. To allow one, a separate pull request adds its
claude-lane: claude-security-review |
|
claude-review holds this pull request for a person (binary-artifact) at 1 changed file(s) are executables or archives no review reads, and the base branch's binary allowlist does not list them. A person reviews each file. To allow one, a separate pull request adds its
claude-lane: claude-review |
|
Session 8f53d784 (GitHub Work) put the do-not-merge label back. The real-output fixture |
The committed registry tarball held the pull request for a person on binary-artifact: no review reads an archive, and listing it would loosen the binary allowlist. The real-output test now runs the npm bundled with Node (npm-cli.js beside process.execPath) to pack a scoped fixture package in a temp dir, offline, with scripts off and its own cache and userconfig. It checks the tarball's sha512 against the integrity npm reports, reads package/dist/fixture.js and package/package.json through tarFile, and runs verifiedFile end to end on a lock entry built from that tarball, refusing a CDN body that differs. A Node without its bundled npm fails the test with a message instead of skipping it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
|
Session 8f53d784 (GitHub Work) lifts its hold. d0d33dd removes the committed tarball that tripped both lanes' |
|
pr-review-main at d0d33dd: security 0 findings, claude-review 1 SUGGESTION, 0 critical. The suggestion ( |
Closes #17783
Siblings: #18336
Summary
The rendered views' jsDelivr pins now come from a manifest Dependabot bumps, which delivers done-when items 1 to 4 of #17783. The pr-unblock route that syncs a Dependabot pull request (item 5) merged in #18336, and this pull request makes it live. It also closes the five gaps the review of #18336 found (hold comment), so the route goes live with both merge gates bound to its own commit.
Fix
lib/cdn-pins/package.jsonpinsmermaid12.3.0 and@tailwindcss/browser4.3.5, the versions the deepening view loads.package-lock.jsonwas written withnpm install --package-lock-only --ignore-scripts, and nothing installs the directory..github/dependabot.ymlgains an npm entry for/lib/cdn-pins, in the same per-directory shape as the other npm entries.lib/cdn-pins/sync.mjs syncfetches each bumped file, refuses it unless it equals the file in the npm tarball the lockfile pins (gap 7), hashes its exact bytes with the algorithmpins.jsonrecords (sha256, as #17844 chose), and rewrites every target thatpins.jsonlists. It rewrites each URL, SRI hash and CSP source as written, inside a regular-expression literal, and as the "<name>" prose form, then updatespins.json. Before it writes anything, it checks that every target carries the new pins.lib/cdn-pins/sync.mjs checkis offline. It fails whilepackage.jsonandpins.jsondisagree, or while a target lacks its current URL or hash or names another version.lib/cdn-pins/sync.test.sh. It runscheckon the repository's own tree, and itstest-scopeheader makes the test-bash lane select it whenever the manifest, the record or a target changes.deepening-report.mjs(the builder that emits the tags and the CSP), its test,html-report.md, and the two CSP eval samples. The issue named three of them. The builder and its test carry the same pins, so they are targets too. No other file loads from jsDelivr: the remainingcdn.jsdelivr.nethits are negative eval samples and an unrelated adapter doc.The review gaps:
cdnSyncRefusal(.github/scripts/pr-unblock/dependency-classify.mjs) andcdn_sync_refusal(babysit_dependabot.py) took any lanes App commit whose message contained[dependabot skip]. Both now call a message check (cdnSyncMessageRefusal/cdn_sync_message_refusal). It takes only thecdn-pins-syncrow's message as apply-patch'scommitMessagerenders it for theapply-cdn-pins-syncjob: the subjectSync the CDN pins to the bumped manifest on <head ref> [dependabot skip]on the pull request's own head ref, a blank line, then the one trailerLane-Activity: pr-unblock/review-dependency(lanepr-unblock,patch-activity: review-dependencyinpr-unblock.yml). Final newlines are ignored. Another row's subject or another branch iscdn-sync-message. A missing, different or extra trailer line iscdn-sync-trailer. Every earlier check stays: lanes App author, web-flow committer, valid signature, one parent, base-registry paths, in-place 100644 modification, and a refusal when the base registry is missing or unreadable. The head ref comes frompull.head.ref(apply-dependency-verdict.mjs) andpr.head.ref(_dependabot_contentinbabysit_merge_policy.py).lib/cdn-pins/pins.jsonandlib/cdn-pins/sync.mjsareenforcementrows indocs/conventions/pr-pipeline.yaml, next tocdn-paths.mjs. The generated copies were regenerated withscripts/sync-hold-floor.py. The pins were recounted from the merged yaml after the main merge, with digests recomputed: 168 to 170 classes, 68 to 70 enforcement, 136 to 138 config rows. The high (100) and author-review (24) sets did not change.sync.mjs(lib/cdn-pins/sync.test.mjs).check(root)returns a list of strings: empty on a synced tree, non-empty on a stale one.node sync.mjs sync <root>, the argv thereview-cdn-pins-synccontainer runs, rewrites every target, and it exits 1 with nothing written on a 404. Fetch is answered offline through a--importpreload (lib/cdn-pins/fixtures/fake-fetch.mjs).apply-patch.test.mjs):cdnRequestbuilds the request, the realsync.mjsruns in the container's shape into a result directory, and thecdn-pins-sync.mjs patchCLI builds the patch. Apply-patch then pushes it under thecdn-pins-syncrow with the base registry, using the lane and activity read from theapply-cdn-pins-syncjob. The pushed message passescdnSyncMessageRefusal, and only the registry and the changed target are modified..github/scripts/pr-unblock/cdn-pins-sync.test.mjscovers the CLI's outcomes: no result directory, or unchanged results, exit 1 with no patch file; changed results give a patch of those files alone; a non-regular result and a bad usage fail.pins.jsonnames the registry plus 5 targets, 6 paths. That is within thecdn-pins-syncrow'smax-filesof 6 (lib/cdn-pins/sync.test.mjs).lib/cdn-pins/pins.json, so CI Status's require-checks step held each such bump with "A person merges it", which contradicts owner decision Q154 A. The step now has a Dependabot exit (pr-require-checks.yml, outside the generatedhold-floorblock). When the held set is exactlylib/cdn-pins/pins.json, listed once in the broker's file pages asmodifiedwith no previous name, the hold clears on the lanes App's newest review-dependency round marker for this head withverdict=merge. That is the same marker check the action-ref exception uses, now onemerge_verdictfunction. Until then the step fails with#<n> by Dependabot changes only the CDN pins record on trust-gate paths.review-dependency.mjsGATE_HOLDSreads that as a verdict hold, so the round runs and the dispatcher re-runs CI Status after the verdict, where the old message would have been skipped asgate-hold. Any other held path, a rename, missing pages, an unreadable read, or a marker for another head, by another account or with another verdict keeps the hold. Thediff_risk.pyconcern does not apply:score_unattendeddoes not score a Dependabot pull request (babysit_merge.py:3691-3695,not-scored:dependabot), andenable-auto-merge.mjsarms only the lanes App's own pull requests.lib/cdn-pins/sync.mjs:128).syncused to hash whatever jsDelivr served, so with the route merging unattended a jsDelivr serving tampered bytes at sync time would have had its hash pinned as trusted. Now, before writing any target, for each package whose version changes,verifiedFilerequires thepackage-lock.jsonentrynode_modules/<name>to lock the bumped version, to resolve to the canonical registry tarballhttps://registry.npmjs.org/<name>/-/<basename>-<version>.tgz(the same formdependency-classify.mjsrequires), and to carry onesha512-integrity. It fetches that tarball, checks its sha512 against the lock, gunzips it withnode:zlib, readspackage/<file>with a small ustar parser (tarFile: header checksum, octal size, block padding, theprefixfield and a paxpath; any other entry type, a truncated entry or a second copy is refused), and requires jsDelivr's bytes to equal that entry byte for byte. Only then does it record the SRI hash from those bytes. A package whose version does not change is no longer fetched. Any failure exits 1 and writes nothing, as a jsDelivr 404 does.cdnRequestnow readslib/cdn-pins/package-lock.jsonfrom the pull request head and carries it asrequest.lock, and thereview-cdn-pins-synccontainer writes it into the work tree beside the manifest. It is not inrequest.files, so the patch still changes onlypins.jsonand targets. The request's sha256 check is unchanged.Choices, each with its basis:
ci-statusred. Basis:ci-statusis the one required check (AGENTS.md "Pull request states"). The cost is that a hash someone edits by hand inpins.jsonand in every target together goes unnoticed until the nextsync.CHECK_RESULTSand ascripts/check-affected-gates.txtrow (pr-require-checks.yml, the check-skills aggregator); a suite needs neither.HEAD_REFis the pull request's head ref in pr mode (pr-run-activity-write.yml), and apply-patch fills{ref}with it verbatim (commitMessageinapply-patch.mjs).Verification
node lib/cdn-pins/sync.mjs syncon the committed head (live fetch) printednothing to change, andgit status --porcelainwas empty after it. The skill text, the builder, its test and both eval samples are byte-identical.package-lock.jsonresolves every package fromregistry.npmjs.orgonly. The rootpackage.jsondeclares no workspaces, so no rootnpm ciinstalls this directory.mermaidto 12.2.0 madecheckfail withpackage.json pins mermaid 12.2.0 but the views carry 12.3.0.syncthen rewrote the URL, hash and CSP source in the builder, the plain and regex forms in its test, the prose version, CSP and hash inhtml-report.md, and the mermaid eval sample. After thatcheckpassed, anddeepening-report.test.mjspassed (31 pass).window.mermaidloaded, 2 Mermaid SVGs drew, Tailwind injected its styles, and there were no console errors.syncreturned every view to its committed bytes.plugins/architecture/scripts/deepening-report-browser.test.sh(headless Chromium against the pinned CDN files) passed 21 of 21 on this head.lib/cdn-pins/sync.test.mjs: 11 pass (the contract, CLI andmax-filestests among them)..github/scripts/pr-unblock/cdn-pins-sync.test.mjs: 3 pass..github/scripts/pr-unblock/apply-dependency-verdict.test.mjs: 50 pass, including the new refusals for another row's subject, another branch, a missing trailer, another activity and a second trailer..github/scripts/apply-patch/apply-patch.test.mjs: 446 pass, the end-to-end test among them.test_babysit_dependabot.py: 83 pass. ItsCdnSyncIsTheGatesvectors now run 17 commit vectors and 16 message vectors through both languages, and they agree on each.test_babysit_merge_policy.py(with the new subject and trailer refusals),test_diff_risk.py,test_floor_paths.pyandtest_merge_holds_sync.pypass.merge-holds.test.mjs: 78 pass.scripts/sync-hold-floor.py --checkis clean, andscripts/check-workflow-template-size.shpasses.scripts/ci-review-lanes.test.sh: 338 pass, 0 fail. The 11 new vectors cover the cleared case and these refusals: an extra held path, a rename into place, no broker pages, a marker on another head, afixverdict, a newerescalatemarker, a marker from a user account with the App's id, a marker from another bot, unreadable markers, and no lanes App id..github/scripts/pr-unblock/review-dependency.test.mjs: 46 pass, the newgateHoldOnlycase among them..github/scripts/pr-unblock/dependency-dispatch.test.mjs: 39 pass.test_floor_paths.pyandtest_merge_holds_sync.py: 50 pass.scripts/sync-hold-floor.py --checkis clean, and a rerun of the generator changed nothing.scripts/check-workflow-template-size.shpasses, andscripts/check-affected.sh --base HEAD~1reports 20 passed, 4 skipped.selection-audit.sh trace --strictfinds no selection gap for any new or changed suite, includingci-review-lanes.test.shandreview-dependency.test.mjsafter gap 6.verifiedFilefetched the registry tarballs for@tailwindcss/browser4.3.5 andmermaid12.3.0, matched each sha512 topackage-lock.json, readpackage/dist/index.global.js(287,414 bytes) andpackage/dist/mermaid.min.js(5,537,838 bytes) from the real tarballs, found jsDelivr's bytes equal, and their sha256 equals the hashespins.jsonrecords.lib/cdn-pins/sync.test.mjs(andlib/cdn-pins/sync.test.sh): 15 pass, 0 fail. New cases build a real gzipped ustar tarball and lock: a tarball whose sha512 differs from the lock, jsDelivr bytes that differ frompackage/<file>, a tarball that does not gunzip, a lock entry with another version, an off-registry or another package'sresolved, a sha1 or missing integrity, no lock entry, and a tarball without the file. Each refuses and leaves every file, the lock included, unchanged. The command line exits 1 with nothing written on a tampered file as on a 404.tarFilecases cover theprefixfield, a paxpath, directories, multi-block bodies, a bad checksum, a truncated archive and entry, a duplicate, a symlink entry and a malformed pax record. The repository's ownchecktest passes..github/scripts/apply-patch/apply-patch.test.mjs: 446 pass, 0 fail. The end-to-end test now carries the head's lock asrequest.lock, serves the tarball, and checks that thereview-cdn-pins-syncjob writesrequest.manifest,request.lockandrequest.scriptinto the work tree..github/scripts/pr-unblock/review-dependency.test.mjs: 46 pass, 0 fail, withlockin the written request and a missing head lock writing none..github/scripts/pr-unblock/cdn-pins-sync.test.mjs: 3 pass.workflow-gates.test.mjsCDN tests: 2 pass.npm-cli.jsbesideprocess.execPath) tonpm packa scoped@cdn-pins-test/fixture1.0.0 in a temp dir, offline, with--ignore-scriptsand its own cache and userconfig. It checks the tarball's sha512 against theintegritynpm reports, readspackage/dist/fixture.jsandpackage/package.jsonthroughtarFile, and runsverifiedFileend to end on a lock entry built from that tarball: equal jsDelivr bytes pass, other bytes are refused. A Node without its bundled npm fails the test with a message rather than skipping it. npm 11.19.0 wrote two typeflag0entries with POSIXustar\000magic; both pinned registry tarballs (@tailwindcss/browser4.3.5, 4 entries;mermaid12.3.0, 1,405 entries) likewise hold only typeflag0entries: no pax,g, GNU or directory entries. In CI,Test NodeandTest Bashboth install Node withsetup-pinned-node, which extracts the official nodejs.org Linux release, bundled npm included. A second test runs the lock checks, nowlockedTarball, over the committedpackage-lock.jsonfor every packagepins.jsonlists,mermaidand the scoped@tailwindcss/browseramong them: version equal topackage.json's, the canonical registryresolved, and one sha512.lib/cdn-pins/sync.test.mjsandlib/cdn-pins/sync.test.sh: 17 pass, 0 fail each.scripts/ci-review-lanes.test.sh: 338 pass, 0 fail aftermerge_verdictand the pins exit moved above the action-ref comment.scripts/check-affected.sh --base 3250df4079reports 19 passed, 5 skipped.selection-audit.sh trace --strictfinds no gap forsync.test.mjs, and test-tmp-cleanup, silent-skips and orphaned-fixtures pass.lib/publish-gate.mjsscanLeak, so the credential scan before upload still passes.scripts/check-workflow-template-size.shpasses, withpr-unblock.yml522,092 bytes under the fail line.scripts/check-affected.sh --base ba8ca97fc2reports 20 passed, 4 skipped.selection-audit.sh trace --strictfinds no gap forsync.test.mjs,sync.test.sh,apply-patch.test.mjs,cdn-pins-sync.test.mjsorreview-dependency.test.mjs.Not in this change
html-report.mdstill carries its dated sentences ("As of 2026-11-15 ...", "checked against the files themselves on 2026-11-21") beside the new versions and hashes. Its recheck-trigger sentence still says to change the pins and hashes by hand. This pull request leaves that skill text alone.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5