Skip to content

feat(assets): address packs by content and resolve them through a manifest - #750

Merged
Exoridus merged 6 commits into
nextfrom
feat/exoa-manifest
Sep 16, 2026
Merged

Exoridus merged 6 commits into
nextfrom
feat/exoa-manifest

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

Stage three of the .exoa block container: content-addressed pack names and a manifest, which turns "only changed blocks are fetched" into something that can be shipped. The container format is unchanged.

A pack is written as <name>.<first 16 hex of its SHA-256>.exoa, so its URL changes exactly when its bytes do and the file can be served with immutable caching. The manifest is the one mutable URL: a small JSON document listing each pack under its logical name with its file, full hash, byte length, block count and the entries it carries, plus its own version, which is refused rather than migrated when it is not the one this build reads. exo assets pack <description> --manifest <path> writes the pack under its content-addressed name and creates or merges the manifest atomically (temp file and rename); superseded pack files are kept for deploys still serving them. At runtime AssetManifest.open(url) or Loader.loadManifest(url) fetches the manifest without HTTP caching, and loadContainer accepts a ManifestPack; through the block store, keyed by block hash, a re-pack with one changed asset fetches the head and the changed block and serves the rest from the store, which the test asserts over the wire.

Verification: the whole-file path checks the digest before anything is cached, so a truncated download is never persisted under the content-addressed key; the block path holds no whole file and checks the length. Pack containment is decided on the resolved URL, so %2e%2e cannot escape the manifest's directory; a __proto__ pack name is data; transport failures are AssetNetworkError on both paths and shape failures AssetDecodeError. In development the loader warns when a pack is served whole instead of by range, naming the reason (no 206, or a content-encoded response whose offsets address the encoded stream).

Design note in .workspace/specs; guide section, API reference and the CLI README updated. The @codexo/exojs-build tarball bound moves to 40 KiB with its guarding purpose stated: the new module costs 5.6 KB three times over (emitted JS with JSDoc, declarations, inlined source map), and stripping comments would strip the declaration docs too.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@Exoridus
Exoridus enabled auto-merge (squash) September 16, 2026 01:50
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 49.68kB (0.15%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
exo-esm-esm 1.27MB 3.28kB (0.26%) ⬆️
exo-esm-modules-esm 3.66MB 13.44kB (0.37%) ⬆️
exo-iife-min-Exo-iife 1.27MB 3.28kB (0.26%) ⬆️
exo-full-iife-Exo-iife 5.5MB 13.21kB (0.24%) ⬆️
exo-iife-Exo-iife 3.55MB 13.2kB (0.37%) ⬆️
exo-full-iife-min-Exo-iife 1.99MB 3.28kB (0.16%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: exo-full-iife-min-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.full.iife.min.js 3.28kB 1.99MB 0.16%
view changes for bundle: exo-esm-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.esm.js 3.28kB 1.27MB 0.26%

Files in exo.esm.js:

  • ./src/assets/container/ContainerReader.ts → Total Size: 8.46kB

  • ./src/assets/AssetDecoder.ts → Total Size: 13.97kB

  • ./src/assets/container/containerSource.ts → Total Size: 4.46kB

  • ./src/assets/Loader.ts → Total Size: 40.17kB

  • ./src/assets/LoaderScope.ts → Total Size: 5.88kB

  • ./src/assets/container/containerIntegrity.ts → Total Size: 1.47kB

  • ./src/index.ts → Total Size: 0 bytes

  • ./src/assets/container/AssetManifest.ts → Total Size: 7.28kB

view changes for bundle: exo-iife-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.iife.js 13.2kB 3.55MB 0.37%

Files in exo.iife.js:

  • ./src/assets/container/AssetManifest.ts → Total Size: 7.45kB

  • ./src/assets/container/containerIntegrity.ts → Total Size: 1.5kB

  • ./src/assets/Loader.ts → Total Size: 41.09kB

  • ./src/assets/container/containerSource.ts → Total Size: 4.57kB

  • ./src/assets/container/ContainerReader.ts → Total Size: 8.65kB

  • ./src/assets/LoaderScope.ts → Total Size: 6.02kB

  • ./src/index.ts → Total Size: 0 bytes

  • ./src/assets/AssetDecoder.ts → Total Size: 14.32kB

view changes for bundle: exo-esm-modules-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/Loader.js 3.25kB 41.23kB 8.56% ⚠️
index.js 84 bytes 21.89kB 0.39%
assets/AssetDecoder.js 332 bytes 14.58kB 2.33%
assets/container/ContainerReader.js 156 bytes 8.76kB 1.81%
assets/container/AssetManifest.js (New) 7.41kB 7.41kB 100.0% 🚀
assets/LoaderScope.js 6 bytes 6.03kB 0.1%
assets/container/containerSource.js 573 bytes 4.73kB 13.77% ⚠️
assets/container/containerIntegrity.js (New) 1.62kB 1.62kB 100.0% 🚀

Files in assets/Loader.js:

  • ./src/assets/Loader.ts → Total Size: 40.17kB

Files in index.js:

  • ./src/index.ts → Total Size: 0 bytes

Files in assets/AssetDecoder.js:

  • ./src/assets/AssetDecoder.ts → Total Size: 13.97kB

Files in assets/container/ContainerReader.js:

  • ./src/assets/container/ContainerReader.ts → Total Size: 8.44kB

Files in assets/container/AssetManifest.js:

  • ./src/assets/container/AssetManifest.ts → Total Size: 7.24kB

Files in assets/LoaderScope.js:

  • ./src/assets/LoaderScope.ts → Total Size: 5.88kB

Files in assets/container/containerSource.js:

  • ./src/assets/container/containerSource.ts → Total Size: 4.45kB

Files in assets/container/containerIntegrity.js:

  • ./src/assets/container/containerIntegrity.ts → Total Size: 1.47kB
view changes for bundle: exo-iife-min-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.iife.min.js 3.28kB 1.27MB 0.26%

Files in exo.iife.min.js:

  • ./src/assets/Loader.ts → Total Size: 41.09kB

  • ./src/assets/container/AssetManifest.ts → Total Size: 7.45kB

  • ./src/assets/container/ContainerReader.ts → Total Size: 8.65kB

  • ./src/assets/AssetDecoder.ts → Total Size: 14.32kB

  • ./src/assets/container/containerSource.ts → Total Size: 4.57kB

  • ./src/index.ts → Total Size: 0 bytes

  • ./src/assets/LoaderScope.ts → Total Size: 6.02kB

  • ./src/assets/container/containerIntegrity.ts → Total Size: 1.5kB

view changes for bundle: exo-full-iife-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.full.iife.js 13.21kB 5.5MB 0.24%

@Exoridus
Exoridus merged commit d7a1427 into next Sep 16, 2026
17 checks passed
@Exoridus
Exoridus deleted the feat/exoa-manifest branch September 16, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant