Skip to content

refactor(v0.44): converge existing-DOM claim to one canonical execution path (#1211) - #1253

Merged
SisyphusZheng merged 1 commit into
devfrom
v044/a10.3-claim-convergence
Sep 2, 2026
Merged

refactor(v0.44): converge existing-DOM claim to one canonical execution path (#1211)#1253
SisyphusZheng merged 1 commit into
devfrom
v044/a10.3-claim-convergence

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Member

Problem

Issue #1211 (umbrella #1155, Alpha.10, audit H1). Two claim engines with duplicate claimExistingDom/PartProgramClaimError semantics: engine A in runtime.ts (production, used by the Kernel) and engine B in claim/index.ts (dead in production, but owning the pre-upgrade capture/replay helpers the facade imports). Forbidden multi-semantics (constitution 4.2).

Owner

Canonical claim executor: packages/element/src/internal/compiled/runtime.ts. The Kernel already used it; the semantic duplicate is deleted (1441 lines), no backup retained. This PR REMOVES a semantic authority and ports required behaviors into the canonical one.

Before → After (behavior audit, full table in the commit/PR discussion)

Behavior Engine A (production) Engine B (dead) Disposition
Staged validation partial (subscriptions interleaved) full plan→attach ported B (scan subscribes nothing)
Bounded recovery none owning, one attempt ported B
Ownership diagnostics 2-arg error 3-arg + ClaimOwner canonical = B's superset ctor
Pre-upgrade events unreachable option capture/replay helpers ported to canonical home
Zero-allocation claim yes yes kept (identity asserted)
Regions shared update machinery duplicated/reduced kept A + ported detached-anchor guard
Static-style / disposal expectStaticStyle / ResourceScope same / flat list kept A
Missing-attr + item validation absent present ported B
Empty text-part tolerance tolerant (serializer parity) strict kept A

Evidence

  • RED at base SHA: new single-owner.test.ts found 2 executors / 2 error classes; repointing the existing 16-test claim suite at engine A failed 8 tests (missing staging/recovery/owner diagnostics/pre-upgrade helpers).
  • GREEN: 17/17 claim tests against the canonical engine (node identity on success, staged validation = 0 subscriptions on failure, fail-closed mismatch, bounded recovery, pre-upgrade replay); element suite 220 passed; full deno task test exit 0; fmt/lint/typecheck/arch/freeze-semantics/package-surface/interface:snapshot all exit 0; public snapshot unchanged.
  • Fresh kimi-code/k3-256k HIGH implementer session; orchestrator independently re-ran the claim suite and verified the deletion surface.

Scope / non-goals

Facade lifecycle/mode truth (willClaim) is A10.5's scope — the helpers now sit in the canonical home ready for it; kernel claim-option wiring likewise. No adapter-vite changes.

Risk

Claim error constructor contract unified to 3-arg (internal type; snapshot unchanged). Duplicate-key error message unified to engine B's wording. Rollback: revert.

…on path (#1211)

Alpha.10 truth closure (H1): two claim engines existed — runtime.ts
(production) and claim/index.ts (dead in production but owning the
pre-upgrade helpers the facade imports), with duplicate
claimExistingDom/PartProgramClaimError definitions.

Behavior audit decided the canonical engine: runtime.ts stays canonical
(zero-allocation claim, shared Region update machinery, ResourceScope
disposal, serializer/fresh parity); from the deleted duplicate it
absorbs the behaviors the production engine lacked: full staged
plan→attach validation, bounded owning recovery (region-range or root,
exactly one attempt), ClaimOwner ownership diagnostics (3-arg
PartProgramClaimError), pre-upgrade capture/replay helpers (now in the
canonical claim home), missing-attribute drift check, own-field
each-item validation, and the detached-anchor update guard.

- claim/index.ts deleted (1441 lines); no backup implementation
- single-owner mechanical test pins one executor / one error class
- kernel already used runtime.ts; facade import updated only
- public interface snapshot unchanged (internal modules only)

Implemented by fresh kimi-code/k3-256k HIGH session
(.agents/v044-kimi-implementer.md), packet A10.3. No frozen paths, no
publish, no tag.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@SisyphusZheng
SisyphusZheng merged commit b96d972 into dev Sep 2, 2026
9 checks passed
@SisyphusZheng
SisyphusZheng deleted the v044/a10.3-claim-convergence branch September 3, 2026 09:50
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