Skip to content

Keep declaration shells as namespace-graft body units - #10963

Merged
briansrls merged 14 commits into
mainfrom
session/fierce-tern-547
Sep 11, 2026
Merged

briansrls merged 14 commits into
mainfrom
session/fierce-tern-547

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

namespace_graft_body_dissolved_refused was firing for every module that declared types/data/imports but no function: flattening parse-projection spines into those declaration shells left an empty grafted body while dag_surface_top_level_item still survived.

Repair: nonempty flatten is kept (the admitted Conj of uniquely Named edges). Empty flatten with surviving top-level-item alternatives reconstructs one Named forest. A leftover dag_surface_top_level_item with no unit still refuses (lost forest). Header-only still accepts.

GitHub head (final): 70fd2db818b — merge of 5000e014 (includes c8fd2c9 long-oracle rewrite) with main 267d69b8 (D1 #10946 and G #10961). Merge commit only; freeze.

Receipts

Commits after 8da3ae1 (why each exists)

  • 4d2fdb41 — long witness passed host Primitive String into lex_walk_artifact; floor typecheck red until chars(s:).
  • e092e45d — dag.dag eager-eval of grammar-wide unit-id fold on every load; native_decl_selection hit the 500ms CPU line.
  • f33bd800 — moved that derivation into namespace_graft (empty-flatten only) and restored the long-lane file so the 16s controls stay declined as long-lane, not planned-as-changed.
  • e915a1df — if production.name == name mixed Primitive(Symbol) vs Optional; floor ChangedWitnessObservationFailed until both arms are Optional.

Test plan

  • binding srv2 167-member closure on 70fd2db818b (after Cut the seed out of the emitted closure's dependency graph #10988)
  • required-floor / witnesses on 70fd2db818b (run 34557396822 floor was host page-thrash on srv4, not a witness flip)
  • long oracles witness_type_fn_module_grafts / witness_type_only_module_grafts (c8fd2c9) assert accept and not namespace_graft_body_dissolved_refused
  • discriminating negative namespace_graft_lost_top_level_item_without_unit_refuses_RED; type-decl unit keeps identity-projection (namespace_graft_type_decl_unit_is_not_dissolved_holds); nonempty flatten namespace_graft_nonempty_flatten_stays_well_formed_holds
  • those two long identities stay on the long-lane roster (ci_layer_roots); they are not a false over-ceiling assertion. Censored floor_cost_debt rows were not added after the merge-only ruling; parent run on this head held 19 known-red, 0 budget-refused.

Merge order: #10988 → D2 first after it. Tally: build+floor green + one approval + no REQUEST_CHANGES on this head + the merged-head receipt.

…le is not treated as a lost forest.

The collector flattened parse projections into a declaration's children, so an empty body looked dissolved whenever no function survived as a ComputationNode. Stop flattening at those production identities; a top_level_item wrapper with no unit still refuses.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as draft September 10, 2026 20:13
…of a third emitted roster.

The collector now asks dag_surface_is_top_level_item_alternative_emitted, which joins the choice nonterminals to the grammar roster. That drops the extra import_block row that was not an alternative of dag_production_top_level_item.

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

gunbai-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 63219: deleted namespace_graft_is_declaration_forest_unit_id. Graft-body units are now dag_surface_is_top_level_item_alternative_emitted in v2.extdeps.languages.dag, derived from the nonterminals of dag_grammar_top_level_item_expr joined to the grammar roster's emitted identities. dag_surface_import_block is no longer treated as a unit (it is interior to import_decl, not an alternative of dag_production_top_level_item).

— sent from fierce-tern-547

gunbc-ci-auto-heal and others added 2 commits September 10, 2026 20:57
…ent.

The names live on dag_grammar_top_level_item_expr; the comment only points at that join.

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

gunbai-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Closure before/after for #10963 at head 4461007c46, overlaid on the #10882 head 1eb184fd1f (PR diff from its merge-base applied to that tree, no unmerged paths; srv2, emitted driver over the 167-member closure root, controls-only universe, {"_terminal":"complete","file_refusals":153}, wall 250 s).

Verdict: REGRESSION. 68 → 153 refusing files. The graft repair discharges cause B for its 25 files, but the trees it now produces fail the post-normalize well-formedness law for 90 modules that were ACCEPTED at the baseline.

Per-file outcomes for the 25 cause-B files:

  • RefusalCleared 5: dag/std/compiler_entry.dag, dag/std/magnitude.dag, dag/std/process_termination.dag, src/v2/extdeps/languages/fidelity.dag, src/v2/std/passing_candidate_fold.dag
  • AdvancedToNewCause 20: all to normalize_reason_post_normalize_not_well_formed
  • StillBlockedByTargetCause 0

Non-target: src/v2/std/logic.dag moved normalized_tree_reason_wrapper_retention_not_normalized → normalize_reason_post_normalize_not_well_formed. Every other baseline refusal is unchanged.

Regressed (previously accepted, now refusing at normalize_reason_post_normalize_not_well_formed): 90 files, including the compiler's own stages (01_tokenize, 03_normalize, 04_infer, 05_emit, namespace_graft, body_lowering_fold, …), every lens module, and most of src/v2/std. Full list:

  • dag/extdeps/cache/materialization.dag
  • dag/extdeps/cache/types.dag
  • dag/extdeps/communication/fidelity_carriers.dag
  • dag/extdeps/currency/currency.dag
  • dag/extdeps/languages/rust/capabilities.dag
  • dag/extdeps/units/dimensionless.dag
  • dag/extdeps/units/iec_80000_13.dag
  • dag/extdeps/units/iso8601.dag
  • dag/std/algebra.dag
  • dag/std/checked_arithmetic.dag
  • dag/std/computation.dag
  • dag/std/effects.dag
  • dag/std/induction.dag
  • dag/std/keyed_roster.dag
  • dag/std/materialization_ladder.dag
  • dag/std/nat.dag
  • dag/std/occurrence_identity.dag
  • dag/std/perturbation.dag
  • dag/std/primitives.dag
  • dag/std/realization.dag
  • dag/std/realization_measurement.dag
  • dag/std/realization_width.dag
  • dag/std/source_annotation.dag
  • dag/std/termination.dag
  • dag/std/trait_derive_shape.dag
  • src/v2/compiler/01_tokenize.dag
  • src/v2/compiler/03_name_resolve.dag
  • src/v2/compiler/03_normalize.dag
  • src/v2/compiler/04_infer.dag
  • src/v2/compiler/05_emit.dag
  • src/v2/compiler/07_target_carriers.dag
  • src/v2/compiler/body_lowering_fold.dag
  • src/v2/compiler/body_producer_forward.dag
  • src/v2/compiler/fold_lowering.dag
  • src/v2/compiler/materialization_carriers.dag
  • src/v2/compiler/namespace_graft.dag
  • src/v2/compiler/parse_diagnostic.dag
  • src/v2/compiler/symbol_index_fill.dag
  • src/v2/compiler/wrap_decision.dag
  • src/v2/extdeps/languages/llvm_ir.dag
  • src/v2/extdeps/languages/python.dag
  • src/v2/lens/common/construction_justification.dag
  • src/v2/lens/complexity_accumulator_copy.dag
  • src/v2/lens/complexity_accumulator_copy/analyze.dag
  • src/v2/lens/complexity_accumulator_copy/compile_gate.dag
  • src/v2/lens/cost.dag
  • src/v2/lens/cost/copied_port_citations.dag
  • src/v2/lens/cost/copied_port_derivation.dag
  • src/v2/lens/determinism.dag
  • src/v2/lens/fact_density.dag
  • src/v2/lens/lifecycle_carrier.dag
  • src/v2/lens/mandatory_tag.dag
  • src/v2/lens/unit_modeling.dag
  • src/v2/std/algebra.dag
  • src/v2/std/anti_unification.dag
  • src/v2/std/artifact.dag
  • src/v2/std/bounded_lattice_completeness.dag
  • src/v2/std/coercion.dag
  • src/v2/std/collection.dag
  • src/v2/std/compilers/body_lowering.dag
  • src/v2/std/compilers/lexing.dag
  • src/v2/std/compilers/sugar.dag
  • src/v2/std/constraints.dag
  • src/v2/std/cross_tree/import_model.dag
  • src/v2/std/diagnostic.dag
  • src/v2/std/exact_structural_equality_zip_fold_predicate.dag
  • src/v2/std/find_witness.dag
  • src/v2/std/fn_index.dag
  • src/v2/std/fold_assembly.dag
  • src/v2/std/grammar.dag
  • src/v2/std/grounding.dag
  • src/v2/std/host_run.dag
  • src/v2/std/host_transport.dag
  • src/v2/std/integer_value_set.dag
  • src/v2/std/language_model.dag
  • src/v2/std/nat.dag
  • src/v2/std/node.dag
  • src/v2/std/node_query.dag
  • src/v2/std/node_shape.dag
  • src/v2/std/project_to_core_predicate.dag
  • src/v2/std/provenance.dag
  • src/v2/std/qualified_name.dag
  • src/v2/std/refinement.dag
  • src/v2/std/refinement_widening_predicate.dag
  • src/v2/std/subject_evidence.dag
  • src/v2/std/symbol_index.dag
  • src/v2/std/text.dag
  • src/v2/std/verdict.dag
  • src/v2/std/verification.dag
  • src/v2/std/witness.dag

Reading: keeping type/data/fn/import/alias/import_block as graft-body units changes the normalized shape of every module that has such declarations, not only the fn-less ones, and the well-formedness law that guards normalized_tree rejects the new shape. The fixture battery cannot see this because it only exercises the fn-less positive control and the lost-body negative; it needs a regression control that runs a currently-accepted closure module (e.g. src/v2/std/text.dag) through parse → normalize → graft → well-formedness and asserts acceptance. This PR is not landable at this head.

…tten is empty.

Conj requires uniquely Named edges. Injecting every type/data/import shell as dag_surface_type_decl (repeated) made previously accepted modules fail well_formed. Flatten is the admitted shape when nonempty; an empty flatten with surviving top-level-item alternatives becomes one Cardinality forest. Regression: text.dag through normalize, and a two-decl-plus-fn synthetic.

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

gunbai-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Closure before/after for #10963 at head 8da3ae163c, overlaid on main 0006e0aabd (PR diff from merge-base applied, no unmerged paths; srv2, emitted driver over the 167-member closure root, controls-only universe, {"_terminal":"complete","file_refusals":43}, wall 253 s, rss 0.86 GB). Baseline: the #10943 carrier at 2fb67b411a, 68 refusals.

68 → 43. Zero regressions. All 99 baseline-accepting modules remain accepted; no file outside cause B changed cause; nothing moved to an earlier stage. The 90-file regression from the previous head (4461007c) is gone.

Cause B (namespace_graft_body_dissolved_refused), 25 attributed files: RefusalCleared ×25, AdvancedToNewCause 0, StillBlocked 0. The graft cause no longer occurs anywhere in the closure. Terminal-cause histogram after: parse 26, match-arm 8, lexer 8, wrapper-retention 1.

This meets the stated bar (all 25 cleared or advanced; all 99 accepting modules still accepted; no earlier-stage movement; the synthetic lost-wrapper red is your fixture's to keep red). Ready to leave draft.

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review September 10, 2026 22:03
…witness.

Floor typecheck refuses Primitive(String) at lex_walk_artifact's source parameter; chars is the existing inhabitance path used by tokenize claims.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbc-ci-auto-heal and others added 3 commits September 10, 2026 22:56
Module-level data ran a grammar-wide fold on every load, which pushed native_decl_selection over the floor CPU line. Membership still derives from dag_grammar_top_level_item_expr, only on the empty-flatten graft path.

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

Eager membership over the grammar on every node made native_decl_selection miss the floor CPU line. Derive the unit identities once per empty flatten. Restore the long-lane file so interpreted 16s controls stay declined rather than planned as changed witnesses.

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

The changed-witness observer typechecks the graft module; if-branches of Primitive(Symbol) vs Optional refused the floor before any claim ran.

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

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Closure before/after for #10963 at head e915a1df2a, overlaid on main b0a6d53c35 (PR diff from merge-base 0006e0aabd applied, no unmerged paths; srv2, pinned instrument sha256 815a9684d69a0651, emitted driver over the 167-member closure root, controls-only universe, {"_terminal":"complete","file_refusals":43}). Baseline: the #10943 carrier at 2fb67b411a, 68 refusals. Target cause: namespace_graft_body_dissolved_refused (25 baseline rows).

68 → 43. Zero regressions. Cause-relative outcome for the 25 target rows: 25 RefusalCleared, 0 AdvancedToNewCause, 0 StillBlockedByTargetCause, 0 RegressedToEarlierCause — all 25 discharge. Non-target files whose cause changed: 0. Previously accepted members now refusing: 0. After-histogram: parse_g0_tokens_remain 26, body_lowering_reason_match_arm_navigation_refused 8, tokenize_lex_e1_unrecognized_char 8, normalized_tree_reason_wrapper_retention_not_normalized 1.

Identical outcome to the receipt at 8da3ae16; this receipt supersedes it and is bound to e915a1df2a. Any later push touching src/v2/{compiler,std,lens,extdeps}, dag/std or dag/extdeps voids it; a test-only push carries it forward. This receipt establishes the self-host compiler closure and this PR's cause-relative delta; it does not establish whole-v2.test.* native-route admission and does not retire v2_native_route_off_the_merge_path.

Consequence (ruled): because the closure reduction reproduces, the long source-level witnesses at this head that still assert namespace_graft_body_dissolved_refused (witness_type_fn_module_dissolution_refuses_RED, witness_type_only_module_dissolution_refuses_RED) are stale and must be deleted or rewritten to assert the repaired behavior before this PR lands.

…ldless atom.

A non-well_formed unit becoming Atom{id} with empty children was the empty-observation drop again: presence of a production identity without the declaration. Cardinality already admits positional children; well_formed of interiors is the unit's own fact.

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

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63268 (dashboard-only, /api/reviews/63268/artifacts/stdout.log)

  1. SubstrateInputsOnly vs live filesystem_read of src/v2/std/text.dag: that row and the witness_accepted_closure_module_text_dag_still_normalizes call are not on this head. dag/test/claim/long/namespace_graft_body_dissolution_witness_test.dag matches main (no live_tree_disposition, no host read of text.dag). The mechanism RED that stays enrolled is namespace_graft_lost_top_level_item_without_unit_refuses_RED in graft_shape_test. No disposition edit to make.

  2. namespace_graft_admitted_unit_node was the silent drop: a non-well_formed unit became Atom { identity } with empty children and no diagnostic. Deleted. Reconstruct now keeps the collected unit as a Positional child of the one Named Cardinality forest. Presence of a production identity without its declaration is the defect this graft repair exists to close; the strip was that defect on the reconstruct path.

— sent from fierce-tern-547

… walk.

namespace_graft_fold_collect_children only called namespace_graft_collect_body_edge over children; the outer name already is that walk.

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

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63283 (dashboard-only, /api/reviews/63283/artifacts/stdout.log)

  1. namespace_graft_admitted_unit_node is already gone on this head (200fdbb9d74 and after). Reconstruct keeps the collected unit as a Positional child of the Cardinality forest; there is no childless-Atom substitution and no silent well_formed-false arm. The type-decl / nonempty-flatten claims still only cover the keep path because the drop path no longer exists.

  2. namespace_graft_fold_collect_children was a second name for namespace_graft_collect_body_edges_from_node. Inlined the fold into that function and deleted the wrapper.

— sent from fierce-tern-547

Those identities still expected namespace_graft_body_dissolved_refused after the reconstruct path landed, so the executing real-source controls contradicted the repair. They now require normalize accept and absence of that reason.

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

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63307 (dashboard-only, /api/reviews/63307/artifacts/stdout.log)

  1. namespace_graft_admitted_unit_node is not on this head. Reconstruct keeps collected units; there is no childless-Atom substitution.

  2. The long-lane type-only / type+fn identities were still the main RED oracles (expect namespace_graft_body_dissolved_refused) while production reconstructs an empty flatten. That was specification-without-execution for the must-graft target. They are now witness_type_only_module_grafts / witness_type_fn_module_grafts: tokenize/parse/normalize must accept, and that reason must be absent. Lost-wrapper RED stays the synthetic namespace_graft_lost_top_level_item_without_unit_refuses_RED. ci_layer_roots long-lane rows follow the new function names.

  3. Nonempty flatten still keeps the flatten (does not reconstruct). That is the path that restored the 90 previously-accepted modules at 8da3ae16 (Conj uniquely Named). Cause B was empty flatten on fn-less modules. Changing nonempty flatten to stop-at-shell without a Cardinality wrap reopens well_formed on duplicate Named production identities; I am not doing that without a refreshed 167-member receipt.

— sent from fierce-tern-547

…raft.

well_formed alone was green for a childless Atom of the same identity; the discriminating RED is that grammar_production_identity_node_projection targeting dag_surface_type_decl is still in the grafted tree.

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

gunbai-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

review 63318 (dashboard-only, /api/reviews/63318/artifacts/stdout.log)

  1. namespace_graft_admitted_unit_node is not on this head. Reconstruct keeps the collected unit; there is no childless-Atom failure arm.

  2. namespace_graft_type_decl_unit_is_not_dissolved_holds now requires well_formed and that the grafted tree still carries grammar_production_identity_node_projection targeting dag_surface_type_decl. A hollow Atom of that identity would pass the first conjunct and fail the second.

  3. namespace_graft_fold_collect_children is already gone; namespace_graft_collect_body_edges_from_node is the fold itself.

— sent from fierce-tern-547

@gunbai-bot
gunbai-bot Bot force-pushed the session/fierce-tern-547 branch from 5000e01 to c49b443 Compare September 11, 2026 03:07
@briansrls
briansrls deleted the session/fierce-tern-547 branch September 11, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant