Skip to content

GrammarExpr → FormalProduction flat-list refactor across extdeps Wave-1/2a language files - #3834

Closed
briansrls wants to merge 4 commits into
mainfrom
session/crisp-koi-360
Closed

briansrls wants to merge 4 commits into
mainfrom
session/crisp-koi-360

Conversation

@briansrls

@briansrls briansrls commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds canonical FormalProduction flat-list grammar carriers alongside existing GrammarExpr/GrammarRoot operational scaffolds across Wave-1/2a extdeps language files (cpp, go, java, kotlin, swift, typescript). Each file gains *_formal_production(s)() lists with choice/optional/repeat expanded via suffix nonterminals, matching the rust.dag CP-1b dual-carrier pattern. GrammarExpr trees remain until CP-1b converges parse onto the canonical substrate.

Test plan

@briansrls
briansrls force-pushed the session/crisp-koi-360 branch from 0c8fdbc to b7d04b3 Compare May 28, 2026 21:02
@briansrls
briansrls marked this pull request as ready for review May 28, 2026 21:02
@briansrls

Copy link
Copy Markdown
Contributor Author

Superseded by #3828 (valiant-boar-99). Stale duplicate from earlier spawn attempt.

@briansrls briansrls closed this May 28, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current HEAD (b7d04b3ae) and superseding branch session/valiant-boar-99 (#3828).

Duplicate finding: valid for the overlapping carrier pattern. #3828 already lands the Wave-1/2a FormalProduction flat-RHS scaffold across the full T-4.17 language set (cpp, go, java, kotlin, swift, typescript, rust, python, wasm, dag.dag) with the CP-1b dual-carrier hold. #3834's commits are a subset of that scope — no further merge path here.

One delta worth noting for #3828 (not blocking this close): this branch's kotlin_wave2_formal_productions / swift_wave2_formal_productions (~480/350 lines each) expand GrammarExpr wave-2 productions into flat multi-rule CFG; #3828 at HEAD only has wave-1 formal lists for those two files. If wave-2 flat lists are still wanted before #3828 merges, cherry-pick commits cb2fc2e66/217f89d0a onto session/valiant-boar-99.

No code changes on this closed PR. Merge readiness: N/A (closed, not merged).

— sent from crisp-koi-360

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 0c8fdbcb · Trigger: schedule
  • Thinking: 368s wall

BLOCKING (1)

Root Cause

  • src/v4/std/grammar.dag ParseGrammar remains the only consumed grammar boundary while FormalProduction is staged as a bare list → add a consumed FormalGrammar/FormalProduction carrier and derive canonical_symbols from it, or keep the flat lists out until CP-1b lands.

⚠️ The flat FormalProduction data needs to become the consumed language-model grammar authority, not an unconsumed parallel list.

}

// Canonical CFG: flat FormalProduction rhs (choice/optional/repeat as multi-rule expansions).
fn kotlin_wave2_formal_productions() -> List<FormalProduction> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: kotlin_wave2_formal_productions introduces a second grammar authority whose formal-only suffix/opt nonterminals never flow into KotlinLanguageModel or canonical_symbols, which still consume kotlin_wave1_grammar, violating INVARIANTS P2 single-authority/facts-flow-forward.

@briansrls
briansrls deleted the session/crisp-koi-360 branch June 1, 2026 18:42
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