v0.40.6 — Audit-Driven Quality Cleanup
v0.40.6 Release Plan
Summary
v0.40.6 closes the internal quality gaps identified by the 2026-06-15
architecture audit (docs/audit/2026-06-15-architecture-audit.md). The release
adds test coverage for element and ui, splits over-large source files,
unifies error handling, cleans up runtime assertions, and removes remaining
ad-hoc console.* usage. No public API or package topology changes are
introduced.
This release also fixes the post-publish consumer smoke failure that affected
v0.40.5: packages/adapter-vite/src/ssg-package-resolver.ts now resolves the
new @openelement/ui subpaths open-dropdown, open-modal, and open-tabs
that were added in the v0.40.6 UI component test hardening. Additionally,
packages/create/deno.json correctly declares its dependency on
@openelement/core/logger, and the JSR publish order places create after
core.
This release is executed under the v0.40.x cleanup-train authority from
ADR-0105 and recorded in ADR-0106.
Changes
Documentation
- Add
docs/audit/2026-06-15-architecture-audit.mdas a persistent architecture
artifact. - Add ADR-0106 documenting the audit-driven cleanup scope and boundaries.
- Update
docs/status/STATUS.mdanddocs/roadmap/ROADMAP.mdfor the v0.40.6
line. - Archive the v0.40.4 plan to
docs/release/v0.40.4-plan.md.
Tests
- Expand
packages/element/__tests__/open-element.test.tsfrom 2 to 22 tests,
covering lifecycle, DSD/CSR, signal hydration, events, static props, error
boundaries, form internals, and params. - Expand
packages/ui/__tests__/components.test.tsfrom 20 to 58 tests,
covering all 13open-*components plus manifest metadata. - Add missing
open-dropdown,open-modal, andopen-tabsdeclarations to
packages/ui/src/manifest.tsand update smoke tests accordingly.
Error Handling
- Introduce
formatError(e: unknown): stringinpackages/core/src/errors.ts. - Replace all
e instanceof Error ? e.message : String(e)patterns across
packages with the shared helper.
File Size Reduction
- Split
packages/ssg/src/route-scanner.tsinto
route-scanner-ast.ts+route-scanner-fs.ts+ orchestrator
(~795 → ~555 lines). - Split
packages/element/src/open-element.tsinto
open-element-render.ts+open-element-hydration.ts+ base class
(~719 → ~602 lines). - Extract alias normalization and build constants from
packages/adapter-vite/src/cli/build-ssg.tsintoalias-utils.tsand
build-constants.ts(~526 → ~492 lines).
Runtime Safety
- Replace
shadowRoot!assertions inopen-element.tswith a guarded local
variable. - Add runtime guards for RegExp match indices in
postprocess.ts. - Add runtime guard for
openElement.moduleinentry-descriptor.ts.
Adapter-Vite Cleanup
- Move alias normalization to
alias-utils.ts. - Move build constants (
DEFAULT_ADAPTER_VERSION_FALLBACK,
SSR_CHUNK_SIZE_WARNING_LIMIT_KB,SANITIZE_HTML_SPECIFIER) to
build-constants.ts.
Logging Cleanup
- Route
router/src/client-router.ts,adapter-vite/src/cli/build.ts,
create/cli.ts,ui/src/open-layout.tsx, andui/src/open-code-block.tsx
logging throughOpenElementLogger. - Leave generated runtime code and the low-level signal engine console logger
unchanged by design.
Acceptance
deno task fmt:check,deno task lint,deno task typecheck, and
deno task testall pass.deno task type-safety:checkreports 0 explicitany.deno task graph:checkanddeno task package-surface:checkconfirm no
package or public surface changes.deno task arch:check,deno task repo:hygiene,
deno task workflow:check, anddeno task workflow:check-slimmingpass.deno task docs:check-current,deno task docs:check-public, and
deno task docs:check-strategypass.deno task consumer:localanddeno task consumer:packagedpass.deno task nitro:proof:nodeanddeno task nitro:proof:workerspass.deno task publish:dry-runpasses.
Verification
deno task fmt:check
deno task lint
deno task typecheck
deno task test
deno task test:coverage:check
deno task build
deno task graph:check
deno task arch:check
deno task repo:hygiene
deno task workflow:check
deno task workflow:check-slimming
deno task docs:check-public
deno task docs:check-current
deno task docs:check-strategy
deno task package-surface:check
deno task signals:check-protocol-boundary
deno task type-safety:check
deno task autoflow:test
deno task autoflow:push
deno task autoflow:ci
deno task nitro:proof:node
deno task nitro:proof:workers
deno task consumer:local
deno task consumer:packaged
deno task publish:dry-run