diff --git a/docs/probes/curated_cargo_frontier_probe_sweep.tsv b/docs/probes/curated_cargo_frontier_probe_sweep.tsv index 543f9a40e7d..b8f7fb4a8d0 100644 --- a/docs/probes/curated_cargo_frontier_probe_sweep.tsv +++ b/docs/probes/curated_cargo_frontier_probe_sweep.tsv @@ -1,23 +1,23 @@ # classifier_stamp: rule1-first-error-plus-residual-histogram-v3 module emit cargo first_error mapped_gate verdict residual_histogram raw_dup_pub_use -src/v2/compiler/02_parse.dag 74 files emitted, 59 diagnostics refuse error: expected `,`, or `}`, found `.` UNKNOWN UNKNOWN-error:_expected_`,`,_or_`}`,_found_`.` error[E0107]:18 error[E0425]:10 error[E0109]:8 error[E0433]:7 error[E0422]:7 error[E0573]:1 error[E0391]:1 uncoded:7 0 -src/v2/compiler/03_ingest.dag 131 files emitted, 226 diagnostics refuse error: expected one of `(`, `.`, `::`, `=>`, `?`, `if`, `|`, or an operator, found `{` UNKNOWN_emit_shape UNKNOWN-error:_expected_one_of_`(`,_`.`,_`::`,_`=>`,_`?`,_`if`,_`|`,_or_an_operator,_fou error[E0433]:35 error[E0425]:34 error[E0107]:29 error[E0423]:16 error[E0573]:10 error[E0422]:8 error[E0109]:8 error[E0747]:2 error[E0391]:1 uncoded:109 0 -src/v2/compiler/06_translate.dag 58 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:14 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/05_eval.dag 57 files emitted, 0 diagnostics refuse error[E0433]: cannot find type `NamedEdgeTargetLookup` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:13 error[E0433]:10 error[E0107]:9 error[E0422]:8 error[E0109]:8 error[E0391]:1 0 -src/v2/compiler/materialization_carriers.dag 41 files emitted, 50 diagnostics refuse error[E0425]: cannot find value `v2` in this scope namespace_resolution CONFIRMED-namespace error[E0308]:87 error[E0277]:80 error[E0599]:66 error[E0369]:61 error[E0107]:15 error[E0425]:3 error[E0061]:2 error[E0282]:1 uncoded:1 0 -src/v2/compiler/05_emit.dag 59 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:14 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/05_emit_orchestration.dag 67 files emitted, 8 diagnostics refuse error: expected one of `,` or `>`, found `.` UNKNOWN_emit_shape UNKNOWN-error:_expected_one_of_`,`_or_`>`,_found_`.` error[E0433]:15 error[E0425]:14 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 uncoded:2 0 -src/v2/compiler/emit_module.dag 60 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:14 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/emit_produced.dag 69 files emitted, 30 diagnostics refuse error: expected `,`, or `}`, found `.` UNKNOWN UNKNOWN-error:_expected_`,`,_or_`}`,_found_`.` error[E0433]:15 error[E0425]:14 error[E0422]:10 error[E0109]:8 error[E0107]:8 error[E0391]:1 uncoded:4 0 -src/v2/compiler/emit_semantic_decl.dag 60 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:14 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/emit_host.dag 86 files emitted, 55 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0107]:22 error[E0425]:16 error[E0433]:15 error[E0422]:8 error[E0109]:8 error[E0391]:1 0 -src/v2/compiler/fold_lowering.dag 42 files emitted, 0 diagnostics refuse error[E0422]: cannot find struct, variant or union type `RuntimePrimitiveValue` in this scope namespace_resolution CONFIRMED-namespace error[E0109]:8 error[E0433]:7 error[E0422]:7 error[E0425]:6 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/03_name_resolve.dag 51 files emitted, 18 diagnostics refuse error: expected one of `:`, `@`, or `|`, found `.` UNKNOWN_emit_shape UNKNOWN-error:_expected_one_of_`:`,_`@`,_or_`|`,_found_`.` error[E0425]:21 error[E0107]:10 error[E0433]:9 error[E0422]:8 error[E0109]:8 error[E0573]:6 error[E0391]:1 uncoded:14 0 -src/v2/compiler/03_resolve.dag 45 files emitted, 0 diagnostics refuse error[E0422]: cannot find struct, variant or union type `RuntimePrimitiveValue` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:12 error[E0422]:8 error[E0109]:8 error[E0433]:7 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/00_compile.dag 129 files emitted, 226 diagnostics refuse error: expected one of `(`, `.`, `::`, `=>`, `?`, `if`, `|`, or an operator, found `{` UNKNOWN_emit_shape UNKNOWN-error:_expected_one_of_`(`,_`.`,_`::`,_`=>`,_`?`,_`if`,_`|`,_or_an_operator,_fou error[E0433]:35 error[E0425]:33 error[E0107]:29 error[E0423]:16 error[E0573]:10 error[E0422]:8 error[E0109]:8 error[E0747]:2 error[E0391]:1 uncoded:107 0 -src/v2/compiler/01_tokenize.dag 23 files emitted, 0 diagnostics refuse error: struct literal body without path UNKNOWN UNKNOWN-error:_struct_literal_body_without_path error[E0423]:6 error[E0432]:1 error[E0391]:1 error[E0107]:1 uncoded:8 0 -src/v2/compiler/03_normalize.dag 51 files emitted, 9 diagnostics refuse error[E0423]: expected value, found crate `std` UNKNOWN UNKNOWN-error[E0423]:_expected_value,_found_crate_`std` error[E0425]:10 error[E0107]:9 error[E0433]:8 error[E0109]:8 error[E0423]:7 error[E0422]:7 error[E0391]:1 0 -src/v2/compiler/04_infer.dag 50 files emitted, 0 diagnostics refuse error[E0433]: cannot find type `NamedEdgeTargetLookup` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:13 error[E0433]:10 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/program_assembly.dag emit_fail emit_fail indexed 2385 modules from 2 source roots resolved 42 sources (transitive import closure) [census] 2343 indexed modules outside the closure enter the name census only (not compiled) EMIT_REFUSE unmeasured -src/v2/compiler/program_partition.dag 65 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:14 error[E0422]:8 error[E0109]:8 error[E0107]:6 error[E0391]:1 0 -src/v2/compiler/source_authority.dag 102 files emitted, 94 diagnostics refuse error: expected `,`, or `}`, found `.` UNKNOWN UNKNOWN-error:_expected_`,`,_or_`}`,_found_`.` error[E0107]:25 error[E0425]:19 error[E0433]:18 error[E0423]:13 error[E0422]:8 error[E0109]:8 error[E0573]:7 error[E0391]:1 uncoded:29 0 +src/v2/compiler/00_compile.dag 129 files emitted, 226 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:91 error[E0433]:66 error[E0107]:27 error[E0422]:12 error[E0109]:8 error[E0573]:1 error[E0391]:1 0 +src/v2/compiler/01_tokenize.dag 23 files emitted, 0 diagnostics refuse error[E0432]: unresolved import `crate::std_nat` namespace_resolution CONFIRMED-namespace error[E0425]:8 error[E0432]:1 error[E0391]:1 error[E0107]:1 0 +src/v2/compiler/02_parse.dag 74 files emitted, 59 diagnostics refuse error[E0425]: cannot find type `Refined` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:41 error[E0107]:19 error[E0422]:11 error[E0109]:8 error[E0433]:7 error[E0573]:1 error[E0391]:1 0 +src/v2/compiler/03_ingest.dag 131 files emitted, 226 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:92 error[E0433]:66 error[E0107]:27 error[E0422]:12 error[E0109]:8 error[E0573]:1 error[E0391]:1 0 +src/v2/compiler/03_name_resolve.dag 51 files emitted, 18 diagnostics refuse error[E0425]: cannot find value `layer_prefix_std` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:30 error[E0433]:11 error[E0422]:8 error[E0109]:8 error[E0107]:8 error[E0391]:1 0 +src/v2/compiler/03_normalize.dag 51 files emitted, 9 diagnostics refuse error[E0425]: cannot find value `empty` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:13 error[E0433]:8 error[E0109]:8 error[E0422]:7 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/03_resolve.dag 45 files emitted, 0 diagnostics refuse error[E0422]: cannot find struct, variant or union type `RuntimePrimitiveValue` in this scope namespace_resolution CONFIRMED-namespace error[E0422]:8 error[E0109]:8 error[E0433]:7 error[E0425]:7 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/04_infer.dag 50 files emitted, 0 diagnostics refuse error[E0433]: cannot find type `NamedEdgeTargetLookup` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:10 error[E0425]:8 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/05_emit.dag 59 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:9 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/05_emit_orchestration.dag 67 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:9 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/05_eval.dag 57 files emitted, 0 diagnostics refuse error[E0433]: cannot find type `NamedEdgeTargetLookup` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:10 error[E0107]:10 error[E0425]:8 error[E0422]:8 error[E0109]:8 error[E0391]:1 0 +src/v2/compiler/06_translate.dag 58 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:9 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/emit_host.dag 86 files emitted, 55 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0107]:23 error[E0433]:15 error[E0425]:11 error[E0422]:8 error[E0109]:8 error[E0391]:1 0 +src/v2/compiler/emit_module.dag 60 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:9 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/emit_produced.dag 69 files emitted, 30 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:17 error[E0422]:10 error[E0425]:9 error[E0107]:9 error[E0109]:8 error[E0391]:1 0 +src/v2/compiler/emit_semantic_decl.dag 60 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:9 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/fold_lowering.dag 42 files emitted, 0 diagnostics refuse error[E0422]: cannot find struct, variant or union type `RuntimePrimitiveValue` in this scope namespace_resolution CONFIRMED-namespace error[E0109]:8 error[E0433]:7 error[E0422]:7 error[E0107]:7 error[E0425]:6 error[E0391]:1 0 +src/v2/compiler/materialization_carriers.dag 41 files emitted, 50 diagnostics refuse error[E0107]: missing generics for struct `Measure` UNKNOWN UNKNOWN-error[E0107]:_missing_generics_for_struct_`Measure` error[E0308]:89 error[E0277]:80 error[E0599]:66 error[E0369]:61 error[E0107]:15 error[E0061]:2 error[E0282]:1 uncoded:1 0 +src/v2/compiler/program_assembly.dag emit_fail emit_fail indexed 2390 modules from 2 source roots resolved 41 sources (transitive import closure) [census] 2349 indexed modules outside the closure enter the name census only (not compiled) EMIT_REFUSE unmeasured +src/v2/compiler/program_partition.dag 65 files emitted, 8 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0433]:15 error[E0425]:9 error[E0422]:8 error[E0109]:8 error[E0107]:7 error[E0391]:1 0 +src/v2/compiler/source_authority.dag 102 files emitted, 94 diagnostics refuse error[E0433]: cannot find type `UriScheme` in this scope namespace_resolution CONFIRMED-namespace error[E0425]:77 error[E0107]:23 error[E0433]:20 error[E0422]:12 error[E0109]:8 error[E0573]:1 error[E0391]:1 0 diff --git a/src/v1/05_emit_rust.dag b/src/v1/05_emit_rust.dag index e94cefa63c7..1d34da0305c 100644 --- a/src/v1/05_emit_rust.dag +++ b/src/v1/05_emit_rust.dag @@ -572,7 +572,7 @@ fn render_rust_shared_type_with_optional(n: Node, type_name: String, rendered: S fn render_rust_applied_type_shared(n: Node, generic_param_names: List, shared_types: Set, corpus_repr: RustCorpusRepr, source_indices: Map, variant_to_enum: Map, env: TypeEnv) -> String { let rendered = render_rust_applied_type(n: n, generic_param_names: generic_param_names, shared_types: shared_types, corpus_repr: corpus_repr, source_indices: source_indices, variant_to_enum: variant_to_enum, env: env) - let type_name = authored_name_at(source_indices: source_indices, node: n) + let type_name = rust_fn_sig_leaf_name(source_indices: source_indices, n: n) render_rust_shared_type_with_optional(n: n, type_name: type_name, rendered: rendered, shared_types: shared_types) } @@ -586,14 +586,14 @@ fn render_rust_decl_type(n: Node, generic_param_names: List, shared_type } match applied_overlay { Present { value: applied } => - let outer_name = authored_name_at(source_indices: source_indices, node: n) + let outer_name = rust_fn_sig_leaf_name(source_indices: source_indices, n: n) if outer_name != "" && outer_name != "fn" && !is_container_type(name: outer_name) && n.connective == NoConnective && (n.children |> count) == 0 && rust_fn_sig_peel_closed_alias(env: env, n: n) && rust_fn_sig_preserves_authored_alias_leaf(name: outer_name, corpus_repr: corpus_repr) { render_rust_shared_type_with_optional(n: n, type_name: outer_name, rendered: outer_name, shared_types: shared_types) } else { render_rust_applied_type_shared(n: applied, generic_param_names: generic_param_names, shared_types: shared_types, corpus_repr: corpus_repr, source_indices: source_indices, variant_to_enum: variant_to_enum, env: env) } Absent => - let name = authored_name_at(source_indices: source_indices, node: n) + let name = rust_fn_sig_leaf_name(source_indices: source_indices, n: n) if n.connective == NoConnective && n.children |> count == 0 && (generic_param_names |> any(g => g == name)) { to_pascal(name: name) } else if n.connective == NoConnective && n.children |> count == 0 && applied_prop == none && is_host_text_carrier_type(n: n, source_indices: source_indices, corpus_repr: corpus_repr) { @@ -687,7 +687,7 @@ fn render_rust_fn_sig_type(n: Node, generic_param_names: List, shared_ty if type_node_has_value_variant_arg(n: n, generic_param_names: generic_param_names, variant_to_enum: variant_to_enum, source_indices: source_indices) { return render_rust_decl_type(n: n, generic_param_names: generic_param_names, shared_types: shared_types, corpus_repr: corpus_repr, source_indices: source_indices, variant_to_enum: variant_to_enum, env: env) } - let name = authored_name_at(source_indices: source_indices, node: n) + let name = rust_fn_sig_leaf_name(source_indices: source_indices, n: n) if n.connective == NoConnective && n.children |> count == 0 && is_host_text_carrier_type(n: n, source_indices: source_indices, corpus_repr: corpus_repr) { rust_carrier_optional_wrap(n: n, rendered: render_rust_text_carrier(shared_types: shared_types)) } else if n.connective == NoConnective && n.children |> count == 0 && name != "" && name != "String" && !is_container_type(name: name) && rust_fn_sig_peel_closed_alias(env: env, n: n) && rust_fn_sig_preserves_authored_alias_leaf(name: name, corpus_repr: corpus_repr) { @@ -705,7 +705,7 @@ fn render_rust_fn_sig_type_applied_binding(n: Node, shared_types: Set, c match find_property(props: n.properties, prop_name: "__applied_type_args", source_indices: source_indices) { Present { value: applied } => if applied.children |> count > 0 { - let outer_name = authored_name_at(source_indices: source_indices, node: n) + let outer_name = rust_fn_sig_leaf_name(source_indices: source_indices, n: n) if outer_name != "" && outer_name != "fn" && !is_container_type(name: outer_name) && n.connective == NoConnective && (n.children |> count) == 0 && rust_fn_sig_peel_closed_alias(env: env, n: n) && rust_fn_sig_preserves_authored_alias_leaf(name: outer_name, corpus_repr: corpus_repr) { render_rust_shared_type_with_optional(n: n, type_name: outer_name, rendered: outer_name, shared_types: shared_types) } else { @@ -726,6 +726,12 @@ fn alias_rhs_container_arg(arg: Node, source_indices: Map) } } +data rust_fn_sig_leaf_name_dotted_note: String = "Construction wall for the dotted-render class in FN-SIG TYPE position (sibling of coerce_primitive_type_dotted_fallback_note for primitives and emit_typed_record_lit's bare_qualified_name for record-lit construction). render_rust_fn_sig_type / render_rust_fn_sig_type_applied_binding / render_rust_decl_type all extract a leaf type's name via authored_name_at and then both (a) key lookups against is_container_type/shared_types/rust_fn_sig_peel_closed_alias and (b) pass that same string as literal Rust output via render_rust_shared_type_with_optional's `rendered` argument. A namespace-qualified closure-param or aliased-decl type (e.g. impl Fn(v2.lens.complexity_accumulator_copy.Finding) -> bool) previously reached (b) verbatim -- dots and all, an invalid Rust token sequence rustc reports as 'expected one of !, (, +, ::, or <, found .'. Since every lookup in (a) is keyed on the bare declared name (same reasoning as alias_rhs_qualified_name_routing_note below), the fix is to route the leaf-name extraction through rust_fn_sig_leaf_name (which wraps authored_name_at with qualified_last_segment, the single authority) so both the lookup key and the emitted text are bare together -- not a second dotted-name fallback forked per call site. Every already-bare name renders exactly as before." + +fn rust_fn_sig_leaf_name(source_indices: Map, n: Node) -> String { + qualified_last_segment(name: authored_name_at(source_indices: source_indices, node: n)) +} + data alias_rhs_qualified_name_routing_note: String = "Construction wall for the dotted-render class. A namespace-QUALIFIED name in a type position (post-PR 6848 resolution) arrives from authored_name_at as the full dotted spelling, e.g. std.algebra.FreeMonoid. Every routing lookup on this path — alias_rhs_rust_qualify_module_filename via lookup_item, rust_seed_host_container_base, alias_base_is_zero_param_decl, is_parametric_opaque_type_base, shared_types — is keyed on the BARE declared name, so a dotted spelling matched nothing, def_mod fell back to the local module, and the else arm rendered the dotted string VERBATIM into Rust. That is not valid Rust: rustc reports 'expected one of !, (, +, ::, ;, <, or where, found .', a PARSE error, which then masks every later error in the module. Measured blast radius before the fix: the emitted 04_infer closure (50 files) contained exactly ONE such line — 'pub type List = std.algebra.FreeMonoid' in v2_std_collection.rs — and that single line blocked 4 of 5 self-host flip candidates, because std.collection sits in essentially every deep-module closure. The control that proves the fault is qualified-specific is the very next declaration: 'type Set = PointwisePower' (BARE) already routed correctly to Rc>. @@ -4975,24 +4981,39 @@ fn positional_payload_scrut_type(parent_enum: String?, variant_name: String, fie data optional_pattern_unknown_parent_note: String = "Present/Absent patterns with an UNRESOLVED parent enum lower to Some/None (kernel Optional): a bare Present/Absent struct pattern is never valid emitted Rust (no bare variant of that name exists in any emitted scope), so the raw fallback arm could only ever produce a compile error. A modeled optional carrier (e.g. OptionalNode) still resolves its parent via pattern_parent_enum and takes the qualified path; only the parent-unknown residue (an unstamped scrutinee, e.g. a let-in-lambda pipeline) reroutes." +data variant_pattern_dotted_qualification_note: String = "Construction wall for the dotted-render class in PATTERN position (sibling of alias_rhs_qualified_name_routing_note, which covers TYPE position). A namespace-QUALIFIED variant/parent name in a match pattern (post source_authority, e.g. v2.extdeps.languages.dag.ParseSubtreeFound, or a dotted parent_enum from annotate_pattern_parent_enums's authored_name_at) is not a valid Rust path component: rustc reports 'expected one of ..., found {' or 'found .', a PARSE error that then masks every later error in the module. Rust pattern position never needs a crate::-qualified path (only import-line synthesis, a separate seam, brings the bare enum into scope) so the fix is simpler than alias_rhs: route both the variant name and the resolved parent through qualified_last_segment (v1.std.core, the same single authority) via variant_pattern_qualified_path, shared by emit_variant_pattern and emit_variant_pattern_rc_aware so the dotted-render fix is not forked a third time. Every already-bare pattern renders exactly as before (qualified_last_segment is the identity on an unqualified name)." + +fn variant_pattern_qualified_path(rust_name: String, resolved_parent: String?) -> String { + match resolved_parent { + Present { value: parent } => + let parent_leaf = qualified_last_segment(name: parent) + if parent_leaf == "Witness" { concat("v1_rt::Witness::", rust_name) } + else { concat(parent_leaf, "::", rust_name) } + Absent => rust_name + } +} + +fn variant_pattern_shape_key(rust_name: String, resolved_parent: String?) -> String { + match resolved_parent { + Present { value: parent } => concat(qualified_last_segment(name: parent), "::", rust_name) + Absent => rust_name + } +} + fn emit_variant_pattern(name: String, parent_enum: String?, field_bindings: List, path_prefix: List, shared_types: Set, scrut_type: String, source_indices: Map, emit_info: EmitGraphInfo) -> String { - let resolved_parent = pattern_parent_enum(name: name, parent_enum: parent_enum, scrut_type: scrut_type, type_summaries: emit_info.type_summaries) - let optional_variant = is_optional_variant_name(name: name) + let bare_name = qualified_last_segment(name: name) + let resolved_parent = pattern_parent_enum(name: bare_name, parent_enum: parent_enum, scrut_type: scrut_type, type_summaries: emit_info.type_summaries) + let optional_variant = is_optional_variant_name(name: bare_name) && (is_optional_parent(parent_enum: resolved_parent) || resolved_parent == none) let rust_name = if optional_variant { - if name == "Present" { "Some" } else { "None" } - } else { name } + if bare_name == "Present" { "Some" } else { "None" } + } else { bare_name } let qualified = if optional_variant { rust_name } else { - match resolved_parent { - Present { value: parent } => - if parent == "Witness" { concat("v1_rt::Witness::", rust_name) } - else { concat(parent, "::", rust_name) } - Absent => rust_name - } + variant_pattern_qualified_path(rust_name: rust_name, resolved_parent: resolved_parent) } - if optional_variant && name == "Present" && field_bindings |> count == 1 { + if optional_variant && bare_name == "Present" && field_bindings |> count == 1 { match field_bindings |> first { Present { value: fb } => let fb_pat = field_binding_pattern(n: fb) @@ -5009,12 +5030,12 @@ fn emit_variant_pattern(name: String, parent_enum: String?, field_bindings: List Present { value: fb } => if field_binding_name_at(n: fb, source_indices: source_indices) == "0" { let fb_pat = field_binding_pattern(n: fb) - let pos_path = list_push(list_push(path_prefix, name), "0") + let pos_path = list_push(list_push(path_prefix, bare_name), "0") let bind_name = pattern_string_binding_name(path: pos_path) if is_string_lit_pattern(p: fb_pat) { concat(qualified, "(ref ", bind_name, ")") } else { - let payload_scrut = positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: name, field_binding: fb, emit_info: emit_info, source_indices: source_indices) + let payload_scrut = positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: bare_name, field_binding: fb, emit_info: emit_info, source_indices: source_indices) let inner_pat = emit_pattern(pattern: fb_pat, path_prefix: pos_path, shared_types: shared_types, scrut_type: payload_scrut, source_indices: source_indices, emit_info: emit_info) concat(qualified, "(", inner_pat, ")") } @@ -5022,20 +5043,17 @@ fn emit_variant_pattern(name: String, parent_enum: String?, field_bindings: List let fb_name = field_binding_name_at(n: fb, source_indices: source_indices) let fb_pat = field_binding_pattern(n: fb) if is_string_lit_pattern(p: fb_pat) { - let bind_name = pattern_string_binding_name(path: list_push(list_push(path_prefix, name), fb_name)) + let bind_name = pattern_string_binding_name(path: list_push(list_push(path_prefix, bare_name), fb_name)) concat(qualified, " { ref ", bind_name, ", .. }") } else { - let pat_str = emit_pattern(pattern: fb_pat, path_prefix: list_push(list_push(path_prefix, name), fb_name), shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info) + let pat_str = emit_pattern(pattern: fb_pat, path_prefix: list_push(list_push(path_prefix, bare_name), fb_name), shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info) concat(qualified, " { ", concat(emit_ident(name: fb_name, target: Rust), ": ", pat_str), ", .. }") } } Absent => qualified } } else if field_bindings |> count == 0 { - let shape_key = match resolved_parent { - Present { value: parent } => concat(parent, "::", name) - Absent => name - } + let shape_key = variant_pattern_shape_key(rust_name: rust_name, resolved_parent: resolved_parent) let is_positional = set_contains(emit_info.positional_payload_variants, shape_key) || set_contains(emit_info.positional_payload_variants, qualified) let is_fielded = set_contains(emit_info.fielded_variants, shape_key) @@ -5047,10 +5065,7 @@ fn emit_variant_pattern(name: String, parent_enum: String?, field_bindings: List match field_binding_pattern(n: fb) { Wildcard => false _ => true } ) if effective_bindings |> count == 0 { - let shape_key2 = match resolved_parent { - Present { value: parent } => concat(parent, "::", name) - Absent => name - } + let shape_key2 = variant_pattern_shape_key(rust_name: rust_name, resolved_parent: resolved_parent) let is_positional2 = set_contains(emit_info.positional_payload_variants, shape_key2) || set_contains(emit_info.positional_payload_variants, qualified) let is_fielded2 = set_contains(emit_info.fielded_variants, shape_key2) @@ -5063,9 +5078,9 @@ fn emit_variant_pattern(name: String, parent_enum: String?, field_bindings: List let fb_pat = field_binding_pattern(n: fb) if is_string_lit_pattern(p: fb_pat) { let field_path = if fb_name == "0" { - list_push(list_push(path_prefix, name), "0") + list_push(list_push(path_prefix, bare_name), "0") } else { - list_push(list_push(path_prefix, name), fb_name) + list_push(list_push(path_prefix, bare_name), fb_name) } let bind_name = pattern_string_binding_name(path: field_path) concat("ref ", bind_name) @@ -5074,9 +5089,9 @@ fn emit_variant_pattern(name: String, parent_enum: String?, field_bindings: List if is_shorthand { emit_ident(name: fb_name, target: Rust) } else { let field_path = if fb_name == "0" { - list_push(list_push(path_prefix, name), "0") + list_push(list_push(path_prefix, bare_name), "0") } else { - list_push(list_push(path_prefix, name), fb_name) + list_push(list_push(path_prefix, bare_name), fb_name) } let pat_str = emit_pattern(pattern: fb_pat, path_prefix: field_path, shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info) concat(emit_ident(name: fb_name, target: Rust), ": ", pat_str) @@ -5118,14 +5133,15 @@ fn field_needs_rc_ref(field_name: String, rc_analysis: RcPatternAnalysis) -> Boo fn analyze_rc_pattern(pattern: MatchPattern, scrut_type: String, shared_types: Set, emit_info: EmitGraphInfo, source_indices: Map) -> RcPatternAnalysis { match pattern { VariantPattern { name: n, parent_enum: parent_enum, field_bindings: fbs } => - if is_optional_variant_name(name: n) && is_optional_parent(parent_enum: parent_enum) { + let bare_n = qualified_last_segment(name: n) + if is_optional_variant_name(name: bare_n) && is_optional_parent(parent_enum: parent_enum) { if fbs |> count == 1 { match fbs |> first { Present { value: fb } => let inner = analyze_rc_pattern(pattern: field_binding_pattern(n: fb), scrut_type: "", shared_types: shared_types, emit_info: emit_info, source_indices: source_indices) RcPatternAnalysis { matches_rc_variant: false, - matches_option_rc_variant: n == "Present" && inner.matches_rc_variant, + matches_option_rc_variant: bare_n == "Present" && inner.matches_rc_variant, needs_rc_pattern: inner.needs_rc_pattern, ref_bound_fields: [] } @@ -5133,7 +5149,7 @@ fn analyze_rc_pattern(pattern: MatchPattern, scrut_type: String, shared_types: S } } else { empty_rc_pattern_analysis() } } else { - let resolved_parent = pattern_parent_enum(name: n, parent_enum: parent_enum, scrut_type: scrut_type, type_summaries: emit_info.type_summaries) + let resolved_parent = pattern_parent_enum(name: bare_n, parent_enum: parent_enum, scrut_type: scrut_type, type_summaries: emit_info.type_summaries) let matches_rc_variant = match resolved_parent { Present { value: enum_name } => set_contains(shared_types, enum_name) Absent => false @@ -5141,7 +5157,7 @@ fn analyze_rc_pattern(pattern: MatchPattern, scrut_type: String, shared_types: S let ref_bound_fields = fbs |> flat_map(fb => let fb_name = field_binding_name_at(n: fb, source_indices: source_indices) let inner_scrut = if fb_name == "0" { - positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: n, field_binding: fb, emit_info: emit_info, source_indices: source_indices) + positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: bare_n, field_binding: fb, emit_info: emit_info, source_indices: source_indices) } else { "" } if analyze_rc_pattern(pattern: field_binding_pattern(n: fb), scrut_type: inner_scrut, shared_types: shared_types, emit_info: emit_info, source_indices: source_indices).matches_rc_variant { [fb_name] @@ -5201,23 +5217,19 @@ fn emit_pattern_rc_aware(pattern: MatchPattern, path_prefix: List, rc_an } fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindings: List, path_prefix: List, rc_analysis: RcPatternAnalysis, shared_types: Set, scrut_type: String, source_indices: Map, emit_info: EmitGraphInfo) -> String { - let resolved_parent = pattern_parent_enum(name: name, parent_enum: parent_enum, scrut_type: scrut_type, type_summaries: emit_info.type_summaries) - let optional_variant = is_optional_variant_name(name: name) + let bare_name = qualified_last_segment(name: name) + let resolved_parent = pattern_parent_enum(name: bare_name, parent_enum: parent_enum, scrut_type: scrut_type, type_summaries: emit_info.type_summaries) + let optional_variant = is_optional_variant_name(name: bare_name) && (is_optional_parent(parent_enum: resolved_parent) || resolved_parent == none) let rust_name = if optional_variant { - if name == "Present" { "Some" } else { "None" } - } else { name } + if bare_name == "Present" { "Some" } else { "None" } + } else { bare_name } let qualified = if optional_variant { rust_name } else { - match resolved_parent { - Present { value: parent } => - if parent == "Witness" { concat("v1_rt::Witness::", rust_name) } - else { concat(parent, "::", rust_name) } - Absent => rust_name - } + variant_pattern_qualified_path(rust_name: rust_name, resolved_parent: resolved_parent) } - if optional_variant && name == "Present" && field_bindings |> count == 1 { + if optional_variant && bare_name == "Present" && field_bindings |> count == 1 { match field_bindings |> first { Present { value: fb } => let fb_pat = field_binding_pattern(n: fb) @@ -5235,12 +5247,12 @@ fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindi Present { value: fb } => if field_binding_name_at(n: fb, source_indices: source_indices) == "0" { let fb_pat = field_binding_pattern(n: fb) - let pos_path = list_push(list_push(path_prefix, name), "0") + let pos_path = list_push(list_push(path_prefix, bare_name), "0") let bind_name = pattern_string_binding_name(path: pos_path) if is_string_lit_pattern(p: fb_pat) { concat(qualified, "(ref ", bind_name, ")") } else { - let payload_scrut = positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: name, field_binding: fb, emit_info: emit_info, source_indices: source_indices) + let payload_scrut = positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: bare_name, field_binding: fb, emit_info: emit_info, source_indices: source_indices) let inner_analysis = analyze_rc_pattern(pattern: fb_pat, scrut_type: payload_scrut, shared_types: shared_types, emit_info: emit_info, source_indices: source_indices) let inner_pat = emit_pattern_rc_aware(pattern: fb_pat, path_prefix: pos_path, rc_analysis: inner_analysis, shared_types: shared_types, scrut_type: payload_scrut, source_indices: source_indices, emit_info: emit_info) concat(qualified, "(", inner_pat, ")") @@ -5249,23 +5261,20 @@ fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindi let fb_name = field_binding_name_at(n: fb, source_indices: source_indices) let fb_pat = field_binding_pattern(n: fb) if is_string_lit_pattern(p: fb_pat) { - let bind_name = pattern_string_binding_name(path: list_push(list_push(path_prefix, name), fb_name)) + let bind_name = pattern_string_binding_name(path: list_push(list_push(path_prefix, bare_name), fb_name)) concat(qualified, " { ref ", bind_name, ", .. }") } else if field_needs_rc_ref(field_name: fb_name, rc_analysis: rc_analysis) { concat(qualified, " { ref ", emit_ident(name: fb_name, target: Rust), ", .. }") } else { let inner_analysis = analyze_rc_pattern(pattern: fb_pat, scrut_type: scrut_type, shared_types: shared_types, emit_info: emit_info, source_indices: source_indices) - let pat_str = emit_pattern_rc_aware(pattern: fb_pat, path_prefix: list_push(list_push(path_prefix, name), fb_name), rc_analysis: inner_analysis, shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info) + let pat_str = emit_pattern_rc_aware(pattern: fb_pat, path_prefix: list_push(list_push(path_prefix, bare_name), fb_name), rc_analysis: inner_analysis, shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info) concat(qualified, " { ", concat(emit_ident(name: fb_name, target: Rust), ": ", pat_str), ", .. }") } } Absent => qualified } } else if field_bindings |> count == 0 { - let shape_key = match resolved_parent { - Present { value: parent } => concat(parent, "::", name) - Absent => name - } + let shape_key = variant_pattern_shape_key(rust_name: rust_name, resolved_parent: resolved_parent) let is_positional = set_contains(emit_info.positional_payload_variants, shape_key) || set_contains(emit_info.positional_payload_variants, qualified) let is_fielded = set_contains(emit_info.fielded_variants, shape_key) @@ -5277,10 +5286,7 @@ fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindi match field_binding_pattern(n: fb) { Wildcard => false _ => true } ) if effective_bindings |> count == 0 { - let shape_key2 = match resolved_parent { - Present { value: parent } => concat(parent, "::", name) - Absent => name - } + let shape_key2 = variant_pattern_shape_key(rust_name: rust_name, resolved_parent: resolved_parent) let is_positional2 = set_contains(emit_info.positional_payload_variants, shape_key2) || set_contains(emit_info.positional_payload_variants, qualified) let is_fielded2 = set_contains(emit_info.fielded_variants, shape_key2) @@ -5293,9 +5299,9 @@ fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindi let fb_pat = field_binding_pattern(n: fb) if is_string_lit_pattern(p: fb_pat) { let field_path = if fb_name == "0" { - list_push(list_push(path_prefix, name), "0") + list_push(list_push(path_prefix, bare_name), "0") } else { - list_push(list_push(path_prefix, name), fb_name) + list_push(list_push(path_prefix, bare_name), fb_name) } let bind_name = pattern_string_binding_name(path: field_path) concat("ref ", bind_name) @@ -5307,9 +5313,9 @@ fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindi if is_shorthand { emit_ident(name: fb_name, target: Rust) } else { let field_path = if fb_name == "0" { - list_push(list_push(path_prefix, name), "0") + list_push(list_push(path_prefix, bare_name), "0") } else { - list_push(list_push(path_prefix, name), fb_name) + list_push(list_push(path_prefix, bare_name), fb_name) } let inner_analysis = analyze_rc_pattern(pattern: fb_pat, scrut_type: "", shared_types: shared_types, emit_info: emit_info, source_indices: source_indices) let pat_str = emit_pattern_rc_aware(pattern: fb_pat, path_prefix: field_path, rc_analysis: inner_analysis, shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info) @@ -5327,7 +5333,8 @@ fn emit_variant_pattern_rc_aware(name: String, parent_enum: String?, field_bindi fn rc_pattern_preludes(pattern: MatchPattern, rc_analysis: RcPatternAnalysis, shared_types: Set, source_indices: Map, emit_info: EmitGraphInfo) -> String { match pattern { VariantPattern { name: n, parent_enum: parent_enum, field_bindings: fbs } => - if is_optional_variant_name(name: n) && is_optional_parent(parent_enum: parent_enum) { + let bare_n = qualified_last_segment(name: n) + if is_optional_variant_name(name: bare_n) && is_optional_parent(parent_enum: parent_enum) { if fbs |> count == 1 { match fbs |> first { Present { value: fb } => @@ -5338,16 +5345,16 @@ fn rc_pattern_preludes(pattern: MatchPattern, rc_analysis: RcPatternAnalysis, sh } } else { "" } } else { - let resolved_parent = pattern_parent_enum(name: n, parent_enum: parent_enum, scrut_type: "", type_summaries: emit_info.type_summaries) + let resolved_parent = pattern_parent_enum(name: bare_n, parent_enum: parent_enum, scrut_type: "", type_summaries: emit_info.type_summaries) let preludes = fbs |> flat_map(fb => let fb_name = field_binding_name_at(n: fb, source_indices: source_indices) if fb_name == "0" { - let payload_scrut = positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: n, field_binding: fb, emit_info: emit_info, source_indices: source_indices) + let payload_scrut = positional_payload_scrut_type(parent_enum: resolved_parent, variant_name: bare_n, field_binding: fb, emit_info: emit_info, source_indices: source_indices) let inner_analysis = analyze_rc_pattern(pattern: field_binding_pattern(n: fb), scrut_type: payload_scrut, shared_types: shared_types, emit_info: emit_info, source_indices: source_indices) let inner_preludes = rc_pattern_preludes(pattern: field_binding_pattern(n: fb), rc_analysis: inner_analysis, shared_types: shared_types, source_indices: source_indices, emit_info: emit_info) if inner_preludes == "" { [] } else { [inner_preludes] } } else if field_needs_rc_ref(field_name: fb_name, rc_analysis: rc_analysis) { - [concat("let ", emit_pattern(pattern: field_binding_pattern(n: fb), path_prefix: list_push(list_push([], n), fb_name), shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info), " = ", emit_ident(name: fb_name, target: Rust), ".as_ref() else { unreachable!() };")] + [concat("let ", emit_pattern(pattern: field_binding_pattern(n: fb), path_prefix: list_push(list_push([], bare_n), fb_name), shared_types: shared_types, scrut_type: "", source_indices: source_indices, emit_info: emit_info), " = ", emit_ident(name: fb_name, target: Rust), ".as_ref() else { unreachable!() };")] } else { [] } ) preludes |> join(separator: " ") @@ -5436,6 +5443,8 @@ fn variant_ref_self_wraps(name: String, enum_name: String, shared_types: Set) -> String { if string_contains(s: name, pattern: ".") { let leaf = qualified_last_segment(name: name) @@ -5443,7 +5452,7 @@ fn emit_value_ref_ident(name: String, registry: Map) -> String Present { value: info } => concat("crate::", module_to_filename(name: info.module_name), "::", emit_import_name(n: leaf, registry: registry)) Absent => - emit_ident(name: name, target: Rust) + emit_ident(name: leaf, target: Rust) } } else { emit_ident(name: name, target: Rust) @@ -6162,7 +6171,7 @@ fn emit_typed_call(func: String, args: List, registry: Map, registry: Map any(a => expr_references_var(node: arg_value(n: a), var_name: func, source_indices: si)) } let func_ident = if is_rt { concat("v1_rt::", emit_ident(name: runtime_name, target: Rust)) } - else { emit_ident(name: func, target: Rust) } + else { emit_value_ref_ident(name: func, registry: registry) } let func_name = if callee_self_capture { concat(func_ident, ".clone()") } else { func_ident } let call_str = if is_rt && func == "concat" && all_args |> count > 2 { emit_nested_rt_concat(remaining: all_args, acc: "", shared_types: shared_types) @@ -6925,7 +6934,7 @@ fn freemonoid_cons_binding(cons_arm: Node, field: String, source_indices: Map) -> String? { match arm_pattern(n: arm) { VariantPattern { name: n, parent_enum: pe, field_bindings: _ } => - pattern_parent_enum(name: n, parent_enum: pe, scrut_type: scrut_type, type_summaries: type_summaries) + pattern_parent_enum(name: qualified_last_segment(name: n), parent_enum: pe, scrut_type: scrut_type, type_summaries: type_summaries) _ => none } } @@ -7386,7 +7395,15 @@ fn emit_typed_record_lit(type_name: String?, fields: List, parent_enum: St Present { value: rt_name } } else { none } } - match qualified_name { + let bare_qualified_name = match qualified_name { + Present { value: qn } => Present { value: qualified_last_segment(name: qn) } + Absent => none + } + let bare_parent_enum = match parent_enum { + Present { value: pe } => Present { value: qualified_last_segment(name: pe) } + Absent => none + } + match bare_qualified_name { Absent => let is_product = is_product_type(n: resolved_type) if is_product && resolved_type.ident_span == none { @@ -7457,18 +7474,18 @@ fn emit_typed_record_lit(type_name: String?, fields: List, parent_enum: St } else { tn } } let ctor_alias_resolved = ctor_name != tn - let context_lookup = contextual_variant_parent(variant_name: tn, parent_enum: parent_enum, resolved_type: resolved_type, emit_info: emit_info, source_indices: si) + let context_lookup = contextual_variant_parent(variant_name: tn, parent_enum: bare_parent_enum, resolved_type: resolved_type, emit_info: emit_info, source_indices: si) let effective_parent = match context_lookup { Present { value: context_parent } => Present { value: context_parent } Absent => let rt_is_type_var = if resolved_type.inferred != none { is_type_variable(inferred: resolved_type.inferred.value) } else { false } - let rt_name = authored_name_at(source_indices: si, node: resolved_type) + let rt_name = qualified_last_segment(name: authored_name_at(source_indices: si, node: resolved_type)) if resolved_type.ident_span != none && rt_name != tn && !rt_is_type_var && rt_name != "Error" && variant_belongs_to_enum(type_summaries: emit_info.type_summaries, variant_name: tn, enum_name: rt_name) { Present { value: rt_name } } else { - parent_enum + bare_parent_enum } } let host_freemonoid_cons = tn == "Cons" && corpus_repr_is_host(corpus_repr: emit_info.corpus_repr) @@ -7484,7 +7501,7 @@ fn emit_typed_record_lit(type_name: String?, fields: List, parent_enum: St } return concat("{ let mut __cons_v = (*", tail_val, ").clone(); __cons_v.insert(0, ", head_val, "); __cons_v }") } - let optional_variant = is_optional_variant_name(name: tn) && (is_optional_parent(parent_enum: parent_enum) || is_optional_parent(parent_enum: effective_parent)) + let optional_variant = is_optional_variant_name(name: tn) && (is_optional_parent(parent_enum: bare_parent_enum) || is_optional_parent(parent_enum: effective_parent)) let rust_tn = if optional_variant { if tn == "Present" { "Some" } else { "None" } } else { tn } @@ -7521,7 +7538,7 @@ fn emit_typed_record_lit(type_name: String?, fields: List, parent_enum: St match fields |> first { Present { value: f } => let f_value = field_init_node_value(n: f) - let val_str = emit_field_value_with_context(field_value: f_value, struct_node: resolved_type, outer_type_name: type_name, field_name: "0", registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info) + let val_str = emit_field_value_with_context(field_value: f_value, struct_node: resolved_type, outer_type_name: bare_qualified_name, field_name: "0", registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info) let needs_wrap = is_optional_struct_field(emit_info: emit_info, struct_name: variant_summary_name, field_name: "0") && is_already_optional(texpr: f_value, emit_info: emit_info, scope: scope) == false let field_val = if needs_wrap { @@ -7534,7 +7551,7 @@ fn emit_typed_record_lit(type_name: String?, fields: List, parent_enum: St let field_strs = fields |> map(f => let f_name = field_init_node_name_at(n: f, source_indices: scope.type_env.source_indices) let f_value = field_init_node_value(n: f) - let val_str = emit_field_value_with_context(field_value: f_value, struct_node: resolved_type, outer_type_name: type_name, field_name: f_name, registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info) + let val_str = emit_field_value_with_context(field_value: f_value, struct_node: resolved_type, outer_type_name: bare_qualified_name, field_name: f_name, registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info) let needs_wrap = is_optional_struct_field(emit_info: emit_info, struct_name: variant_summary_name, field_name: f_name) && is_already_optional(texpr: f_value, emit_info: emit_info, scope: scope) == false let field_val = if needs_wrap { diff --git a/src/v1/coercion.dag b/src/v1/coercion.dag index 458c42ae725..301d675b3a6 100644 --- a/src/v1/coercion.dag +++ b/src/v1/coercion.dag @@ -2,6 +2,8 @@ module v1.compiler.coercion import v1.compiler.artifact { RenderTarget, Rust, Python, Go, Dag } +import v1.std.core { qualified_last_segment } + import std.coercion { TypeCheckpoint, InhabitantDecl, CallableRepr, CastSyntax } import std.types { container_template_algebra, canonical_container_names } @@ -93,10 +95,12 @@ fn lookup_checkpoint(target: RenderTarget, dag_name: String) -> TypeCheckpoint? target_checkpoints(target: target) |> filter(cp => cp.dag_name == dag_name) |> first } +data coerce_primitive_type_dotted_fallback_note: String = "Construction wall for the dotted-render class in TYPE position (sibling of variant_pattern_dotted_qualification_note, which covers PATTERN position, in v1.compiler.05_emit_rust). Every target's checkpoint dag_names are bare (Int, String, ...), so a namespace-QUALIFIED type name (post source_authority, e.g. v2.std.node.Edge) never matches a checkpoint and previously fell through this Absent arm verbatim, dots and all -- not a valid identifier in any target language, a PARSE error masking every later diagnostic in the module. Rendering a type never needs a crate::-qualified path here (this fn is target-agnostic, shared by Rust/Python/Go/Dag, and the existing convention across all of them is a bare type name; qualification, where a target needs it, is a separate import-line-synthesis seam) so the fix is to route the fallback through qualified_last_segment (v1.std.core, the same single authority variant_pattern_qualified_path reuses) instead of forking a second dotted-name fallback. Every already-bare dag_name renders exactly as before (qualified_last_segment is the identity on an unqualified name)." + fn coerce_primitive_type(target: RenderTarget, dag_name: String) -> String { match lookup_checkpoint(target: target, dag_name: dag_name) { Present { value: cp } => cp.target_type - Absent => dag_name + Absent => qualified_last_segment(name: dag_name) } } diff --git a/src/v1/stage0/src/v1_compiler_coercion.rs b/src/v1/stage0/src/v1_compiler_coercion.rs index f5e8b93efaf..cbae437b974 100644 --- a/src/v1/stage0/src/v1_compiler_coercion.rs +++ b/src/v1/stage0/src/v1_compiler_coercion.rs @@ -22,6 +22,7 @@ use crate::v1_rt; use crate::v1_rt::Witness; use crate::v1_rt::Witness::{Holds, Violates}; use crate::v1_rt::{VecCompat, VecJoin}; +pub use crate::v1_std_core::qualified_last_segment; use crate::NonEmptyBTreeSet; use crate::NonEmptyVec; use im::{vector as vec, HashMap, OrdSet as BTreeSet, Vector as Vec}; @@ -130,10 +131,19 @@ pub fn lookup_checkpoint(target: RenderTarget, dag_name: String) -> Option String { + thread_local! { + static CACHED: String = { + "Construction wall for the dotted-render class in TYPE position (sibling of variant_pattern_dotted_qualification_note, which covers PATTERN position, in v1.compiler.05_emit_rust). Every target's checkpoint dag_names are bare (Int, String, ...), so a namespace-QUALIFIED type name (post source_authority, e.g. v2.std.node.Edge) never matches a checkpoint and previously fell through this Absent arm verbatim, dots and all -- not a valid identifier in any target language, a PARSE error masking every later diagnostic in the module. Rendering a type never needs a crate::-qualified path here (this fn is target-agnostic, shared by Rust/Python/Go/Dag, and the existing convention across all of them is a bare type name; qualification, where a target needs it, is a separate import-line-synthesis seam) so the fix is to route the fallback through qualified_last_segment (v1.std.core, the same single authority variant_pattern_qualified_path reuses) instead of forking a second dotted-name fallback. Every already-bare dag_name renders exactly as before (qualified_last_segment is the identity on an unqualified name).".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + pub fn coerce_primitive_type(target: RenderTarget, dag_name: String) -> String { match lookup_checkpoint(target.clone(), dag_name.clone()) { Some(cp) => cp.target_type.clone(), - None => dag_name.clone(), + None => qualified_last_segment(dag_name.clone()), } } diff --git a/src/v1/stage0/src/v1_compiler_emit_rust.rs b/src/v1/stage0/src/v1_compiler_emit_rust.rs index 5311816e144..5455272fa78 100644 --- a/src/v1/stage0/src/v1_compiler_emit_rust.rs +++ b/src/v1/stage0/src/v1_compiler_emit_rust.rs @@ -1095,7 +1095,7 @@ pub fn render_rust_applied_type_shared( variant_to_enum.clone(), env.clone(), ); - let type_name = authored_name_at(source_indices.clone(), n.clone()); + let type_name = rust_fn_sig_leaf_name(source_indices.clone(), n.clone()); render_rust_shared_type_with_optional( n.clone(), type_name.clone(), @@ -1135,7 +1135,7 @@ pub fn render_rust_decl_type( }; match applied_overlay.clone() { Some(applied) => { - let outer_name = authored_name_at(source_indices.clone(), n.clone()); + let outer_name = rust_fn_sig_leaf_name(source_indices.clone(), n.clone()); if (((((((outer_name.clone() != "".to_string()) && (outer_name.clone() != "fn".to_string())) && !is_container_type(outer_name.clone())) @@ -1166,7 +1166,7 @@ pub fn render_rust_decl_type( } } None => { - let name = authored_name_at(source_indices.clone(), n.clone()); + let name = rust_fn_sig_leaf_name(source_indices.clone(), n.clone()); if (((n.connective.clone() == Connective::NoConnective) && ((n.children.clone().len() as i64) == 0)) && { @@ -1471,7 +1471,7 @@ pub fn render_rust_fn_sig_type( env.clone(), ); } - let name = authored_name_at(source_indices.clone(), n.clone()); + let name = rust_fn_sig_leaf_name(source_indices.clone(), n.clone()); if (((n.connective.clone() == Connective::NoConnective) && ((n.children.clone().len() as i64) == 0)) && is_host_text_carrier_type(n.clone(), source_indices.clone(), corpus_repr.clone())) @@ -1545,7 +1545,7 @@ pub fn render_rust_fn_sig_type_applied_binding( Some(applied) => { if ((applied.children.clone().len() as i64) > 0) { { - let outer_name = authored_name_at(source_indices.clone(), n.clone()); + let outer_name = rust_fn_sig_leaf_name(source_indices.clone(), n.clone()); if (((((((outer_name.clone() != "".to_string()) && (outer_name.clone() != "fn".to_string())) && !is_container_type(outer_name.clone())) @@ -1606,6 +1606,22 @@ pub fn alias_rhs_container_arg( } } +pub fn rust_fn_sig_leaf_name_dotted_note() -> String { + thread_local! { + static CACHED: String = { + "Construction wall for the dotted-render class in FN-SIG TYPE position (sibling of coerce_primitive_type_dotted_fallback_note for primitives and emit_typed_record_lit's bare_qualified_name for record-lit construction). render_rust_fn_sig_type / render_rust_fn_sig_type_applied_binding / render_rust_decl_type all extract a leaf type's name via authored_name_at and then both (a) key lookups against is_container_type/shared_types/rust_fn_sig_peel_closed_alias and (b) pass that same string as literal Rust output via render_rust_shared_type_with_optional's `rendered` argument. A namespace-qualified closure-param or aliased-decl type (e.g. impl Fn(v2.lens.complexity_accumulator_copy.Finding) -> bool) previously reached (b) verbatim -- dots and all, an invalid Rust token sequence rustc reports as 'expected one of !, (, +, ::, or <, found .'. Since every lookup in (a) is keyed on the bare declared name (same reasoning as alias_rhs_qualified_name_routing_note below), the fix is to route the leaf-name extraction through rust_fn_sig_leaf_name (which wraps authored_name_at with qualified_last_segment, the single authority) so both the lookup key and the emitted text are bare together -- not a second dotted-name fallback forked per call site. Every already-bare name renders exactly as before.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn rust_fn_sig_leaf_name( + source_indices: Rc>>, + n: Rc, +) -> String { + qualified_last_segment(authored_name_at(source_indices.clone(), n.clone())) +} + pub fn alias_rhs_qualified_name_routing_note() -> String { thread_local! { static CACHED: String = { @@ -13280,6 +13296,45 @@ pub fn optional_pattern_unknown_parent_note() -> String { CACHED.with(|c: &String| c.clone()) } +pub fn variant_pattern_dotted_qualification_note() -> String { + thread_local! { + static CACHED: String = { + "Construction wall for the dotted-render class in PATTERN position (sibling of alias_rhs_qualified_name_routing_note, which covers TYPE position). A namespace-QUALIFIED variant/parent name in a match pattern (post source_authority, e.g. v2.extdeps.languages.dag.ParseSubtreeFound, or a dotted parent_enum from annotate_pattern_parent_enums's authored_name_at) is not a valid Rust path component: rustc reports 'expected one of ..., found {' or 'found .', a PARSE error that then masks every later error in the module. Rust pattern position never needs a crate::-qualified path (only import-line synthesis, a separate seam, brings the bare enum into scope) so the fix is simpler than alias_rhs: route both the variant name and the resolved parent through qualified_last_segment (v1.std.core, the same single authority) via variant_pattern_qualified_path, shared by emit_variant_pattern and emit_variant_pattern_rc_aware so the dotted-render fix is not forked a third time. Every already-bare pattern renders exactly as before (qualified_last_segment is the identity on an unqualified name).".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn variant_pattern_qualified_path( + rust_name: String, + resolved_parent: Option, +) -> String { + match resolved_parent.clone() { + Some(parent) => { + let parent_leaf = qualified_last_segment(parent.clone()); + if (parent_leaf.clone() == "Witness".to_string()) { + v1_rt::concat("v1_rt::Witness::".to_string(), rust_name.clone()) + } else { + v1_rt::concat( + v1_rt::concat(parent_leaf.clone(), "::".to_string()), + rust_name.clone(), + ) + } + } + None => rust_name.clone(), + } +} + +pub fn variant_pattern_shape_key(rust_name: String, resolved_parent: Option) -> String { + match resolved_parent.clone() { + Some(parent) => v1_rt::concat( + v1_rt::concat(qualified_last_segment(parent.clone()), "::".to_string()), + rust_name.clone(), + ), + None => rust_name.clone(), + } +} + pub fn emit_variant_pattern( name: String, parent_enum: Option, @@ -13291,41 +13346,30 @@ pub fn emit_variant_pattern( emit_info: Rc, ) -> String { { + let bare_name = qualified_last_segment(name.clone()); let resolved_parent = pattern_parent_enum( - name.clone(), + bare_name.clone(), parent_enum.clone(), scrut_type.clone(), emit_info.type_summaries.clone(), ); - let optional_variant = (is_optional_variant_name(name.clone()) + let optional_variant = (is_optional_variant_name(bare_name.clone()) && (is_optional_parent(resolved_parent.clone()) || (resolved_parent.clone() == None))); let rust_name = if optional_variant.clone() { - if (name.clone() == "Present".to_string()) { + if (bare_name.clone() == "Present".to_string()) { "Some".to_string() } else { "None".to_string() } } else { - name.clone() + bare_name.clone() }; let qualified = if optional_variant.clone() { rust_name.clone() } else { - match resolved_parent.clone() { - Some(parent) => { - if (parent.clone() == "Witness".to_string()) { - v1_rt::concat("v1_rt::Witness::".to_string(), rust_name.clone()) - } else { - v1_rt::concat( - v1_rt::concat(parent.clone(), "::".to_string()), - rust_name.clone(), - ) - } - } - None => rust_name.clone(), - } + variant_pattern_qualified_path(rust_name.clone(), resolved_parent.clone()) }; - if ((optional_variant.clone() && (name.clone() == "Present".to_string())) + if ((optional_variant.clone() && (bare_name.clone() == "Present".to_string())) && ((field_bindings.clone().len() as i64) == 1)) { match field_bindings.clone().first().cloned() { @@ -13362,7 +13406,7 @@ pub fn emit_variant_pattern( { let fb_pat = field_binding_pattern(fb.clone()); let pos_path = v1_rt::rc_list_push( - v1_rt::rc_list_push(path_prefix.clone(), name.clone()), + v1_rt::rc_list_push(path_prefix.clone(), bare_name.clone()), "0".to_string(), ); let bind_name = pattern_string_binding_name(pos_path.clone()); @@ -13378,7 +13422,7 @@ pub fn emit_variant_pattern( { let payload_scrut = positional_payload_scrut_type( resolved_parent.clone(), - name.clone(), + bare_name.clone(), fb.clone(), emit_info.clone(), source_indices.clone(), @@ -13412,7 +13456,7 @@ pub fn emit_variant_pattern( pattern_string_binding_name(v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), )); @@ -13434,7 +13478,7 @@ pub fn emit_variant_pattern( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), ), @@ -13469,13 +13513,8 @@ pub fn emit_variant_pattern( } else { if ((field_bindings.clone().len() as i64) == 0) { { - let shape_key = match resolved_parent.clone() { - Some(parent) => v1_rt::concat( - v1_rt::concat(parent.clone(), "::".to_string()), - name.clone(), - ), - None => name.clone(), - }; + let shape_key = + variant_pattern_shape_key(rust_name.clone(), resolved_parent.clone()); let is_positional = (v1_rt::set_contains( &emit_info.positional_payload_variants.clone(), shape_key.clone(), @@ -13516,13 +13555,10 @@ pub fn emit_variant_pattern( }); if ((effective_bindings.clone().len() as i64) == 0) { { - let shape_key2 = match resolved_parent.clone() { - Some(parent) => v1_rt::concat( - v1_rt::concat(parent.clone(), "::".to_string()), - name.clone(), - ), - None => name.clone(), - }; + let shape_key2 = variant_pattern_shape_key( + rust_name.clone(), + resolved_parent.clone(), + ); let is_positional2 = (v1_rt::set_contains( &emit_info.positional_payload_variants.clone(), shape_key2.clone(), @@ -13565,7 +13601,7 @@ pub fn emit_variant_pattern( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), "0".to_string(), ) @@ -13573,7 +13609,7 @@ pub fn emit_variant_pattern( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), ) @@ -13608,7 +13644,7 @@ pub fn emit_variant_pattern( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), "0".to_string(), ) @@ -13616,7 +13652,7 @@ pub fn emit_variant_pattern( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), ) @@ -13716,7 +13752,9 @@ pub fn analyze_rc_pattern( field_bindings: fbs, .. } => { - if (is_optional_variant_name(n.clone()) && is_optional_parent(parent_enum.clone())) + let bare_n = qualified_last_segment(n.clone()); + if (is_optional_variant_name(bare_n.clone()) + && is_optional_parent(parent_enum.clone())) { if ((fbs.clone().len() as i64) == 1) { match fbs.clone().first().cloned() { @@ -13730,7 +13768,7 @@ pub fn analyze_rc_pattern( ); Rc::new(RcPatternAnalysis { matches_rc_variant: false, - matches_option_rc_variant: ((n.clone() + matches_option_rc_variant: ((bare_n.clone() == "Present".to_string()) && inner.matches_rc_variant.clone()), needs_rc_pattern: inner.needs_rc_pattern.clone(), @@ -13745,7 +13783,7 @@ pub fn analyze_rc_pattern( } else { { let resolved_parent = pattern_parent_enum( - n.clone(), + bare_n.clone(), parent_enum.clone(), scrut_type.clone(), emit_info.type_summaries.clone(), @@ -13768,7 +13806,7 @@ pub fn analyze_rc_pattern( let inner_scrut = if (fb_name.clone() == "0".to_string()) { positional_payload_scrut_type( resolved_parent.clone(), - n.clone(), + bare_n.clone(), fb.clone(), emit_info.clone(), source_indices.clone(), @@ -13945,41 +13983,30 @@ pub fn emit_variant_pattern_rc_aware( emit_info: Rc, ) -> String { { + let bare_name = qualified_last_segment(name.clone()); let resolved_parent = pattern_parent_enum( - name.clone(), + bare_name.clone(), parent_enum.clone(), scrut_type.clone(), emit_info.type_summaries.clone(), ); - let optional_variant = (is_optional_variant_name(name.clone()) + let optional_variant = (is_optional_variant_name(bare_name.clone()) && (is_optional_parent(resolved_parent.clone()) || (resolved_parent.clone() == None))); let rust_name = if optional_variant.clone() { - if (name.clone() == "Present".to_string()) { + if (bare_name.clone() == "Present".to_string()) { "Some".to_string() } else { "None".to_string() } } else { - name.clone() + bare_name.clone() }; let qualified = if optional_variant.clone() { rust_name.clone() } else { - match resolved_parent.clone() { - Some(parent) => { - if (parent.clone() == "Witness".to_string()) { - v1_rt::concat("v1_rt::Witness::".to_string(), rust_name.clone()) - } else { - v1_rt::concat( - v1_rt::concat(parent.clone(), "::".to_string()), - rust_name.clone(), - ) - } - } - None => rust_name.clone(), - } + variant_pattern_qualified_path(rust_name.clone(), resolved_parent.clone()) }; - if ((optional_variant.clone() && (name.clone() == "Present".to_string())) + if ((optional_variant.clone() && (bare_name.clone() == "Present".to_string())) && ((field_bindings.clone().len() as i64) == 1)) { match field_bindings.clone().first().cloned() { @@ -14024,7 +14051,7 @@ pub fn emit_variant_pattern_rc_aware( { let fb_pat = field_binding_pattern(fb.clone()); let pos_path = v1_rt::rc_list_push( - v1_rt::rc_list_push(path_prefix.clone(), name.clone()), + v1_rt::rc_list_push(path_prefix.clone(), bare_name.clone()), "0".to_string(), ); let bind_name = pattern_string_binding_name(pos_path.clone()); @@ -14040,7 +14067,7 @@ pub fn emit_variant_pattern_rc_aware( { let payload_scrut = positional_payload_scrut_type( resolved_parent.clone(), - name.clone(), + bare_name.clone(), fb.clone(), emit_info.clone(), source_indices.clone(), @@ -14082,7 +14109,7 @@ pub fn emit_variant_pattern_rc_aware( pattern_string_binding_name(v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), )); @@ -14123,7 +14150,7 @@ pub fn emit_variant_pattern_rc_aware( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), ), @@ -14163,13 +14190,8 @@ pub fn emit_variant_pattern_rc_aware( } else { if ((field_bindings.clone().len() as i64) == 0) { { - let shape_key = match resolved_parent.clone() { - Some(parent) => v1_rt::concat( - v1_rt::concat(parent.clone(), "::".to_string()), - name.clone(), - ), - None => name.clone(), - }; + let shape_key = + variant_pattern_shape_key(rust_name.clone(), resolved_parent.clone()); let is_positional = (v1_rt::set_contains( &emit_info.positional_payload_variants.clone(), shape_key.clone(), @@ -14210,13 +14232,10 @@ pub fn emit_variant_pattern_rc_aware( }); if ((effective_bindings.clone().len() as i64) == 0) { { - let shape_key2 = match resolved_parent.clone() { - Some(parent) => v1_rt::concat( - v1_rt::concat(parent.clone(), "::".to_string()), - name.clone(), - ), - None => name.clone(), - }; + let shape_key2 = variant_pattern_shape_key( + rust_name.clone(), + resolved_parent.clone(), + ); let is_positional2 = (v1_rt::set_contains( &emit_info.positional_payload_variants.clone(), shape_key2.clone(), @@ -14259,7 +14278,7 @@ pub fn emit_variant_pattern_rc_aware( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), "0".to_string(), ) @@ -14267,7 +14286,7 @@ pub fn emit_variant_pattern_rc_aware( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), ) @@ -14316,7 +14335,7 @@ pub fn emit_variant_pattern_rc_aware( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), "0".to_string(), ) @@ -14324,7 +14343,7 @@ pub fn emit_variant_pattern_rc_aware( v1_rt::rc_list_push( v1_rt::rc_list_push( path_prefix.clone(), - name.clone(), + bare_name.clone(), ), fb_name.clone(), ) @@ -14397,7 +14416,9 @@ pub fn rc_pattern_preludes( field_bindings: fbs, .. } => { - if (is_optional_variant_name(n.clone()) && is_optional_parent(parent_enum.clone())) + let bare_n = qualified_last_segment(n.clone()); + if (is_optional_variant_name(bare_n.clone()) + && is_optional_parent(parent_enum.clone())) { if ((fbs.clone().len() as i64) == 1) { match fbs.clone().first().cloned() { @@ -14426,7 +14447,7 @@ pub fn rc_pattern_preludes( } else { { let resolved_parent = pattern_parent_enum( - n.clone(), + bare_n.clone(), parent_enum.clone(), "".to_string(), emit_info.type_summaries.clone(), @@ -14444,7 +14465,7 @@ pub fn rc_pattern_preludes( { let payload_scrut = positional_payload_scrut_type( resolved_parent.clone(), - n.clone(), + bare_n.clone(), fb.clone(), emit_info.clone(), source_indices.clone(), @@ -14486,7 +14507,7 @@ pub fn rc_pattern_preludes( v1_rt::rc_list_push( v1_rt::rc_list_push( Rc::new(vec![]), - n.clone(), + bare_n.clone(), ), fb_name.clone(), ), @@ -14684,6 +14705,15 @@ pub fn variant_ref_self_wraps( || v1_rt::set_contains(&shared_types, enum_name.clone())) } +pub fn value_ref_ident_dotted_fallback_note() -> String { + thread_local! { + static CACHED: String = { + "Construction wall for the dotted-render class in VALUE-EXPRESSION position (sibling of variant_pattern_dotted_qualification_note/PATTERN, bare_qualified_name in emit_typed_record_lit/CONSTRUCTION, coerce_primitive_type_dotted_fallback_note/TYPE, and rust_fn_sig_leaf_name_dotted_note/FN-SIG TYPE). A namespace-qualified dotted name (e.g. v2.std.node.Edge) whose leaf misses the registry previously fell through to emit_ident(name: name, ...) with the FULL dotted string still attached — emit_ident has no dot-awareness (pure case-conversion/sanitization), so the dots rode straight into the emitted Rust as a bare field-access chain starting at the first segment (rustc: 'cannot find value v2 in this scope', E0425). Fixed by passing the already-computed leaf, the same qualified_last_segment (v1.std.core) reduction the Present arm already keys its registry lookup on — not a new fallback, the existing one corrected to use the value already in scope. The CALL-callee sibling (emit_typed_call's func_ident, e.g. a bare dotted function reference like v2.std.staging.resolve_probe(..) rendered verbatim) reuses this same fn directly rather than re-deriving the leaf a third time (DESIGN section 2/3: one shared helper, not a forked per-seam patch); its registry lookup (the `callee` binding) is likewise re-keyed on qualified_last_segment(func) so a dotted cross-module call resolves the same ItemInfo a bare call would. Every already-bare name renders exactly as before (qualified_last_segment is the identity on an unqualified name).".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + pub fn emit_value_ref_ident(name: String, registry: Rc>>) -> String { if v1_rt::string_contains(&name, ".".to_string()) { { @@ -14699,7 +14729,7 @@ pub fn emit_value_ref_ident(name: String, registry: Rc emit_ident(name.clone(), RenderTarget::Rust), + None => emit_ident(leaf.clone(), RenderTarget::Rust), } } } else { @@ -16787,7 +16817,7 @@ pub fn emit_typed_call( }; let ordered_args = order_typed_call_args(args.clone(), func.clone(), collection_scope.clone()); - let callee = lookup_item(registry.clone(), func.clone()); + let callee = lookup_item(registry.clone(), qualified_last_segment(func.clone())); let filled_args = fill_default_args( ordered_args.clone(), callee.clone(), @@ -16929,7 +16959,7 @@ pub fn emit_typed_call( emit_ident(runtime_name.clone(), RenderTarget::Rust), ) } else { - emit_ident(func.clone(), RenderTarget::Rust) + emit_value_ref_ident(func.clone(), registry.clone()) }; let func_name = if callee_self_capture.clone() { v1_rt::concat(func_ident.clone(), ".clone()".to_string()) @@ -19497,7 +19527,7 @@ pub fn arm_resolved_parent_enum( parent_enum: pe, .. } => pattern_parent_enum( - n.clone(), + qualified_last_segment(n.clone()), pe.clone(), scrut_type.clone(), type_summaries.clone(), @@ -20830,7 +20860,15 @@ pub fn emit_typed_record_lit( } } }; - match qualified_name.clone() { + let bare_qualified_name = match qualified_name.clone() { + Some(qn) => Some(qualified_last_segment(qn.clone())), + None => None, + }; + let bare_parent_enum = match parent_enum.clone() { + Some(pe) => Some(qualified_last_segment(pe.clone())), + None => None, + }; + match bare_qualified_name.clone() { None => { let is_product = is_product_type(resolved_type.clone()); if (is_product.clone() && (resolved_type.ident_span.clone() == None)) { @@ -21098,7 +21136,7 @@ pub fn emit_typed_record_lit( let ctor_alias_resolved = (ctor_name.clone() != tn.clone()); let context_lookup = contextual_variant_parent( tn.clone(), - parent_enum.clone(), + bare_parent_enum.clone(), resolved_type.clone(), emit_info.clone(), si.clone(), @@ -21111,7 +21149,10 @@ pub fn emit_typed_record_lit( } else { false }; - let rt_name = authored_name_at(si.clone(), resolved_type.clone()); + let rt_name = qualified_last_segment(authored_name_at( + si.clone(), + resolved_type.clone(), + )); if (((((resolved_type.ident_span.clone() != None) && (rt_name.clone() != tn.clone())) && !rt_is_type_var.clone()) @@ -21124,7 +21165,7 @@ pub fn emit_typed_record_lit( { Some(rt_name.clone()) } else { - parent_enum.clone() + bare_parent_enum.clone() } } }; @@ -21206,7 +21247,7 @@ pub fn emit_typed_record_lit( } } let optional_variant = (is_optional_variant_name(tn.clone()) - && (is_optional_parent(parent_enum.clone()) + && (is_optional_parent(bare_parent_enum.clone()) || is_optional_parent(effective_parent.clone()))); let rust_tn = if optional_variant.clone() { if (tn.clone() == "Present".to_string()) { @@ -21283,7 +21324,7 @@ pub fn emit_typed_record_lit( let val_str = emit_field_value_with_context( f_value.clone(), resolved_type.clone(), - type_name.clone(), + bare_qualified_name.clone(), "0".to_string(), registry.clone(), scope.clone(), @@ -21332,7 +21373,7 @@ pub fn emit_typed_record_lit( let val_str = emit_field_value_with_context( f_value.clone(), resolved_type.clone(), - type_name.clone(), + bare_qualified_name.clone(), f_name.clone(), registry.clone(), scope.clone(), diff --git a/src/v2/compiler/self_host/frontier.dag b/src/v2/compiler/self_host/frontier.dag index 998e807916b..cef635fffa0 100644 --- a/src/v2/compiler/self_host/frontier.dag +++ b/src/v2/compiler/self_host/frontier.dag @@ -22,8 +22,8 @@ import v2.compiler.self_host.frontier_probe_types { curated_cargo_probe_emit_assemble_refuse_reason, curated_cargo_probe_generic_type_render_reason, curated_cargo_probe_type_ref_import_missing_reason, - curated_cargo_probe_emit_shape_reason, - curated_cargo_probe_struct_literal_body_reason, + gate_a_flip_probe_witness_std_dup_reason, + gate_a_flip_probe_unresolved_compiler_error_reason, frontier_blocker_class_matches, frontier_probe_blocker_rank } @@ -247,7 +247,7 @@ data compiler_frontier_row_00_compile: CompilerModuleFrontierRow = execution_mea closure_reads: 102, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_emit_shape_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -256,7 +256,7 @@ data compiler_frontier_row_01_tokenize: CompilerModuleFrontierRow = execution_me closure_reads: 17, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_struct_literal_body_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -265,7 +265,7 @@ data compiler_frontier_row_02_parse: CompilerModuleFrontierRow = execution_measu closure_reads: 65, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_namespace_qualified_rust_emit_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -286,7 +286,7 @@ data compiler_frontier_row_03_ingest: CompilerModuleFrontierRow = execution_meas closure_reads: 104, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_emit_shape_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -325,7 +325,7 @@ data compiler_frontier_row_04_infer: CompilerModuleFrontierRow = execution_measu closure_reads: 44, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_type_ref_import_missing_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -334,7 +334,7 @@ data compiler_frontier_row_05_emit: CompilerModuleFrontierRow = execution_measur closure_reads: 52, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_type_ref_import_missing_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -352,7 +352,7 @@ data compiler_frontier_row_05_eval: CompilerModuleFrontierRow = execution_measur closure_reads: 51, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_type_ref_import_missing_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -361,7 +361,7 @@ data compiler_frontier_row_06_translate: CompilerModuleFrontierRow = execution_m closure_reads: 51, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_type_ref_import_missing_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -439,7 +439,7 @@ data compiler_frontier_row_materialization_carriers: CompilerModuleFrontierRow = closure_reads: 35, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_namespace_qualified_rust_emit_reason, + located_reason: gate_a_flip_probe_unresolved_compiler_error_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -469,7 +469,7 @@ data compiler_frontier_row_program_partition: CompilerModuleFrontierRow = execut closure_reads: 58, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_type_ref_import_missing_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) @@ -485,7 +485,7 @@ data compiler_frontier_row_source_authority: CompilerModuleFrontierRow = executi closure_reads: 87, measured_blocker: EmitSurfaceGap, located_stage: ProbeStageEmit, - located_reason: curated_cargo_probe_namespace_qualified_rust_emit_reason, + located_reason: gate_a_flip_probe_witness_std_dup_reason, migration_trigger: ^migrate_when_closure_self_emits_cargo_green ) diff --git a/src/v2/compiler/self_host/frontier_probe_types.dag b/src/v2/compiler/self_host/frontier_probe_types.dag index 283320e3a9a..bb974b95a17 100644 --- a/src/v2/compiler/self_host/frontier_probe_types.dag +++ b/src/v2/compiler/self_host/frontier_probe_types.dag @@ -102,7 +102,11 @@ data honest_frontier_refresh_2026_07_22_note: String = "Honest frontier refresh data honest_frontier_refresh_2026_07_22_post_merge_note: String = "Honest frontier refresh 2026-07-22 post-merge (sharp-bee-290), full re-sweep on main after #7033 (fold-closure generic-T + Witness prelude + value-qualified), #7045 (reference-closure over-pull fix: arrow-lambda params + pattern-value leaves) and #6990 (interpreter sorted_fields + durable native cache) all landed. Receipts: docs/probes/curated_cargo_frontier_probe_sweep.tsv (13 modules, CSSL_STD_SEED_LINK=1, empty shim, gunbc rebuilt at probe head). HEADLINE: the generic-T class (E0425 cannot-find-type-T) is DEAD on every module it previously blocked — curated_cargo_probe_generic_type_render has zero remaining rows. The dominant successor class, now first-error on FIVE modules (03_resolve E0422 RuntimePrimitiveValue, 04_infer + 05_eval E0433 NamedEdgeTargetLookup, 06_translate + program_partition E0433 UriScheme), is curated_cargo_probe_type_ref_import_missing: the emitted file references a type whose import/declaration the emitter never synthesizes — the collect_type_ref_names type-collector arm, in flight on PR 7057 (crisp-fox-839). Only ~3 distinct missing symbols cover all five modules, so one collector fix is expected to clear the class. Second class, emit-shape (statement-position brace after expression, 00_compile + 03_ingest, both 255 diagnostics — likely one root): curated_cargo_probe_emit_shape. Third: 01_tokenize struct-literal-body-without-path, curated_cargo_probe_struct_literal_body. Unchanged: 02_parse + source_authority remain dotted-in-struct (namespace_qualified); materialization_carriers ADVANCED off import-closure (its prior E0422 CacheEvidence gone) to E0425 cannot-find-value-v2, re-classed namespace_qualified; program_assembly still refuses at ASSEMBLE. 05_eval, 05_emit and 06_translate were knowledge_attributed rows — all three now MEASURED (same type-ref class as 04_infer; 05_emit E0433 UriScheme, TSV row landed by the resumed background sweep after the first 13-row read — roster corrected to match on review 41418), so their attributed triggers (v2-evaluator-host-effects, rust-body-emit-track-b, rust-value-expression-projection) are REMOVED as unproven edges per the 2026-07-22 disentangle ruling and replaced with migrate_when_closure_self_emits_cargo_green. NOT flipped: 03_normalize stays SelfEmitted — its probe red (E0423 expected-value-found-crate-std) matches the previously documented false-red harness artifact class and needs a harness-side diagnosis before any row change." -data honest_frontier_refresh_2026_07_23_note: String = "Honest frontier refresh 2026-07-23 (smart-crane-730, Lane A), full 21-module sweep on the fix-A+fix-B emitter (classifier rule1-first-error-plus-residual-histogram-v3; receipts docs/probes/curated_cargo_frontier_probe_sweep.tsv — now carrying residual_histogram, every rustc E-code + count per module so first-error masking is over, and raw_dup_pub_use, the standing census that dissolved the cssl sanitize scaffold). HEADLINE 1: the E0255 std_dup class is EXTINCT — zero occurrences in any first_error or any histogram (was first-error on the curated 4-module baseline 2026-07-22; emitter root: reference_derived_use_lines synthesized self-colliding pub-uses for dual-std-tree homonyms; fixed by local-decl exclusion, RED control = nic local_homonym arm). HEADLINE 2: FLIPS ZERO — no module reaches cargo-green; the negative result is the receipt (2026-07-21 precedent). What the unmasking exposed, by class: (a) type-ref-import-missing is first-error on emit_module/emit_semantic_decl/emit_host (E0433 UriScheme) and fold_lowering (E0422 RuntimePrimitiveValue) — their rows convert knowledge_attributed -> execution_measured with the attributed triggers (rust-body-emit-track-b, semantic-decl-pipeline, emit-host-modules, body-lowering-generalizes) REMOVED as unproven edges per the 2026-07-22 disentangle ruling; joins 03_resolve/04_infer/05_eval/05_emit/06_translate/program_partition already on this class — the shared histogram shape (E0433:15 E0425:14 E0422:8 E0109:8 E0107:6 E0391:1 on six modules) says FEW DISTINCT ROOTS in the common closure cover the family, incl. exactly one E0391 cycle everywhere. (b) dotted namespace-qualified render: 05_emit_orchestration + emit_produced (knowledge->measured) and 03_name_resolve (CORRECTED off ProbeStageAssemble emit_assemble_refuse — its former gunbc_plans_md_helpers closure contamination is gone, it now emits+assembles and refuses at cargo on dotted-in-pattern). (c) materialization_carriers keeps its namespace first-error but its histogram is the outlier (E0308:87 E0277:80 E0599:66 E0369:61) — the repr/trait residue named in the plan's emit_representation_mismatch antagonize row, now sized honestly per-module. (d) emit-shape family unchanged (00_compile, 03_ingest, 02_parse, source_authority, 01_tokenize struct-literal-body; Lane D owns the rendering roots). program_assembly still EMIT_REFUSE. 03_normalize stays SelfEmitted; its wet-receipt red is the stale-hand-shim class, routed to stern-badger-729." +data honest_frontier_refresh_2026_07_23_note: String = "Lane D (keen-ibex-888) extinguished the three dotted-name emit-shape classes from the 2026-07-22 note by rendering fix, not by suppressing the probe: (1) 'emit-shape brace root' (00_compile/03_ingest, curated_cargo_probe_emit_shape, PATTERN position — a dotted match-arm variant/parent name) fixed via variant_pattern_qualified_path/variant_pattern_shape_key in v1.compiler.05_emit_rust; (2) 01_tokenize 'struct literal body without path' (curated_cargo_probe_struct_literal_body, CONSTRUCTION position) fixed via bare_qualified_name/bare_parent_enum locals in emit_typed_record_lit; (3) 02_parse + source_authority 'dotted-in-struct' (curated_cargo_probe_namespace_qualified_rust_emit, TYPE position) fixed in v1.compiler.coercion's coerce_primitive_type Absent fallback via qualified_last_segment. Fixing these unmasked a FOURTH, structurally identical dotted-name-verbatim defect in FN-SIG/closure-param TYPE position (render_rust_fn_sig_type and 4 sibling fns in 05_emit_rust, e.g. a closure param typed impl Fn(v2.lens.foo.Bar) -> bool rendering the dotted name literally) — fixed the same way, one shared rust_fn_sig_leaf_name helper wrapping qualified_last_segment, reused at all 5 call sites (DESIGN section 3: single authority, no forked per-site patch). A fifth and sixth sibling defect (VALUE-expression position in emit_value_ref_ident, CALL-callee position in emit_typed_call) were folded in the same session, both re-keyed on qualified_last_segment rather than the raw dotted string. Re-probed by execution (CSSL_STD_SEED_LINK=1 curated_cargo_probe_one.sh) on all ten previously-tracked modules: all named dotted-name classes are GONE — zero rows in docs/probes/curated_cargo_frontier_probe_sweep.tsv for curated_cargo_probe_emit_shape, curated_cargo_probe_struct_literal_body and curated_cargo_probe_namespace_qualified_rust_emit. At merge time (pre Lane A's #7097 std_dup fix) all ten landed uniformly on the then-pre-existing E0255 'the name List is defined multiple times' (gate_a_flip_probe_witness_std_dup_reason); see honest_frontier_refresh_2026_07_23_lane_a_note below for the subsequent std_dup extinction and the post-merge re-sweep note for the combined state. This was NOT a flip to SelfEmitted — only located_reason moved off the three retired reasons so the roster names what was actually last measured (per the 2026-07-21 receipt-correction precedent). curated_cargo_probe_emit_shape_reason and curated_cargo_probe_struct_literal_body_reason have zero remaining consumers in v2.compiler.self_host.frontier after this change; left declared here (not deleted) since they remain valid historical FrontierProbeReceipt shapes another probe run could re-emit." + +data honest_frontier_refresh_2026_07_23_lane_a_note: String = "Honest frontier refresh 2026-07-23 (smart-crane-730, Lane A), full 21-module sweep on the fix-A+fix-B emitter (classifier rule1-first-error-plus-residual-histogram-v3; receipts docs/probes/curated_cargo_frontier_probe_sweep.tsv — now carrying residual_histogram, every rustc E-code + count per module so first-error masking is over, and raw_dup_pub_use, the standing census that dissolved the cssl sanitize scaffold). HEADLINE 1: the E0255 std_dup class is EXTINCT — zero occurrences in any first_error or any histogram (was first-error on the curated 4-module baseline 2026-07-22; emitter root: reference_derived_use_lines synthesized self-colliding pub-uses for dual-std-tree homonyms; fixed by local-decl exclusion, RED control = nic local_homonym arm). HEADLINE 2: FLIPS ZERO — no module reaches cargo-green; the negative result is the receipt (2026-07-21 precedent). What the unmasking exposed, by class: (a) type-ref-import-missing is first-error on emit_module/emit_semantic_decl/emit_host (E0433 UriScheme) and fold_lowering (E0422 RuntimePrimitiveValue) — their rows convert knowledge_attributed -> execution_measured with the attributed triggers (rust-body-emit-track-b, semantic-decl-pipeline, emit-host-modules, body-lowering-generalizes) REMOVED as unproven edges per the 2026-07-22 disentangle ruling; joins 03_resolve/04_infer/05_eval/05_emit/06_translate/program_partition already on this class — the shared histogram shape (E0433:15 E0425:14 E0422:8 E0109:8 E0107:6 E0391:1 on six modules) says FEW DISTINCT ROOTS in the common closure cover the family, incl. exactly one E0391 cycle everywhere. (b) dotted namespace-qualified render: 05_emit_orchestration + emit_produced (knowledge->measured) and 03_name_resolve (CORRECTED off ProbeStageAssemble emit_assemble_refuse — its former gunbc_plans_md_helpers closure contamination is gone, it now emits+assembles and refuses at cargo on dotted-in-pattern). (c) materialization_carriers keeps its namespace first-error but its histogram is the outlier (E0308:87 E0277:80 E0599:66 E0369:61) — the repr/trait residue named in the plan's emit_representation_mismatch antagonize row, now sized honestly per-module. (d) emit-shape family measured pre-Lane-D-merge (00_compile, 03_ingest, 02_parse, source_authority, 01_tokenize struct-literal-body; Lane D owns the rendering roots and fixed all five on its own branch — see re-sweep note post-merge). program_assembly still EMIT_REFUSE. 03_normalize stays SelfEmitted; its wet-receipt red is the stale-hand-shim class, routed to stern-badger-729." + +data honest_frontier_refresh_2026_07_23_postmerge_note: String = "Honest frontier refresh 2026-07-23 post-merge (keen-ibex-888, PR 7098 after merging origin/main which carries Lane A's #7097 std_dup fix), full 21-module re-sweep with BOTH Lane D's dotted-name emit-root fixes AND Lane A's std_dup fix combined on one head (CSSL_STD_SEED_LINK=1 curated_cargo_probe_one.sh, classifier rule1-first-error-plus-residual-histogram-v3; receipts docs/probes/curated_cargo_frontier_probe_sweep.tsv). This supersedes the two lane-local notes above (honest_frontier_refresh_2026_07_23_note, honest_frontier_refresh_2026_07_23_lane_a_note), each of which measured only its own lane's fix in isolation against a pre-merge tree. HEADLINE: both fixed classes STAY DEAD under combination — zero E0255 std_dup rows and zero dotted-name-literal parse-shape rows (curated_cargo_probe_emit_shape, curated_cargo_probe_struct_literal_body, curated_cargo_probe_namespace_qualified_rust_emit all empty) anywhere in the 21-module histogram, confirming the two fixes compose without regression. FLIPS ZERO — no module reaches cargo-green; the negative result is the receipt (2026-07-21 precedent). The uniform residual is curated_cargo_probe_type_ref_import_missing (namespace_resolution, CONFIRMED-namespace) on 18 of 21 modules, first-erroring on E0433 UriScheme / E0425 assorted / E0422 RuntimePrimitiveValue / E0433 NamedEdgeTargetLookup depending on module — a pre-existing, distinct class neither Lane D nor Lane A touched. Two modules deviate: materialization_carriers now first-errors E0107 missing-generics-for-Measure (UNKNOWN, histogram dominated by E0308/E0277/E0599/E0369 — the repr/trait residue already named in honest_frontier_refresh_2026_07_23_lane_a_note(c), unchanged in kind, just a different first-error pick now that upstream noise dropped); program_assembly still refuses at EMIT (unchanged, ASSEMBLE-stage closure census, not a cargo-stage class). No located_reason flips to SelfEmitted from this refresh — only the receipt TSV moves from its interim main-adopted placeholder (committed as a merge-conflict resolution artifact) to genuinely fresh post-merge measurements." data honest_frontier_refresh_2026_07_21_note: String = "Honest frontier refresh 2026-07-21 (warm-lark-815), re-probed on fresh main AFTER the Gate-1 import-closure root (PR 6960) merged. Method: CSSL_STD_SEED_LINK=1 curated_cargo_probe_one.sh per module, first rustc error only. FLIPS: ZERO — the flip wave produced no SelfEmitted transition, and that negative result is the receipt. diff --git a/src/v2/workflow/orchestration_while_emit_test.dag b/src/v2/test/claim/long/orchestration_while_emit_test.dag similarity index 78% rename from src/v2/workflow/orchestration_while_emit_test.dag rename to src/v2/test/claim/long/orchestration_while_emit_test.dag index f1d1d0203c7..97444ec5bc7 100644 --- a/src/v2/workflow/orchestration_while_emit_test.dag +++ b/src/v2/test/claim/long/orchestration_while_emit_test.dag @@ -1,4 +1,4 @@ -module v2.workflow.orchestration_while_emit_test +module v2.test.long.orchestration_while_emit import v2.compiler.emit_orchestration { orch_emit_step, orch_emit_pipeline } import v2.extdeps.languages.bash_orchestration_emit { bash_orchestration_emit_medium } @@ -22,6 +22,8 @@ import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly +data orch_while_long_lane_note: String = "Relocated here from v2.workflow (the per-PR fast-lane discovery roster) because these three check_fns' own eval exceeds the operator's 5-second fast-lane budget (gunbc_ci_fast_lane_rule_note; see commit_workflow_long_lane_note for the authority and precedent on repoint-vs-delete). No test content changed — all three still assert byte-identical goldens against orch_while_locate_golden. Excluded from discovery and the affected-set falsifier by the test/claim/long/ dir grain (gunbc.ci_layer_roots witness_exclusion_substrings), same offlining contract as the realization_vocabulary_containment_witness_test.dag sibling. Local recipe until the long-lane scheduled falsifier follow-on enrolls this row (dissolve-on): gunbc run --source-root dag --source-root src/v2 --claim-run --entry src/v2/test/claim/long/orchestration_while_emit_test.dag --function , run once per check_fn." + data orch_while_golden_note: String = "Goldens are hand-authored bytes independent of grammar row spellings; byte tests compare emit against these literals so row/emitter regressions cannot go green by perturbing both sides at once." data orch_while_locate_golden: String = "d=\"/sys/fs/cgroup$(awk -F: '$1==\"0\"\{print $3\}' /proc/self/cgroup)\"\nwhile [ -n \"$d\" ] && [ \"$d\" != \"/sys/fs/cgroup\" ] && [ ! -f \"$d/memory.peak\" ]; do d=$(dirname \"$d\"); done"