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
46 changes: 23 additions & 23 deletions dag/test/claim/codex_supervised_turn_wet_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ fn wet_supervised_turn() -> WorkerTurn {
}
}

fn wet_committed_admitted_source_lock_admits() -> Bool {
test fn wet_committed_admitted_source_lock_admits() -> Bool {
match admit_codex_package_lock_text(text: committed_codex_lock_text()) {
CodexPackageLockAdmitted { graph: _, nodes, registry_artifacts } =>
count(nodes) > 0 && count(registry_artifacts) > 0
_ => false
}
}

fn wet_committed_admitted_source_construct_only() -> Bool {
test fn wet_committed_admitted_source_construct_only() -> Bool {
let source = committed_admitted_codex_runtime_source()
(source.lock_bytes != "") && (source.manifest_bytes != "")
}

fn wet_select_codex_exact_target_closure_only() -> Bool {
test fn wet_select_codex_exact_target_closure_only() -> Bool {
match admit_codex_package_lock_text(text: committed_codex_lock_text()) {
CodexPackageLockAdmitted { graph, nodes: _, registry_artifacts: _ } =>
match observe_codex_npm_runtime_target() {
Expand All @@ -161,7 +161,7 @@ fn wet_select_codex_exact_target_closure_only() -> Bool {
}
}

fn wet_acquire_wrapper_artifact_only() -> Bool {
test fn wet_acquire_wrapper_artifact_only() -> Bool {
match prepare_codex_runtime_closure(
source: committed_admitted_codex_runtime_source(),
) {
Expand Down Expand Up @@ -199,7 +199,7 @@ fn wet_acquire_wrapper_artifact_only() -> Bool {
}
}

fn wet_acquire_platform_artifact_only() -> Bool {
test fn wet_acquire_platform_artifact_only() -> Bool {
match prepare_codex_runtime_closure(
source: committed_admitted_codex_runtime_source(),
) {
Expand Down Expand Up @@ -237,7 +237,7 @@ fn wet_acquire_platform_artifact_only() -> Bool {
}
}

fn wet_codex_runtime_prepare_closure_only() -> Bool {
test fn wet_codex_runtime_prepare_closure_only() -> Bool {
match prepare_codex_runtime_closure(
source: committed_admitted_codex_runtime_source(),
) {
Expand All @@ -255,98 +255,98 @@ fn wet_codex_runtime_prepare_closure_only() -> Bool {
}
}

fn wet_materialize_through_prepare_only() -> Bool {
test fn wet_materialize_through_prepare_only() -> Bool {
materialize_codex_runtime_bundle_through_prepare(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_acquire_selected_pair_only() -> Bool {
test fn wet_acquire_selected_pair_only() -> Bool {
materialize_codex_runtime_bundle_through_pair_acquire(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_materialize_npm_ci_offline_only() -> Bool {
test fn wet_materialize_npm_ci_offline_only() -> Bool {
materialize_codex_runtime_bundle_through_npm_ci_offline(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_materialize_finish_after_install_only() -> Bool {
test fn wet_materialize_finish_after_install_only() -> Bool {
materialize_codex_runtime_bundle_finish_after_install(
source: committed_admitted_codex_runtime_source(),
release_parent: wet_materialize_bisect_release_parent,
)
}

fn wet_finish_observe_set_identity_only() -> Bool {
test fn wet_finish_observe_set_identity_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_set_identity_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_manifest_digest_only() -> Bool {
test fn wet_finish_observe_manifest_digest_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_manifest_digest_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_lock_digest_only() -> Bool {
test fn wet_finish_observe_lock_digest_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_lock_digest_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_native_digest_only() -> Bool {
test fn wet_finish_observe_native_digest_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_native_digest_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_toolchain_only() -> Bool {
test fn wet_finish_observe_toolchain_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_toolchain_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_protocol_schema_only() -> Bool {
test fn wet_finish_observe_protocol_schema_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_protocol_schema_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_parse_largest_protocol_schema_only() -> Bool {
test fn wet_finish_parse_largest_protocol_schema_only() -> Bool {
materialize_codex_runtime_finish_bisect_parse_largest_protocol_schema_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_parse_canonicalize_largest_protocol_schema_only() -> Bool {
test fn wet_finish_parse_canonicalize_largest_protocol_schema_only() -> Bool {
materialize_codex_runtime_finish_bisect_parse_canonicalize_largest_protocol_schema_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_package_tree_only() -> Bool {
test fn wet_finish_observe_package_tree_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_package_tree_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_receipt_identity_only() -> Bool {
test fn wet_finish_observe_receipt_identity_only() -> Bool {
materialize_codex_runtime_finish_bisect_observe_receipt_identity_only(
source: committed_admitted_codex_runtime_source(),
)
}

fn wet_finish_observe_package_tree_tiny_fixture() -> Bool {
test fn wet_finish_observe_package_tree_tiny_fixture() -> Bool {
finish_bisect_observe_package_materialized_tree_tiny_fixture()
}

data wet_materialize_bisect_release_parent: FilePath = "/tmp/gunbc-wet-materialize-bisect-release" as FilePath

fn wet_materialize_codex_runtime_bundle_only() -> Bool {
test fn wet_materialize_codex_runtime_bundle_only() -> Bool {
match materialize_codex_runtime_bundle(
source: committed_admitted_codex_runtime_source(),
release_parent: wet_materialize_bisect_release_parent,
Expand All @@ -357,7 +357,7 @@ fn wet_materialize_codex_runtime_bundle_only() -> Bool {
}
}

fn supervised_turn_materialized_bundle_writes_terminal_receipt() -> Bool {
test fn supervised_turn_materialized_bundle_writes_terminal_receipt() -> Bool {
let release_tmp = shell.Mktemp.Dir()
let evidence = shell.Mktemp.Dir()
let cwd = shell.Mktemp.Dir()
Expand Down
24 changes: 12 additions & 12 deletions dag/test/claim/emit_summary_map_consumer_partition_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import gunbc.emit_summary_map_consumer_partition {
// THE ASK COLUMN IS A PARTITION, NOT A SET OF TAGS. Every row sits in exactly one of the four ask
// arms, so the four counts must sum to the member count. RED case: add a fifth ask arm and file a
// row in it without extending the histogram, and this sum breaks.
fn ask_column_partitions_every_member() -> Bool {
test fn ask_column_partitions_every_member() -> Bool {
partition_holds_node_count() + partition_spelling_only_count() + partition_composite_count() + partition_scan_count() == partition_member_count()
}

Expand All @@ -49,7 +49,7 @@ fn ask_column_partitions_every_member() -> Bool {
// the ask alone would have been sufficient and the second column would be ceremony. RED case: file
// the roster with the use column collapsed so that holding a node implies terminal use -- this goes
// red, which is exactly the finding it guards.
fn holding_a_node_does_not_imply_a_terminal_use() -> Bool {
test fn holding_a_node_does_not_imply_a_terminal_use() -> Bool {
(partition_holds_node_but_rekeys() |> count) > 0
}

Expand All @@ -58,15 +58,15 @@ fn holding_a_node_does_not_imply_a_terminal_use() -> Bool {
// spelling leaving the site. This is the number the sizing rests on, so it is carried by an
// executing assertion and not by prose. RED case: any row filed with NodeHeldAtAsk and
// TerminalAtSite -- at which point the sizing changed and this witness says so.
fn rekey_alone_repairs_nothing_on_this_roster() -> Bool {
test fn rekey_alone_repairs_nothing_on_this_roster() -> Bool {
(partition_repaired_by_rekey_alone() |> count) == 0
}

// A SPELLING-ONLY ROW MUST NAME THE FOLD THAT SEVERED IT, AND THAT FOLD MUST BE ON THE SEVERANCE
// ROSTER. Otherwise a row could file "the identity is gone" without saying where it went, which is
// the claim a reader most needs to check and the one an author is most tempted to assume. RED case:
// file a spelling-only row naming a fold absent from emit_summary_map_severance_points.
fn every_severance_fold_named_is_rostered() -> Bool {
test fn every_severance_fold_named_is_rostered() -> Bool {
emit_summary_map_consumers |> all(c =>
if consumer_ask_is_spelling_only(c: c) {
consumer_severance_is_rostered(c: c)
Expand All @@ -77,19 +77,19 @@ fn every_severance_fold_named_is_rostered() -> Bool {
// EVERY MEMBER READS THE MAP AT LEAST ONCE. lookup_expression_count is the only field saying how
// much of the map each row actually decides from; a zero would admit a row contributing nothing a
// reader could go and look at. RED case: file a row with a count of zero.
fn every_member_reads_the_map() -> Bool {
test fn every_member_reads_the_map() -> Bool {
emit_summary_map_consumers |> all(c => c.lookup_expression_count > 0)
}

// THE LOOKUP TOTAL IS AT LEAST THE MEMBER COUNT, given the assertion above. This is the arithmetic
// tie between the two derived numbers a reader compares; it goes red if either fold is rewritten to
// count something else.
fn lookup_total_covers_every_member() -> Bool {
test fn lookup_total_covers_every_member() -> Bool {
partition_lookup_expression_total() >= partition_member_count()
}

// EVERY COLUMN COUNT LIES INSIDE THE ROSTER IT IS DERIVED FROM.
fn derived_counts_lie_within_the_roster() -> Bool {
test fn derived_counts_lie_within_the_roster() -> Bool {
partition_terminal_use_count() <= partition_member_count()
&& partition_holds_node_count() <= partition_member_count()
&& partition_member_count() > 0
Expand All @@ -99,31 +99,31 @@ fn derived_counts_lie_within_the_roster() -> Bool {
// corpus-wide bound. The two figures came from different walks over different populations, so this
// ties them rather than restating one. RED case: file a closure row whose collision count exceeds
// the corpus bound, which is what a mis-scoped closure walk would produce.
fn no_pool_collides_more_than_the_whole_tree_bound() -> Bool {
test fn no_pool_collides_more_than_the_whole_tree_bound() -> Bool {
largest_measured_pool_collision_count() <= whole_tree_collision_upper_bound()
}

// THE CORPUS BOUND IS NOT CARRIED ALONE. A collision population reporting only the upper bound is
// the shape the sequencing rule forbids -- it cannot size a refusal. RED case: delete the closure
// rows and keep the corpus row.
fn the_collision_population_is_measured_at_pool_grain() -> Bool {
test fn the_collision_population_is_measured_at_pool_grain() -> Bool {
measured_pool_row_count() > 0
}

// A CORRECTLY WRITTEN GUARD THAT CANNOT SEE ITS OWN TRIGGER IS THE FINDING, so it is asserted.
// If this set were empty the two-part test would be carrying no information here and the roster
// would collapse back into "is the check well written". RED case: file every guard row as
// preserving its trigger.
fn some_guard_is_correct_and_unable_to_fire() -> Bool {
test fn some_guard_is_correct_and_unable_to_fire() -> Bool {
(guards_written_correctly_but_unable_to_fire() |> count) > 0
}

// AND AT LEAST ONE GUARD MUST PRESERVE ITS TRIGGER, or the roster has no contrast row and the
// column cannot be read as discriminating. RED case: drop build_qualified_item_registry.
fn some_guard_preserves_its_trigger() -> Bool {
test fn some_guard_preserves_its_trigger() -> Bool {
(guards_preserving_their_trigger() |> count) > 0
}

fn every_guard_row_is_counted() -> Bool {
test fn every_guard_row_is_counted() -> Bool {
guard_row_count() == (emit_summary_map_guard_rows |> count)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data emitter_bare_variant_expected_adoption_witness_note: String = "PERMANENT RE
// unwrapped spelling `sign: Sign::Plus` must be absent. The must-contain row alone
// would be satisfiable by an emitter that produced both forms; the must-not-contain row
// alone passes vacuously if emission fails and yields no text at all.
fn w_optional_field_bare_variant_keeps_its_wrapper() -> Bool {
test fn w_optional_field_bare_variant_keeps_its_wrapper() -> Bool {
compile_dag_rust_emit_check(
"module optvar\n\nimport std.types { String }\n\ntype Sign\n = Plus\n | Minus\n\ntype Holder {\n sign: Sign?\n label: String\n}\n\nfn make(l: String) -> Holder {\n Holder { sign: Plus, label: l }\n}\n",
"src/optvar.rs",
Expand All @@ -22,7 +22,7 @@ fn w_optional_field_bare_variant_keeps_its_wrapper() -> Bool {
// The same shape at a REQUIRED field, which must keep rendering the bare constructor.
// This is the feature's positive control: it is what keeps the repair above from being
// satisfiable by wrapping every variant, or by refusing every adoption.
fn w_required_field_bare_variant_is_not_wrapped() -> Bool {
test fn w_required_field_bare_variant_is_not_wrapped() -> Bool {
compile_dag_rust_emit_check(
"module reqvar\n\nimport std.types { String }\n\ntype Sign\n = Plus\n | Minus\n\ntype Holder {\n sign: Sign\n label: String\n}\n\nfn make(l: String) -> Holder {\n Holder { sign: Minus, label: l }\n}\n",
"src/reqvar.rs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import v2.compiler.discovery_enumeration {
}
import v2.workflow.floor_discovery {
FloorDiscoveryRow,
BarrenTestSidecar,
FloorDiscoverySidecarViolation,
TestMarkedDecl,
WireContractDecl,
Expand All @@ -27,6 +28,7 @@ import v2.workflow.floor_discovery_producer {
FloorDiscoveryAccepted,
FloorDiscoveryRefused,
discover_floor_corpus_rows_from_host_facts,
floor_discovery_barren_test_sidecar_refusal_for_content,
floor_discovery_content_has_wire_contract_decl,
floor_discovery_wire_contract_sidecar_refusal_for_content,
floor_discovery_entry_live_tree_disposition_refusal_for_content,
Expand Down Expand Up @@ -79,6 +81,8 @@ 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"
data fixture_test_data_content: String = "test data floor_discovery_data_fixture: Bool = true\n"
data fixture_misplaced_entry: String = "src/v2/lens/example.dag"
data fixture_barren_test_entry: String = "dag/test/claim/floor_discovery_barren_fixture_test.dag"
data fixture_barren_test_content: String = "module test.claim.floor_discovery_barren_fixture_test\n\nfn floor_discovery_barren_helper() -> Bool { true }\n"
data fixture_misplaced_wire_contract_entry: String = "dag/test/fixture/floor_discovery/misplaced_wire_contract.dag"
data fixture_live_tree_entry: String = "dag/test/claim/floor_discovery_roster_fixture_test.dag"

Expand Down Expand Up @@ -306,6 +310,59 @@ test fn floor_discovery_equivalence_misplaced_wire_contract_refuses_holds() -> B
}
}

// The `*_test.dag` suffix is one half of a two-sided rule: a `test`-marked decl may live
// ONLY in such a file (the misplaced-decl control above), and such a file must declare at
// least ONE. Without this second half a witness file enrolls nothing and the floor reports
// nothing missing -- discovery cannot distinguish "no witnesses here" from "no witnesses
// authored yet", so the file is silently uncovered. Nine such files stood in tree.
test fn floor_discovery_barren_test_sidecar_refuses_red_control() -> Bool {
match floor_discovery_barren_test_sidecar_refusal_for_content(
repo_path: fixture_barren_test_entry,
content: fixture_barren_test_content
) {
Present { value: msg } =>
string_contains(s: msg, pattern: "test fn")
&& string_contains(s: msg, pattern: fixture_barren_test_entry)
Absent => false
}
}

// The positive control: the SAME path with one authored test decl must be admitted, so the
// row above discriminates on the decl scan rather than on the filename.
test fn floor_discovery_populated_test_sidecar_admitted_holds() -> Bool {
match floor_discovery_barren_test_sidecar_refusal_for_content(
repo_path: fixture_barren_test_entry,
content: fixture_test_fn_content
) {
Absent => true
Present { value: _ } => false
}
}

// The other direction: an ordinary module declaring no test decls is not barren -- the rule
// is scoped to entries the sidecar suffix claims, never to the corpus at large.
test fn floor_discovery_non_test_entry_is_never_barren_holds() -> Bool {
match floor_discovery_barren_test_sidecar_refusal_for_content(
repo_path: fixture_misplaced_entry,
content: fixture_barren_test_content
) {
Absent => true
Present { value: _ } => false
}
}

test fn floor_discovery_barren_refusal_reason_carries_its_path_holds() -> Bool {
let msg = floor_discovery_sidecar_refusal_reason(violations: [
FloorDiscoverySidecarViolation {
entry_path: fixture_barren_test_entry,
kind: BarrenTestSidecar,
required_suffix: floor_test_sidecar_suffix
}
])
string_contains(s: msg, pattern: fixture_barren_test_entry)
&& string_contains(s: msg, pattern: "at least one")
}

test fn floor_discovery_sidecar_combined_refusal_reports_both_holds() -> Bool {
let msg = floor_discovery_sidecar_refusal_reason(violations: [
FloorDiscoverySidecarViolation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test fn w_severed_fixture_refusal_message_names_the_derivation_not_an_exclusion(
//
// This file's fixture witnesses are the complete, permanent proof of the mechanism
// (see v2.workflow.floor_expected_red_coherence's floor_expected_red_chunk_coherence_check_note).
// floor_expected_red.dag's own 20 chunks against its own evaluated roster is a
// floor_expected_red.dag's own 21 chunks against its own evaluated roster is a
// separate, pre-existing, unowned gap this file does not close -- see that module's
// live_floor_expected_red_coherence_join_gap_note for the measured cost and natural
// home of that still-open work.
Expand Down
Loading
Loading