Skip to content

translate CLI + artifactsFromEnvelope: build-time translation deploy path (A4) - #59

Merged
lann merged 1 commit into
mainfrom
translate-cli
Aug 10, 2026
Merged

translate CLI + artifactsFromEnvelope: build-time translation deploy path (A4)#59
lann merged 1 commit into
mainfrom
translate-cli

Conversation

@lann

@lann lann commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

PR 2 of 4 from the #16 delivery design note.

Browser-production answer: don't ship the translator. tools/translate emits the envelope (the single-file plan+adapters JSON translateRaw already produces — same format the §10 artifact cache stores), and artifactsFromEnvelope (embedder A4) reconstitutes ComponentArtifacts from envelope + component bytes, fetch-agnostic. Deploy set: component.wasm + component.plan.json + runtime. The envelope's embedded sha-256 makes a mismatched pair fail loudly at instantiation — pinned.

New test-translate recipe wired into gates + CI core. Gates: test-translate, test-runtime, conformance 1254/0 (0 unexpected/stale).

…deploy path (A4)

Item 2 of the #16 delivery design note: apps that know their components
at build time should not ship the translator at all. The pieces already
existed — Translator.translateRaw emits the envelope (single-file JSON:
plan + FACT adapters base64, the same format the artifact cache stores)
and loadEnvelope is public — this PR assembles them into the consumer
story:

- tools/translate/main.ts: translate a component to its envelope at
  build time (deno run tools/translate/main.ts app.wasm). Validates the
  envelope before writing so a rejected component fails at build, not at
  deploy.
- artifactsFromEnvelope(envelopeJson, componentBytes) on the embedder
  surface (embedder-api.md amendment A4): pure, fetch-agnostic
  reconstitution of ComponentArtifacts. The deploy set is component.wasm
  + envelope + runtime; the envelope's embedded sha-256/length are
  verified at instantiation, so a mismatched deploy pair fails loudly —
  pinned by the second test.
- tools/translate/README.md: the deploy-host recipe (3 lines of fetch)
  and the decision line vs runtime translation (dynamic components ->
  A3 + the artifact cache).

Gates: test-translate (new recipe, wired into gates and the CI core
matrix), test-runtime, conformance (1254/0, 0 unexpected, 0 stale).
@lann
lann enabled auto-merge August 10, 2026 22:22
@lann
lann merged commit 6767545 into main Aug 10, 2026
3 checks passed
@lannbot
lannbot deleted the translate-cli branch August 23, 2026 16:51
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