Skip to content

@thoremin/ext-air: the air extension as a workspace package (ADR follow-up c, part 3) - #301

Merged
thorwhalen merged 3 commits into
mainfrom
adr/ext-air-package
Oct 6, 2026
Merged

thorwhalen merged 3 commits into
mainfrom
adr/ext-air-package

Conversation

@thorwhalen

Copy link
Copy Markdown
Owner

Follow-up (c), part 3 of the instruments-as-graphs ADR (#268): the air extension becomes a workspace package, @thoremin/ext-air. With #298 (sdk) and #300 (sdk-ui), that completes O2 (§4.3) for the first extension. O3, separate repositories, still waits on #262.

What moved

  • src/extensions/air → packages/ext-air/src, by git mv. 257 specifiers were rewritten mechanically: the extension's own imports became relative, and tests and scripts now import @thoremin/ext-air/....
  • extensions.json names the package (@thoremin/ext-air, @thoremin/ext-air/ui), and the generated list declaration types it from there.
  • The package imports only packages (packages_purity), so an extension physically cannot import the app.

Guards that would otherwise have gone vacuous

A review of #300 noted five static guards that found extensions by scanning src/extensions. After this move they would have scanned nothing and stayed green. They now find extension sources from extensions.json (SHIPPED_EXTENSION_DIRS in test/helpers/extensions.ts) and fail if they find none:

  • dials_write_path, layering, commands_firewall, timescale_boundary, extensions_boundary.
  • I probed the rewritten rule-2 boundary test by planting an @/app import, an sdk-ui import and an app-side import into lib/notes.ts. All three were caught.
  • The core-alone bundle check now flags any packages/ext-* module. A probe import of @thoremin/ext-air/lib/notes from main.tsx was caught.
  • The manifest test checks that a package-named extension's index.ts / ui.tsx exist.

Verified

  • npm run typecheck (now includes packages/ext-air/src, minus its .tsx), typecheck:core, npm test (2442 passed), npm run build (the full bundle carries the air nodes), and npm run test:core (2335 passed / 87 skipped, bundle check clean): all green.
  • The deploy is unchanged: npm ci && npm run build at the root links the new workspace.

Refs #268.

…ow-up c, part 3)

- src/extensions/air moves to packages/ext-air/src (git mv, 257 specifiers rewritten: the
  extension's own imports relative, tests and scripts via @thoremin/ext-air/...);
  extensions.json names the package, the list declaration is typed from it
- the package imports only packages (packages_purity): an extension physically cannot import
  the app
- the static guards that scanned src/extensions (write path, layering, command firewall,
  timescale boundary, extension boundary) find extension sources from extensions.json
  (SHIPPED_EXTENSION_DIRS) and fail if they find none; probed with planted violations
- the core-alone bundle check flags any packages/ext-* module (probed)
…nsions.json, so tests no longer depend on the working directory
…t, in-tree or a package); rule 2 resolves the file an import reaches, so a pure file cannot reach its React half by an explicit .tsx or a directory
@thorwhalen
thorwhalen merged commit eecd658 into main Oct 6, 2026
3 checks passed
@thorwhalen
thorwhalen deleted the adr/ext-air-package branch October 6, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant