fix(v0.44): make claim-vs-fresh activation mode a Kernel-owned truth (#1213) - #1254
Merged
Conversation
…1213) Alpha.10 truth closure (H3 + M1): the facade guessed willClaim before the kernel resolved its root — closed-shadow DSD claims were misreported as CSR and pre-upgrade replay was skipped — and the pre-upgrade capture (8 document listeners + a strong Map retaining event targets) was never torn down. - kernel.connect() now returns the activation truth ({ mode: 'claim' | 'fresh', root }); the executor that performs claim/fresh owns which mode happened; a thrown connect produces no mode, so failure can never mislabel - closed-root DSD discovery works for real: the kernel reaches a declaratively attached closed root through ElementInternals.shadowRoot (attachShadow would wipe declarative content); form-associated hosts reuse the form controller's internals - facade derives onDsdHydrated/onCsrRendered and pre-upgrade replay from the kernel result; capture is released (listeners stopped, records cleared) with every activation decision, success or failure - removes the stale type-escape allowlist entry for the deleted pre-connect probe (tools/check-architecture-contract.ts) Implemented by fresh kimi-code/k3-256k HIGH session (.agents/v044-kimi-implementer.md), packet A10.5. Public interface snapshot unchanged. No publish, no tag.
Deploying openelement with
|
| Latest commit: |
92be264
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f496c441.lessjs.pages.dev |
| Branch Preview URL: | https://v044-a10-5-activation-truth.lessjs.pages.dev |
Contributor
|
APIError: Insufficient Balance |
Repair per CI e2e evidence (light-mode-activation.spec.ts:48 failing on chromium/firefox/webkit): the first activation's blanket teardown of the shared document-level capture broke the standing delayed-upgrade replay contract (#1170). - per-element record release at each activation decision (success or failure) via releasePreUpgradeEvents(kernel.root, ...) — retained event-target records (the actual M1 leak) die with the decision - the fixed page-level capture listener set stays installed for pending elements; outside-root records are neither released nor consumed by another element's replay - exactly-once replay preserved (consumed WeakSets + record release) - new unit proof: a late upgrader still replays its pre-upgrade click after another activation; failed claim releases only its own records - e2e contract spec verified green locally on chromium against a fresh www build Repair by the same kimi-code/k3-256k HIGH session (packet A10.5-repair) on top of the orchestrator-reviewed base.
Contributor
|
APIError: Insufficient Balance |
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #1213 (umbrella #1155, Alpha.10, audit H3 + M1). The facade guessed
willClaimbefore the kernel resolved its root: for closed ShadowRoots the guess always read an empty root, so a closed-root DSD claim was misreported asonCsrRendered()and pre-upgrade replay was skipped. Separately, the pre-upgrade capture (8 capture-phase document listeners + a strongMapretaining event targets incl. detached DOM) was never torn down — the onlystop()lived behind the deleted engine-B's unreachable option.Owner
The Kernel (the executor that performs claim/fresh) owns which mode happened:
connect()returns{ mode: 'claim' | 'fresh', root }. The facade derives lifecycle hooks from that result — the pre-connect guess (#rootContent) is deleted. This PR REMOVES a second mode-decision authority.Before
Facade guesses mode pre-connect; closed-root DSD claim mislabeled; capture leaks for page lifetime.
After
Mode computed once from the resolved root's real content by the executor; hooks/replay tied to actual claim success; capture released in
finallyon every activation decision. Closed-root DSD claim now works for real viaElementInternals.shadowRootdiscovery (browsers wipe declarative content onattachShadow, so that could never serve the claim).Evidence
onDsdHydrated(H3); capture-teardown tests failed (M1); kernel returned void.deno task testexit 0; all static gates green; interface snapshot unchanged (internal plumbing only).Scope / non-goals
No new lifecycle callbacks; no public API expansion; no second claim path.
Risk
Per the issue's mandated contract, the first activation decision tears down the shared document-level capture — islands upgrading much later (idle/visible) get no pre-upgrade replay (flagged by the implementer; accepted: no listener may survive the decision). Non-form closed-root CSR elements gain a benign
ElementInternalsattachment during discovery. Rollback: revert.