From 2451a9981c7c52d04bbc028e857488b9dcb1f041 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 24 Jun 2026 23:42:54 +0000 Subject: [PATCH 1/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/tests/src/pipeline.rs | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index f59bd29e8ff..66617bc2a74 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -11840,3 +11840,72 @@ fn ownership_stage0_census() { TRY_UNWRAP_RATCHET ); } + +#[test] +#[ignore = "census: enumerate whole-tree advisory typecheck debt by kind/name/module"] +fn whole_tree_advisory_typecheck_census() { + use v1_compiler::v1_std_core::is_discovery_corpus_advisory_typecheck_diagnostic; + let ws = workspace_root(); + let mut sources: Vec> = Vec::new(); + collect_dag_sources(&ws, &ws.join("dsl"), &mut sources); + collect_dag_sources(&ws, &ws.join("src/v2"), &mut sources); + eprintln!("census: {} sources", sources.len()); + + let resolved = + v1_compiler::v1_compiler_compile::compile_to_resolved(Rc::new(sources)); + + let mut by_kind: HashMap<&'static str, usize> = HashMap::new(); + let mut by_name: HashMap = HashMap::new(); + let mut by_module: HashMap = HashMap::new(); + let mut advisory = 0usize; + for d in resolved.diagnostics.iter() { + if !is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) { + continue; + } + advisory += 1; + let (kind, name) = match &*d.diagnostic { + CompilerDiagnostic::UnresolvedType { name, .. } => ("UnresolvedType", name.clone()), + CompilerDiagnostic::TypeMismatch { expected, got, .. } => { + ("TypeMismatch", format!("{} != {}", expected, got)) + } + CompilerDiagnostic::ArityMismatch { name, .. } => ("ArityMismatch", name.clone()), + CompilerDiagnostic::VariantNotFound { variant, type_name, .. } => { + ("VariantNotFound", format!("{}::{}", type_name, variant)) + } + CompilerDiagnostic::FieldNotFound { field, type_name, .. } => { + ("FieldNotFound", format!("{}.{}", type_name, field)) + } + CompilerDiagnostic::NonExhaustiveMatch { .. } => ("NonExhaustiveMatch", String::new()), + CompilerDiagnostic::MissingAnnotation { fn_name, what, .. } => { + ("MissingAnnotation", format!("{}:{}", fn_name, what)) + } + CompilerDiagnostic::VariantCollision { variant, .. } => { + ("VariantCollision", variant.clone()) + } + _ => ("Other", String::new()), + }; + *by_kind.entry(kind).or_insert(0) += 1; + *by_name.entry(format!("{} {}", kind, name)).or_insert(0) += 1; + *by_module.entry(d.module_name.clone()).or_insert(0) += 1; + } + + eprintln!("=== ADVISORY TOTAL: {} ===", advisory); + let mut kinds: Vec<_> = by_kind.into_iter().collect(); + kinds.sort_by(|a, b| b.1.cmp(&a.1)); + eprintln!("--- by kind ---"); + for (k, c) in &kinds { + eprintln!(" {:5} {}", c, k); + } + let mut names: Vec<_> = by_name.into_iter().collect(); + names.sort_by(|a, b| b.1.cmp(&a.1)); + eprintln!("--- top 40 by name ---"); + for (n, c) in names.iter().take(40) { + eprintln!(" {:5} {}", c, n); + } + let mut mods: Vec<_> = by_module.into_iter().collect(); + mods.sort_by(|a, b| b.1.cmp(&a.1)); + eprintln!("--- top 40 modules ---"); + for (m, c) in mods.iter().take(40) { + eprintln!(" {:5} {}", c, m); + } +} From 5ddf4eda0ce62079de199d7de15b59881be4cbf3 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 24 Jun 2026 23:53:24 +0000 Subject: [PATCH 2/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/tests/src/pipeline.rs | 106 +++++++++++++++++++++++------------ 1 file changed, 70 insertions(+), 36 deletions(-) diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index 66617bc2a74..53eaa81b0d2 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -11844,52 +11844,56 @@ fn ownership_stage0_census() { #[test] #[ignore = "census: enumerate whole-tree advisory typecheck debt by kind/name/module"] fn whole_tree_advisory_typecheck_census() { + use std::collections::BTreeSet; + use v1_compiler::cli_run::{discover_floor_corpus_rows, load_sources_for_entry}; use v1_compiler::v1_std_core::is_discovery_corpus_advisory_typecheck_diagnostic; let ws = workspace_root(); - let mut sources: Vec> = Vec::new(); - collect_dag_sources(&ws, &ws.join("dsl"), &mut sources); - collect_dag_sources(&ws, &ws.join("src/v2"), &mut sources); - eprintln!("census: {} sources", sources.len()); - - let resolved = - v1_compiler::v1_compiler_compile::compile_to_resolved(Rc::new(sources)); + std::env::set_current_dir(&ws).expect("chdir to workspace root"); + let roots = vec![ + ws.join("dsl").to_string_lossy().into_owned(), + ws.join("src/v2").to_string_lossy().into_owned(), + ]; + let scan_dirs = vec![ + "dsl/test/claim".to_string(), + "src/v2/compiler/manual".to_string(), + ]; + let rows = discover_floor_corpus_rows(&roots, &scan_dirs).expect("discover roster"); + let entries: BTreeSet = rows.into_iter().map(|r| r.entry).collect(); + eprintln!("census: {} discovery entries", entries.len()); let mut by_kind: HashMap<&'static str, usize> = HashMap::new(); let mut by_name: HashMap = HashMap::new(); let mut by_module: HashMap = HashMap::new(); + let mut by_entry: HashMap = HashMap::new(); + // dedup advisory diagnostics globally by (file, byte-start, kind, name) + let mut seen: BTreeSet<(String, i64, &'static str, String)> = BTreeSet::new(); let mut advisory = 0usize; - for d in resolved.diagnostics.iter() { - if !is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) { - continue; - } - advisory += 1; - let (kind, name) = match &*d.diagnostic { - CompilerDiagnostic::UnresolvedType { name, .. } => ("UnresolvedType", name.clone()), - CompilerDiagnostic::TypeMismatch { expected, got, .. } => { - ("TypeMismatch", format!("{} != {}", expected, got)) - } - CompilerDiagnostic::ArityMismatch { name, .. } => ("ArityMismatch", name.clone()), - CompilerDiagnostic::VariantNotFound { variant, type_name, .. } => { - ("VariantNotFound", format!("{}::{}", type_name, variant)) - } - CompilerDiagnostic::FieldNotFound { field, type_name, .. } => { - ("FieldNotFound", format!("{}.{}", type_name, field)) - } - CompilerDiagnostic::NonExhaustiveMatch { .. } => ("NonExhaustiveMatch", String::new()), - CompilerDiagnostic::MissingAnnotation { fn_name, what, .. } => { - ("MissingAnnotation", format!("{}:{}", fn_name, what)) + for entry in &entries { + let sources = match load_sources_for_entry(&roots, entry) { + Ok(s) => s, + Err(_) => continue, + }; + let resolved = + v1_compiler::v1_compiler_compile::compile_to_resolved(Rc::new(sources)); + for d in resolved.diagnostics.iter() { + if !is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) { + continue; } - CompilerDiagnostic::VariantCollision { variant, .. } => { - ("VariantCollision", variant.clone()) + let span = d.diagnostic.span(); + let (kind, name) = census_kind_name(&d.diagnostic); + let key = (span.file.clone(), span.start, kind, name.clone()); + if !seen.insert(key) { + continue; } - _ => ("Other", String::new()), - }; - *by_kind.entry(kind).or_insert(0) += 1; - *by_name.entry(format!("{} {}", kind, name)).or_insert(0) += 1; - *by_module.entry(d.module_name.clone()).or_insert(0) += 1; + advisory += 1; + *by_kind.entry(kind).or_insert(0) += 1; + *by_name.entry(format!("{} {}", kind, name)).or_insert(0) += 1; + *by_module.entry(span.file.clone()).or_insert(0) += 1; + *by_entry.entry(entry.clone()).or_insert(0) += 1; + } } - eprintln!("=== ADVISORY TOTAL: {} ===", advisory); + eprintln!("=== ADVISORY TOTAL (distinct): {} ===", advisory); let mut kinds: Vec<_> = by_kind.into_iter().collect(); kinds.sort_by(|a, b| b.1.cmp(&a.1)); eprintln!("--- by kind ---"); @@ -11904,8 +11908,38 @@ fn whole_tree_advisory_typecheck_census() { } let mut mods: Vec<_> = by_module.into_iter().collect(); mods.sort_by(|a, b| b.1.cmp(&a.1)); - eprintln!("--- top 40 modules ---"); + eprintln!("--- top 40 files ---"); for (m, c) in mods.iter().take(40) { eprintln!(" {:5} {}", c, m); } + let mut ents: Vec<_> = by_entry.into_iter().collect(); + ents.sort_by(|a, b| b.1.cmp(&a.1)); + eprintln!("--- top 30 entries (new-distinct introduced) ---"); + for (e, c) in ents.iter().take(30) { + eprintln!(" {:5} {}", c, e); + } +} + +fn census_kind_name(d: &Rc) -> (&'static str, String) { + match &**d { + CompilerDiagnostic::UnresolvedType { name, .. } => ("UnresolvedType", name.clone()), + CompilerDiagnostic::TypeMismatch { expected, got, .. } => { + ("TypeMismatch", format!("{} != {}", expected, got)) + } + CompilerDiagnostic::ArityMismatch { name, .. } => ("ArityMismatch", name.clone()), + CompilerDiagnostic::VariantNotFound { + variant, type_name, .. + } => ("VariantNotFound", format!("{}::{}", type_name, variant)), + CompilerDiagnostic::FieldNotFound { + field, type_name, .. + } => ("FieldNotFound", format!("{}.{}", type_name, field)), + CompilerDiagnostic::NonExhaustiveMatch { .. } => ("NonExhaustiveMatch", String::new()), + CompilerDiagnostic::MissingAnnotation { fn_name, what, .. } => { + ("MissingAnnotation", format!("{}:{}", fn_name, what)) + } + CompilerDiagnostic::VariantCollision { variant, .. } => { + ("VariantCollision", variant.clone()) + } + _ => ("Other", String::new()), + } } From d4790f49a25a5c8e1482e05c88e56df05d557c4b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 25 Jun 2026 00:05:41 +0000 Subject: [PATCH 3/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/stage0/src/cli_run.rs | 6 +++--- src/v1/tests/src/pipeline.rs | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index a811927a3de..1cf0c051f30 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -155,9 +155,9 @@ pub fn build_module_path_index(source_roots: &[String]) -> HashMap>; +pub type ModuleSourceIndex = HashMap>; -fn build_module_index(source_roots: &[String]) -> ModuleSourceIndex { +pub fn build_module_index(source_roots: &[String]) -> ModuleSourceIndex { let mut index = ModuleSourceIndex::new(); for root in source_roots { let root_path = std::path::Path::new(root); @@ -241,7 +241,7 @@ fn entry_source_from_index_or_disk( })) } -fn load_sources_for_entry_with_index( +pub fn load_sources_for_entry_with_index( index: &ModuleSourceIndex, entry_path: &str, ) -> Result>, String> { diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index 53eaa81b0d2..c100cd8507c 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -11845,7 +11845,9 @@ fn ownership_stage0_census() { #[ignore = "census: enumerate whole-tree advisory typecheck debt by kind/name/module"] fn whole_tree_advisory_typecheck_census() { use std::collections::BTreeSet; - use v1_compiler::cli_run::{discover_floor_corpus_rows, load_sources_for_entry}; + use v1_compiler::cli_run::{ + build_module_index, discover_floor_corpus_rows, load_sources_for_entry_with_index, + }; use v1_compiler::v1_std_core::is_discovery_corpus_advisory_typecheck_diagnostic; let ws = workspace_root(); std::env::set_current_dir(&ws).expect("chdir to workspace root"); @@ -11860,6 +11862,7 @@ fn whole_tree_advisory_typecheck_census() { let rows = discover_floor_corpus_rows(&roots, &scan_dirs).expect("discover roster"); let entries: BTreeSet = rows.into_iter().map(|r| r.entry).collect(); eprintln!("census: {} discovery entries", entries.len()); + let mod_index = build_module_index(&roots); let mut by_kind: HashMap<&'static str, usize> = HashMap::new(); let mut by_name: HashMap = HashMap::new(); @@ -11869,7 +11872,7 @@ fn whole_tree_advisory_typecheck_census() { let mut seen: BTreeSet<(String, i64, &'static str, String)> = BTreeSet::new(); let mut advisory = 0usize; for entry in &entries { - let sources = match load_sources_for_entry(&roots, entry) { + let sources = match load_sources_for_entry_with_index(&mod_index, entry) { Ok(s) => s, Err(_) => continue, }; From d9426dbf4c49599f734caeea133a75a0335844ed Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 25 Jun 2026 00:18:47 +0000 Subject: [PATCH 4/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/stage0/src/cli_run.rs | 26 ++++++++++++++++++++++++++ src/v1/tests/src/pipeline.rs | 27 ++++++++++++++------------- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index 1cf0c051f30..9709aa1c3fd 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -401,6 +401,25 @@ fn resolve_entry_with_parse_cache( Rc>>, ), String, +> { + resolve_entry_with_parse_cache_advisory(index, entry_file, typecheck_gate, &mut None) +} + +/// Like `resolve_entry_with_parse_cache`, but when `advisory_out` is `Some`, the +/// advisory-demoted typecheck diagnostics for this entry's closure are pushed into +/// it (instead of only being logged). Used to census the discovery advisory debt +/// (#5760 parse-resilience) toward promoting the gate to blocking. +pub fn resolve_entry_with_parse_cache_advisory( + index: &MultiEntryIndex, + entry_file: &str, + typecheck_gate: ResolveTypecheckGate, + advisory_out: &mut Option<&mut Vec>>, +) -> Result< + ( + Rc, + Rc>>, + ), + String, > { let sources = load_sources_for_entry_with_index(&index.source_files, entry_file)?; @@ -490,6 +509,13 @@ fn resolve_entry_with_parse_cache( for d in typed.diagnostics.iter() { log_discovery_advisory_typecheck(d, &source_indices, typecheck_gate); + if let Some(out) = advisory_out.as_mut() { + if is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) + && is_interpreter_blocking_diagnostic(d.diagnostic.clone()) + { + out.push(d.clone()); + } + } } let has_type_errors = typed .diagnostics diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index c100cd8507c..a6f075b28a5 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -11846,9 +11846,9 @@ fn ownership_stage0_census() { fn whole_tree_advisory_typecheck_census() { use std::collections::BTreeSet; use v1_compiler::cli_run::{ - build_module_index, discover_floor_corpus_rows, load_sources_for_entry_with_index, + build_multi_entry_index, discover_floor_corpus_rows, + resolve_entry_with_parse_cache_advisory, ResolveTypecheckGate, }; - use v1_compiler::v1_std_core::is_discovery_corpus_advisory_typecheck_diagnostic; let ws = workspace_root(); std::env::set_current_dir(&ws).expect("chdir to workspace root"); let roots = vec![ @@ -11862,7 +11862,7 @@ fn whole_tree_advisory_typecheck_census() { let rows = discover_floor_corpus_rows(&roots, &scan_dirs).expect("discover roster"); let entries: BTreeSet = rows.into_iter().map(|r| r.entry).collect(); eprintln!("census: {} discovery entries", entries.len()); - let mod_index = build_module_index(&roots); + let index = build_multi_entry_index(&roots); let mut by_kind: HashMap<&'static str, usize> = HashMap::new(); let mut by_name: HashMap = HashMap::new(); @@ -11871,17 +11871,17 @@ fn whole_tree_advisory_typecheck_census() { // dedup advisory diagnostics globally by (file, byte-start, kind, name) let mut seen: BTreeSet<(String, i64, &'static str, String)> = BTreeSet::new(); let mut advisory = 0usize; + let mut total_logged = 0usize; for entry in &entries { - let sources = match load_sources_for_entry_with_index(&mod_index, entry) { - Ok(s) => s, - Err(_) => continue, - }; - let resolved = - v1_compiler::v1_compiler_compile::compile_to_resolved(Rc::new(sources)); - for d in resolved.diagnostics.iter() { - if !is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) { - continue; - } + let mut diags: Vec> = Vec::new(); + let _ = resolve_entry_with_parse_cache_advisory( + &index, + entry, + ResolveTypecheckGate::DiscoveryCorpusAdvisory, + &mut Some(&mut diags), + ); + for d in diags.iter() { + total_logged += 1; let span = d.diagnostic.span(); let (kind, name) = census_kind_name(&d.diagnostic); let key = (span.file.clone(), span.start, kind, name.clone()); @@ -11895,6 +11895,7 @@ fn whole_tree_advisory_typecheck_census() { *by_entry.entry(entry.clone()).or_insert(0) += 1; } } + eprintln!("=== ADVISORY LOGGED (with dups across closures): {} ===", total_logged); eprintln!("=== ADVISORY TOTAL (distinct): {} ===", advisory); let mut kinds: Vec<_> = by_kind.into_iter().collect(); From 7d20998e1aed7e473817264690afb772f79e0864 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 25 Jun 2026 00:42:23 +0000 Subject: [PATCH 5/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/tests/src/pipeline.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index a6f075b28a5..a664a736bf7 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -11872,6 +11872,7 @@ fn whole_tree_advisory_typecheck_census() { let mut seen: BTreeSet<(String, i64, &'static str, String)> = BTreeSet::new(); let mut advisory = 0usize; let mut total_logged = 0usize; + let mut done = 0usize; for entry in &entries { let mut diags: Vec> = Vec::new(); let _ = resolve_entry_with_parse_cache_advisory( @@ -11893,9 +11894,23 @@ fn whole_tree_advisory_typecheck_census() { *by_name.entry(format!("{} {}", kind, name)).or_insert(0) += 1; *by_module.entry(span.file.clone()).or_insert(0) += 1; *by_entry.entry(entry.clone()).or_insert(0) += 1; + eprintln!("ADV\t{}\t{}\t{}:{}", kind, name, span.file, span.start); + } + done += 1; + if done % 25 == 0 { + eprintln!( + "PROGRESS {}/{} distinct={} logged={}", + done, + entries.len(), + advisory, + total_logged + ); } } - eprintln!("=== ADVISORY LOGGED (with dups across closures): {} ===", total_logged); + eprintln!( + "=== ADVISORY LOGGED (with dups across closures): {} ===", + total_logged + ); eprintln!("=== ADVISORY TOTAL (distinct): {} ===", advisory); let mut kinds: Vec<_> = by_kind.into_iter().collect(); From 6e3d751c927921a636240ca45d46bddeb62c05cc Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 25 Jun 2026 01:09:46 +0000 Subject: [PATCH 6/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/00_core.dag | 24 --- src/v1/compile.dag | 4 - src/v1/stage0/src/cli_run.rs | 108 ++-------- src/v1/stage0/src/v1_compiler_compile.rs | 6 - src/v1/stage0/src/v1_std_core.rs | 24 --- src/v1/tests/src/pipeline.rs | 256 +++-------------------- 6 files changed, 43 insertions(+), 379 deletions(-) diff --git a/src/v1/00_core.dag b/src/v1/00_core.dag index 0ccb3943a53..f66424e0e44 100644 --- a/src/v1/00_core.dag +++ b/src/v1/00_core.dag @@ -215,30 +215,6 @@ fn is_interpreter_blocking_diagnostic(d: CompilerDiagnostic) -> Bool { } } -fn is_discovery_corpus_advisory_typecheck_diagnostic(d: CompilerDiagnostic) -> Bool { - match d { - UnresolvedType { name: _, span: _ } => true - TypeMismatch { expected: _, got: _, span: _ } => true - ArityMismatch { name: _, expected: _, got: _, span: _ } => true - VariantNotFound { variant: _, type_name: _, span: _ } => true - FieldNotFound { field: _, type_name: _, span: _ } => true - NonExhaustiveMatch { missing: _, span: _ } => true - MissingAnnotation { fn_name: _, what: _, span: _ } => true - VariantCollision { variant: _, enum1: _, enum2: _, span: _ } => true - _ => false - } -} - -fn is_discovery_corpus_blocking_diagnostic(d: CompilerDiagnostic) -> Bool { - if is_interpreter_blocking_diagnostic(d: d) == false { - false - } else if is_discovery_corpus_advisory_typecheck_diagnostic(d: d) { - false - } else { - true - } -} - fn make_error_node(diagnostic: CompilerDiagnostic, module_name: String) -> ErrorNode { ErrorNode { diagnostic: diagnostic, module_name: module_name } } diff --git a/src/v1/compile.dag b/src/v1/compile.dag index b90552468e6..071240bc98e 100644 --- a/src/v1/compile.dag +++ b/src/v1/compile.dag @@ -1178,10 +1178,6 @@ fn compile_to_resolved(sources: List) -> ResolvedPipelineResult { ) } -fn compile_to_resolved_discovery_corpus_advisory(sources: List) -> ResolvedPipelineResult { - compile_to_resolved(sources: sources) -} - fn compile_to_resolved_with_options(sources: List, options: CompilePipelineOptions) -> ResolvedPipelineResult { let frontend = front_end_sources(sources: sources) let newline_indices = frontend.newline_indices diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index 9709aa1c3fd..816b2851db1 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -20,10 +20,9 @@ use crate::v1_rt; use crate::v1_std_core::{ authored_name_at, build_newline_index, byte_to_line_col, diagnostic_to_message, diagnostic_to_span, empty_intern_table, expr_var_name_at, field_init_node_name_at, - field_init_node_value, has_child_named, intern, - is_discovery_corpus_advisory_typecheck_diagnostic, is_discovery_corpus_blocking_diagnostic, - is_error_diagnostic, is_interpreter_blocking_diagnostic, CompilerDiagnostic, ErrorNode, - ExprData, InferredNode, InternTable, NewlineIndex, Node, + field_init_node_value, has_child_named, intern, is_error_diagnostic, + is_interpreter_blocking_diagnostic, CompilerDiagnostic, ErrorNode, ExprData, InferredNode, + InternTable, NewlineIndex, Node, }; use serde::Serialize; @@ -32,40 +31,6 @@ use crate::resolved_graph_cache::{ write as cross_process_write, CacheLookupResult, }; -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum ResolveTypecheckGate { - Strict, - DiscoveryCorpusAdvisory, -} - -fn is_resolve_typecheck_blocking(d: Rc, gate: ResolveTypecheckGate) -> bool { - match gate { - ResolveTypecheckGate::Strict => is_interpreter_blocking_diagnostic(d), - ResolveTypecheckGate::DiscoveryCorpusAdvisory => is_discovery_corpus_blocking_diagnostic(d), - } -} - -fn log_discovery_advisory_typecheck( - d: &Rc, - source_indices: &HashMap>, - gate: ResolveTypecheckGate, -) { - if gate != ResolveTypecheckGate::DiscoveryCorpusAdvisory { - return; - } - if is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) - && is_interpreter_blocking_diagnostic(d.diagnostic.clone()) - { - let span = diagnostic_to_span(d.diagnostic.clone()); - let loc = format_error_loc(&span.file, span.start, source_indices); - eprintln!( - "advisory(typecheck): {}: error: {}", - loc, - diagnostic_to_message(d.diagnostic.clone()) - ); - } -} - pub const UNIFIED_CLAIM_VERIFICATION_MODULE: &str = "v2.std.verification"; pub const BOOL_WITNESS_CLAIM_TYPE: &str = "BoolWitnessClaim"; pub const NODE_CORPUS_TYPE: &str = "NodeCorpus"; @@ -357,9 +322,13 @@ pub fn resolve_entry_with_index( ), String, > { - resolve_entry_with_parse_cache(index, entry_file, ResolveTypecheckGate::Strict) + resolve_entry_with_parse_cache(index, entry_file) } +/// Discovery-floor entry resolution. The typecheck gate is now blocking (the +/// advisory-demotion seam from #5760 was promoted once the corpus reached zero +/// advisory typecheck debt), so this is identical to `resolve_entry_with_index` +/// — kept as a named call site for the floor. pub fn resolve_entry_with_index_for_discovery_corpus( index: &MultiEntryIndex, entry_file: &str, @@ -370,11 +339,7 @@ pub fn resolve_entry_with_index_for_discovery_corpus( ), String, > { - resolve_entry_with_parse_cache( - index, - entry_file, - ResolveTypecheckGate::DiscoveryCorpusAdvisory, - ) + resolve_entry_with_index(index, entry_file) } fn resolve_entry_graph_with_index( @@ -388,32 +353,12 @@ fn resolve_entry_graph_with_index( String, > { let sources = load_sources_for_entry_with_index(index, entry_file)?; - resolved_graph_from_sources(sources, ResolveTypecheckGate::Strict) + resolved_graph_from_sources(sources) } fn resolve_entry_with_parse_cache( index: &MultiEntryIndex, entry_file: &str, - typecheck_gate: ResolveTypecheckGate, -) -> Result< - ( - Rc, - Rc>>, - ), - String, -> { - resolve_entry_with_parse_cache_advisory(index, entry_file, typecheck_gate, &mut None) -} - -/// Like `resolve_entry_with_parse_cache`, but when `advisory_out` is `Some`, the -/// advisory-demoted typecheck diagnostics for this entry's closure are pushed into -/// it (instead of only being logged). Used to census the discovery advisory debt -/// (#5760 parse-resilience) toward promoting the gate to blocking. -pub fn resolve_entry_with_parse_cache_advisory( - index: &MultiEntryIndex, - entry_file: &str, - typecheck_gate: ResolveTypecheckGate, - advisory_out: &mut Option<&mut Vec>>, ) -> Result< ( Rc, @@ -507,25 +452,15 @@ pub fn resolve_entry_with_parse_cache_advisory( &index.typed_module_cache, ); - for d in typed.diagnostics.iter() { - log_discovery_advisory_typecheck(d, &source_indices, typecheck_gate); - if let Some(out) = advisory_out.as_mut() { - if is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) - && is_interpreter_blocking_diagnostic(d.diagnostic.clone()) - { - out.push(d.clone()); - } - } - } let has_type_errors = typed .diagnostics .iter() - .any(|d| is_resolve_typecheck_blocking(d.diagnostic.clone(), typecheck_gate)); + .any(|d| is_interpreter_blocking_diagnostic(d.diagnostic.clone())); if has_type_errors { let msgs: Vec = typed .diagnostics .iter() - .filter(|d| is_resolve_typecheck_blocking(d.diagnostic.clone(), typecheck_gate)) + .filter(|d| is_interpreter_blocking_diagnostic(d.diagnostic.clone())) .map(|d| format_error_node(d, &source_indices)) .collect(); return Err(msgs.join("\n")); @@ -649,7 +584,6 @@ fn format_error_nodes( fn resolved_graph_from_sources( sources: Vec>, - typecheck_gate: ResolveTypecheckGate, ) -> Result< ( Rc, @@ -657,17 +591,12 @@ fn resolved_graph_from_sources( ), String, > { - let result = match typecheck_gate { - ResolveTypecheckGate::Strict => v1_compiler_compile::compile_to_resolved(Rc::new(sources)), - ResolveTypecheckGate::DiscoveryCorpusAdvisory => { - v1_compiler_compile::compile_to_resolved_discovery_corpus_advisory(Rc::new(sources)) - } - }; + let result = v1_compiler_compile::compile_to_resolved(Rc::new(sources)); let has_errors = result .diagnostics .iter() - .any(|d| is_resolve_typecheck_blocking(d.diagnostic.clone(), typecheck_gate)); + .any(|d| is_interpreter_blocking_diagnostic(d.diagnostic.clone())); if has_errors { let si: HashMap> = result .newline_indices @@ -676,8 +605,7 @@ fn resolved_graph_from_sources( .collect(); let mut msgs = Vec::new(); for d in result.diagnostics.iter() { - if !is_resolve_typecheck_blocking(d.diagnostic.clone(), typecheck_gate) { - log_discovery_advisory_typecheck(d, &si, typecheck_gate); + if !is_interpreter_blocking_diagnostic(d.diagnostic.clone()) { continue; } let span = diagnostic_to_span(d.diagnostic.clone()); @@ -776,7 +704,7 @@ pub fn precompute_whole_tree_published_mock_keys( return Ok(std::collections::HashSet::new()); } let (graph, source_indices) = - resolved_graph_from_sources(all_sources, ResolveTypecheckGate::Strict)?; + resolved_graph_from_sources(all_sources)?; let ctx = v1_interpreter::InterpContext::with_runtime_options( &graph, source_indices, @@ -838,7 +766,7 @@ pub fn whole_tree_resolved_ctx( } let modules_excluded = total - all_sources.len(); let (graph, source_indices) = - resolved_graph_from_sources(all_sources, ResolveTypecheckGate::Strict)?; + resolved_graph_from_sources(all_sources)?; Ok(WholeTreeCtx { ctx: v1_interpreter::InterpContext::with_runtime_options( graph.as_ref(), @@ -1635,7 +1563,7 @@ pub fn discover_owned_data_decls( group.sources.into_values().collect(); sources.sort_by(|a, b| a.path.cmp(&b.path)); let (graph, source_indices) = - resolved_graph_from_sources(sources, ResolveTypecheckGate::DiscoveryCorpusAdvisory)?; + resolved_graph_from_sources(sources)?; let si: HashMap> = source_indices .iter() .map(|(k, v)| (k.clone(), v.clone())) diff --git a/src/v1/stage0/src/v1_compiler_compile.rs b/src/v1/stage0/src/v1_compiler_compile.rs index a70d7937a5a..5f0db03109b 100644 --- a/src/v1/stage0/src/v1_compiler_compile.rs +++ b/src/v1/stage0/src/v1_compiler_compile.rs @@ -2352,12 +2352,6 @@ pub fn compile_to_resolved(sources: Rc>>) -> Rc>>, -) -> Rc { - compile_to_resolved(sources) -} - pub fn compile_to_resolved_with_options( sources: Rc>>, options: CompilePipelineOptions, diff --git a/src/v1/stage0/src/v1_std_core.rs b/src/v1/stage0/src/v1_std_core.rs index cb80a3f6069..2061f5fa1ee 100644 --- a/src/v1/stage0/src/v1_std_core.rs +++ b/src/v1/stage0/src/v1_std_core.rs @@ -675,30 +675,6 @@ pub fn is_interpreter_blocking_diagnostic(d: Rc) -> bool { } } -pub fn is_discovery_corpus_advisory_typecheck_diagnostic(d: Rc) -> bool { - match (*d).clone() { - CompilerDiagnostic::UnresolvedType { .. } => true, - CompilerDiagnostic::TypeMismatch { .. } => true, - CompilerDiagnostic::ArityMismatch { .. } => true, - CompilerDiagnostic::VariantNotFound { .. } => true, - CompilerDiagnostic::FieldNotFound { .. } => true, - CompilerDiagnostic::NonExhaustiveMatch { .. } => true, - CompilerDiagnostic::MissingAnnotation { .. } => true, - CompilerDiagnostic::VariantCollision { .. } => true, - _ => false, - } -} - -pub fn is_discovery_corpus_blocking_diagnostic(d: Rc) -> bool { - if !is_interpreter_blocking_diagnostic(d.clone()) { - false - } else if is_discovery_corpus_advisory_typecheck_diagnostic(d.clone()) { - false - } else { - true - } -} - pub fn make_error_node(diagnostic: Rc, module_name: String) -> Rc { Rc::new(ErrorNode { diagnostic: diagnostic, diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index a664a736bf7..5c00ff7c0ce 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -1180,119 +1180,34 @@ fn bare_import_wildcard_survives_pipeline() { } #[test] -fn discovery_corpus_advisory_demotes_typecheck_not_parse_or_resolve() { +fn discovery_corpus_typecheck_diagnostics_are_blocking() { + // PROMOTION receipt: the discovery-corpus advisory typecheck gate (#5760) was + // promoted to blocking once the whole-tree advisory debt reached zero. The + // discovery floor now uses `is_interpreter_blocking_diagnostic` for typecheck + // diagnostics (no demotion), so a typecheck error fails resolution loudly. use std::rc::Rc; - use v1_compiler::v1_std_core::{ - is_discovery_corpus_blocking_diagnostic, is_interpreter_blocking_diagnostic, no_span, - CompilerDiagnostic, - }; - - let typecheck = Rc::new(CompilerDiagnostic::VariantNotFound { - variant: "Empty".to_string(), - type_name: "FreeMonoid".to_string(), - span: no_span(), - }); - assert!(is_interpreter_blocking_diagnostic(typecheck.clone())); - assert!(!is_discovery_corpus_blocking_diagnostic(typecheck)); - - let parse = Rc::new(CompilerDiagnostic::ParseError { - message: "expected module".to_string(), - span: no_span(), - }); - assert!(is_discovery_corpus_blocking_diagnostic(parse)); -} - -#[test] -fn resolve_typecheck_gate_strict_blocks_advisory_demoted_typecheck() { - use std::rc::Rc; - use v1_compiler::v1_std_core::{ - is_discovery_corpus_advisory_typecheck_diagnostic, is_discovery_corpus_blocking_diagnostic, - is_interpreter_blocking_diagnostic, no_span, CompilerDiagnostic, - }; - - let typecheck = Rc::new(CompilerDiagnostic::VariantNotFound { - variant: "Empty".to_string(), - type_name: "FreeMonoid".to_string(), - span: no_span(), - }); - assert!(is_interpreter_blocking_diagnostic(typecheck.clone())); - assert!(is_discovery_corpus_advisory_typecheck_diagnostic( - typecheck.clone() - )); - assert!(!is_discovery_corpus_blocking_diagnostic(typecheck.clone())); - assert!(is_interpreter_blocking_diagnostic(typecheck)); -} - -#[test] -#[ignore = "receipt: parse-resilience unmasks ~779 typecheck diags demoted by discovery advisory gate"] -fn parse_resilience_unmasked_typecheck_debt_receipt() { - use std::collections::BTreeSet; - use v1_compiler::cli_run::{ - build_multi_entry_index, discover_floor_corpus_rows, - resolve_entry_with_index_for_discovery_corpus, - }; - use v1_compiler::v1_std_core::{ - is_discovery_corpus_advisory_typecheck_diagnostic, is_interpreter_blocking_diagnostic, - }; - - let ws = workspace_root(); - std::env::set_current_dir(&ws).expect("chdir to workspace root"); - let roots = vec![ - ws.join("dsl").to_string_lossy().into_owned(), - ws.join("src/v2").to_string_lossy().into_owned(), - ]; - let scan_dirs = vec![ - "dsl/test/claim".to_string(), - "src/v2/compiler/manual".to_string(), - ]; - let rows = discover_floor_corpus_rows(&roots, &scan_dirs).expect("discover roster"); - let unique_entries: BTreeSet = rows.into_iter().map(|r| r.entry).collect(); - let index = build_multi_entry_index(&roots); - - let mut advisory = 0usize; - let mut blocking_non_advisory = 0usize; - let mut resolve_failures = 0usize; - for entry in &unique_entries { - match resolve_entry_with_index_for_discovery_corpus(&index, entry) { - Ok(_) => {} - Err(_) => resolve_failures += 1, - } - } - - let sample = ws - .join("src/v2/workflow/ci_floor_plan.dag") - .to_string_lossy() - .into_owned(); - let sources = v1_compiler::cli_run::load_sources_for_entry(&roots, &sample) - .expect("load ci_floor_plan closure"); - let resolved = v1_compiler::v1_compiler_compile::compile_to_resolved(Rc::new(sources)); - for d in resolved.diagnostics.iter() { - if !is_interpreter_blocking_diagnostic(d.diagnostic.clone()) { - continue; - } - if is_discovery_corpus_advisory_typecheck_diagnostic(d.diagnostic.clone()) { - advisory += 1; - } else { - blocking_non_advisory += 1; - } - } + use v1_compiler::v1_compiler_compile::{compile_to_resolved, SourceFile}; + use v1_compiler::v1_std_core::is_interpreter_blocking_diagnostic; - eprintln!( - "parse-resilience debt receipt: unique_entries={} resolve_failures_with_advisory={} \ - ci_floor_plan_advisory_typecheck={} ci_floor_plan_blocking_non_advisory={}", - unique_entries.len(), - resolve_failures, - advisory, - blocking_non_advisory - ); - assert_eq!( - resolve_failures, 0, - "discovery resolve must not fail on advisory-demoted typecheck debt" - ); + let sources = vec![Rc::new(SourceFile { + path: "typeerr.dag".to_string(), + content: "module test.typeerr\nfn bad() -> Int { Nonexistent { x: 1 } }\n".to_string(), + })]; + let resolved = compile_to_resolved(Rc::new(sources)); + let blocking = resolved + .diagnostics + .iter() + .filter(|d| is_interpreter_blocking_diagnostic(d.diagnostic.clone())) + .count(); assert!( - unique_entries.len() >= 200, - "expected substantial discovery corpus breadth, got {}", - unique_entries.len() + blocking >= 1, + "a typecheck error must surface as a blocking diagnostic under the promoted \ + (no-demotion) discovery gate; got diagnostics: {:?}", + resolved + .diagnostics + .iter() + .map(|d| v1_compiler::v1_std_core::diagnostic_to_message(d.diagnostic.clone())) + .collect::>() ); } @@ -11841,124 +11756,3 @@ fn ownership_stage0_census() { ); } -#[test] -#[ignore = "census: enumerate whole-tree advisory typecheck debt by kind/name/module"] -fn whole_tree_advisory_typecheck_census() { - use std::collections::BTreeSet; - use v1_compiler::cli_run::{ - build_multi_entry_index, discover_floor_corpus_rows, - resolve_entry_with_parse_cache_advisory, ResolveTypecheckGate, - }; - let ws = workspace_root(); - std::env::set_current_dir(&ws).expect("chdir to workspace root"); - let roots = vec![ - ws.join("dsl").to_string_lossy().into_owned(), - ws.join("src/v2").to_string_lossy().into_owned(), - ]; - let scan_dirs = vec![ - "dsl/test/claim".to_string(), - "src/v2/compiler/manual".to_string(), - ]; - let rows = discover_floor_corpus_rows(&roots, &scan_dirs).expect("discover roster"); - let entries: BTreeSet = rows.into_iter().map(|r| r.entry).collect(); - eprintln!("census: {} discovery entries", entries.len()); - let index = build_multi_entry_index(&roots); - - let mut by_kind: HashMap<&'static str, usize> = HashMap::new(); - let mut by_name: HashMap = HashMap::new(); - let mut by_module: HashMap = HashMap::new(); - let mut by_entry: HashMap = HashMap::new(); - // dedup advisory diagnostics globally by (file, byte-start, kind, name) - let mut seen: BTreeSet<(String, i64, &'static str, String)> = BTreeSet::new(); - let mut advisory = 0usize; - let mut total_logged = 0usize; - let mut done = 0usize; - for entry in &entries { - let mut diags: Vec> = Vec::new(); - let _ = resolve_entry_with_parse_cache_advisory( - &index, - entry, - ResolveTypecheckGate::DiscoveryCorpusAdvisory, - &mut Some(&mut diags), - ); - for d in diags.iter() { - total_logged += 1; - let span = d.diagnostic.span(); - let (kind, name) = census_kind_name(&d.diagnostic); - let key = (span.file.clone(), span.start, kind, name.clone()); - if !seen.insert(key) { - continue; - } - advisory += 1; - *by_kind.entry(kind).or_insert(0) += 1; - *by_name.entry(format!("{} {}", kind, name)).or_insert(0) += 1; - *by_module.entry(span.file.clone()).or_insert(0) += 1; - *by_entry.entry(entry.clone()).or_insert(0) += 1; - eprintln!("ADV\t{}\t{}\t{}:{}", kind, name, span.file, span.start); - } - done += 1; - if done % 25 == 0 { - eprintln!( - "PROGRESS {}/{} distinct={} logged={}", - done, - entries.len(), - advisory, - total_logged - ); - } - } - eprintln!( - "=== ADVISORY LOGGED (with dups across closures): {} ===", - total_logged - ); - - eprintln!("=== ADVISORY TOTAL (distinct): {} ===", advisory); - let mut kinds: Vec<_> = by_kind.into_iter().collect(); - kinds.sort_by(|a, b| b.1.cmp(&a.1)); - eprintln!("--- by kind ---"); - for (k, c) in &kinds { - eprintln!(" {:5} {}", c, k); - } - let mut names: Vec<_> = by_name.into_iter().collect(); - names.sort_by(|a, b| b.1.cmp(&a.1)); - eprintln!("--- top 40 by name ---"); - for (n, c) in names.iter().take(40) { - eprintln!(" {:5} {}", c, n); - } - let mut mods: Vec<_> = by_module.into_iter().collect(); - mods.sort_by(|a, b| b.1.cmp(&a.1)); - eprintln!("--- top 40 files ---"); - for (m, c) in mods.iter().take(40) { - eprintln!(" {:5} {}", c, m); - } - let mut ents: Vec<_> = by_entry.into_iter().collect(); - ents.sort_by(|a, b| b.1.cmp(&a.1)); - eprintln!("--- top 30 entries (new-distinct introduced) ---"); - for (e, c) in ents.iter().take(30) { - eprintln!(" {:5} {}", c, e); - } -} - -fn census_kind_name(d: &Rc) -> (&'static str, String) { - match &**d { - CompilerDiagnostic::UnresolvedType { name, .. } => ("UnresolvedType", name.clone()), - CompilerDiagnostic::TypeMismatch { expected, got, .. } => { - ("TypeMismatch", format!("{} != {}", expected, got)) - } - CompilerDiagnostic::ArityMismatch { name, .. } => ("ArityMismatch", name.clone()), - CompilerDiagnostic::VariantNotFound { - variant, type_name, .. - } => ("VariantNotFound", format!("{}::{}", type_name, variant)), - CompilerDiagnostic::FieldNotFound { - field, type_name, .. - } => ("FieldNotFound", format!("{}.{}", type_name, field)), - CompilerDiagnostic::NonExhaustiveMatch { .. } => ("NonExhaustiveMatch", String::new()), - CompilerDiagnostic::MissingAnnotation { fn_name, what, .. } => { - ("MissingAnnotation", format!("{}:{}", fn_name, what)) - } - CompilerDiagnostic::VariantCollision { variant, .. } => { - ("VariantCollision", variant.clone()) - } - _ => ("Other", String::new()), - } -} From 1f024ab99f20ce475444b6388ceac0896b9056e8 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 25 Jun 2026 02:13:34 +0000 Subject: [PATCH 7/8] fmt: collapse resolved_graph_from_sources call sites after gate-arg removal Co-Authored-By: Claude Opus 4.8 --- src/v1/stage0/src/cli_run.rs | 9 +++------ src/v1/tests/src/pipeline.rs | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index 816b2851db1..535eccdcf9f 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -703,8 +703,7 @@ pub fn precompute_whole_tree_published_mock_keys( if all_sources.is_empty() { return Ok(std::collections::HashSet::new()); } - let (graph, source_indices) = - resolved_graph_from_sources(all_sources)?; + let (graph, source_indices) = resolved_graph_from_sources(all_sources)?; let ctx = v1_interpreter::InterpContext::with_runtime_options( &graph, source_indices, @@ -765,8 +764,7 @@ pub fn whole_tree_resolved_ctx( return Err("whole-tree corpus is empty (no .dag modules under source roots)".to_string()); } let modules_excluded = total - all_sources.len(); - let (graph, source_indices) = - resolved_graph_from_sources(all_sources)?; + let (graph, source_indices) = resolved_graph_from_sources(all_sources)?; Ok(WholeTreeCtx { ctx: v1_interpreter::InterpContext::with_runtime_options( graph.as_ref(), @@ -1562,8 +1560,7 @@ pub fn discover_owned_data_decls( let mut sources: Vec> = group.sources.into_values().collect(); sources.sort_by(|a, b| a.path.cmp(&b.path)); - let (graph, source_indices) = - resolved_graph_from_sources(sources)?; + let (graph, source_indices) = resolved_graph_from_sources(sources)?; let si: HashMap> = source_indices .iter() .map(|(k, v)| (k.clone(), v.clone())) diff --git a/src/v1/tests/src/pipeline.rs b/src/v1/tests/src/pipeline.rs index 5c00ff7c0ce..6d420043d0e 100644 --- a/src/v1/tests/src/pipeline.rs +++ b/src/v1/tests/src/pipeline.rs @@ -11755,4 +11755,3 @@ fn ownership_stage0_census() { TRY_UNWRAP_RATCHET ); } - From be71403b9e84d4b9513c377d517328f7dfb576dc Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 25 Jun 2026 02:27:18 +0000 Subject: [PATCH 8/8] WIP: Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 p --- src/v1/stage0/src/cli_run.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index 7c873962b5a..c367272cc07 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -325,23 +325,6 @@ pub fn resolve_entry_with_index( resolve_entry_with_parse_cache(index, entry_file) } -/// Discovery-floor entry resolution. The typecheck gate is now blocking (the -/// advisory-demotion seam from #5760 was promoted once the corpus reached zero -/// advisory typecheck debt), so this is identical to `resolve_entry_with_index` -/// — kept as a named call site for the floor. -pub fn resolve_entry_with_index_for_discovery_corpus( - index: &MultiEntryIndex, - entry_file: &str, -) -> Result< - ( - Rc, - Rc>>, - ), - String, -> { - resolve_entry_with_index(index, entry_file) -} - fn resolve_entry_graph_with_index( index: &ModuleSourceIndex, entry_file: &str, @@ -2947,9 +2930,8 @@ fn run_discovery_rows( .map_err(|msg| format!("load sources failed for {}: {}", row.entry, msg))?; let closure_subject = subject_digest_for_closure(&sources); let resolve_started = std::time::Instant::now(); - let (graph, source_indices) = - resolve_entry_with_index_for_discovery_corpus(index, &row.entry) - .map_err(|msg| format!("resolve failed for {}: {}", row.entry, msg))?; + let (graph, source_indices) = resolve_entry_with_index(index, &row.entry) + .map_err(|msg| format!("resolve failed for {}: {}", row.entry, msg))?; let resolve_nanos = resolve_started.elapsed().as_nanos(); summary.total_resolve_nanos += resolve_nanos; summary.entry_resolve_receipts.push(EntryResolveReceipt {