Repository navigation
Conversation
A module that keeps state contributes one ot_store record (table index 38) naming a block in its own memory. The base keeps every block in project.work as '#MWS=', '#MWD=' and '#MWE=' lines (16 bytes a line, 53 characters at most) through fxmap's existing project-file seams, so the table owns no stock site. It also keeps them in battery RAM (0x100f8f08, 12 KB), because a power cycle reads no project file. The loader's storing pass only stages complete entries whose sum holds. The UI tick commits them after a successful load and calls each module: LOADED, NEW for a project without its block, or RESTORED after a power-on or a reinstall. Once a second it copies changed blocks to battery RAM. The writer only reads: installed modules' blocks as they are, then the kept blocks of modules that are not installed, written back unchanged. Base rebuilt with --beta --write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run octatrack:module-packages -- --base-only (the write-lease entries did not move). system.md and the module guides' README tell authors to keep settings in ot_store instead of a format or battery RAM of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Micro Timing draft (#1262) keeps its table at 0x100f8ffc-0x100f97ff, inside the range the store took. The store now fills 0x100f9800-0x100fc000: 10,232 bytes for every kept block. Base rebuilt, base-bound packages relinked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/module-guides/README.md
This was referenced Nov 8, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: waits for the owner's unit test. Not mergeable before that.
What
Modwerk's own per-module settings store, in the base (owner, 8 November 2026: our own implementation, not octabam's).
ot_store(events.json index 38, 16 bytes, room 32):{abi, block, bytes, version, loaded(how, version, bytes)}. The module keeps its state in its own block. The base saves the block with the project and hands it back.project.workas#MWS=module:version:bytes,#MWD=module:offset:hex(16 bytes a line, at most 53 characters with CR LF; the base's own#MODWERK_FX=lines already reach about 45 on hardware) and#MWE=module:sum(FNV-1a). Stock's loader skips#lines, so stock's SAVE,.work→.strdcopy, RELOAD and project change carry them. The store rides fxmap's existing project-file seams (fxmap.c calls in), so the table owns no stock site.LOADED, or withNEWwhen its project has no block for it.RESTORED).0x100f9800-0x100fc000(10,232 bytes for all blocks). It copies changed blocks there once a second, so a power cut can lose the last second. The first range I picked overlapped the Micro Timing draft's battery table (0x100f8ffc-0x100f97ff, Align Micro Timing's screen claim, battery notes and index #1262), so the store starts after it.modwerk_store_tick, ev_tick order 94). The loader pass only stages lines; the tick commits them, calls the modules and keeps battery RAM up to date. The writer only reads: the live blocks of installed modules, then the kept blocks of the rest.system.md("Persistence is honest") and the module guides' README ("A module owns what it saves", the Module settings row) now nameot_store. HOOKS.md is regenerated from events.json.Base rebuilt with
--beta --write. Base-bound packages relinked (octatrack:module-packages -- --base-only); the write-lease entries did not move.How I checked
test_store.c(insdk/tests/test_machine_events.py, address and undefined-behaviour sanitizers) covers:I broke the sum check on purpose and the test failed.
npm run pr:ready: Ready (SDK suite, site tests, base pins).Not tested
ot_emu, 8 November; emulator evidence, not hardware). The base was built from 35498b4 (--beta --out), with a probe module (40-byte block, version 1) on the private TEMPLATE card:NEW. PROJECT > SAVE writes one#MWS, three#MWDand one#MWEline with the right bytes and sum (longest line 53 characters) and leaves stock's lines alone. PROJECT > RELOAD givesLOADEDwith the saved bytes. A restart with battery RAM kept (--cs1-in) givesRESTOREDwith the battery's newer block. Removing the probe keeps its lines through a SAVE, and re-adding it givesRESTORED.project.work. The store needs the new-project path; that fix comes before this can merge.OS_VERSIONin the saved file went from the fixture'sR0177 1.40BtoR.Base batch
#1321 (crash naming) also regenerates the base files. Whichever merges second merges
main, then rebuilds the base (--beta --write) and the base-bound packages.Guides
Battery RAM has no ledger, so nothing caught the overlap with Micro Timing. A check for it follows as its own Improvement PR.
🤖 Generated with Claude Code