Repository navigation
core: offline extension-bundle acquisition (cache-first, --bundle-release-path) - #637
Merged
Merged
Conversation
…le-release-path) `extension-bundles install` and `init --with` now check the verified local cache (.urlcode/extension-bundles/<sha256>/, from a prior successful install of the same name and --bundle-release) before touching the network, and skip the network entirely on a match. A tampered cache entry for a matching lock fails closed instead of silently reinstalling over it. Add --bundle-release-path <local-directory> to both commands: it reads a release's catalog and tarballs from a local directory shaped like a GitHub release instead of GitHub, and verifies every file with the identical `gh attestation verify` policy (repo, signer workflow, source ref, no self-hosted runners), pointed offline at a `gh attestation download` bundle already on disk instead of letting `gh` reach the GitHub API. This reuses createGithubTransport's attestation-verify call (extracted into a shared helper) rather than inventing a separate check, and promotes initProjectWith's existing test-only bundleTransport seam to a real, documented, user-facing local transport (createLocalBundleTransport). Closes #533. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # llms-full.txt # packages/core/src/cli.ts # packages/core/src/extension-bundles.ts # packages/core/src/extension-transport.ts
# Conflicts: # packages/core/src/cli.ts
jimhoyd
force-pushed
the
claude/offline-extension-bundles
branch
from
September 24, 2026 04:12
23c431b to
eff8a69
Compare
# Conflicts: # docs/EXTENSIONS.md # llms-full.txt # packages/core/src/cli.ts # packages/core/src/extensions-cli.ts # test/extension-bundles.test.ts
# Conflicts: # packages/core/src/cli.ts
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.
Summary
installBundle(extension-bundles install, andinit --within aproject that already vendors the same install) now checks whether the
requested name +
--bundle-releasetag is already recorded inurlcode.extension-bundles.lock.jsonand byte-for-byte identical to.urlcode/extension-bundles/<sha256>/before making any network call, andreuses it on a match. If the lock names that release but the cache was
modified, it fails closed (
validateCached's existing "was modified"refusal) instead of silently reinstalling over the tampered entry.
--bundle-release-path <local-directory>toextension-bundles installandinit --with: reads that release's signed catalog andtarballs from a local directory shaped like a GitHub release, instead of
GitHub. Implemented as
createLocalBundleTransportinpackages/core/src/extension-bundles.ts, promotinginitProjectWith'sexisting test-only
bundleTransportseam to a real, documented,user-facing option —
bundleReleasePathbuilds the same kind ofBundleTransporta test double would, just backed by disk instead of afake.
transports call through a new shared
runAttestationVerifyhelper inpackages/core/src/extension-transport.tswith the identical policy(
--repo,--signer-workflow,--source-ref refs/tags/<release>,--deny-self-hosted-runners); the local transport only adds--bundle <file>,gh attestation verify's own documented flag for offlineverification against a bundle already fetched with
gh attestation download. That downloaded bundle is namedsha256-<digest>.jsonlbyghitself, and the local transport looks it up by that exact convention — a
missing bundle, a tampered tarball (whose digest no longer matches any
bundle on disk), a wrong tag, or a revoked catalog entry all refuse exactly
as they do online, naming the
gh attestation downloadcommand thatproduces the missing file.
--bundle-release-pathcomposes with--bundle-release: the tag stillselects which release is being verified; the path only changes where its
bytes and attestations come from. Network acquisition is unchanged and
remains the default/fallback when neither a cache hit nor
--bundle-release-pathapplies.docs/EXTENSIONS.md(cache-first behavior, the local-directory shape, the
gh attestation downloadstep); CLI help text updated for both commands.Scope note
Per the issue triage, this only covers
installBundle/extension-bundles/init --with. The data-onlyextension-artifactschannel(
extension-artifacts.ts) isn't touched — it wasn't in scope for #533, andits own local/offline story (if wanted) should be a separate decision.
Security notes
exact same
gh attestation verifyinvocation and policy as the networkpath, just pointed at local material via
gh's own documented--bundleoffline-verification flag. Nothing is treated as pre-verified merely
because it's on local disk.
(
validateCached, the same re-hashloadExtensionBundle/inspectalreadyperform) rather than trusting the directory's existence, and refuses
instead of reinstalling when that re-hash fails.
of
gh attestation verify's existing offline mode. I did not find a casewhere the local path needed to diverge from the network path's checks; if
a reviewer sees one, flag it rather than assuming this description is
exhaustive.
Test plan
npm run typechecknpm run lintnpm run verify(846 tests; 1 pre-existing, unrelated timing flake intest/sandbox-pool.test.tsunder heavy concurrent-CI load on thismachine — reproduced in isolation as passing cleanly, confirmed
unrelated to this change)
npm run test:packagenpm run check:docs(regeneratedllms-full.txtvianpm run docs:llmsfor the newdocs/EXTENSIONS.mdsection)test/extension-bundles.test.ts(local transport install,missing/refused attestation bundle fail-closed, malformed release
directory, cache-hit skips the transport entirely, tampered-cache
fail-closed, CLI end-to-end
--bundle-release-pathinstall +validation) and
test/init-with.test.ts(init --with --bundle-release-pathwith no injected transport, tampered assetfail-closed, mutual exclusivity with an injected
bundleTransport,CLI flag validation)
Closes #533.
🤖 Generated with Claude Code