Skip to content

unresolved_compiler_error diagnosis + fix: 6 modules (00_compile, materialization_carriers, program_assembly, source_authority, 02_parse, 03_ingest) refuse with UNRESOLVED_CompilerError in curated probes — census + receipts in #6872 TSVs (calm-boar-697). Read the actual probe error output per module - #6986

Merged
briansrls merged 44 commits into
mainfrom
session/neat-swift-795-flip-prep
Jul 21, 2026

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session neat-swift-795.
Pushing to session/neat-swift-795-flip-prep advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

Brian Searls and others added 30 commits July 19, 2026 03:56
Rebased session/neat-swift-795-flip-prep onto origin/main: drop superseded
module-identity/integration history already landed via #6866; retain flip
infrastructure (frontier 6→12 SelfEmitted, wet enrollment, behavioral
transports/shims), Measure emitter generic-env threading (EmitGraphInfo
fn_generic_param_names/fn_type_env, fold lambda param_nodes, container
child recursion gated to generic-fn context), stage0 regen, and nested
List<List<Measure>> emit witness.

PR #6881 remains draft until sign-off receipts complete.

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

Hermetic discovery was running the three new self-host behavioral witnesses
(shell.Mktemp.Dir has no mock); add them to witness_exclusion_substrings like
the other wet receipts. Discharge Band-A OtherGate rows when the frontier
module is already SelfEmitted. Rename nested-fold witness so its stem covers
the new v1 emit test module for the migration-debt ratchet.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore origin/main section 6 (FLAG A interim): workspace Read grant,
ownership-implies-read note, and PR-1/PR-2 LANDED paragraphs. The hunk
was accidental doc drift with no tie to the flip or emitter work.

Co-authored-by: Cursor <cursoragent@cursor.com>
Documents hash-verified gunbc rebuild probe results for the flip-wave
baseline: emit 0-diag on all six, cargo at named next layers (std_dup on
5/6; materialization_carriers E0433 deferred per operator routing).

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove duplicate empty_type_env fallout from stage0 infer emit drift,
and normalize rustfmt-only diffs in regen_stage0 verify so workspace
cargo fmt and fresh self-compile compare cleanly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…revert (12→6).

Regenerated stage0_crate_layout_generated artifacts to drop the six
prematurely-flipped modules from hand-maintained pub mod / filename rosters
now that frontier.dag marks them SeedRetained again.

Co-authored-by: Cursor <cursoragent@cursor.com>
Re-sort compiler_frontier_sweep_order after SeedRetained revert changed
tractability ranks (materialization_carriers/program_assembly →
NameResolutionGap band; 00_compile → EmitSurfaceGap). Fixes
compiler_frontier_census_composite_test CI failure on #6881.

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

Six reverted-module transport docs now cite SeedRetained / honest_frontier_refresh_probe_note instead of stale "flip landed" prose. Remove three flip-wave seed stubs (parse/ingest/materialization_carriers) that were never wired into the frontier-derived crate layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
…lly defines"

An anonymous record literal takes its type from the FIELD it initializes, so the
constructed type name appears nowhere in the source and can never sit in an
authored import list. emit_imports derives use-lines only from import lists, so
the emitted Rust refused: E0422 cannot find struct ... in this scope.

module_data_field_struct_import_names gated candidates on
has_physical_type_def_in_module_filename — field type PHYSICALLY DEFINED in the
module being imported from. That is narrower than the question being asked.
compile_stage_memo imports CacheInterfaceCatalogFacts from extdeps.cache.types
but its io/placement field types are defined in the SIBLING modules
extdeps.cache.catalog_io / catalog_placement and merely re-exported, so they were
rejected and no use-line was synthesized.

Now uses name_in_transitive_export_surface, the existing authority for "does this
module provide this name" (get_exported_names counts specific-import names as
exports, which is exactly re-export) — reused, not re-minted. Routing needed no
change: graph_type_import_module_filename already groups emitted use-lines by the
type's DEFINING module. export_sets is threaded as a parameter rather than rebuilt
inside the filter, which would have been a per-field quadratic cost-shape defect.

Verified by execution, both halves:
  regen_divergence_count=0 (two-stage bootstrap; stage 2 with the new emitter LIVE
    over the whole import-BEARING seed, which is the run that counts)
  materialization_carriers first error advanced
    CacheInterfaceCatalogIoSemantics -> CacheEvidence

Known residue, documented in-code not hidden: a generic field type
(evidence: List<CacheEvidence>) still misses, because build_field_type_map stores
only the type node's HEAD name, so CacheEvidence is absent from field_type_map
entirely and no string-level test can recover it. Distinct axis, separate increment.

Honest frontier refresh (receipt must match measurement, independent of any flip):
01_tokenize / 04_infer / program_partition were recorded as import_closure but all
three now MEASURE as the dotted namespace-qualified render class; rows corrected.
Flip wave produced ZERO flips — 4 of 5 probed modules refuse on the dotted class,
which is emitted into std.collection itself and so sits in every deep closure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brian Searls and others added 5 commits July 21, 2026 10:51
…face names.

