feat(v0.44): define compiler intrinsics by binding provenance, not spelling (#1209) - #1250
Merged
Merged
Conversation
…elling (#1209) Alpha.10 truth closure: the compiler admitted intrinsics by identifier spelling (getText === 'element'), letting foreign/ambient same-name bindings into the OE grammar, with three disagreeing recognizers. - one canonical intrinsic-binding model in the semantic core (createModuleIntrinsicBindings / resolveIntrinsic): module specifier + imported name, aliases followed; bare/global/local spellings never admit; type-only/namespace/default/conflicting/relative-re-export provenance fails closed with OEC9027 - compile.ts: every recognition site uses the model; import injection deleted; generated modules strip compile-time-only element/property bindings; codegen follows aliases - plugin.ts prefilter documented as a non-recognizer; ambiguous provenance routes to the compiler boundary for fail-closed diagnostics - element gains runtime no-op element/property exports (@experimental dual-use contract) so ui/www modules evaluate uncompiled; the ui compile-decorators impostor shim is deleted - all declare-spelling fixtures/templates/www/examples/tools and the MDX generator + v0.44 codemod migrated to canonical imports - 19 hostile provenance tests (RED at baseline) + 3 no-op contract tests Implemented by fresh kimi-code/k3-256k HIGH session (.agents/v044-kimi-implementer.md), packet A10.1 with two orchestrator-reviewed repair rounds (scope expansion + ui dual-use resolution). No frozen ADR-0122 paths touched. No publish, no tag.
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 #1209 (umbrella #1155, Alpha.10). The compiler recognized intrinsics by identifier spelling: a third-party
elementfunction, an ambientdeclare function element, or a local class namedOpenElementwere silently admitted into the OE language grammar (proven at base SHA with adeno evalprobe: BASELINE-ADMITS-FOREIGN). Three recognizers disagreed (compile.ts spelling, module-analysis dual-mode, plugin.ts substring).Owner
Canonical owner: the bundler-neutral compiler semantic core (ADR-0148). This PR REMOVES the spelling recognizers and concentrates all admission/provenance in one model (
createModuleIntrinsicBindings/resolveIntrinsicin module-analysis.ts). The plugin.ts substring prefilter remains only as a documented cheap perf gate, explicitly not a recognizer.Before
Spelling-based admission; foreign/ambient/same-name bindings compiled; import injection papered over missing canonical imports.
After
Intrinsics are binding identities: canonical runtime named import from
@openelement/element(or@openelement/appfor defineIslandConfig), aliases followed. Bare/global/local/type-only/namespace/default/conflicting/re-export spellings are never admitted — ambiguous provenance fails closed with source-located OEC9027. Codegen follows aliases (extends <localName>). Generated modules strip the compile-time-onlyelement/propertybindings. The uicompile-decorators.tsimpostor shim is deleted;@openelement/elementgains@experimentalruntime no-opelement/propertyexports with a documented dual-use contract (inert when evaluated uncompiled; no runtime semantics; not a recognizer).Why this is not a second semantic owner
Exactly one binding-resolution model used by compile/lowering, module analysis, and diagnostics; the no-op runtime exports are inert evaluation scaffolding, not recognition logic.
Evidence
deno task build; FULLdeno task test(1630 + 150 example tests, 0 failed).Scope / non-goals
No Vite/Rollup imports in semantic-core; no public compiler package; no re-export provenance resolution across modules (deliberate — single-module bundler-neutral analysis; fails closed with a clear diagnostic); desktop examples retain local shims (follow-up recorded on the issue).
Risk
User code relying on bare/ambient spellings now fails closed with OEC9027 — intended truth-closure breakage, pre-1.0.
expected-program.jsonregen is position-metadata-only (program semantics byte-identical). Rollback: revert this commit.