Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
197ea96
Surface #9439's two failing dispositions as typed diagnostics, and sp…
Aug 27, 2026
4a512cc
Fix two refusals from the first gen-0 compile: ModuleEmission field a…
Aug 27, 2026
52bbf22
Install the regenerated mirrors and the cli_run arms they make compil…
Aug 27, 2026
9972267
Add the two cli_run match arms the regenerated mirror makes compilable
Aug 27, 2026
5b358fd
Surface only the export-proof arm as a diagnostic: the registry-absen…
Aug 27, 2026
56be069
Flip ExportUnproven to blocking (approved), both halves of the condit…
Aug 27, 2026
8ee2a04
Correct the producer attribution, and make the diagnostic match wildc…
Aug 27, 2026
e954b73
Correct the registry-absent characterisation: the 473 is MIXED, not a…
Aug 27, 2026
d4f8fd9
Row-count and distinct-name point opposite ways: state both, quote ne…
Aug 27, 2026
5221756
Record the structural variant fact and how it composes with the fifth…
Aug 27, 2026
af77d3a
Regenerate the three drifted mirrors against the final head
Aug 27, 2026
67fdd06
Merge main into session/clever-ibex-894
Aug 27, 2026
157cef3
A variant whose parent is unresolvable gets its own arm, not registry…
Aug 27, 2026
b331e24
Regenerate the stage0 mirrors for the sixth disposition arm
Aug 27, 2026
132f1ee
Demote the export-proof refusal to advisory: its first execution over…
Aug 27, 2026
40f6b80
Name the three required closures in the carrier rather than describin…
Aug 27, 2026
13ea193
Fix the carrier note's inner double quotes, which terminated the .dag…
Aug 27, 2026
a3ba9c1
Regenerate the mirrors for the advisory demotion
Aug 27, 2026
8e8e070
Merge main into session/clever-ibex-894, resolving the mirrors by reg…
Aug 27, 2026
5a30019
Merge main (91c05c1b344) into session/clever-ibex-894, mirrors regene…
Aug 28, 2026
f360e2b
Re-apply the two diagnostic arms onto main's cli_run.rs instead of re…
Aug 28, 2026
fdf4ccf
Merge remote-tracking branch 'origin/main' into session/clever-ibex-894
Aug 28, 2026
da0ccfc
State that step 2 landed in the note that still called it future work
Aug 28, 2026
037cda8
Regenerate the emit_rust mirror for the note edit
Aug 28, 2026
6232b70
Merge remote-tracking branch 'origin/main' into session/clever-ibex-894
Aug 28, 2026
a3347f7
Seed the merge resolution from the side that compiles, then let regen…
Aug 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/v1/00_core.dag

Large diffs are not rendered by default.

