Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Skills load on clone: Claude Code reads `.claude/skills/`, Codex the identical `
- Run `npm run pr:ready` last, before marking a PR ready or pushing to it; between fixes, `npm run check -- --rerun-failed`. Complete its [assigned replay](docs/AGENT_EVALS.md) and watch CI until green. [Registered authors](docs/DEVELOPER_WORKFLOW.md#make-it-mergeable) add `--author <login>`. Never edit a check, gate, test or workflow to pass it. Fix a wrong check in its own `Fix:` PR outside module releases.
- Never edit generated files by hand (`src/catalog/module-documents.json`, licence notices, the machine registry): `npm run modules:generate`, `licenses:generate` and `machines:generate` write them.
- Every fix ships with its changelog entry in the same pull request: a file `changelog/<YYYY-MM-DD>-<topic>.md` for the site, app, Worker, SDK or base (never edit `CHANGELOG.md`), or a version-matched entry in the module's own file in `src/community/module-changelogs/`, at most five short lines for the people who play it ([release notes](docs/ADD_A_MODULE.md#release-notes-required-for-every-fix-and-module-version)). Test evidence and waivers go in the pull request; `npm run check` enforces it.
- Never commit firmware, extracted stock code or tables, memory dumps or built images. Firmware stays on the developer's computer and never enters CI.
- Never commit firmware, extracted stock code or tables, memory dumps or built images. Firmware stays on the developer's computer and never enters CI. Except [hosted bases](docs/HOSTED_BASES.md).

## Modules

Expand Down
2 changes: 1 addition & 1 deletion MODDING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ These rules cover Modwerk modules, machine ports and research, including what an
## Never share firmware

- **Never upload, post, send or link a maker's firmware.** That means OS, update and SysEx files, code or tables taken from them, memory dumps, disassembly listings and built images that contain any of these. It includes leaked or decrypted firmware that someone else has published.
- **Everyone works from their own official download.** Modwerk builds firmware on the user's own computer from the OS file they supply, and refers to stock code only by address, length and checksum.
- **Everyone works from their own official download.** Modwerk builds firmware on the user's own computer from the OS file they supply, and refers to stock code only by address, length and checksum. The one exception is Modwerk's own: where the maker agreed, it hosts its prebuilt base for that maker's instruments, so the base installs without an OS file.
- Share hashes, file layouts, addresses, notes and your own code instead.

## Respect the makers
Expand Down
1 change: 1 addition & 0 deletions changelog/2026-11-28-hosted-base-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Site: once Modwerk hosts the Octatrack base, its install guide offers the prebuilt base to verified members, so it installs without your own OS 1.40C file; you can still choose your own. The guide's anonymous step counts tell the two apart (`hosted-base-ready`, `hosted-download-failed`). The owner builds and uploads the images with `npm run base:publish`, using the same build path as the browser, and the Worker serves them at `/api/bases`. The modding guidelines and agent rules now name this one exception to sharing no firmware: hosted base images, for makers who agreed.
1 change: 1 addition & 0 deletions changelog/2026-11-28-hosted-bases-elektron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Site: the Digitakt II, Analog Rytm MKII and Model:Cycles build panels offer Modwerk's prebuilt base once it is hosted, for a set with no modules while no OS file is chosen, wherever downloads are open for the machine. It downloads only after the risk and recovery ticks, and only an image whose identity is the base the page builds and whose size and SHA-256 match. Sets with modules still build from your own OS file. `npm run base:publish -- --machine <id>` builds and uploads these images for the owner.
2 changes: 1 addition & 1 deletion docs/APP_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Existing published module authors may use the [automatic author-update workflow]

For module development, start with the [repository quickstart](../README.md) and [SDK guide](../sdk/README.md). Run commands below from the repository root.

A React / TypeScript web configurator for octabam, with a GitHub Pages frontend and a separate Cloudflare community API. Firmware stays on the user's device.
A React site with a GitHub Pages frontend and a Cloudflare community API. Firmware stays on the user's device, except [hosted bases](HOSTED_BASES.md).

The frontend, backend and octabam-derived developer SDK belong in one repository. The owner may self-host the backend later; storage adapters for that option remain pending. See [architecture decisions](DECISIONS.md).

Expand Down
42 changes: 42 additions & 0 deletions docs/HOSTED_BASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Hosted base images

Modwerk serves prebuilt base images for the machines whose maker agreed to it, so a musician can install the base
without their own OS file. Everything else is unchanged: module sets on a machine whose modules link into the OS image
still build in the browser from the musician's own file, the own-file route stays open on every machine, and other
makers' devices (Zoom and the rest) build only from the musician's own file in the browser. The owner keeps the maker's
agreement privately; it is not recorded in the repository.

| What | Where |
| --- | --- |
| Machines | Every Elektron machine with a Modwerk base (`sdk/machines/*/base-binding.json`). Octatrack, Digitakt II, Analog Rytm MKII (the plain variant, which a set without modules builds on) and Model:Cycles. On the last three the hosted image is the page's build with no modules, in its default display version |
| Images | The base alone, one image per published base identity (the Octatrack's step bases included). No module sets |
| Built | Only on the owner's computer, from the owner's own OS file, with the same builder the site uses: `npm run base:publish` |
| Stored | The private R2 bucket `modwerk-base-images` (binding `BASES`), never in Git, GitHub Actions or the site's assets |
| Served | `GET /api/bases` (the manifest: machine, identity, layout, SHA-256, size; public) and `GET /api/bases/<machine>/<identity>` (the image; verified members), `server/base-images.ts` |
| Checked | The site (`src/config/hosted-bases.ts`) refuses an image whose identity is not the published one for its layout or whose bytes differ from the manifest; the Octatrack's IDENTIFY then confirms the identity on the unit |
| Site | The Octatrack install guide offers the hosted base while no OS file is chosen, and keeps "Use my own OS 1.40C file". The other machines' build panel (`DigiBuildPanel`) offers it for a selection with no modules while no OS file is chosen, where downloads are open for the machine; a selection with modules still builds from the musician's own file |

## Publish

```sh
npm run base:publish -- --stock /path/to/OCTATRACK_OS1.40C.bin
npm run base:publish -- --machine digitakt-ii --stock /path/to/Digitakt_II_OS1.17.syx # also analog-rytm-mkii, model-cycles
```

It builds every image the site asks for (the base and its step base, both with USB Audio off while USB Audio is a module) with the browser's own path
(`published-base.ts`), checks each identity against the committed pins, and uploads image and manifest entry with the
owner's `wrangler` login (`--dry-run` builds and checks without uploading). Create the bucket once with
`npx wrangler r2 bucket create modwerk-base-images`. Run it after a base release is live, from a checkout of the deployed revision. An image
already in the bucket with the same identity and SHA-256 is skipped; the same identity with another SHA-256 stops it. Contributors never run it and CI has no access to
the bucket.

After every base release (the Octatrack's 0.8.4, repeat98/modwerk#2333, is the next), run it again: the guide offers
only the base this deploy publishes, so until the new images are up it falls back to the musician's own file. The
step is in [Ship a base](OWNER_OPERATIONS.md#ship-a-base).

## Rules this changes

The rule "firmware never enters Git or CI" holds as before. The one exception is these base images, built and uploaded
by the owner, for makers who agreed. `MODDING_GUIDELINES.md`, `AGENTS.md`, `sdk/machines/AGENTS.md` and the
[machine recipe](MACHINE_RECIPE.md) say so; the stock-free scanners and CI gates are unchanged, because nothing stock
enters the checkout.
2 changes: 1 addition & 1 deletion docs/MACHINE_RECIPE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Read this before you plan a core, a base or the first modules for any machine ot

| Piece | On the Octatrack | What a new machine adds |
| --- | --- | --- |
| Base | [`sdk/machines/octatrack/elekloader/`](../sdk/machines/octatrack/elekloader/README.md), built in the browser from the user's own stock OS ([`octatrack-base.ts`](../src/engine/elekloader/octatrack-base.ts)); firmware never enters CI; one variant per USB Audio layout, each identified in `base-binding.json`'s `variants` | Its base source in `sdk/machines/<id>/`, started from the upstream core's source; the same browser build. Where a shared part costs every build (the Rytm's send bus: RAM and kit storage), a variant without it, recorded in the same `variants`, and the site picks the variant from the selection (the Rytm: [`machine-build.ts`](../src/engine/elekloader/machine-build.ts)) |
| Base | [`sdk/machines/octatrack/elekloader/`](../sdk/machines/octatrack/elekloader/README.md), built in the browser from the user's own stock OS ([`octatrack-base.ts`](../src/engine/elekloader/octatrack-base.ts)); firmware never enters CI, and the owner hosts the prebuilt image for musicians without the file ([hosted bases](HOSTED_BASES.md)); one variant per USB Audio layout, each identified in `base-binding.json`'s `variants` | Its base source in `sdk/machines/<id>/`, started from the upstream core's source; the same browser build. Where a shared part costs every build (the Rytm's send bus: RAM and kit storage), a variant without it, recorded in the same `variants`, and the site picks the variant from the selection (the Rytm: [`machine-build.ts`](../src/engine/elekloader/machine-build.ts)) |
| Hooks | [`events.json`](../sdk/machines/octatrack/events.json) generates [`HOOKS.md`](../sdk/machines/octatrack/HOOKS.md) and `include/modwerk_events.h`: call, take and table hooks, each with an order band and a room | The same registry format, starting with the core's UI hooks and the shared sites the first modules need |
| Admission | The loader refuses a package past a hook's room or the declared budgets; `compatibility.uiClaims` and the [pairwise check](module-guides/README.md#cross-compatibility) | The machine's budgets in `machine.json`'s `sdk` |
| USB link | Vendor interface on the unit ([`ep0.c`](../sdk/machines/octatrack/elekloader/ep0.c), [`sdk/runtime/upload/`](../sdk/runtime/upload/README.md), [USB vendor interface](../sdk/machines/octatrack/elekloader/README.md#usb-vendor-interface)); host side [`octatrack-link.ts`](../src/engine/elekloader/octatrack-link.ts), [`upload-session.ts`](../src/engine/elekloader/upload-session.ts), [`module-set.ts`](../src/engine/elekloader/module-set.ts); identify, inventory, status, load meters, self-test results and the unit's log ([`diag.c`](../sdk/machines/octatrack/elekloader/diag.c)) | A transport on the machine's USB: a vendor interface like the Octatrack's, or SysEx where USB MIDI is all the unit offers (the [LXR-02 plan](LXR_02.md)); the upload controller's frames then go over the link: whole on the Digitone II (`upload`, [`dn2-link.ts`](../src/engine/elektron/dn2-link.ts)), in parts on the Model:Cycles ([LINK.md](../sdk/machines/model-cycles/LINK.md#loading-modules)) |
Expand Down
4 changes: 4 additions & 0 deletions docs/OWNER_OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Running the live Modwerk site is the owner's work: the complete issue-fix and re
- The unit on this computer is a development unit, and agents need no OK from the owner to use it (owner, 20 November 2026): a session takes its turn through the queue and runs, without asking, rolled-back trials, `device:test`, `device:price`, RAM boots of development builds, driving it and captures. It also Keeps without asking when a test needs it (`device:qualify` does), on the card that is in the unit: never ask him to insert or swap a card. Before the first Keep it records the kept set (`inventory`) and the flashed base's identity, and when it is done it puts that set back and checks the inventory against the record. Flashing stays his, and so do power cycles: an agent never power-cycles the unit itself and asks for one only when a test cannot go on without it.
- Disk space on the owner's computer runs out. Once a pull request you opened is merged or closed, remove its worktree with `git worktree remove` and delete the temporary folders you created for it, such as builds, renders and logs under `/private/tmp`. Keep anything with uncommitted or unpushed work, and leave folders another session created.

## Ship a base

When a machine's cumulative base draft (`base/<machine>-next`) is merged and live, publish its hosted images the same day, or the install guide asks everyone for their own OS file again until you do: from a checkout of the deployed `main`, `npm run base:publish -- --stock <your OS file>` uploads the new base and its step base ([hosted bases](HOSTED_BASES.md#publish)). The Octatrack's 0.8.4 (repeat98/modwerk#2333) is the first base this applies to.

## Email sendouts

- For an email sendout, follow [Preparing an email sendout](COMMUNITY_OPERATIONS.md#preparing-an-email-sendout). Draft and preview revisions are operational work, without app checks or SDK builds; validate any notification-code repair separately.
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Every document in `docs/`, one line each. [AGENTS.md](../AGENTS.md) says which t
- [STATISTICS.md](STATISTICS.md): the admin statistics.
- [WEB_PUSH.md](WEB_PUSH.md): device push notifications.
- [FIRMWARE_DOWNLOAD_API.md](FIRMWARE_DOWNLOAD_API.md): building and saving firmware without a browser.
- [HOSTED_BASES.md](HOSTED_BASES.md): the prebuilt base images the owner hosts, for makers who agreed, and how he publishes them.
- [EXTERNAL_PROJECTS.md](EXTERNAL_PROJECTS.md): the Other projects directory.
- [SOCIAL-PREVIEW.md](SOCIAL-PREVIEW.md): sharing preview artwork.
- [COMMUNITY_OPERATIONS.md](COMMUNITY_OPERATIONS.md): running the community: registrations, moderation, [email sendouts](COMMUNITY_OPERATIONS.md#preparing-an-email-sendout).
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"changelog": "node scripts/changelog.mjs",
"preview": "vite preview --host 127.0.0.1",
"firmware:download": "node scripts/firmware-download.mjs",
"base:publish": "node scripts/base-publish.mjs",
"firmware:api": "node scripts/firmware-api.mjs",
"mcp": "node scripts/frontend-mcp.mjs",
"lint": "eslint --cache --cache-strategy content --cache-location node_modules/.cache/eslint/",
Expand Down
Loading
Loading