Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 10 additions & 4 deletions dag/gunbc/stage0_crate_layout_generated.dag
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import std.types { List, String }

data stage0_crate_layout_generated_note: String = "Generated by gunbc stage0_crate_layout_emit — do not hand-edit. Authority: v2.compiler.self_host.stage0_crate_layout; regen via dag/tools/generated_artifact_gate.dag main_wet."

data generated_pub_mod_block: String = "\n#[macro_use]\npub mod v1_interpreter_dispatch_generated;\npub mod v1_interpreter;\npub mod cli_run;\npub mod codex_app_server_stdio_session;\npub mod coproduct_reflection;\npub mod data_initializer_identity;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod derived_realization_schedule;\npub mod expected_red_roster_join;\npub mod memory_governor;\npub mod module_path_index;\npub mod usv_pilot_v2_std_algebra;\npub mod usv_pilot_v2_std_collection;\npub mod usv_pilot_v2_std_node;\npub mod v2_compiler_resolve;\npub mod v2_compiler_program_partition;\npub mod v2_compiler_tokenize;\npub mod v2_compiler_infer;"
data generated_pub_mod_block: String = "\n#[macro_use]\npub mod v1_interpreter_dispatch_generated;\npub mod v1_interpreter;\npub mod cli_run;\npub mod codex_app_server_stdio_session;\npub mod coproduct_reflection;\npub mod data_initializer_identity;\npub mod resolved_graph_cache;\npub mod shared_typecheck_store;\npub mod recorded_fixture;\npub mod derived_realization_schedule;\npub mod v1_compiler_expected_red_roster_join;\npub mod memory_governor;\npub mod module_path_index;\npub mod usv_pilot_v2_std_algebra;\npub mod usv_pilot_v2_std_collection;\npub mod usv_pilot_v2_std_node;\npub mod v2_compiler_resolve;\npub mod v2_compiler_program_partition;\npub mod v2_compiler_tokenize;\npub mod v2_compiler_infer;"

