ADR: local-engine asset delivery (CDN vs self-hosted) #18

Closed
opened 2026-10-25 14:58:44 +00:00 by dsh · 1 comment
Owner

Goal

Settle how local-engine JS/WASM/voice assets reach the browser — the last architectural unknown before v0.1.0.

Scope

  • Compare: (a) pinned upstream CDNs (Piper: cdnjs/jsdelivr/HF), (b) self-hosted assets/ served by a read-only Host prefix route, (c) vendored engine code in the client bundle (size check).
  • Security review for (b): path traversal, auth fence (reuse the dsh-gitea guard pattern), no inference, no credentials, immutable caching headers.
  • Decide offline expectations: must a cached voice work with the network down? What still breaks?
  • Write docs/adr/0003-asset-delivery.md with the decision, threat notes and rollback.
  • Implement the chosen path (route or pins) and a manifest of expected asset URLs + sizes/checksums.

Acceptance

  • ADR accepted; asset URLs are pinned with expected sizes (checksums where we own the fetch).
  • A cached voice synthesizes with DevTools "offline" where the decision promises offline.
  • If a Host route exists: it serves only files under the plugin's assets/, rejects traversal, and adds no measurable RSS.

Notes

  • Depends on #10. Part of M3. Constraint: no host inference (D1); package must stay small (no 90 MB voices in the tarball).
## Goal Settle how local-engine JS/WASM/voice assets reach the browser — the last architectural unknown before v0.1.0. ## Scope - [ ] Compare: (a) pinned upstream CDNs (Piper: cdnjs/jsdelivr/HF), (b) self-hosted `assets/` served by a read-only Host prefix route, (c) vendored engine code in the client bundle (size check). - [ ] Security review for (b): path traversal, auth fence (reuse the dsh-gitea guard pattern), no inference, no credentials, immutable caching headers. - [ ] Decide offline expectations: must a cached voice work with the network down? What still breaks? - [ ] Write `docs/adr/0003-asset-delivery.md` with the decision, threat notes and rollback. - [ ] Implement the chosen path (route or pins) and a manifest of expected asset URLs + sizes/checksums. ## Acceptance - ADR accepted; asset URLs are pinned with expected sizes (checksums where we own the fetch). - A cached voice synthesizes with DevTools "offline" where the decision promises offline. - If a Host route exists: it serves only files under the plugin's `assets/`, rejects traversal, and adds no measurable RSS. ## Notes - Depends on #10. Part of M3. Constraint: no host inference (D1); package must stay small (no 90 MB voices in the tarball).
Author
Owner

Resolved with ADR 0001: pinned upstream stays primary, public Forgejo assets-v1 release is the browser-side fallback, with scripts/mirror-assets.mjs and assets-manifest.json. No host proxy. Phonon wasm glue remains a follow-up.

Resolved with [ADR 0001](../src/branch/master/docs/adr/0001-asset-delivery.md): pinned upstream stays primary, public Forgejo `assets-v1` release is the browser-side fallback, with `scripts/mirror-assets.mjs` and `assets-manifest.json`. No host proxy. Phonon wasm glue remains a follow-up.
dsh closed this issue 2026-11-06 10:48:12 +00:00
Sign in to join this conversation.
No description provided.