build_field_type_map now walks resolved generic/container argument nodes so
List<CacheEvidence> contributes CacheEvidence to field_import_surface_names,
not just the List head in field_type_map. emit_imports field-struct synth
consumes the expanded surface list (rides on #6981 sibling-axis machinery).

Oracle: materialization_carriers first cargo error advances past CacheEvidence
E0422 (verified via cssl probe + emitted use of std_cache_interface::CacheEvidence).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 21, 2026 11:05
…xis.

Replace stale KNOWN RESIDUE paragraph claiming CacheEvidence still misses —
increment-2 now walks the resolved field-type node tree into
field_import_surface_names. Update frontier_probe_types receipt to record
materialization_carriers advancing past CacheEvidence E0422.

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

gunbai-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Addressed review 40676: updated data_field_struct_import_provider_note (and the stage0 mirror + frontier_probe_types receipt) to replace the stale KNOWN RESIDUE paragraph. Increment-2 is now documented as landed — collect_type_node_import_surface_names → field_import_surface_names → synth, with the 2026-07-21 materialization_carriers re-probe showing CacheEvidence E0422 cleared (first error advanced to E0425 cannot find value extdeps).

— sent from neat-swift-795

Brian Searls and others added 2 commits July 21, 2026 11:10
@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

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

Brian Searls and others added 5 commits July 21, 2026 12:46
Post-merge regen_stage0 --verify reported regen_divergence_count=1
(v1_compiler_infer_emit_info.rs stale vs live emitter). Re-emitted seed;
verify now regen_divergence_count=0.

Co-authored-by: Cursor <cursoragent@cursor.com>
Post-merge regen_stage0 --verify reported regen_divergence_count=1
(std_measure.rs; main's measure.dag delta, not #7002 cli_run). Re-emitted;
verify now regen_divergence_count=0.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 21, 2026
Inherited drift, not from this PR. #6991 (59e5cbf, color palette
catalogue) added `data percent_from_computed_int_frontier` to
dag/std/measure.dag without regenerating the emitted seed, so main
carries a stale std_measure.rs. Merging main into this branch inherited
that staleness: regen_divergence_count=1 (std_measure.rs).

Regenerated from the .dag authority via the two-stage bootstrap
(write -> rebuild -> verify); regen_divergence_count=0. The delta is
purely additive (9 lines) and is exactly #6991's declaration -- nothing
from this PR's emitter changes.

neat-swift hit the identical divergence merging the same main into #6986
and resolved it the same way.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls
briansrls merged commit 3bd736d into main Jul 21, 2026
1 check passed
@briansrls
briansrls deleted the session/neat-swift-795-flip-prep branch July 21, 2026 17:55
briansrls added a commit that referenced this pull request Jul 21, 2026
…seed

#6986 merged ahead of #6981, so this integrates it. Three conflicts, NOT
a clean merge:

- src/v1/05_emit_rust.dag and src/v2/compiler/self_host/frontier_probe_types.dag
  both conflicted on a `data ..._note` describing the generic-argument
  residue. Mine documented it as OPEN ("deliberately not fixed here");
  #6986 CLOSED it (increment 2: build_field_type_map walks the resolved
  field-type node tree via collect_type_node_import_surface_names, so
  List<CacheEvidence> now admits CacheEvidence). Took #6986's text on both
  — mine had become factually wrong. Resolved per-hunk, not per-file, so
  the rest of the auto-merge survived.

- src/v1/stage0/src/v1_compiler_emit_rust.rs is the EMITTED SEED and was
  NOT hand-merged. Reset to main's known-good copy, rebuilt, then
  regenerated from the merged .dag via the two-stage bootstrap
  (write -> rebuild -> verify). A git text-merge of two independently
  regenerated seeds is not a valid regen.

Verified both sides survived: this PR's dotted fix (qualified_last_segment)
and emit_imports fix (name_in_transitive_export_surface) are present, and
so is #6986's increment-2. regen_divergence_count=0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jul 21, 2026
…ly defines" (+ honest frontier refresh, zero flips) (#6981)

