Skip to content

v1 seed alias-decl parse arm (§13): syntax spec row + v1.compiler.parse arm + typecheck-env binding + regen fixed-point + corpus probe (dissolves the walk_target_alias_apply corpus --write gate) - #7094

Merged
briansrls merged 8 commits into
mainfrom
session/sleek-otter-633
Jul 23, 2026

Conversation

@briansrls

@briansrls briansrls commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the v1 seed §13 namespace alias-decl arm so alias X = a.b.c parses, binds in the typecheck env, and refuses dangling targets fail-closed. This unblocks the walk_target_alias_apply corpus --write gate on the apply lane (PR #7078).

What changed:

  • dag/std/syntax.dag + dag/extdeps/languages/dag/syntax.dag: AliasBody item form + reserved alias keyword
  • src/v1/02_parse.dag: parse_alias_after_kw → namespace_alias_target property on the item node
  • src/v1/04_infer.dag: symbol-index insertion + build_type_env local-bindings fold; namespace_alias_diags emits UnresolvedType for dangling targets; local_binding_for_item skips alias decls (prevents falling into the nominal-binding arm)
  • src/v1/tests/src/namespace_alias_decl_test.rs: GREEN + RED witnesses
  • src/v2/lens/test_migration_debt.dag: module-count baseline 80→81 for the new witness module
  • Stage0 regen output (v1_compiler_parse.rs, v1_compiler_infer.rs, std_syntax.rs, extdeps_languages_dag_syntax.rs)

Why: v1 seed previously rejected alias decls at parse ("expected item declaration…") and panicked in module indexing. v2 grammar + symbol-index binding already landed (#6974); this is the matching v1 seed parse + typecheck-env seam.

Executed receipts (green-by-execution)

Receipt Command Result
Alias fixture compiles gunbc compile --target dag on alias_fixture.{target,consumer} 0 diagnostics
GREEN witness cargo test -p v1-compiler-tests namespace_alias_resolves_without_direct_import pass
RED witness (dangling target) cargo test -p v1-compiler-tests namespace_alias_dangling_target_refuses pass
2-gen regen fixpoint stage-1 regen_stage0 → rebuild → stage-2 regen_stage0 → --verify regen_divergence_count=0, EXIT=0
v1 self-compile (regen oracle) embedded in regen_stage0 --verify 0 hard diagnostics
cargo fmt --all --check local pass
Migration debt ratchet test_migration_debt_module_count_baseline 80→81 (2e85fda) fixes CI witness for new namespace_alias_decl_test.rs

Test plan

  • cargo test -p v1-compiler-tests namespace_alias_decl_test — 2/2 pass
  • regen_stage0 2-generation recipe + --verify — regen_divergence_count=0
  • gunbc compile on alias fixture — 0 diagnostics
  • cargo fmt --all --check — pass
  • build CI job — green on 2e85fda
  • ci floor — in progress on 2e85fda (prior failure was test_migration_debt_module_count_does_not_grow, fixed by baseline bump)

Worker attestation

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why.
  • Tests run: commands and results listed above.
  • Closes #N — no tracked issue; unblocks walk_target_alias_apply corpus gate.
  • No surprise commits on this branch.
  • No secrets / credentials / large binaries staged.

Review notes

  • Alias binding is intentionally special-cased in symbol_index_insert_item and build_type_env (not folded into local_binding_for_item) because those sites own different binding mechanics; worth consolidating if a third consumer appears.
  • Dangling alias targets refuse via UnresolvedType diagnostic — no fabricated binding.

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 23, 2026 01:58
@gunbai-bot
gunbai-bot Bot marked this pull request as draft July 23, 2026 02:18
@gunbai-bot

gunbai-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Verified review 41613 against current 2b272ae: findings stand — the diff is narrowly scoped to the v1 seed alias-decl arm (syntax spec, parse, infer binding, regen, witnesses). Dangling targets refuse via UnresolvedType; is_namespace_alias_item early-return prevents alias decls from entering the properties |> count > 0 nominal-binding arm. No code changes requested.

— sent from sleek-otter-633

@gunbai-bot

gunbai-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Verified review 41619 against current 2b272ae: agree with APPROVE. The dual call-site special-casing (symbol_index_insert_item + build_type_env local-bindings fold, separate from local_binding_for_item) is intentional for this seed: symbol-index insertion needs the resolved target node for qualified lookup, while build_type_env owns intern-table binding + diagnostics — folding into local_binding_for_item would conflate those two authorities. Happy to consolidate if a third consumer appears; not blocking this seed.

PR body updated with executed receipts (2-gen regen fixpoint regen_divergence_count=0, both witnesses green, alias fixture compiles with 0 diagnostics). Flipped to draft pending CI floor completion, then back to ready.

— sent from sleek-otter-633

…cl_test.

The new v1 seed §13 witness module is intentional hand-Rust debt until a
floor *_test.dag counterpart lands; ratchet must admit the +1 module.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 23, 2026 03:03
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Mirrors the resolved-path skip: namespace alias decls no longer fabricate
nominal_type_binding in the unresolved env twin (review 41646).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Addressed review 41646 in 88386c9c (dag fix in 32bd8d84e).

Finding verified: build_type_env_unresolved local-bindings fold was still routing alias decls (namespace_alias_target property, no connective/inferred/params) through the properties |> count > 0 arm into nominal_type_binding — a §5 fail-open twin of the resolved-path bug already fixed in local_binding_for_item / build_type_env.

Fix: early is_namespace_alias_item skip (returns acc unchanged), matching local_binding_for_item's none arm. Stage0 regen landed in 88386c9c; 2-gen regen_stage0 --verify → regen_divergence_count=0; namespace_alias_decl_test 2/2 green.

— sent from sleek-otter-633

@gunbai-bot

gunbai-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Verified review 41653 against current 88386c9c: findings stand — no issues. The described seams are present and consistent on HEAD:

  • syntax spec AliasBody + reserved alias keyword (regen'd)
  • parse_alias_after_kw → namespace_alias_target property
  • infer: local_binding_for_item skip, symbol_index_insert_item target binding, build_type_env + namespace_alias_diags (UnresolvedType on dangling target)
  • build_type_env_unresolved alias skip landed in 32bd8d84e / regen 88386c9c (review 41646)
  • GREEN/RED witnesses + migration-debt baseline 80→81

Agree with APPROVE.

— sent from sleek-otter-633

@gunbai-bot

gunbai-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Verified review 41656 against current 88386c9c: findings stand — no issues. End-to-end coherence confirmed on HEAD:

  • grammar row (alias + AliasBody) in syntax spec + regen
  • v1 parse_alias_after_kw → namespace_alias_target property
  • infer binding via symbol_index_lookup, namespace_alias_diags (UnresolvedType on dangling target)
  • local_binding_for_item / build_type_env / build_type_env_unresolved alias guards
  • GREEN/RED witnesses + migration-debt baseline bump

Agree with APPROVE — v1 seed bridge via Node property discrimination, not a parallel fork of v2's AliasBindingRow.

— sent from sleek-otter-633

@briansrls
briansrls merged commit 1ee1221 into main Jul 23, 2026
3 checks passed
@briansrls
briansrls deleted the session/sleek-otter-633 branch July 23, 2026 06:21
gunbai-bot Bot pushed a commit that referenced this pull request Aug 5, 2026
… modules.

namespace_alias_decl_test (from #7094) lacked #[cfg(test)], so the lib target
compiled it without #[test] bodies and failed under RUSTFLAGS=-D warnings when
the compile-contract gate first built v1-compiler-tests. Same class fixed on
import_visibility_pool_coincidence_test and nested_list_alias_emit_test.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Aug 6, 2026
…eatures, gate after release) (#7868)

* WIP: PR A: reuse one v1-compiler build across release bins and the compile-co

* PR A: one release v1-compiler build + compile-contract admission.

Reorder build job to fmt → release build → cargo test --release --no-run,
align ci_release_features with v1-compiler-tests deps, and add fail-closed
change-sensitive admission with typed CompileContractAdmissionReceipt.
Regenerate ci.yml and falsifier.yml so workflow drift no longer blocks heal.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: PR A: reuse one v1-compiler build across release bins and the compile-co

* Gate-found inherited defects: #[cfg(test)] on three v1-compiler-tests modules.

namespace_alias_decl_test (from #7094) lacked #[cfg(test)], so the lib target
compiled it without #[test] bodies and failed under RUSTFLAGS=-D warnings when
the compile-contract gate first built v1-compiler-tests. Same class fixed on
import_visibility_pool_coincidence_test and nested_list_alias_emit_test.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: PR A: reuse one v1-compiler build across release bins and the compile-co

* Drop interp_test_witness from CI release bins; default-off depth hook.

ci_release_features is text_lookup_work_counter only so claim_executor/gunbc
carry no per-call record_call_env_depth instrumentation. Tests arm the hook
explicitly before depth assertions. Regenerated workflow feature strings.

Fixes fmt failure on 4c8ab44 (WIP compile_contract_surface path abandoned
per operator: guarded default-off is the cheaper fix).

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: PR A: reuse one v1-compiler build across release bins and the compile-co

* WIP: PR A: reuse one v1-compiler build across release bins and the compile-co

* Remove compile-contract admission from CI workflows.

The witness cost 84-133s to skip an 18s gate compile; drop it from
build/verify/pack and run the gate unconditionally.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix cli_run test module after admission test removal.

Restore the doc comment and test boundary broken when deleting the
compile-contract admission unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Align hand-Rust scaffold receipt with release compile gate.

Update the dissolve trigger to cite cargo test --release --no-run
after the release build, matching ci_v1_compiler_tests_compile_gate_emit.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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