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
6 changes: 3 additions & 3 deletions dag/test/claim/builtin_get_resolver_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ module test.claim.builtin_get_resolver

data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly

fn witness_get_in_bounds_returns_element() -> Bool {
test fn witness_get_in_bounds_returns_element() -> Bool {
match get(xs: [10, 20, 30], index: 1) {
Present { value: v } => v == 20
Absent => false
}
}

fn witness_get_out_of_bounds_is_absent() -> Bool {
test fn witness_get_out_of_bounds_is_absent() -> Bool {
match get(xs: [10, 20, 30], index: 7) {
Present { value: _ } => false
Absent => true
}
}

fn witness_get_negative_index_is_absent() -> Bool {
test fn witness_get_negative_index_is_absent() -> Bool {
match get(xs: [10, 20, 30], index: 0 - 1) {
Present { value: _ } => false
Absent => true
Expand Down
12 changes: 6 additions & 6 deletions dag/test/claim/ci_yaml_serializer_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ test fn witness_steps_sequence_elements_are_yaml_values() -> Bool {
}
}

fn witness_step_sequence_only_serializes() -> Bool {
test fn witness_step_sequence_only_serializes() -> Bool {
let step = step_yaml(step: ci_workflow.jobs.first().steps.first())
serialize_yaml(v: yaml_sequence(elements: concat(empty_yaml_values, [step]))) != ""
}

fn witness_step_mapping_serializes() -> Bool {
test fn witness_step_mapping_serializes() -> Bool {
serialize_yaml(v: step_yaml(step: ci_workflow.jobs.first().steps.first())) != ""
}

fn witness_first_step_is_mapping() -> Bool {
test fn witness_first_step_is_mapping() -> Bool {
match steps_yaml(steps: ci_workflow.jobs.first().steps) {
YamlSequence { elements: els } =>
match els.first() {
Expand All @@ -41,20 +41,20 @@ fn witness_first_step_is_mapping() -> Bool {
}
}

fn witness_one_step_serializes() -> Bool {
test fn witness_one_step_serializes() -> Bool {
let first = ci_workflow.jobs.first().steps.first()
serialize_yaml(v: yaml_mapping(entries: [
kv(key: "steps", value: yaml_sequence(elements: concat(empty_yaml_values, [step_yaml(step: first)])))
])) != ""
}

fn witness_steps_wrapped_serializes() -> Bool {
test fn witness_steps_wrapped_serializes() -> Bool {
serialize_yaml(v: yaml_mapping(entries: [
kv(key: "steps", value: steps_yaml(steps: ci_workflow.jobs.first().steps))
])) != ""
}

fn witness_jobs_yaml_serializes() -> Bool {
test fn witness_jobs_yaml_serializes() -> Bool {
serialize_yaml(v: yaml_mapping(entries: [
kv(key: "jobs", value: jobs_yaml(jobs: ci_workflow.jobs))
])) != ""
Expand Down
4 changes: 2 additions & 2 deletions dag/test/claim/live_deploy/service_ready_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ test fn witness_readiness_poll_bound_grounded_on_std_measure_second() -> Bool {
&& second_count(s: live_deploy_readiness_poll_bound_seconds()) == 120
}

fn witness_poll_bound_strictly_exceeds_expected_startup() -> Bool {
test fn witness_poll_bound_strictly_exceeds_expected_startup() -> Bool {
let expected = second_count(s: live_deploy_roadmap_unit_expected_startup)
let bound = second_count(s: live_deploy_service_ready_poll_bound)
bound > expected
&& live_deploy_service_ready_poll_bound_margin_factor > 1
&& bound == expected * live_deploy_service_ready_poll_bound_margin_factor
}

fn witness_expected_startup_covers_measured_srv1_observations() -> Bool {
test fn witness_expected_startup_covers_measured_srv1_observations() -> Bool {
let expected = second_count(s: live_deploy_roadmap_unit_expected_startup)
expected >= 39
}
Expand Down
14 changes: 7 additions & 7 deletions dag/test/claim/shell_dag_census_5a_typed_ops_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly

data shell_dag_census_5a_scope_note: String = "Hermetic witnesses for the shell->dag census §5.A finite new-op list: os.Hostname.Set, systemd.Systemctl.ListUnits, systemd.Systemctl.Status, extdeps.tools.id (Uid/Gid/Lookup). Model-before-implement only (D1) — each op's mock_response proves the typed exit{}/output shape realizes hermetically; call-site migration (§5.B) is a separate, later lane. Each op cites its upstream authority in its home file's extdeps_external_authority_anchor."

fn witness_hostname_set_argv_is_typed_not_concat() -> Bool {
test fn witness_hostname_set_argv_is_typed_not_concat() -> Bool {
join(hostname_set_argv(desired: "srv9" as DnsLabel), " ") == "hostnamectl set-hostname srv9"
}

fn witness_hostname_set_realizes_hermetically() -> Bool {
test fn witness_hostname_set_realizes_hermetically() -> Bool {
let r = os.Hostname.Set(desired: "srv9" as DnsLabel)
r.success && r.stderr == ""
}

fn witness_systemctl_list_units_realizes_hermetically() -> Bool {
test fn witness_systemctl_list_units_realizes_hermetically() -> Bool {
let r = systemd.Systemctl.ListUnits(pattern: "demo@*.service" as NonEmptyStr)
r.success && r.stdout != ""
}

fn witness_systemctl_status_realizes_hermetically() -> Bool {
test fn witness_systemctl_status_realizes_hermetically() -> Bool {
let r = systemd.Systemctl.Status(unit: "demo.service" as NonEmptyStr)
r.success && r.stdout != ""
}

fn witness_os_id_uid_realizes_hermetically() -> Bool {
test fn witness_os_id_uid_realizes_hermetically() -> Bool {
let r = os.Id.Uid()
r.success && r.value == "1000"
}

fn witness_os_id_gid_realizes_hermetically() -> Bool {
test fn witness_os_id_gid_realizes_hermetically() -> Bool {
let r = os.Id.Gid()
r.success && r.value == "1000"
}

fn witness_os_id_lookup_realizes_hermetically() -> Bool {
test fn witness_os_id_lookup_realizes_hermetically() -> Bool {
let r = os.Id.Lookup(user: "demo" as NonEmptyStr)
r.success && r.stdout != ""
}
8 changes: 4 additions & 4 deletions dag/test/claim/string_brace_escape_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ data lone_escaped_brace: String = "\{"
data backslash_then_brace: String = "\\\{"
data escaped_pair: String = "\{x}"

fn brace_escape_shell_form_length_test() -> Bool {
test fn brace_escape_shell_form_length_test() -> Bool {
string_length(s: shell_default_form) == 42
}

fn brace_escape_produces_single_char_test() -> Bool {
test fn brace_escape_produces_single_char_test() -> Bool {
string_length(s: lone_escaped_brace) == 1
}

fn brace_escape_after_backslash_is_two_chars_test() -> Bool {
test fn brace_escape_after_backslash_is_two_chars_test() -> Bool {
string_length(s: backslash_then_brace) == 2
}

fn brace_escape_pair_stays_literal_test() -> Bool {
test fn brace_escape_pair_stays_literal_test() -> Bool {
string_length(s: escaped_pair) == 3
}
6 changes: 3 additions & 3 deletions src/v1/stage0/src/bin/floor_skip_discovery_witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn floor_skip_test_roster() -> (Vec<String>, Vec<(String, String)>) {
.join("src/v2/workflow/affected_set_floor_runner_test.dag")
.to_string_lossy()
.into_owned();
let function = "floor_runner_node_frontier_policy_holds".to_string();
let function = "floor_test_untouched_skips_assumed_green_holds".to_string();
(floor_skip_source_roots(), vec![(entry, function)])
}

Expand Down Expand Up @@ -545,7 +545,7 @@ fn entry_file_helper_fn_edit_scopes_runs_to_touched_entry_only() {
),
(
runner_entry,
"floor_runner_node_frontier_policy_holds".to_string(),
"floor_test_untouched_skips_assumed_green_holds".to_string(),
),
];

Expand Down Expand Up @@ -585,7 +585,7 @@ fn import_closure_helper_fn_edit_runs_importer_entry_only() {
(disc_entry, "floor_disc_witness_a_only_holds".to_string()),
(
runner_entry,
"floor_runner_node_frontier_policy_holds".to_string(),
"floor_test_untouched_skips_assumed_green_holds".to_string(),
),
];

Expand Down
8 changes: 3 additions & 5 deletions src/v1/stage0/src/cli_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13133,11 +13133,9 @@ pub fn discover_floor_witness_roster(
discovery_scope_dirs: &[String],
) -> Result<Vec<DiscoveryRow>, String> {
floor_filename_hygiene_refusal_via_producer(source_roots)?;
// U2 orphan enroll-or-refuse is implemented in test_module_hygiene (unit RED live) but
// NOT wired into the naming walk on this PR: the live corpus still has dark helpers that
// the companion sweep PR resolves. Wiring here before that sweep fail-closes the floor
// on ~75 pre-existing orphans. Dissolve-on: #7274 / session/proud-wren-892-sweep-b
// (re-enable check_orphan_helpers_or_err here in the same commit as the src/v2 corpus sweep).
// U2 — orphan plain fns in *_test.dag (enroll-or-refuse). Lives in the naming walk,
// not a new lens (umbrella-dissolution fence).
crate::test_module_hygiene::check_orphan_helpers_or_err(source_roots)?;
let mut rows = invoke_floor_discovery_producer(source_roots, scan_dirs, exclude_substrings)?;
rows = apply_discovery_scope_dirs_filter(rows, discovery_scope_dirs);
let FloorLensImportGraph {
Expand Down
21 changes: 20 additions & 1 deletion src/v1/stage0/src/test_module_hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,16 @@ fn umbrellas_in_module(entry: &str, module: &ModuleFns) -> Vec<UmbrellaRecord> {
}

fn orphans_in_module(entry: &str, module: &ModuleFns) -> Vec<OrphanHelper> {
// U2 enroll-or-refuse is for test modules: plain helpers beside live `test fn`s.
// A `*_test.dag` with zero `test fn`s is a fixture/example library (e.g.
// `extdeps/languages/rust_test.dag` — cross-module consumers, module-local
// reachability cannot see them). Skip rather than false-red every export.
// Dissolve-on: rename fixture libraries off the `_test.dag` suffix, or lift
// reachability to the import graph.
let has_test_fn = module.fns.values().any(|(is_test, _, _)| *is_test);
if !has_test_fn {
return Vec::new();
}
let plain: HashSet<String> = module
.fns
.iter()
Expand Down Expand Up @@ -379,10 +389,19 @@ pub fn collect_umbrella_roster(roots: &[String]) -> Result<Vec<UmbrellaRecord>,

/// U2 — orphan plain fns across `*_test.dag` under roots.
pub fn collect_orphan_helpers(roots: &[String]) -> Result<Vec<OrphanHelper>, String> {
// Relative roots resolve against cwd (floor discovery: workspace root). Absolute
// roots are used as-is — callers must not mutate process cwd to pass a workspace
// (cargo tests are multi-threaded; set_current_dir races).
let ws = std::env::current_dir().map_err(|e| format!("cwd: {e}"))?;
let mut files = Vec::new();
for root in roots {
collect_dag_files(&ws.join(root), &mut files);
let root_path = Path::new(root);
let abs = if root_path.is_absolute() {
root_path.to_path_buf()
} else {
ws.join(root_path)
};
collect_dag_files(&abs, &mut files);
}
files.sort();
let mut out = Vec::new();
Expand Down
7 changes: 4 additions & 3 deletions src/v1/tests/src/c_compilation_unit_witness_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use v1_compiler::cli_run::{make_eval_context, resolve_entry_graph, run_claim, Cl
use v1_compiler::v1_interpreter::ExecutionMode;

#[test]
fn c_compilation_unit_witnesses_green_by_execution() {
fn c_compilation_unit_leaf_witness_green_by_execution() {
let roots = vec![
workspace_root()
.join("src/v2")
Expand All @@ -17,10 +17,11 @@ fn c_compilation_unit_witnesses_green_by_execution() {
.into_owned();
let (graph, si) = resolve_entry_graph(&roots, &entry).expect("resolve c witness entry");
let ctx = make_eval_context(&graph, si, ExecutionMode::Hermetic);
let outcome = run_claim(&ctx, "c_compilation_unit_witnesses");
// Umbrella `c_compilation_unit_witnesses` dissolved; pin one surviving leaf.
let outcome = run_claim(&ctx, "witness_r3_header_source_object_paths");
assert!(
matches!(outcome, ClaimOutcome::Pass),
"c_compilation_unit_witnesses must pass by execution, got {:?}",
"witness_r3_header_source_object_paths must pass by execution, got {:?}",
outcome
);
}
84 changes: 0 additions & 84 deletions src/v2/extdeps/react/structural_receipts_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,16 @@ import v2.extdeps.frameworks.react {
Text,
UseActionState,
UseCallback,
UseContext,
UseDebugValue,
UseDeferredValue,
UseEffect,
UseEffectEvent,
UseId,
UseImperativeHandle,
UseInsertionEffect,
UseLayoutEffect,
UseMemo,
UseOptimistic,
UseReducer,
UseRef,
UseState,
UseSyncExternalStore,
UseTransition,
ValueAbsent
}
import std.algebra { Cons, Empty }
import v2.std.algebra { length }
Expand All @@ -63,34 +56,6 @@ fn react_probe_props_site() -> ReactPropsSite {
}
}

fn react_probe_hook_use_state() -> ReactHookSite {
UseState { initial_ref: react_probe_cross_decl_ref }
}

fn react_probe_hook_use_reducer() -> ReactHookSite {
UseReducer {
reducer_ref: react_probe_cross_decl_ref,
initial_arg_ref: react_probe_cross_decl_ref,
init: ValueAbsent
}
}

fn react_probe_hook_use_context() -> ReactHookSite {
UseContext { context_ref: react_probe_cross_decl_ref }
}

fn react_probe_hook_use_ref() -> ReactHookSite {
UseRef { initial_ref: react_probe_cross_decl_ref }
}

fn react_probe_hook_use_imperative_handle() -> ReactHookSite {
UseImperativeHandle {
ref_target: react_probe_cross_decl_ref,
factory_ref: react_probe_cross_decl_ref,
dependencies: DependenciesArgOmitted
}
}

fn react_probe_hook_use_effect() -> ReactHookSite {
UseEffect {
setup_ref: react_probe_cross_decl_ref,
Expand All @@ -115,10 +80,6 @@ fn react_probe_hook_use_insertion_effect() -> ReactHookSite {
}
}

fn react_probe_hook_use_effect_event() -> ReactHookSite {
UseEffectEvent { callback_ref: react_probe_cross_decl_ref }
}

fn react_probe_hook_use_memo() -> ReactHookSite {
UseMemo {
factory_ref: react_probe_cross_decl_ref,
Expand All @@ -133,47 +94,6 @@ fn react_probe_hook_use_callback() -> ReactHookSite {
}
}

fn react_probe_hook_use_deferred_value() -> ReactHookSite {
UseDeferredValue {
value_ref: react_probe_cross_decl_ref,
initial_value: ValueAbsent
}
}

fn react_probe_hook_use_sync_external_store() -> ReactHookSite {
UseSyncExternalStore {
subscribe_ref: react_probe_cross_decl_ref,
get_snapshot_ref: react_probe_cross_decl_ref,
get_server_snapshot: ValueAbsent
}
}

fn react_probe_hook_use_debug_value() -> ReactHookSite {
UseDebugValue {
value_ref: react_probe_cross_decl_ref,
format: ValueAbsent
}
}

fn react_probe_hook_use_action_state() -> ReactHookSite {
UseActionState {
action_ref: react_probe_cross_decl_ref,
initial_state_ref: react_probe_cross_decl_ref,
permalink: ValueAbsent
}
}

fn react_probe_hook_use_optimistic() -> ReactHookSite {
UseOptimistic {
value_ref: react_probe_cross_decl_ref,
reducer: ValueAbsent
}
}

fn react_probe_hook_custom_hook() -> ReactHookSite {
CustomHook { implementation_ref: react_probe_cross_decl_ref }
}

fn react_probe_host_element() -> ReactHostElement {
ReactHostElement {
tag_ref: react_probe_cross_decl_ref,
Expand All @@ -198,10 +118,6 @@ fn react_probe_react_element_host() -> ReactElement {
Host { host: react_probe_host_element() }
}

fn react_probe_react_element_composite() -> ReactElement {
Composite { composite: react_probe_composite_element() }
}

fn react_probe_react_element_fragment() -> ReactElement {
Fragment { key: KeyAbsent, children: Empty }
}
Expand Down
Loading