From 99f786ec0048a3c95d994c7e13bbe24ace71ee3a Mon Sep 17 00:00:00 2001 From: Diego Date: Sat, 7 Nov 2026 14:09:01 +0100 Subject: [PATCH] Fix: published-package test counts only site-event hook words past the four UI handlers Co-Authored-By: Claude Opus 5.5 --- changelog/2026-11-07-titled-package-hook-words.md | 1 + src/engine/elekloader/module-set.test.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/2026-11-07-titled-package-hook-words.md diff --git a/changelog/2026-11-07-titled-package-hook-words.md b/changelog/2026-11-07-titled-package-hook-words.md new file mode 100644 index 000000000..4a9a0b3c2 --- /dev/null +++ b/changelog/2026-11-07-titled-package-hook-words.md @@ -0,0 +1 @@ +SDK: the published-package test accepts an ABI 8 C package that only has its UI handlers (module_tick, module_draw, module_key, module_enc), as `npm run octatrack:module-packages` now publishes one with no events (#1231). Only hook words past those four, which are site events, need the base's events feature (128), as the builder already decides. diff --git a/src/engine/elekloader/module-set.test.ts b/src/engine/elekloader/module-set.test.ts index 3843166d4..06703be68 100644 --- a/src/engine/elekloader/module-set.test.ts +++ b/src/engine/elekloader/module-set.test.ts @@ -22,7 +22,7 @@ describe('the site’s runtime packages', () => { if (!('octabam' in entry) && !('machine' in entry) && !('tables' in entry) && !('base' in entry) && !('sources' in entry)) expect([abi, view.getUint32(20), view.getUint32(24)]).toEqual([entry.requires ? 9 : 6, 0, 0]) // ABI 6 DSP effects (9 when they require a base feature) carry no stock-code bytes if ('machine' in entry) expect([abi, view.getUint16(6) & 4]).toEqual([8, 0]) // an independent machine package, never a group expect([entry.abi, entry.sites, entry.copies, entry.fills]).toEqual([abi, view.getUint32(24), abi >= 7 ? view.getUint32(68) : 0, abi === 8 ? view.getUint32(72) : 0]) - expect(view.getUint32(20) > 0).toBe((entry.features & 128) !== 0) // only a site-event subscriber has hook words + expect(view.getUint32(20) > 4).toBe((entry.features & 128) !== 0) // only a site-event subscriber has hook words past the four UI handlers (module_tick, module_draw, module_key, module_enc) // A package bound to a base names exactly the published one (octatrack:base writes its binding). expect((entry as { requiredBase?: string }).requiredBase).toBe('base' in entry ? baseBinding.identity : undefined) }