Skip to content

refactor: centralize component ownership and generation disposal - #383

Merged
smiggleworth merged 2 commits into
mainfrom
codex/core-03-ownership
Sep 5, 2026
Merged

refactor: centralize component ownership and generation disposal#383
smiggleworth merged 2 commits into
mainfrom
codex/core-03-ownership

Conversation

@smiggleworth

@smiggleworth smiggleworth commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

A component could be disposed repeatedly during reentrant cleanup, retain a child scope after a strict cleanup failure, or attach a lifecycle callback's returned cleanup after its lifetime had ended. Navigation also copied and reset component fields itself.

This change gives each lifetime one runtime ownership record and one disposal path. Component and keyed/control scope cleanup, resource/watch/query attachments, and cancellation use that owner. Lifecycle settlement captures its invoking lifetime, renderer reuse rejects disposed owners, and root preparation/rollback/retirement moves into runtime capabilities. The compatibility adapter preserves published owner properties and callback/readable-map identity through backed views, including extension-created records.

Validation:

  • Formatting, lint/typecheck, build, public types, and publint pass.
  • 238 unit, 53 repository-check, 1,533 jsdom, and 53 tests in each of Chromium, Firefox, and WebKit pass.
  • Packed candidate and published 0.2.4 consumer fixtures pass (14 tests plus both TypeScript compiler checks).
  • Three baseline and three candidate benchmark captures against ffa0ff4 pass all 19 touched rows: every capture meets the quality rules and every median change stays within 5%. The largest slowdown is 4.55% for table truncation. Full per-run statistics and provenance are in docs/benchmarks/core-ownership-8847810.json; no optimization claim.

Stage 3 of the core consolidation series. Renderer range ownership and the shared commit coordinator remain the following stages.

@smiggleworth
smiggleworth marked this pull request as ready for review September 5, 2026 00:00
@smiggleworth
smiggleworth merged commit 346b05a into main Sep 5, 2026
7 checks passed
@smiggleworth
smiggleworth deleted the codex/core-03-ownership branch September 5, 2026 00:04
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