data generated_pub_mod_basenames: List<String> = [
"v1_interpreter",
Expand All @@ -16,7 +16,7 @@ data generated_pub_mod_basenames: List<String> = [
"shared_typecheck_store",
"recorded_fixture",
"derived_realization_schedule",
"expected_red_roster_join",
"v1_compiler_expected_red_roster_join",
"memory_governor",
"module_path_index",
"usv_pilot_v2_std_algebra",
Expand Down Expand Up @@ -44,7 +44,7 @@ data generated_stage0_filenames: List<String> = [
"pre_push.rs",
"census_exclude_derive.rs",
"derived_realization_schedule.rs",
"expected_red_roster_join.rs",
"v1_compiler_expected_red_roster_join.rs",
"memory_governor.rs",
"std_lens_verdict.rs",
"v2_compiler_body_producer.rs",
Expand All @@ -53,14 +53,20 @@ data generated_stage0_filenames: List<String> = [
"v2_compiler_discovery_enumeration.rs",
"v2_compiler_parse_engine_hooks.rs",
"v2_compiler_use_site_verdict.rs",
"cssl_seed_linked_closure_assembly.rs",
"required_regen_host.rs",
"v2_compiler_compile.rs",
"v2_compiler_program_assembly.rs",
"v2_compiler_source_authority.rs",
"usv_pilot_v2_std_algebra.rs",
"usv_pilot_v2_std_collection.rs",
"usv_pilot_v2_std_node.rs",
"v2_compiler_resolve.rs",
"v2_compiler_program_partition.rs",
"v2_compiler_tokenize.rs",
"v2_compiler_infer.rs",
"v1_interpreter_dispatch_generated.rs"
"v1_interpreter_dispatch_generated.rs",
"bootstrap_stage0_crate_layout_generated.rs"
]

data generated_stage0_dirs: List<String> = [
Expand Down
35 changes: 14 additions & 21 deletions dag/gunbc/stage0_rust_source_lifecycle_scaffold.dag
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ fn derived_hand_maintained_stage0_repo_paths() -> List<String> {
)
}

data residue_frontier_module_gap_dissolved_note: String = "v2_compiler_compile.rs, v2_compiler_program_assembly.rs and v2_compiler_source_authority.rs carried a residue_frontier_module_gap row each, whose own dissolution condition read: 'dissolve-on: the module basename appears on hand_maintained_stage0_filenames() ... and this residue row deletes.' The #8428 regen-survivability backfill (pre_existing_hand_retained_registration_backfill_note, v2.compiler.self_host.stage0_crate_layout) registered all three as SeedRetainedIntrinsicRegistration rows, so the trigger fired and the three residue rows are deleted here rather than left stale — the dissolution condition is evidence consumed, not a permission grant kept beside a state it no longer describes."

data residue_cssl_hand_maintained_overlap_note: String = "cssl_seed_linked_closure_assembly.rs is BOTH a residue row here (not yet regen-emitted, dissolve-on generated_stage0_files membership) AND, since the same #8428 backfill, a hand_maintained_stage0_filenames() member (excluded from required_regen_host's compile_stage0() population comparison, since it is a CSSL-harness-compiled oracle never part of the stage0 crate's own mod tree). Its dissolution condition names generated_stage0_files membership, not hand_maintained_stage0_filenames() membership, so unlike the three dissolved rows above this one's trigger has not fired — it is a genuine, currently-necessary dual classification (residue-pending-emission AND emit-comparison-excluded), not a duplicate authority for the same fact. classified_residue_disjoint_holds is scoped to exclude this single known, named path rather than silently widening to tolerate any future collision."

data generated_artifact_disposition_derivation_note: String = "derived_hand_maintained_stage0_repo_paths() answers ONE question: which paths must be pub-mod-declared for the crate to link (layout membership, per hand_maintained_stage0_filenames_authority_ref). It does not answer who maintains a path's contents. A layout member's maintenance disposition is DERIVED, never hand-enumerated: gunbc.generated_artifact's generated_artifact_registry is the closed, single authority over every drift-gated artifact this repo produces, and artifact_path is its per-variant path projection — the same projection generated_artifact_emit.dag's artifact_generate dispatch already reads. Any stage0-src path that is a member of that registry (generated_artifact_stage0_src_repo_paths, an identity join by artifact_path, not a filename literal) is EmitFrom the registry's real generation authority, never HandScaffold and never silently excluded by a hand-picked path. v1_interpreter_dispatch_generated.rs (V1InterpreterDispatchGeneratedRsArtifact) is the discriminating case that exposed the conflation; bootstrap_stage0_crate_layout_generated.rs (Stage0CrateLayoutGeneratedRsArtifact) is the second instance the same join surfaces — both derive from the identical registry membership check, no per-file code. derived_hand_maintained_disposition_repo_paths() is the corrected maintenance-disposition population: layout membership minus the generated-artifact-registry overlap. This is the single authority consumed by count_hand_maintained_in_tracked/count_hand_maintained_in_prior_tracked and by gunbc.stage0_rust_honest_frontier_integration's exact_hand_maintained_* joins."

data v1_interpreter_dispatch_generated_repo_path: String = stage0_src_repo_path(
Expand Down Expand Up @@ -490,10 +494,6 @@ data residue_module_path_index_reason: String = "hand_maintained_stage0_dirs lis

data residue_module_path_index_dissolution: DissolutionCondition = unbound_dissolution(description: "dissolve-on: module_path_index/*.rs paths derive from hand_maintained_stage0_dirs + host census, or the directory dissolves into generated emit")

data residue_frontier_module_gap_reason: String = "frontier module with behavioral receipt roster row but not yet on hand_maintained_stage0_filenames / generated_stage0_files join"

data residue_frontier_module_gap_dissolution: DissolutionCondition = unbound_dissolution(description: "dissolve-on: the module basename appears on hand_maintained_stage0_filenames() or generated_stage0_files and this residue row deletes")

data residue_stage0_core_lib_reason: String = "src/v1/stage0_core/src/lib.rs exists on disk but is absent from stage0_partition_crate_rows — authority contradiction surfaced for operator resolution"

data residue_stage0_core_lib_dissolution: DissolutionCondition = unbound_dissolution(description: "dissolve-on: stage0_partition_crate_rows enrolls src/v1/stage0_core OR the crate deletes")
Expand Down Expand Up @@ -529,21 +529,6 @@ data rust_source_lifecycle_residue_rows: List<RustSourceLifecycleRow> = [
reason: residue_module_path_index_reason,
dissolution: residue_module_path_index_dissolution
),
residue_row(
path: "src/v1/stage0/src/v2_compiler_compile.rs",
reason: residue_frontier_module_gap_reason,
dissolution: residue_frontier_module_gap_dissolution
),
residue_row(
path: "src/v1/stage0/src/v2_compiler_program_assembly.rs",
reason: residue_frontier_module_gap_reason,
dissolution: residue_frontier_module_gap_dissolution
),
residue_row(
path: "src/v1/stage0/src/v2_compiler_source_authority.rs",
reason: residue_frontier_module_gap_reason,
dissolution: residue_frontier_module_gap_dissolution
),
residue_row(
path: "src/v1/stage0_core/src/lib.rs",
reason: residue_stage0_core_lib_reason,
Expand Down Expand Up @@ -712,15 +697,23 @@ fn derived_generated_hand_disjoint_holds() -> Bool {
)
}

fn classified_residue_disjoint_holds() -> Bool {
!any(
data cssl_seed_linked_closure_assembly_repo_path: String = stage0_src_repo_path(
filename: "cssl_seed_linked_closure_assembly.rs"
)

fn residue_hand_maintained_overlap_repo_paths() -> List<String> {
filter(
xs: residue_lifecycle_repo_paths(),
predicate: fn(residue_path) {
any(xs: derived_authority_join_repo_paths(), predicate: fn(derived_path) { derived_path == residue_path })
}
)
}

fn classified_residue_disjoint_holds() -> Bool {
residue_hand_maintained_overlap_repo_paths() == [cssl_seed_linked_closure_assembly_repo_path]
}

fn file_grain_paths_avoid_discovery_prefix_holds() -> Bool {
!any(
xs: file_grain_lifecycle_repo_paths(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ test fn scaffold_generated_artifact_emit_authority_ref_populated() -> Bool {
}

test fn scaffold_generated_artifact_layout_overlap_repo_paths_is_exactly_v1_interpreter_dispatch() -> Bool {
generated_artifact_layout_overlap_repo_paths() == [v1_interpreter_dispatch_generated_repo_path]
generated_artifact_layout_overlap_repo_paths() == [v1_interpreter_dispatch_generated_repo_path, bootstrap_stage0_crate_layout_generated_repo_path]
}

test fn scaffold_generated_artifact_layout_overlap_subset_of_hand_maintained_holds_green() -> Bool {
Expand Down
202 changes: 202 additions & 0 deletions src/v1/expected_red_roster_join.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
module v1.compiler.expected_red_roster_join

import v1.compiler.emit_core_support { to_string }

// Identity-grain join of the floor's expected-red roster against witness verdicts.
//
// Every enrolled identity receives exactly one of three outcomes:
// - StillRed — the witness ran and failed on its subject (not infra/budget flake).
// - NowPasses — the witness ran and returned true; retire the enrollment, keep the witness.
// - NotEvaluated — no subject verdict (not in manifest, host tool missing, ...).
//
// Completeness is an identity join over the full roster, never a scan of failure-log lines.
// This module is pure logic ported from the hand-authored expected_red_roster_join.rs
// (#8428) so its .rs realization is emitted, not hand-maintained; file I/O and
// diagnostic printing stay in cli_run.rs, which is already a registered hand-maintained
// support module (v2.compiler.self_host.stage0_crate_layout).

type BudgetVerdictCompletion
= Interrupted
| CompletedOverBudget

type WitnessEvalVerdict
= Passed
| BoolFalse
| NotBool { got: String }
| RuntimeError { message: String }
| HostToolUnresolved { name: String, probed: List<String> }
| BudgetExceeded { elapsed_ms: Int, budget_ms: Int, kind: String, completion: BudgetVerdictCompletion }

type ExpectedRedJoinDisposition
= StillRed
| NowPasses
| NotEvaluated { reason: String }

type ExpectedRedRosterJoinRow {
identity: String
disposition: ExpectedRedJoinDisposition
detail: String
}

type ExpectedRedRosterJoinReport {
run_head: String?
run_note: String
rows: List<ExpectedRedRosterJoinRow>
}

fn new_expected_red_roster_join_report(run_head: String?, run_note: String, roster: List<String>) -> ExpectedRedRosterJoinReport {
ExpectedRedRosterJoinReport {
run_head: run_head,
run_note: run_note,
rows: roster |> map(identity => ExpectedRedRosterJoinRow {
identity: identity,
disposition: NotEvaluated { reason: "not_observed" },
detail: ""
})
}
}

fn expected_red_roster_join_roster_len(report: ExpectedRedRosterJoinReport) -> Int {
report.rows |> count
}

fn is_still_red(disposition: ExpectedRedJoinDisposition) -> Bool {
match disposition {
StillRed => true,
_ => false
}
}

fn is_now_passes(disposition: ExpectedRedJoinDisposition) -> Bool {
match disposition {
NowPasses => true,
_ => false
}
}

fn is_not_evaluated(disposition: ExpectedRedJoinDisposition) -> Bool {
match disposition {
NotEvaluated { reason: _ } => true,
_ => false
}
}

fn expected_red_roster_join_still_red(report: ExpectedRedRosterJoinReport) -> Int {
report.rows |> filter(row => is_still_red(disposition: row.disposition)) |> count
}

fn expected_red_roster_join_now_passes(report: ExpectedRedRosterJoinReport) -> Int {
report.rows |> filter(row => is_now_passes(disposition: row.disposition)) |> count
}

fn expected_red_roster_join_not_evaluated(report: ExpectedRedRosterJoinReport) -> Int {
report.rows |> filter(row => is_not_evaluated(disposition: row.disposition)) |> count
}

type VerdictClassification {
disposition: ExpectedRedJoinDisposition
detail: String
}

fn classify_verdict(verdict: WitnessEvalVerdict) -> VerdictClassification {
match verdict {
Passed =>
VerdictClassification { disposition: NowPasses, detail: "witness returned Bool(true)" },
BoolFalse =>
VerdictClassification { disposition: StillRed, detail: "witness returned Bool(false)" },
NotBool { got: got } =>
VerdictClassification { disposition: StillRed, detail: concat("witness answered ", got, ", not a Bool") },
RuntimeError { message: message } =>
VerdictClassification { disposition: StillRed, detail: message },
HostToolUnresolved { name: name, probed: probed } =>
VerdictClassification {
disposition: NotEvaluated { reason: "host_tool_unresolved" },
detail: concat("host tool unresolved: ", name, " (probed: ", probed |> join(separator: ", "), ")")
},
BudgetExceeded { elapsed_ms: elapsed_ms, budget_ms: budget_ms, kind: kind, completion: Interrupted } =>
VerdictClassification {
disposition: NotEvaluated { reason: "budget_refused" },
detail: concat(
"exceeded ", kind, " budget (", to_string(elapsed_ms), "ms elapsed against ",
to_string(budget_ms), "ms; interrupted — no subject verdict)"
)
},
BudgetExceeded { elapsed_ms: elapsed_ms, budget_ms: budget_ms, kind: kind, completion: CompletedOverBudget } =>
VerdictClassification {
disposition: NowPasses,
detail: concat(
"passed then exceeded ", kind, " budget (", to_string(elapsed_ms), "ms against ",
to_string(budget_ms), "ms; stale roster row — prune enrollment, cost debt is separate)"
)
}
}
}

fn disposition_label(disposition: ExpectedRedJoinDisposition) -> String {
match disposition {
StillRed => "still_red",
NowPasses => "now_passes",
NotEvaluated { reason: _ } => "not_evaluated"
}
}

fn not_evaluated_reason(disposition: ExpectedRedJoinDisposition) -> String {
match disposition {
NotEvaluated { reason: reason } => reason,
_ => ""
}
}

fn row_with_recorded_verdict(row: ExpectedRedRosterJoinRow, verdict: WitnessEvalVerdict) -> ExpectedRedRosterJoinRow {
let classification = classify_verdict(verdict: verdict)
ExpectedRedRosterJoinRow {
identity: row.identity,
disposition: classification.disposition,
detail: classification.detail
}
}

// Pure equivalent of ExpectedRedRosterJoinReport::record_observed: returns a report whose
// row matching `identity` reflects `verdict`, all other rows unchanged.
fn record_observed(report: ExpectedRedRosterJoinReport, identity: String, verdict: WitnessEvalVerdict) -> ExpectedRedRosterJoinReport {
ExpectedRedRosterJoinReport {
run_head: report.run_head,
run_note: report.run_note,
rows: report.rows |> map(row =>
if row.identity == identity {
row_with_recorded_verdict(row: row, verdict: verdict)
} else {
row
}
)
}
}

fn is_not_observed(disposition: ExpectedRedJoinDisposition) -> Bool {
match disposition {
NotEvaluated { reason: reason } => reason == "not_observed",
_ => false
}
}

fn row_finalized_if_not_observed(row: ExpectedRedRosterJoinRow) -> ExpectedRedRosterJoinRow {
if is_not_observed(disposition: row.disposition) {
ExpectedRedRosterJoinRow {
identity: row.identity,
disposition: NotEvaluated { reason: "not_in_executed_manifest" },
detail: "enrolled on roster but no matching claim executed in this run"
}
} else {
row
}
}

// Pure equivalent of ExpectedRedRosterJoinReport::finalize_not_observed: every row still
// carrying the initial "not_observed" placeholder is reclassified to "not_in_executed_manifest".
fn finalize_not_observed(report: ExpectedRedRosterJoinReport) -> ExpectedRedRosterJoinReport {
ExpectedRedRosterJoinReport {
run_head: report.run_head,
run_note: report.run_note,
rows: report.rows |> map(row_finalized_if_not_observed)
}
}
10 changes: 8 additions & 2 deletions src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub const HAND_MAINTAINED_STAGE0_FILES: &[&str] = &[
"pre_push.rs",
"census_exclude_derive.rs",
"derived_realization_schedule.rs",
"expected_red_roster_join.rs",
"v1_compiler_expected_red_roster_join.rs",
"memory_governor.rs",
"std_lens_verdict.rs",
"v2_compiler_body_producer.rs",
Expand All @@ -26,14 +26,20 @@ pub const HAND_MAINTAINED_STAGE0_FILES: &[&str] = &[
"v2_compiler_discovery_enumeration.rs",
"v2_compiler_parse_engine_hooks.rs",
"v2_compiler_use_site_verdict.rs",
"cssl_seed_linked_closure_assembly.rs",
"required_regen_host.rs",
"v2_compiler_compile.rs",
"v2_compiler_program_assembly.rs",
"v2_compiler_source_authority.rs",
"usv_pilot_v2_std_algebra.rs",
"usv_pilot_v2_std_collection.rs",
"usv_pilot_v2_std_node.rs",
"v2_compiler_resolve.rs",
"v2_compiler_program_partition.rs",
"v2_compiler_tokenize.rs",
"v2_compiler_infer.rs",
"v1_interpreter_dispatch_generated.rs"
"v1_interpreter_dispatch_generated.rs",
"bootstrap_stage0_crate_layout_generated.rs"
];

#[rustfmt::skip]
Expand Down
Loading