176 changes: 164 additions & 12 deletions src/v1/05_emit_rust.dag

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/v1/stage0/src/cli_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5537,6 +5537,12 @@ pub fn compile_clean_diagnostic_histogram_key(d: &Rc<ErrorNode>) -> (String, Str
"ServiceConfigReferenceJudgmentDeferred"
}
CompilerDiagnostic::UnlistedVariantValueUse { .. } => "UnlistedVariantValueUse",
CompilerDiagnostic::ReferenceDerivedImportProviderUnknown { .. } => {
"ReferenceDerivedImportProviderUnknown"
}
CompilerDiagnostic::ReferenceDerivedImportExportUnproven { .. } => {
"ReferenceDerivedImportExportUnproven"
}
};
let name = match d.diagnostic.as_ref() {
CompilerDiagnostic::UnresolvedImport { module_path, .. } => module_path.clone(),
Expand Down Expand Up @@ -5581,6 +5587,8 @@ pub fn compile_clean_diagnostic_histogram_key(d: &Rc<ErrorNode>) -> (String, Str
CompilerDiagnostic::DeclaredTypeInhabitanceUndecided { position, .. } => position.clone(),
CompilerDiagnostic::UnlistedImportUse { name, .. } => name.clone(),
CompilerDiagnostic::UnlistedVariantValueUse { name, .. } => name.clone(),
CompilerDiagnostic::ReferenceDerivedImportProviderUnknown { name, .. } => name.clone(),
CompilerDiagnostic::ReferenceDerivedImportExportUnproven { name, .. } => name.clone(),
CompilerDiagnostic::AmbiguousReference { name, .. } => name.clone(),
CompilerDiagnostic::DataReferenceVisibilityBudgetExceeded { name, .. } => name.clone(),
CompilerDiagnostic::ParameterDefaultFormNotAdmitted { parameter, .. } => parameter.clone(),
Expand Down
201 changes: 149 additions & 52 deletions src/v1/stage0/src/v1_compiler_emit_rust.rs

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions src/v1/stage0/src/v1_std_core.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
// Generated by v1 compiler -- do not edit.
// Source module: v1.tests.claim.reference_derived_disposition_census_witness_test

pub use crate::std_types::SourceSpan;
pub use crate::v1_compiler_compile::compile_to_resolved;
pub use crate::v1_compiler_compile::SourceFile;
use crate::v1_compiler_emit_rust::ReferenceDerivedCandidateDisposition::{
CandidateExportProofFailed, CandidateOwnModule, CandidateRegistryAbsent, CandidateSurvived,
CandidateVariantDelegatedToParent, CandidateVariantParentUnresolved,
};
pub use crate::v1_compiler_emit_rust::{
build_module_index, emit_rust_reference_derived_census, emit_rust_reference_derived_rows,
reference_derived_candidate_disposition, reference_derived_census,
reference_derived_disposition_name,
reference_derived_disposition_name, reference_derived_row_diagnostics,
};
pub use crate::v1_compiler_emit_rust::{
ReferenceDerivedCandidateDisposition, ReferenceDerivedCandidateRow, ReferenceDerivedCensus,
};
use crate::v1_compiler_infer_emit_info::TypeRepr::EnumRepr;
pub use crate::v1_compiler_infer_emit_info::{TypeRepr, TypeSummary};
use crate::v1_compiler_infer_items::ItemKind::FnItem;
pub use crate::v1_compiler_infer_items::{ItemInfo, ItemKind};
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
pub use crate::v1_std_core::{NewlineIndex, Node};
use crate::v1_std_core::CompilerDiagnostic::*;
pub use crate::v1_std_core::ErrorNode;
pub use crate::v1_std_core::{diagnostic_to_message, is_error_diagnostic, no_span};
pub use crate::v1_std_core::{CompilerDiagnostic, FieldSummary, NewlineIndex, Node};
use crate::NonEmptyBTreeSet;
use crate::NonEmptyVec;
use im::{vector as vec, HashMap, OrdSet as BTreeSet, Vector as Vec};
Expand Down Expand Up @@ -78,6 +85,8 @@ pub fn fixture_disposition(
Rc::new(vec![]),
v1_rt::rc_empty_map::<String, Rc<NewlineIndex>>(),
crate::v1_compiler_emit_rust::build_module_index(Rc::new(vec![])),
v1_rt::rc_empty_map::<String, Rc<TypeSummary>>(),
v1_rt::rc_empty_map::<String, String>(),
),
)
}
Expand Down Expand Up @@ -112,6 +121,8 @@ pub fn cross_module_candidate_with_export_proof_survives() -> bool {
Rc::new(vec![]),
v1_rt::rc_empty_map::<String, Rc<NewlineIndex>>(),
crate::v1_compiler_emit_rust::build_module_index(Rc::new(vec![])),
v1_rt::rc_empty_map::<String, Rc<TypeSummary>>(),
v1_rt::rc_empty_map::<String, String>(),
) == Rc::new(ReferenceDerivedCandidateDisposition::CandidateSurvived {
provider_module: "fixture.provider".to_string(),
}))
Expand Down Expand Up @@ -146,11 +157,291 @@ pub fn census_counts_each_arm_separately() -> bool {
},
),
}),
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "e".to_string(),
disposition: Rc::new(
ReferenceDerivedCandidateDisposition::CandidateVariantDelegatedToParent {
parent_enum: "E".to_string(),
},
),
}),
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "f".to_string(),
disposition: Rc::new(
ReferenceDerivedCandidateDisposition::CandidateVariantParentUnresolved,
),
}),
]);
let census = crate::v1_compiler_emit_rust::reference_derived_census(rows.clone());
(((((census.candidates.clone() == 4) && (census.survived.clone() == 1))
(((((((census.candidates.clone() == 6) && (census.survived.clone() == 1))
&& (census.own_module.clone() == 1))
&& (census.variant_delegated_to_parent.clone() == 1))
&& (census.variant_parent_unresolved.clone() == 1))
&& (census.registry_absent.clone() == 1))
&& (census.export_proof_failed.clone() == 1))
}
}

pub fn variant_arm_red_note() -> String {
thread_local! {
static CACHED: String = {
"THE DISCRIMINATING RED FOR THE FIFTH ARM, and it is the one this file most needs. Before the arm existed a bare variant name reached the registry lookup, missed, and answered registry-absent -- so the fixture below is RED against the four-arm classifier and green against the five-arm one, which is what makes it evidence rather than decoration. The positive control beside it is the census row above: a name that is NOT a known variant still answers registry-absent, so the arm narrows the class rather than emptying it.".to_string()
};
}
CACHED.with(|c: &String| c.clone())
}

pub fn fixture_variant_type_summaries() -> Rc<HashMap<String, Rc<TypeSummary>>> {
v1_rt::rc_map_insert(
v1_rt::rc_empty_map::<String, Rc<TypeSummary>>(),
"E".to_string(),
Rc::new(TypeSummary {
name: "E".to_string(),
repr: Rc::new(TypeRepr::EnumRepr { unit_only: true }),
field_summaries: v1_rt::rc_empty_map::<String, Rc<FieldSummary>>(),
field_type_map: v1_rt::rc_empty_map::<String, String>(),
field_import_surface_names: Rc::new(vec![]),
variant_name_set: v1_rt::rc_map_insert(
v1_rt::rc_empty_map::<String, bool>(),
"V".to_string(),
true,
),
generic_param_names: Rc::new(vec![]),
has_fn_fields: false,
}),
)
}

pub fn known_variant_is_delegated_to_its_parent_not_registry_absent() -> bool {
(crate::v1_compiler_emit_rust::reference_derived_candidate_disposition(
"V".to_string(),
"fixture.consumer".to_string(),
v1_rt::rc_empty_map::<String, Rc<ItemInfo>>(),
v1_rt::rc_empty_map::<String, Rc<HashMap<String, bool>>>(),
Rc::new(vec![]),
v1_rt::rc_empty_map::<String, Rc<NewlineIndex>>(),
crate::v1_compiler_emit_rust::build_module_index(Rc::new(vec![])),
fixture_variant_type_summaries(),
v1_rt::rc_map_insert(
v1_rt::rc_empty_map::<String, String>(),
"V".to_string(),
"E".to_string(),
),
) == Rc::new(
ReferenceDerivedCandidateDisposition::CandidateVariantDelegatedToParent {
parent_enum: "E".to_string(),
},
))
}

pub fn ambiguous_parent_red_note() -> String {
thread_local! {
static CACHED: String = {
"THE REACHABLE HALF of the unresolved-parent arm, and the reason it is not merely a tidier name. derive_variant_to_enum inserts the EMPTY STRING as the parent when one variant name appears in two enums, so the lookup answers Present with a parent naming nothing. Without this arm that produced CandidateVariantDelegatedToParent { parent_enum: \"\" } -- a delegation to no one, wearing the payload that was supposed to make delegation honest. This fixture authors the collision directly and is RED against the arm-less form.".to_string()
};
}
CACHED.with(|c: &String| c.clone())
}

pub fn fixture_colliding_variant_type_summaries() -> Rc<HashMap<String, Rc<TypeSummary>>> {
v1_rt::rc_map_insert(
fixture_variant_type_summaries(),
"F".to_string(),
Rc::new(TypeSummary {
name: "F".to_string(),
repr: Rc::new(TypeRepr::EnumRepr { unit_only: true }),
field_summaries: v1_rt::rc_empty_map::<String, Rc<FieldSummary>>(),
field_type_map: v1_rt::rc_empty_map::<String, String>(),
field_import_surface_names: Rc::new(vec![]),
variant_name_set: v1_rt::rc_map_insert(
v1_rt::rc_empty_map::<String, bool>(),
"V".to_string(),
true,
),
generic_param_names: Rc::new(vec![]),
has_fn_fields: false,
}),
)
}

pub fn a_variant_whose_parent_is_ambiguous_is_not_delegated_to_nothing() -> bool {
(crate::v1_compiler_emit_rust::reference_derived_candidate_disposition(
"V".to_string(),
"fixture.consumer".to_string(),
v1_rt::rc_empty_map::<String, Rc<ItemInfo>>(),
v1_rt::rc_empty_map::<String, Rc<HashMap<String, bool>>>(),
Rc::new(vec![]),
v1_rt::rc_empty_map::<String, Rc<NewlineIndex>>(),
crate::v1_compiler_emit_rust::build_module_index(Rc::new(vec![])),
fixture_colliding_variant_type_summaries(),
v1_rt::rc_map_insert(
v1_rt::rc_empty_map::<String, String>(),
"V".to_string(),
"".to_string(),
),
) == Rc::new(ReferenceDerivedCandidateDisposition::CandidateVariantParentUnresolved))
}

pub fn an_unresolved_parent_is_not_reported_as_registry_absent() -> bool {
(crate::v1_compiler_emit_rust::reference_derived_disposition_name(Rc::new(
ReferenceDerivedCandidateDisposition::CandidateVariantParentUnresolved,
)) != "registry-absent".to_string())
}

pub fn non_variant_name_still_answers_registry_absent() -> bool {
(crate::v1_compiler_emit_rust::reference_derived_disposition_name(
crate::v1_compiler_emit_rust::reference_derived_candidate_disposition(
"NotAVariant".to_string(),
"fixture.consumer".to_string(),
v1_rt::rc_empty_map::<String, Rc<ItemInfo>>(),
v1_rt::rc_empty_map::<String, Rc<HashMap<String, bool>>>(),
Rc::new(vec![]),
v1_rt::rc_empty_map::<String, Rc<NewlineIndex>>(),
crate::v1_compiler_emit_rust::build_module_index(Rc::new(vec![])),
fixture_variant_type_summaries(),
v1_rt::rc_map_insert(
v1_rt::rc_empty_map::<String, String>(),
"V".to_string(),
"E".to_string(),
),
),
) == "registry-absent".to_string())
}

pub fn only_export_proof_failed_produces_a_diagnostic() -> bool {
{
let rows = Rc::new(vec![
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "a".to_string(),
disposition: Rc::new(ReferenceDerivedCandidateDisposition::CandidateSurvived {
provider_module: "p".to_string(),
}),
}),
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "b".to_string(),
disposition: Rc::new(ReferenceDerivedCandidateDisposition::CandidateOwnModule),
}),
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "e".to_string(),
disposition: Rc::new(
ReferenceDerivedCandidateDisposition::CandidateVariantDelegatedToParent {
parent_enum: "E".to_string(),
},
),
}),
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "c".to_string(),
disposition: Rc::new(ReferenceDerivedCandidateDisposition::CandidateRegistryAbsent),
}),
Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "d".to_string(),
disposition: Rc::new(
ReferenceDerivedCandidateDisposition::CandidateExportProofFailed {
provider_module: "p".to_string(),
},
),
}),
]);
((crate::v1_compiler_emit_rust::reference_derived_row_diagnostics(
rows.clone(),
crate::v1_std_core::no_span(),
)
.len() as i64)
== 1)
}
}