* WIP: Gate-1 emit regression (post-#6848): the Rust emit target renders namesp

* WIP: Gate-1 emit regression (post-#6848): the Rust emit target renders namesp

* emit_imports: field-struct import synth asks "provides", not "physically defines"

An anonymous record literal takes its type from the FIELD it initializes, so the
constructed type name appears nowhere in the source and can never sit in an
authored import list. emit_imports derives use-lines only from import lists, so
the emitted Rust refused: E0422 cannot find struct ... in this scope.

module_data_field_struct_import_names gated candidates on
has_physical_type_def_in_module_filename — field type PHYSICALLY DEFINED in the
module being imported from. That is narrower than the question being asked.
compile_stage_memo imports CacheInterfaceCatalogFacts from extdeps.cache.types
but its io/placement field types are defined in the SIBLING modules
extdeps.cache.catalog_io / catalog_placement and merely re-exported, so they were
rejected and no use-line was synthesized.

Now uses name_in_transitive_export_surface, the existing authority for "does this
module provide this name" (get_exported_names counts specific-import names as
exports, which is exactly re-export) — reused, not re-minted. Routing needed no
change: graph_type_import_module_filename already groups emitted use-lines by the
type's DEFINING module. export_sets is threaded as a parameter rather than rebuilt
inside the filter, which would have been a per-field quadratic cost-shape defect.

Verified by execution, both halves:
  regen_divergence_count=0 (two-stage bootstrap; stage 2 with the new emitter LIVE
    over the whole import-BEARING seed, which is the run that counts)
  materialization_carriers first error advanced
    CacheInterfaceCatalogIoSemantics -> CacheEvidence

Known residue, documented in-code not hidden: a generic field type
(evidence: List<CacheEvidence>) still misses, because build_field_type_map stores
only the type node's HEAD name, so CacheEvidence is absent from field_type_map
entirely and no string-level test can recover it. Distinct axis, separate increment.

Honest frontier refresh (receipt must match measurement, independent of any flip):
01_tokenize / 04_infer / program_partition were recorded as import_closure but all
three now MEASURE as the dotted namespace-qualified render class; rows corrected.
Flip wave produced ZERO flips — 4 of 5 probed modules refuse on the dotted class,
which is emitted into std.collection itself and so sits in every deep closure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: Gate-1 emit regression (post-#6848): the Rust emit target renders namesp

* emit: route qualified type names through their terminal segment (dotted-render fix)

A namespace-qualified name in a type position arrived from authored_name_at as
the full dotted spelling (std.algebra.FreeMonoid). Every routing lookup on the
alias-RHS path 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:

    pub type List<T> = std.algebra.FreeMonoid<T>;   // invalid Rust

rustc reports that as "expected one of !, (, +, ::, ;, <, or where, found ." — a
PARSE error, so it masked every later error in the module.

Measured blast radius: the emitted 04_infer closure (50 files) contained exactly
ONE such line, and it blocked 4 of 5 self-host flip candidates, because
std.collection sits in essentially every deep-module closure. The control proving
it was qualified-specific is the next declaration: type Set<T> = PointwisePower<T>
(BARE) already routed to Rc<crate::v2_std_algebra::PointwisePower<T>>.

Fix routes on the terminal segment via v1.std.core qualified_last_segment — the
existing authority, not a minted helper: a qualified name IS a containment path
and its last segment IS the declared name the registry knows. Explicitly NOT a
string dot-to-colon rewrite, which would fabricate a path from the spelling rather
than resolve the declaration, and would emit a wrong path whenever the qualifier
does not match the defining module.

Zero drift BY CONSTRUCTION rather than by hope: qualified_last_segment is the
identity on an unqualified name, so every bare name renders byte-identically and
only the qualified case changes.

Verified by execution, both halves:
  regen_divergence_count=0 (two-stage bootstrap, stage 2 with the new emitter live)
  pub type List<T> = Rc<crate::std_algebra::FreeMonoid<T>>;
  zero dotted type paths remain in the emitted closure

Deliberately NOT taken: collection.dag already imports FreeMonoid, so editing that
one declaration to the bare name would have turned the chain green in one
character. That is the cement anti-pattern — it hides the emitter defect and the
next qualified name reintroduces it silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* regen: refresh std_measure.rs seed after #6991 measure.dag change

Inherited drift, not from this PR. #6991 (59e5cbf, color palette
catalogue) added `data percent_from_computed_int_frontier` to
dag/std/measure.dag without regenerating the emitted seed, so main
carries a stale std_measure.rs. Merging main into this branch inherited
that staleness: regen_divergence_count=1 (std_measure.rs).

Regenerated from the .dag authority via the two-stage bootstrap
(write -> rebuild -> verify); regen_divergence_count=0. The delta is
purely additive (9 lines) and is exactly #6991's declaration -- nothing
from this PR's emitter changes.

neat-swift hit the identical divergence merging the same main into #6986
and resolved it the same way.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* merge main (#6986 increment-2) into 6981; resolve 3 conflicts, regen seed

#6986 merged ahead of #6981, so this integrates it. Three conflicts, NOT
a clean merge:

- src/v1/05_emit_rust.dag and src/v2/compiler/self_host/frontier_probe_types.dag
  both conflicted on a `data ..._note` describing the generic-argument
  residue. Mine documented it as OPEN ("deliberately not fixed here");
  #6986 CLOSED it (increment 2: build_field_type_map walks the resolved
  field-type node tree via collect_type_node_import_surface_names, so
  List<CacheEvidence> now admits CacheEvidence). Took #6986's text on both
  — mine had become factually wrong. Resolved per-hunk, not per-file, so
  the rest of the auto-merge survived.

- src/v1/stage0/src/v1_compiler_emit_rust.rs is the EMITTED SEED and was
  NOT hand-merged. Reset to main's known-good copy, rebuilt, then
  regenerated from the merged .dag via the two-stage bootstrap
  (write -> rebuild -> verify). A git text-merge of two independently
  regenerated seeds is not a valid regen.

Verified both sides survived: this PR's dotted fix (qualified_last_segment)
and emit_imports fix (name_in_transitive_export_surface) are present, and
so is #6986's increment-2. regen_divergence_count=0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant