Skip to content

Improvement: hosted Elektron base images - #2361

Merged
repeat98 merged 8 commits into
mainfrom
feature/hosted-elektron-bases
Nov 28, 2026
Merged

repeat98 merged 8 commits into
mainfrom
feature/hosted-elektron-bases

Conversation

@repeat98

@repeat98 repeat98 commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

What works: once the owner publishes it, an Octatrack owner can install the Modwerk base without their own OS 1.40C file. The install guide says "Modwerk's prebuilt base is ready", downloads it, checks it and installs it over USB or the card. "Use my own OS 1.40C file" stays. What is live: the bucket exists and holds the 0.8.3 base and its step base (uploaded by the owner, 28 November); the site offers them once this merges. Digitakt II, Rytm MKII and Model:Cycles follow in their own draft, built on this branch. Who must act: the owner (Jannik). On a unit: not run. The hosted image is byte-identical to the browser build, and the unit's IDENTIFY checks the identity.

Agreed with the owner on 28 November 2026: the owner builds and uploads from his own OS file on his own computer, never in CI. Every Elektron machine with a Modwerk base is in scope. Only the base is hosted, no module sets. The own-file route stays open. Other makers' devices stay local-only. The maker's agreement is kept privately, not in the repository.

Owner steps:

  1. Done: the modwerk-base-images bucket exists (the Worker deploy needs it).
  2. Once this is live, from a checkout of the deployed revision: npm run base:publish -- --stock ~/Downloads/OCTATRACK_OS1.40C_dist/OCTATRACK_OS1.40C.bin (--dry-run first if you like).
  • What was wrong or hard: every base had to be built from the musician's own OS file. That is a hurdle for a first install.
  • What this changes:
    • server/base-images.ts: public GET /api/bases manifest; GET /api/bases/<machine>/<identity> serves an image to verified members only, from a new private R2 bucket (BASES).
    • scripts/base-publish.mjs (npm run base:publish, owner only): builds the base and its step base (both USB Audio off, since USB Audio is a module) with the browser's own build path. That path moved out of the worker into src/engine/elekloader/published-base.ts without changing what it does. The script checks each identity against the committed pins and uploads with the owner's wrangler login. It refuses to replace an identity that is already hosted with different bytes.
    • Hosted files carry the name a base built from your own file downloads under (Modwerk-octatrack-base-0.8.3-5af431bd.bin); publishing renames hosted entries without re-uploading.
    • The guide's anonymous counts tell the source apart: hosted-base-ready instead of os-file-ready, hosted-download-failed instead of build-failed (tested).
    • docs/OWNER_OPERATIONS.md "Ship a base": run base:publish again after each base release (next: 0.8.4, Improvement: Octatrack base cumulative draft after 0.8.3 #2333).
    • src/config/hosted-bases.ts + BaseInstallDialog: the guide uses the hosted image while no file is chosen. It refuses an image whose identity is not the published one for its layout, or whose size or SHA-256 differs from the manifest.
    • Rules: MODDING_GUIDELINES.md, AGENTS.md, sdk/machines/AGENTS.md, docs/MACHINE_RECIPE.md, docs/APP_DEVELOPMENT.md and the FAQ name this one exception. The stock-free scanners and CI gates are unchanged, because nothing stock enters the checkout.
  • How I checked it: npm run pr:ready. New tests cover the Worker route (manifest public, image only for a member, unknown identity 404) and the identity/layout pick. A local base:publish --dry-run with the owner's OS file built both images, and each identity matched its pin (base 5af431bd…, 837,908 bytes; step c1f21351…). Nothing was uploaded.
  • Tested on a unit: Not tested on a unit: no base code changed. The hosted bytes come from the same build function the browser runs, and the unit's IDENTIFY confirms the identity after install. Not checked in a browser: the guide's new lines and the cross-origin download.
  • Edge cases:
Case Why this change makes it a risk How run Result
Damaged or swapped image the site installs bytes it did not build hosted-bases.ts checks size + SHA-256 against the manifest, identity against the site's pin pass (unit test of the identity pick; hash check by reading)
Image for a different base version an old manifest entry after a release the entry must name the identity this deploy publishes for the layout pass (test)
Step base missing from the bucket a two-update install needs it the guide fails with "no prebuilt base for this yet, choose your own file" not run: by reading
Visitor or unverified account images are for members Worker 401/403; the guide says to sign in pass (Worker test)
Bucket binding missing (Pages Functions, local dev) the route must not crash empty manifest, so the guide offers only the own-file route not run: by reading
  • What the guides lacked or got wrong, and where I fixed it: no route existed for an image a maker agreed to host. docs/HOSTED_BASES.md (new, listed in docs/README.md) is it, and the rule lines above point to it.
Follow-ups
  • DT2 / Rytm MKII / Model:Cycles: base:publish and their pages, after Improvement: Modwerk's own firmware builder #2346 lands. The storage, route and manifest already take any machine.
  • scripts/machine-slots.test.mjs failed in two full runs under load and passed alone: it needs its own Fix.

🤖 Generated with Claude Code

repeat98 and others added 4 commits November 28, 2026 07:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner builds the published Octatrack images from his own OS file with
the browser's build path (npm run base:publish) and uploads them to the
private modwerk-base-images bucket; the Worker lists them at /api/bases and
serves an image to verified members. The install guide offers the hosted
base while no OS file is chosen and checks its identity and SHA-256. The
guidelines and agent rules name this one exception.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98 repeat98 changed the title Hosted Elektron base images Improvement: hosted Elektron base images Nov 28, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Nov 28, 2026
@repeat98
repeat98 marked this pull request as ready for review November 28, 2026 06:58
repeat98 and others added 4 commits November 28, 2026 08:02
USB Audio is a module, so the guide builds the base and its step base with
USB Audio off; the step bases for other layouts are never requested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ase step

The install guide's anonymous counts record hosted-base-ready instead of
os-file-ready, and hosted-download-failed instead of build-failed, when
Modwerk's hosted base stands in for the OS file. OWNER_OPERATIONS.md and
HOSTED_BASES.md say to run base:publish again after every base release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98
repeat98 merged commit 3cf075a into main Nov 28, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant