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
8 changes: 7 additions & 1 deletion dag/gunbc/floor_discovery_scaffold.dag
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module gunbc.floor_discovery_scaffold

import std.disposition { Disposition, Scaffold, SingleAuthority }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import std.types { String }
import std.types { Int, String }

data floor_discovery_hand_rust_scaffold: Disposition = Scaffold {
dissolves_to: SingleAuthority,
Expand All @@ -15,6 +15,12 @@ data floor_discovery_hand_rust_scaffold: Disposition = Scaffold {

data floor_discovery_dissolve_trigger: String = "🟡 dissolve-on: floor_discovery_hand_rust_bridge — floor_discovery_producer.dag is roster authority; Rust host still realizes effect-reach reclassification (apply_effect_reach_derived_reads_live_tree), parallel tree walks for build_floor_lens_import_graph, and invoke_floor_discovery_producer interpreter transport via discover_floor_witness_roster; DISSOLVES WHEN discovery admission consumes v2.lens.effect_reach directly and lens-graph feed the .dag producer closure (witness: dag/test/claim/floor_discovery_hand_rust_equivalence_witness_test.dag). Legacy discover_floor_corpus_rows_inner_rust_legacy deleted; discover_floor_corpus_rows / check_floor_filename_hygiene / _inner / _scoped arms deleted. Transport surface enumerated for this receipt (review 44710): invoke_floor_discovery_producer delegates to invoke_floor_discovery_producer_over_corpus(producer_roots, corpus_roots, ...), which de-fuses the two roles the single source_roots list carried — producer_roots locates the MACHINERY (this module's producer entry), corpus_roots is the SUBJECT walked and judged. Production passes one list for both, so the split is role-naming with no behaviour change, and it dissolves with the transport it parameterizes. The producer entry is located by floor_discovery_producer_entry_anchored (process_workspace_root join, NOT cwd-relative) at both resolve sites so resolve_entry_graph_shared keeps one cache key; that anchoring belongs to the cli_run_runtime_workspace_root_plumbing scaffold and dissolves with it."

data floor_naming_hygiene_entry_hand_rust_loc_delta_net: Int = 6

data floor_naming_hygiene_entry_hand_rust_census_note: String = "HAND-RUST census against origin/main: src/v1/stage0/src/cli_run.rs is +8/-2, net +6. The growth is exactly FLOOR_NAMING_HYGIENE_ENTRY plus floor_naming_hygiene_entry_anchored and the filename-hygiene resolver repoint; no second consumer or decision is added. DISSOLVE-ON: the cli_run_runtime_workspace_root_plumbing scaffold deletes this constant/helper when entry resolution receives a typed workspace-root-relative entry instead of anchoring in hand Rust. Concrete ROADMAP row: gunbc.roadmap_authority v1-hand-queue-drain (Work through the remaining hand-written files the products need)."

data floor_naming_hygiene_entry_hand_rust_discriminator: String = "floor_naming_hygiene_entry_anchored"

data floor_discovery_producer_entry: String = "src/v2/workflow/floor_discovery_producer.dag"

data floor_discovery_equivalence_test_sidecar_misplaced: String = "misplaced_wire_contract_decl_drives_discover_to_err"
Expand Down
2 changes: 1 addition & 1 deletion dag/gunbc/test_module_hygiene.dag
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module gunbc.test_module_hygiene

import std.types { String, Bool, List }
import v2.std.optional { Absent, Optional, Present, optional_absent, optional_present }
import v2.workflow.floor_discovery_producer { floor_discovery_scan_test_decl_names }
import v2.workflow.floor_naming_hygiene { floor_discovery_scan_test_decl_names }

data test_module_hygiene_authority_note: String = "U2 orphan enroll-or-refuse + U3 file-grain expand authority (proud-wren-892). Pure fold over ModuleSurface — refs are already-extracted local names (call + bare-var). Host realizes parse Node→surface, FS walk, and interpreter transport (cli_run/test_module_hygiene_bridge.rs). Equivalence: dag/test/claim/test_module_hygiene_hand_rust_equivalence_witness_test.dag + cli_run.rs test_module_hygiene_bridge_equivalence_tests. ROADMAP node v1-test-hygiene-producer-retirement: seed producer deleted; bind is gunbc.test_module_hygiene.orphan_plain_names_or_refuse."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import gunbc.floor_discovery_scaffold {
floor_discovery_equivalence_test_sidecar_misplaced,
floor_discovery_equivalence_test_scan_wire_contract,
floor_discovery_equivalence_test_narrowed_corpus_control,
floor_naming_hygiene_entry_hand_rust_loc_delta_net,
floor_naming_hygiene_entry_hand_rust_census_note,
floor_naming_hygiene_entry_hand_rust_discriminator,
}
import v2.compiler.discovery_enumeration {
OwnedBoolWitnessClaimInit,
Expand All @@ -23,21 +26,22 @@ import v2.workflow.floor_discovery_producer {
FloorDiscoveryAccepted,
FloorDiscoveryRefused,
discover_floor_corpus_rows_from_host_facts,
floor_discovery_scan_test_decl_names,
floor_discovery_content_has_wire_contract_decl,
floor_discovery_wire_contract_sidecar_refusal_for_content,
floor_discovery_entry_live_tree_disposition_refusal_for_content,
floor_filename_hygiene_refusal_for_paths,
floor_discovery_sidecar_refusal_reason,
floor_discovery_surface_text_scan_scaffold,
floor_discovery_surface_text_scan_dissolve_on
}
import v2.workflow.floor_naming_hygiene {
floor_filename_hygiene_refusal_for_paths,
floor_discovery_scan_test_decl_names,
floor_test_sidecar_suffix,
floor_wire_contract_sidecar_suffix
}
import v2.std.algebra { length, list_head, HeadFound, HeadAbsent }
import std.disposition { Disposition, Scaffold, SingleAuthority }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import v2.std.collection {
List,
fold_list
Expand All @@ -55,6 +59,24 @@ data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly

data floor_discovery_hand_rust_equivalence_note: String = "Executes floor_discovery_producer.dag on fixtures (owned-data transport projection, filename hygiene, test-decl scan, wire-contract scan/sidecar, sidecar placement) with RED perturbation controls. Producer authority is exercised here; Rust bridge cross-checks (discover_floor_witness_roster, scan_wire_contract_decl_names) are named in gunbc.floor_discovery_scaffold and proven by cargo test sidecar_placement_hygiene_tests in cli_run.rs on the same fixture spellings."

test fn floor_naming_hygiene_entry_hand_rust_growth_is_censused() -> Bool {
floor_naming_hygiene_entry_hand_rust_loc_delta_net == 6
&& floor_naming_hygiene_entry_hand_rust_discriminator ==
"floor_naming_hygiene_entry_anchored"
&& string_contains(
s: floor_naming_hygiene_entry_hand_rust_census_note,
pattern: "src/v1/stage0/src/cli_run.rs",
)
&& string_contains(
s: floor_naming_hygiene_entry_hand_rust_census_note,
pattern: "DISSOLVE-ON",
)
&& string_contains(
s: floor_naming_hygiene_entry_hand_rust_census_note,
pattern: "v1-hand-queue-drain",
)
}

data fixture_witness_entry: String = "dag/test/claim/floor_discovery_roster_fixture_test.dag"
data fixture_witness_function: String = "floor_discovery_roster_fixture_witness"
data fixture_test_fn_content: String = "test fn floor_discovery_roster_fixture_witness() -> Bool { true }\n"
Expand Down Expand Up @@ -186,7 +208,14 @@ test fn floor_discovery_dissolve_trigger_names_producer_authority() -> Bool {

test fn floor_discovery_surface_text_scan_scaffold_on_carrier() -> Bool {
match floor_discovery_surface_text_scan_scaffold {
Scaffold { dissolves_to: SingleAuthority, bind: _ } => true
Scaffold {
dissolves_to: SingleAuthority,
bind: DeclarationRef {
module_path: "v2.workflow.floor_naming_hygiene",
decl_name: "floor_discovery_scan_test_decl_names",
field: WholeDeclaration
}
} => true
_ => false
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/fail-closed-lockdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The test for "locked": (a) wired into the floor (discovered + run), (b) fail-clo
| Gate | Scope | Evidence |
| --- | --- | --- |
| DagCompileCleanGate | whole tree (fail-fast root) | `gunbc.ci_gate` `DagCompileCleanGate`; `v2.workflow.ci_floor_plan` `gate_runnable` |
| GeneratedArtifactDriftGate | `ci.yml` / `ROADMAP.md` / `.gitignore` byte-drift + per-artifact perturb, over the committed (= generated AND not-ignored) registry | `ci_spec.dag` `GeneratedArtifactDriftGate`; `generated_artifact_gate.dag`; registry+commit-derivation `gunbc/generated_artifact.dag` |
| GeneratedArtifactDriftGate | `ci.yml` / `ROADMAP.md` / `.gitignore` byte-drift + per-artifact perturb, over the committed (= generated AND not-ignored) registry | `gunbc.ci_gate` `GeneratedArtifactDriftGate`; `tools.generated_artifact_gate` `run_generated_artifact_drift_gate`; `gunbc.generated_artifact` `committed_generated_artifacts` |

These are the **structural** gates. The gap is everything *analytical* and the *bootstrap purity* gate.

Expand Down
10 changes: 8 additions & 2 deletions src/v1/stage0/src/cli_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15104,8 +15104,8 @@ fn floor_filename_hygiene_refusal_via_producer(source_roots: &[String]) -> Resul
return Ok(());
}
let (graph, indices) =
resolve_entry_graph_shared(source_roots, &floor_discovery_producer_entry_anchored())
.map_err(|e| format!("floor_discovery_producer resolve for filename hygiene: {e}"))?;
resolve_entry_graph_shared(source_roots, &floor_naming_hygiene_entry_anchored())
.map_err(|e| format!("floor_naming_hygiene resolve for filename hygiene: {e}"))?;
let ctx = make_eval_context(&graph, indices, v1_interpreter::ExecutionMode::Wet);
let path_values: Vec<v1_interpreter::Value> = dag_paths
.iter()
Expand Down Expand Up @@ -15150,6 +15150,7 @@ fn floor_filename_hygiene_refusal_via_producer(source_roots: &[String]) -> Resul
}

const FLOOR_DISCOVERY_PRODUCER_ENTRY: &str = "src/v2/workflow/floor_discovery_producer.dag";
const FLOOR_NAMING_HYGIENE_ENTRY: &str = "src/v2/workflow/floor_naming_hygiene.dag";

/// The producer entry above is repo-relative, and every resolve of it ultimately reads the
/// path **cwd-relative** (`entry_source_from_index_or_disk` does a bare `Path::is_file`).
Expand All @@ -15173,6 +15174,11 @@ fn floor_discovery_producer_entry_anchored() -> String {
anchored.to_string_lossy().into_owned()
}

fn floor_naming_hygiene_entry_anchored() -> String {
let anchored = process_workspace_root().join(FLOOR_NAMING_HYGIENE_ENTRY);
anchored.to_string_lossy().into_owned()
}

fn owned_data_decl_record_to_value(
rec: &OwnedDataDeclRecord,
ctx: &v1_interpreter::InterpContext,
Expand Down
114 changes: 5 additions & 109 deletions src/v2/workflow/floor_discovery_producer.dag
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import v2.workflow.floor_naming_hygiene {
floor_test_marked_decl_allowed_in_entry,
floor_wire_contract_decl_allowed_in_entry,
floor_test_sidecar_suffix,
floor_wire_contract_sidecar_suffix
floor_wire_contract_sidecar_suffix,
floor_discovery_first_token_before_space,
floor_discovery_scan_test_decl_names
}
import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree, SubstrateInputsOnly }
import v2.std.optional {
Expand Down Expand Up @@ -108,88 +110,6 @@ fn floor_discovery_path_excluded(path: String, exclude_substrings: List<String>)
)
}

fn floor_discovery_line_starts_test_decl(line: String) -> Bool {
starts_with(s: trim(line), prefix: "test fn ") || starts_with(s: trim(line), prefix: "test data ")
}

fn floor_discovery_test_rest_from_line(line: String) -> String {
let trimmed = trim(line)
if starts_with(s: trimmed, prefix: "test fn ") {
substring(s: trimmed, start: 8, end: string_length(s: trimmed))
} else if starts_with(s: trimmed, prefix: "test data ") {
substring(s: trimmed, start: 10, end: string_length(s: trimmed))
} else {
""
}
}

fn floor_discovery_first_token_before_space(seg: String) -> String {
fold(
split(s: seg, delimiter: " "),
init: "",
f: fn(name, token) {
if name != "" {
name
} else if token == "" {
""
} else {
token
}
}
)
}

fn floor_discovery_test_decl_name_from_rest(rest: String) -> String {
let before_paren = fold(
split(s: rest, delimiter: "("),
init: "",
f: fn(acc, seg) {
if acc != "" {
acc
} else {
seg
}
}
)
let before_colon = fold(
split(s: before_paren, delimiter: ":"),
init: "",
f: fn(acc, seg) {
if acc != "" {
acc
} else {
seg
}
}
)
floor_discovery_first_token_before_space(seg: before_colon)
}

fn floor_discovery_test_decl_name_from_line(line: String) -> String {
floor_discovery_test_decl_name_from_rest(
rest: floor_discovery_test_rest_from_line(line: line)
)
}

fn floor_discovery_scan_test_decl_names(content: String) -> List<String> {
fold(
split(s: content, delimiter: "\n"),
init: [],
f: fn(acc, line) {
if floor_discovery_line_starts_test_decl(line: line) {
let name = floor_discovery_test_decl_name_from_line(line: line)
if name == "" {
acc
} else {
concat(acc, [name])
}
} else {
acc
}
}
)
}

fn floor_discovery_line_has_wire_contract_decl(line: String) -> Bool {
let trimmed = trim(line)
if starts_with(s: trimmed, prefix: "data ") {
Expand Down Expand Up @@ -776,30 +696,6 @@ fn floor_discovery_wire_contract_sidecar_refusal_for_content(
}
}

fn floor_filename_hygiene_refusal_for_paths(
dag_paths: List<String>
) -> Optional<String> {
fold_list(
xs: dag_paths,
empty: optional_absent(),
cons: fn(found, path) {
match found {
Present { value: _ } => found
Absent => if floor_filename_contains_double_underscore(path: path) {
optional_present(
value: concat(
"filename hygiene: `.dag` basenames must not contain `__`; offending: ",
path
)
)
} else {
optional_absent()
}
}
}
)
}

data floor_discovery_producer_note: String = "Floor discovery producer: enrolled witness roster = pure fold over Filesystem.List/Read host facts, owned-data transport records (host-materialized from scan_dirs by invoke_floor_discovery_producer before the producer call — scan_dirs is not a producer parameter), witness_exclusion_substrings, and *_test.dag naming rules. List/read failures increment walk_failures with a located Optional path; finalize refuses, never an empty roster. Interior directory candidates (basename has no '.') are descended; dotted basenames are skipped as non-dag files."

data floor_discovery_directory_candidate_dissolve_on: String = "dissolve-on: floor_discovery_directory_candidate — basename-without-dot descent heuristic dissolves when Filesystem.List surfaces entry kind (file | directory) and the walker consumes it; live dag/ + src/v2/ corpora have zero dotted directory basenames today (find -type d -name '*.*' empty)."
Expand All @@ -809,10 +705,10 @@ data floor_discovery_live_tree_disposition_dissolve_on: String = "dissolve-on: f
data floor_discovery_surface_text_scan_scaffold: Disposition = Scaffold {
dissolves_to: SingleAuthority,
bind: DeclarationRef {
module_path: "v2.workflow.floor_discovery_producer",
module_path: "v2.workflow.floor_naming_hygiene",
decl_name: "floor_discovery_scan_test_decl_names",
field: WholeDeclaration
}
}

data floor_discovery_surface_text_scan_dissolve_on: String = "🟡 dissolve-on: floor_discovery_surface_text_scan — producer recovers test-decl names, live_tree_disposition rows, and CoproductWireContract markers via hand-rolled line/token splitting over raw source text (§4 grammar-owned-reads violation); DISSOLVES WHEN discovery enumeration consumes grammar-owned parse/AST facts from the same ingress surface as v2.compiler so structural reads are not forked from the ingester."
data floor_discovery_surface_text_scan_dissolve_on: String = "🟡 dissolve-on: floor_discovery_surface_text_scan — naming hygiene recovers test-decl names (and the producer recovers live_tree_disposition rows + CoproductWireContract markers) via hand-rolled line/token splitting over raw source text (§4 grammar-owned-reads violation); DISSOLVES WHEN discovery enumeration consumes grammar-owned parse/AST facts from the same ingress surface as v2.compiler so structural reads are not forked from the ingester. Authority moved to floor_naming_hygiene so orphan/filename resolve stays free of the Filesystem service closure."
Loading
Loading