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>
Adds the application composition root and six new runtime artifacts. lang
and logr alone could not cover an app surface — locale propagation, format
helpers, frontend preferences, validation, persistence and DOM service all
needed independent artifacts that aapp wires together under a single
locale source of truth and a shared logger.
New artifacts:
- aapp: composition root. createActiveApp + createTestApp +
App.createSiumEngine + frontend.persist + Storage wiring.
- stor: pluggable adapters (local/session/memory/cookie + SSR via
cookieAdapter.fromCookies), envelope versioning + migrate +
TTL, validate via Standard Schema, intra-tab + cross-tab sync,
Storage.clear(), per-entry adapter/namespace overrides.
- adom: reactive DOM service. shareViewport opt-in + per-window
tracker, dispose(). breakpoints, viewport, attribute writes.
- fend: frontend preferences (theme, mode, dir, density,
reducedMotion, reducedSound) with auto/clear/isAuto pattern.
- fmts: localized formatting (numbers, currency, units, dates) with
shared LocaleSource and per-domain auto/clear pattern.
- sium: validation engine. Standard Schema interop, Lang/Logger
injection, codec/refine/transform, domain types
(color/date/time), introspection.
Existing artifacts extended:
- lang: BCP 47 SupportedLocale (LangBase | base-region), mono lang
for monolingual apps, extend() leaf-overwrite warning,
EngineLang/ActiveLang naming alignment with the rest of the
project (no Instance suffix).
- logr: EngineLogger.dispose(), failureThrottleMs anti-cascade for
transports, README sync to the per-level filter API
(minLevel removed).
Cross-cutting:
- $locale: shared LocaleSource type consumed by fmts and fend.
- arts/README.md: artifact map, dependency graph, naming conventions.
- Test pages for every artifact under /test/<artifact>.
733 tests passing; svelte-check clean except 2 pre-existing errors on
sium/svelte provider (port pending).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>