Layer-boundary cleanup (audit-1-5.md section 1):
- fend → adom: move apply.ts to libs/dom; FrontendDom is now DomApplier;
fend falls back to bare applyChange instead of constructing ActiveDom
- sium → lang: full split — pure code (consts, types, guards, helpers,
errors, json, plural, plural_rules, diagnostics) moves to libs/lang;
arts/lang keeps engine + active wrappers and re-exports for back-compat
- conn → timr: minimum split — types and public constants move to
libs/timers; conn imports types from $libs/timers; EngineConnectionsOptions.timers
is now required (no more silent createEngineTimers fallback). Tests
updated to construct shared timers per beforeEach
Bus contract finishing touches (continued from prior session):
- subscribe() returns the unsubscribe function directly
- publishCausedBy() propagates correlationId/causationId
- invokeListener hook + Svelte adapter wraps listeners in untrack
- maxReentrancyDepth guard with BusReentrancyLimitError (fatal — bypasses
listener-error trap)
- DEV-mode structuredClone payload check raising BusInvalidPayloadError
- BusListenerFailure carries envelopeId/correlationId/causationId
- createBusRecent active wrapper, bus-context.svelte.ts, APP_EVENT_RUNTIMES
table with assertEventCanFire wired into every publishApp* helper
- App switches to createSvelteEngineBus
audit-1-5.md captures the full ecosystem audit (5 axes); section 1 is
now closed by these changes. Sections 2-5 remain open.
Verification: svelte-check 1395/0 errors; server 1230 tests passed;
client 19 tests passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>