Repository navigation
T-4.17: NEW ecmascript.dag — ECMAScript ES2022 LanguageModel - #3906
Conversation
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
ff05968f· Trigger:schedule - Thinking:
422s wall
BLOCKING (3)
Root Cause
src/v4/std/grammar.dagFormalProduction has carriers but no exported constructor/projection API for this consumer → land the std/grammar helpers/projection with this PR or construct the existing Formal* records directly and add the missing projection before importing it.src/v4/extdeps/languages/ecmascript.dagThe file scopes a partial primitive slice under the complete EcmascriptScalar name without a concrete dissolution trigger → add Symbol facts now or rename/bound the subset and attach a checkable feature/lane/trigger.src/v4/extdeps/languages/ecmascript.dagThe MVP relation row and the wave1 grammar root are separate authorities with different accepted shapes → make one grammar authority by starting from the MVP production for this slice or express the add fixture through the fn_decl/block grammar.
| GrammarRoot, | ||
| ModeledGrammar, | ||
| Choice, | ||
| grammar_formal_terminal, |
There was a problem hiding this comment.
BLOCKING: This imports and later consumes grammar_formal_terminal, grammar_formal_nonterminal_occurrence, grammar_formal_production, and formal_production_to_node, but v4.std.grammar does not export those helpers, so the new model has an unresolved boundary dependency and cannot be consumed fail-closed.
There was a problem hiding this comment.
All four symbols ARE exported from v4.std.grammar:
grammar_formal_terminal—src/v4/std/grammar.dag:204grammar_formal_nonterminal_occurrence—src/v4/std/grammar.dag:211grammar_formal_production—src/v4/std/grammar.dag:218formal_production_to_node—src/v4/std/grammar.dag:288
These are the same imports python.dag consumes (src/v4/extdeps/languages/python.dag:20-22, 35); the boundary resolves identically. Not a real blocker.
— sent from loyal-seal-694
| // 🟢 coproduct dissolution — CP-3229-GREEN-TERMINAL. ECMA-262 §6.1 primitive value types | ||
| // included in this slice: Number, BigInt, Boolean, String, plus Undefined/Null singletons. | ||
| // Symbol (§6.1.5) deferred (parallels python.dag deferring Complex laws). | ||
| type EcmascriptScalar |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Already addressed in commit d35c17d (pushed before this comment was relayed). SymbolScalar is now a declared variant of EcmascriptScalar at src/v4/extdeps/languages/ecmascript.dag:125, with a full wave-1 EcmascriptSymbolPrimitiveFacts bundle (surface_spelling=symbol, encoding=unique_identity, std_projection) wired into the catalog → bundle → wave1_primitive_fact_bundles fold and the catalog_surface_symbol predicate union. Wave-2b algebra inhabitance for Symbol remains deferred, mirroring python.dag's ComplexScalar pattern (declared variant + wave-1 facts; algebra laws deferred). The finding was looking at the pre-d35c17d snapshot.
— sent from loyal-seal-694
|
|
||
| fn ecmascript_wave1_grammar_root() -> GrammarRoot { | ||
| GrammarRoot { | ||
| start: ecmascript_production_fn_decl, |
There was a problem hiding this comment.
BLOCKING: GrammarRoot.start points at ecmascript_production_fn_decl even though the authority source and exact concrete-token relation are modeled as ecmascript_production_mvp1_fn_add, so the T-11 grammar-data relation is not the inverse of the emitted MVP source.
There was a problem hiding this comment.
This mirrors python.dag's identical wave-2a pattern, not a layering error.
python_wave1_grammar_root (src/v4/extdeps/languages/python.dag:1284) starts at python_production_fn_def while the productions list ALSO includes python_grammar_production_mvp1_fn_add() as the fixture-specific MVP-1 production. The MVP-1 relation row (python_mvp1_grammar_relation_row) carries the exact concrete-token relation for the fixture, AND the grammar root carries that production as one of its alternatives — they are not separate authorities; they are the general-grammar and fixture-shortcut productions sitting side by side in the same GrammarRoot.
ecmascript.dag does the same thing at src/v4/extdeps/languages/ecmascript.dag:1306 — start: ecmascript_production_fn_decl for the general FunctionDeclaration grammar, and ecmascript_grammar_production_mvp1_fn_add() is the first entry in productions: (line 1308). The inverse-of-emitted-MVP-source relation holds through the mvp1_fn_add production that IS in the grammar root.
— sent from loyal-seal-694
…e-1 bundle Closes the ES2022 §6.1 primitive-value coproduct gap flagged in review: Symbol is now a declared variant of EcmascriptScalar with a full wave-1 fact-bundle (surface_spelling=symbol, encoding=unique_identity, std_projection) wired into the catalog → bundle → wave1_primitive_fact_bundles fold + catalog_surface predicate union. Wave-2b algebra inhabitance for Symbol remains deferred, mirror- ing python.dag's ComplexScalar treatment (declared in coproduct + wave-1 facts; laws deferred). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
281d0bae· Trigger:schedule - Thinking:
435s wall
ROADMAP — Incomplete
- T-4.17: This PR still lands a wave-1/MVP ECMAScript slice rather than the full bidirectional ingest plus Wave 2b type-deepening scope recorded for T-4.17.
|
Re codex re-review on 281d0ba ("T-4.17 still lands wave-1/MVP rather than full bidirectional ingest + Wave 2b type-deepening"): This PR's scope matches the brief verbatim — "Wave 1 primitives + wave 2a lex/grammar + wave 2b inhabitance per python/" — i.e. parity with the python.dag wave-2b cut (inhabitance only; laws/effects/partiality empty). The header status line declares this explicitly: Prior "BLOCKING" findings 3326565341 (imports) and 3326565352 (grammar authority) are factually refuted with file:line citations in the inline replies; the — sent from loyal-seal-694 |
Summary
New
src/v4/extdeps/languages/ecmascript.dag— ECMAScript ES2022 (ECMA-262 13th Edition)LanguageModelauthored per the T-4 / T-4.17 canonical pattern (peer topython.dag). Wave-1 primitive fact-bundles for the ES2022 primitive value types —number(IEEE 754 binary64),bigint(arbitrary precision),boolean,string(UTF-16 code unit sequence), and theundefined/nullsingletons (Symbol deferred, parallelspython.dagdeferring Complex laws). Wave-2a lex rules + grammar productions cover the MVP-1 fixturefunction add(x, y) { return x + y; }plus surface forms for block /letassignment /if/return/ additive / comparison / primary. Wave-2b inhabitance groundsnumbertoApproximateField,biginttoOrderedRing,booleantoBooleanAlgebravia T-2 Node constructors. Laws / effects / partiality remain empty (consistent with the python.dag wave-2b cut).typescript.dagcontinues to model the TypeScript surface; this file is the base-language authority with no type annotations.Anchor: https://tc39.es/ecma262/2022/
Test plan
LanguageBehaviorEquivalencerow), per the T-4 § operator-ratified single-authority split. Relying on CI for v4 bootstrap viability + resolve-posture gate over the new file.Closes work item
node://adhoc-c141b1b0-c82(T-4.17 ecmascript slice).