pub fn the_export_unproven_diagnostic_is_advisory() -> bool {
{
let rows = Rc::new(vec![Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "d".to_string(),
disposition: Rc::new(
ReferenceDerivedCandidateDisposition::CandidateExportProofFailed {
provider_module: "p".to_string(),
},
),
})]);
{
let mut __all = true;
for e in crate::v1_compiler_emit_rust::reference_derived_row_diagnostics(
rows.clone(),
crate::v1_std_core::no_span(),
)
.iter()
.cloned()
{
if !(!crate::v1_std_core::is_error_diagnostic(e.diagnostic.clone())) {
__all = false;
break;
}
}
__all
}
}
}

pub fn registry_absent_not_surfaced_note() -> String {
thread_local! {
static CACHED: String = {
"The RED that keeps registry-absent OUT of the diagnostic stream. Measured over the regen seed closure, that arm returns 473 rows over 63 names dominated by Rust target-language tokens -- Vec, bool, Option, i64, empty_map -- which the candidate walk proposes by tokenizing the module's own emitted Rust and for which no .dag provider can ever exist. Wiring it would print a false report on every build. This test fails the moment someone adds that arm to reference_derived_row_diagnostics, which is the intended wall until the candidate walk stops proposing target-language vocabulary.".to_string()
};
}
CACHED.with(|c: &String| c.clone())
}

pub fn registry_absent_produces_no_diagnostic() -> bool {
{
let rows = Rc::new(vec![Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "bool".to_string(),
disposition: Rc::new(ReferenceDerivedCandidateDisposition::CandidateRegistryAbsent),
})]);
((crate::v1_compiler_emit_rust::reference_derived_row_diagnostics(
rows.clone(),
crate::v1_std_core::no_span(),
)
.len() as i64)
== 0)
}
}

pub fn the_export_unproven_message_names_its_own_remedy() -> bool {
{
let rows = Rc::new(vec![Rc::new(ReferenceDerivedCandidateRow {
module_name: "m".to_string(),
name: "d".to_string(),
disposition: Rc::new(
ReferenceDerivedCandidateDisposition::CandidateExportProofFailed {
provider_module: "p".to_string(),
},
),
})]);
{
let mut __all = true;
for e in crate::v1_compiler_emit_rust::reference_derived_row_diagnostics(
rows.clone(),
crate::v1_std_core::no_span(),
)
.iter()
.cloned()
{
if !(v1_rt::string_contains(
&crate::v1_std_core::diagnostic_to_message(e.diagnostic.clone()),
"NOT an import".to_string(),
)) {
__all = false;
break;
}
}
__all
}
}
}
Loading
Loading