P28-02-EQ: 意味を保つ軽量化:同等性の先行固定(harness)

This commit is contained in:
Agent Control Runner
2026-10-22 04:31:20 +09:00
parent b2dbda8c95
commit a46418d064
11 changed files with 450 additions and 8 deletions
@@ -707,3 +707,17 @@ limit is kept; the Runner configuration is not changed.
parsed and memoized by SHA; restore uses the memoized skeleton, so join and comparison do parsed and memoized by SHA; restore uses the memoized skeleton, so join and comparison do
not parse again. compare_trees records nodes shared with the immutable trees instead of not parse again. compare_trees records nodes shared with the immutable trees instead of
deep copies; keys use inline text. deep copies; keys use inline text.
### Self-contained bundle for the sandboxed native-verify (repair 11)
The formal p28-02-eq-native-verify runs under the Runner seatbelt, which denies reading data
under the home directory except the validation checkout and the task runtime (the bundle is in
the runtime's BUILD_OUTPUT_DIR). The first S5 validation failed on the fixture for this reason.
run_eq now copies the fixture to inputs/fixture/ and the read-only manifest with its nine
destinations to inputs/readonly/ before any phase, and checks the copies against the admission
pins (bundle_inputs); the seal covers them. verify_eq passes those copies to actual_pins
(bundled_inputs applies collector.inputs' rule: each manifest destination lies in the original
read-only directory and its copy has the recorded bytes and SHA). The engine (/Applications) and
the machine model stay read live. Everything else verify_eq recomputes from the bundle and the
checkout as before.
@@ -38,6 +38,26 @@ Submission goes through the normal Runner submit, which makes the commit. 正式
fixture event uses a domain_event ID. All other earlier test bodies and raw outputs are fixture event uses a domain_event ID. All other earlier test bodies and raw outputs are
unchanged; 15 S5 tests were added. unchanged; 15 S5 tests were added.
- Repair 11 (after the first S5 submission b2dbda8c956643a2a972e8bcf7416038a3f70b2c):
- Its exact-S native passed: driver exit 0, execution passed, cleanup errors empty,
R-A/R-B and O-A/O-B compared with 0 differences, sealed (native-b2dbda8-r01, 5954 files).
This exercised the whole S5 driver path on real data.
- Its formal validation (report c02eda130f6c49e6bcf2ec4a7c1e8f69): p28-02-eq-unit passed
(161 tests); p28-02-eq-native-verify failed, exit 1, 'Operation not permitted' on the
fixture. The Runner validation seatbelt cannot read data under the home directory outside
the checkout and the task runtime, and verify_eq read the original fixture and read-only
inputs. Kept as a failure; the b2dbda8 bundle is retained but not reused.
- Fix: run_eq seals copies of the fixture and the nine read-only inputs inside the bundle
after checking them against the admission pins; verify_eq recomputes the pins from the
checkout and those sealed copies by the same rules (bundled_inputs). No permission,
policy, timeout or Runner configuration change.
- Final unit evidence for repair 11: UNIT_OUTPUT_S5_ATTEMPT_06 (162 tests OK in 120.853 s,
Python exit 0, outer 120.983 s; same bytes as UNIT_OUTPUT.txt, SHA-256
846ab3b45705f269a81181c818dc5e3b8bc0057863794d59e8d641fe5a4e4c32) and
UNIT_OUTPUT_S5_SEATBELT_06 (the same suite under the Runner validation seatbelt profile,
run locally: 162 tests OK in 120.930 s, Python exit 0). Local runs are not formal
validation.
Next: Runner submit → exact-S native 7 phases → bundle → p28-02-eq-unit and Next: Runner submit → exact-S native 7 phases → bundle → p28-02-eq-unit and
p28-02-eq-native-verify → fresh independent Opus review of all 6 conditions → normal p28-02-eq-native-verify → fresh independent Opus review of all 6 conditions → normal
qualification, approval, integration and final → OPT/whole-unit. 23/88、4/30は不変。 qualification, approval, integration and final → OPT/whole-unit. 23/88、4/30は不変。
@@ -1 +1 @@
7372a382cc2f3c090013874d8f28f17cad4cb1b965ad86c86de7a21fc2d851a8 UNIT_OUTPUT.txt 846ab3b45705f269a81181c818dc5e3b8bc0057863794d59e8d641fe5a4e4c32 UNIT_OUTPUT.txt
@@ -134,6 +134,7 @@ test_missing_sidecar_rejected_after_seal (__main__.S4StoredResultBindings.test_m
test_raw_joined_substitution_rejected_after_seal (__main__.S4StoredResultBindings.test_raw_joined_substitution_rejected_after_seal) ... ok test_raw_joined_substitution_rejected_after_seal (__main__.S4StoredResultBindings.test_raw_joined_substitution_rejected_after_seal) ... ok
test_blob_transport_is_verified_and_bound (__main__.S5.test_blob_transport_is_verified_and_bound) ... ok test_blob_transport_is_verified_and_bound (__main__.S5.test_blob_transport_is_verified_and_bound) ... ok
test_blob_trees_get_the_same_full_validation_as_inline (__main__.S5.test_blob_trees_get_the_same_full_validation_as_inline) ... ok test_blob_trees_get_the_same_full_validation_as_inline (__main__.S5.test_blob_trees_get_the_same_full_validation_as_inline) ... ok
test_bundled_inputs_replace_unreadable_originals (__main__.S5.test_bundled_inputs_replace_unreadable_originals) ... ok
test_compare_and_digest_equal_s1_reference (__main__.S5.test_compare_and_digest_equal_s1_reference) ... ok test_compare_and_digest_equal_s1_reference (__main__.S5.test_compare_and_digest_equal_s1_reference) ... ok
test_event_stream_replacement_is_existing_defect_not_pass (__main__.S5.test_event_stream_replacement_is_existing_defect_not_pass) ... ok test_event_stream_replacement_is_existing_defect_not_pass (__main__.S5.test_event_stream_replacement_is_existing_defect_not_pass) ... ok
test_every_checkpoint_full_tree_verified_like_inline (__main__.S5.test_every_checkpoint_full_tree_verified_like_inline) test_every_checkpoint_full_tree_verified_like_inline (__main__.S5.test_every_checkpoint_full_tree_verified_like_inline)
@@ -162,6 +163,6 @@ test_nonstring_keys_keep_types_and_values (__main__.TypedTrees.test_nonstring_ke
test_unsupported_and_malformed (__main__.TypedTrees.test_unsupported_and_malformed) ... ok test_unsupported_and_malformed (__main__.TypedTrees.test_unsupported_and_malformed) ... ok
---------------------------------------------------------------------- ----------------------------------------------------------------------
Ran 161 tests in 121.627s Ran 162 tests in 120.853s
OK OK
@@ -0,0 +1 @@
846ab3b45705f269a81181c818dc5e3b8bc0057863794d59e8d641fe5a4e4c32 UNIT_OUTPUT_S5_ATTEMPT_06.txt
@@ -0,0 +1,168 @@
test_all_operations (__main__.Diffs.test_all_operations) ... ok
test_invalid_operations (__main__.Diffs.test_invalid_operations) ... ok
test_reconstruction_and_proofs (__main__.Diffs.test_reconstruction_and_proofs) ... ok
test_attempt_to_normalize_violation_rejected (__main__.Normalization.test_attempt_to_normalize_violation_rejected) ... ok
test_environment_values_differ_but_normal_form_equal (__main__.Normalization.test_environment_values_differ_but_normal_form_equal) ... ok
test_every_save_event_reversible (__main__.Normalization.test_every_save_event_reversible) ... ok
test_f3_keeps_relative_paths_and_words (__main__.Normalization.test_f3_keeps_relative_paths_and_words) ... ok
test_guard_mismatch (__main__.Normalization.test_guard_mismatch) ... ok
test_nested_lookalike_is_not_eligible (__main__.Normalization.test_nested_lookalike_is_not_eligible) ... ok
test_original_transport_sha_detects_forged_timing (__main__.Normalization.test_original_transport_sha_detects_forged_timing) ... ok
test_partial_timing_payload_rejected (__main__.Normalization.test_partial_timing_payload_rejected) ... ok
test_prefix_boundary_and_reserved_token (__main__.Normalization.test_prefix_boundary_and_reserved_token) ... ok
test_sidecar_missing_duplicate_and_forged_paths (__main__.Normalization.test_sidecar_missing_duplicate_and_forged_paths) ... ok
test_snapshot_and_latest_reversible (__main__.Normalization.test_snapshot_and_latest_reversible) ... ok
test_snapshot_event_outside_recent_is_not_eligible (__main__.Normalization.test_snapshot_event_outside_recent_is_not_eligible) ... ok
test_wrong_event_and_source_are_preserved (__main__.Normalization.test_wrong_event_and_source_are_preserved) ... ok
test_wrong_timing_type_and_negative (__main__.Normalization.test_wrong_timing_type_and_negative) ... ok
test_all_events_beyond_recent_window (__main__.Reports.test_all_events_beyond_recent_window) ... ok
test_all_semantic_layers_compared (__main__.Reports.test_all_semantic_layers_compared) ... ok
test_digest_alone_is_not_enough (__main__.Reports.test_digest_alone_is_not_enough) ... ok
test_event_original_types_and_order (__main__.Reports.test_event_original_types_and_order) ... ok
test_event_start_and_ids (__main__.Reports.test_event_start_and_ids) ... ok
test_exclusions_keep_actual_values (__main__.Reports.test_exclusions_keep_actual_values) ... ok
test_handler_sets_and_counts (__main__.Reports.test_handler_sets_and_counts) ... ok
test_observation_full_layers (__main__.Reports.test_observation_full_layers) ... ok
test_product_digest_self_consistency (__main__.Reports.test_product_digest_self_consistency) ... ok
test_same_report (__main__.Reports.test_same_report) ... ok
test_scenario_existing_failures_preserved (__main__.Reports.test_scenario_existing_failures_preserved) ... ok
test_timing_digest_rule (__main__.Reports.test_timing_digest_rule) ... ok
test_unknown_or_missing_fields_rejected (__main__.Reports.test_unknown_or_missing_fields_rejected) ... ok
test_violation_presence_and_difference (__main__.Reports.test_violation_presence_and_difference) ... ok
test_O_cadence (__main__.S2Format.test_O_cadence) ... ok
test_counter_and_published_ids_binding (__main__.S2Format.test_counter_and_published_ids_binding) ... ok
test_diff_and_same_as_S_transport (__main__.S2Format.test_diff_and_same_as_S_transport) ... ok
test_digest_and_scenario_contradiction (__main__.S2Format.test_digest_and_scenario_contradiction) ... ok
test_event_no_drop_duplicate_remap (__main__.S2Format.test_event_no_drop_duplicate_remap) ... ok
test_event_original_field_types_mandatory (__main__.S2Format.test_event_original_field_types_mandatory) ... ok
test_guard_actual_not_assumed (__main__.S2Format.test_guard_actual_not_assumed) ... ok
test_harness_digest_allows_only_dictionary_order (__main__.S2Format.test_harness_digest_allows_only_dictionary_order) ... ok
test_join_is_copy_and_retains_normalization_proof (__main__.S2Format.test_join_is_copy_and_retains_normalization_proof) ... ok
test_kernel_cache_contradictions (__main__.S2Format.test_kernel_cache_contradictions) ... ok
test_lifecycle_guard_errors_and_boundaries (__main__.S2Format.test_lifecycle_guard_errors_and_boundaries) ... ok
test_missing_full_state_not_digest_only (__main__.S2Format.test_missing_full_state_not_digest_only) ... ok
test_normalized_digest_and_raw_tree_are_both_bound (__main__.S2Format.test_normalized_digest_and_raw_tree_are_both_bound) ... ok
test_product_event_shape_and_typed_array (__main__.S2Format.test_product_event_shape_and_typed_array) ... ok
test_raw_observation_binding (__main__.S2Format.test_raw_observation_binding) ... ok
test_roundtrip_tree_sha_and_raw_sha (__main__.S2Format.test_roundtrip_tree_sha_and_raw_sha) ... ok
test_s2_valid_and_not_formal_acceptance (__main__.S2Format.test_s2_valid_and_not_formal_acceptance) ... ok
test_state_witness_and_observation_mutation (__main__.S2Format.test_state_witness_and_observation_mutation) ... ok
test_stdout_exactly_one_line (__main__.S2Format.test_stdout_exactly_one_line) ... ok
test_autoload_class_and_script_import (__main__.S2Static.test_autoload_class_and_script_import) ... ok
test_comment_does_not_supply_proof (__main__.S2Static.test_comment_does_not_supply_proof) ... ok
test_current_probe (__main__.S2Static.test_current_probe) ... ok
test_full_state_and_godot_roundtrip_required (__main__.S2Static.test_full_state_and_godot_roundtrip_required) ... ok
test_no_changes_outside_preparation_or_step (__main__.S2Static.test_no_changes_outside_preparation_or_step) ... ok
test_no_event_cap_or_duplicate_report (__main__.S2Static.test_no_event_cap_or_duplicate_report) ... ok
test_pause_and_step_arguments (__main__.S2Static.test_pause_and_step_arguments) ... ok
test_textual_stringname_ordering (__main__.S2Static.test_textual_stringname_ordering) ... ok
test_unlisted_live_method_and_late_preparation (__main__.S2Static.test_unlisted_live_method_and_late_preparation) ... ok
test_variant_inference (__main__.S2Static.test_variant_inference) ... ok
test_X_recent_limit_and_counter (__main__.S3a.test_X_recent_limit_and_counter) ... ok
test_duplicate_JSON_key_rejected (__main__.S3a.test_duplicate_JSON_key_rejected) ... ok
test_e3_NA_cannot_be_PASS_or_applied (__main__.S3a.test_e3_NA_cannot_be_PASS_or_applied) ... ok
test_e3_coverage_input_and_event_count_binding (__main__.S3a.test_e3_coverage_input_and_event_count_binding) ... ok
test_e3_invented_codes_and_missing_load_code (__main__.S3a.test_e3_invented_codes_and_missing_load_code) ... ok
test_e3_valid_R_and_O_records (__main__.S3a.test_e3_valid_R_and_O_records) ... ok
test_envelope_duplicates_not_defect (__main__.S3a.test_envelope_duplicates_not_defect) ... ok
test_event_count_defect_not_silently_accepted (__main__.S3a.test_event_count_defect_not_silently_accepted) ... ok
test_exact_phase_keys (__main__.S3a.test_exact_phase_keys) ... ok
test_interval_gap_rejected (__main__.S3a.test_interval_gap_rejected) ... ok
test_invalid_input_accepted_is_not_PASS (__main__.S3a.test_invalid_input_accepted_is_not_PASS) ... ok
test_load_payload_and_pause_outcome (__main__.S3a.test_load_payload_and_pause_outcome) ... ok
test_operation_moved_outside_scenario_rejected (__main__.S3a.test_operation_moved_outside_scenario_rejected) ... ok
test_package_fixed_mutations_and_hashes (__main__.S3a.test_package_fixed_mutations_and_hashes) ... ok
test_probe_connection_required (__main__.S3a.test_probe_connection_required) ... ok
test_rejection_mutation_retained_as_defect (__main__.S3a.test_rejection_mutation_retained_as_defect) ... ok
test_save_refusal_makes_load_NA (__main__.S3a.test_save_refusal_makes_load_NA) ... ok
test_scenario_mutation_static_boundary (__main__.S3a.test_scenario_mutation_static_boundary) ... ok
test_signals_all_minutes_and_order (__main__.S3a.test_signals_all_minutes_and_order) ... ok
test_E5_cached_digest_defect_is_comparable (__main__.S3b.test_E5_cached_digest_defect_is_comparable) ... ok
test_NA_not_PASS (__main__.S3b.test_NA_not_PASS) ... ok
test_aliasing_cannot_be_PASS (__main__.S3b.test_aliasing_cannot_be_PASS) ... ok
test_aliasing_missing_record (__main__.S3b.test_aliasing_missing_record) ... ok
test_all_paths_and_ownership_R_O (__main__.S3b.test_all_paths_and_ownership_R_O) ... ok
test_digest_defect_other_checkpoint_still_rejected (__main__.S3b.test_digest_defect_other_checkpoint_still_rejected) ... ok
test_digest_materialization_required (__main__.S3b.test_digest_materialization_required) ... ok
test_empty_registry_not_NA (__main__.S3b.test_empty_registry_not_NA) ... ok
test_event_count_mismatch (__main__.S3b.test_event_count_mismatch) ... ok
test_facts_normalization_is_reversible (__main__.S3b.test_facts_normalization_is_reversible) ... ok
test_first_placeable_choice (__main__.S3b.test_first_placeable_choice) ... ok
test_interval_gap (__main__.S3b.test_interval_gap) ... ok
test_joined_s3b_self_comparison (__main__.S3b.test_joined_s3b_self_comparison) ... ok
test_load_X_not_digest_only (__main__.S3b.test_load_X_not_digest_only) ... ok
test_load_extra_event (__main__.S3b.test_load_extra_event) ... ok
test_missing_path_and_combination (__main__.S3b.test_missing_path_and_combination) ... ok
test_missing_preview_observation (__main__.S3b.test_missing_preview_observation) ... ok
test_missing_trial (__main__.S3b.test_missing_trial) ... ok
test_nested_mutation_required (__main__.S3b.test_nested_mutation_required) ... ok
test_no_staleness_assertion_for_non_tick (__main__.S3b.test_no_staleness_assertion_for_non_tick) ... ok
test_ownership_fact_dictionary_order_fallback (__main__.S3b.test_ownership_fact_dictionary_order_fallback) ... ok
test_path_order (__main__.S3b.test_path_order) ... ok
test_restore_extra_event (__main__.S3b.test_restore_extra_event) ... ok
test_signal_facts_cannot_be_dropped (__main__.S3b.test_signal_facts_cannot_be_dropped) ... ok
test_sort_rule_rejected (__main__.S3b.test_sort_rule_rejected) ... ok
test_static_handler_and_outside_mutations (__main__.S3b.test_static_handler_and_outside_mutations) ... ok
test_unpreviewed_choice (__main__.S3b.test_unpreviewed_choice) ... ok
test_wrong_registry_in_either_role (__main__.S3b.test_wrong_registry_in_either_role) ... ok
test_checkout_temp_destination_rejected (__main__.S4Bundle.test_checkout_temp_destination_rejected) ... ok
test_existing_output_never_overwritten (__main__.S4Bundle.test_existing_output_never_overwritten) ... ok
test_import_closure_rejections (__main__.S4Bundle.test_import_closure_rejections) ... ok
test_missing_bundle_manifest_seal_and_changed_bytes (__main__.S4Bundle.test_missing_bundle_manifest_seal_and_changed_bytes) ... ok
test_missing_private_evidence_and_extra_rejected (__main__.S4Bundle.test_missing_private_evidence_and_extra_rejected) ... ok
test_missing_profile_not_export_success (__main__.S4Bundle.test_missing_profile_not_export_success) ... ok
test_phase_role_pid_audio_and_guard_rejected (__main__.S4Bundle.test_phase_role_pid_audio_and_guard_rejected) ... ok
test_rebound_lifecycle_and_scenario_contradictions (__main__.S4Bundle.test_rebound_lifecycle_and_scenario_contradictions) ... ok
test_seal_normal_and_changes_not_native_proof (__main__.S4Bundle.test_seal_normal_and_changes_not_native_proof) ... ok
test_synthetic_phase_all_real_checkers_not_native_proof (__main__.S4Bundle.test_synthetic_phase_all_real_checkers_not_native_proof) ... ok
test_copied_manifest_root_and_destination_count_rejected (__main__.S4NativeBundleLogic.test_copied_manifest_root_and_destination_count_rejected) ... ok
test_failure_keeps_raw_and_no_bundle_without_starting_engine (__main__.S4NativeBundleLogic.test_failure_keeps_raw_and_no_bundle_without_starting_engine) ... ok
test_gate_none_success_not_boolean (__main__.S4NativeBundleLogic.test_gate_none_success_not_boolean) ... ok
test_receipt_and_source_rejection_matrix (__main__.S4NativeBundleLogic.test_receipt_and_source_rejection_matrix) ... ok
test_synthetic_full_bundle_positive_not_native_evidence (__main__.S4NativeBundleLogic.test_synthetic_full_bundle_positive_not_native_evidence) ... ok
test_check_accepts_true (__main__.S4ProbeAdmission.test_check_accepts_true) ... ok
test_check_rejects_false_all_errors (__main__.S4ProbeAdmission.test_check_rejects_false_all_errors) ... ok
test_run_admission_accepts_true_mock_launch_only (__main__.S4ProbeAdmission.test_run_admission_accepts_true_mock_launch_only) ... ok
test_run_admission_rejects_false_without_engine (__main__.S4ProbeAdmission.test_run_admission_rejects_false_without_engine) ... ok
test_nine_original_destinations_required (__main__.S4RemainingBindings.test_nine_original_destinations_required) ... ok
test_nonzero_determinism_rejected_after_real_join (__main__.S4RemainingBindings.test_nonzero_determinism_rejected_after_real_join) ... ok
test_owned_lifecycle_exit_diagnostic_and_profile_rejections (__main__.S4RemainingBindings.test_owned_lifecycle_exit_diagnostic_and_profile_rejections) ... ok
test_verifier_accepts_true_recomputes_raw (__main__.S4RemainingBindings.test_verifier_accepts_true_recomputes_raw) ... ok
test_verifier_rejects_false_with_every_error (__main__.S4RemainingBindings.test_verifier_rejects_false_with_every_error) ... ok
test_cached_verdict_not_trusted (__main__.S4StoredResultBindings.test_cached_verdict_not_trusted) ... ok
test_missing_sidecar_rejected_after_seal (__main__.S4StoredResultBindings.test_missing_sidecar_rejected_after_seal) ... ok
test_raw_joined_substitution_rejected_after_seal (__main__.S4StoredResultBindings.test_raw_joined_substitution_rejected_after_seal) ... ok
test_blob_transport_is_verified_and_bound (__main__.S5.test_blob_transport_is_verified_and_bound) ... ok
test_blob_trees_get_the_same_full_validation_as_inline (__main__.S5.test_blob_trees_get_the_same_full_validation_as_inline) ... ok
test_bundled_inputs_replace_unreadable_originals (__main__.S5.test_bundled_inputs_replace_unreadable_originals) ... ok
test_compare_and_digest_equal_s1_reference (__main__.S5.test_compare_and_digest_equal_s1_reference) ... ok
test_event_stream_replacement_is_existing_defect_not_pass (__main__.S5.test_event_stream_replacement_is_existing_defect_not_pass) ... ok
test_every_checkpoint_full_tree_verified_like_inline (__main__.S5.test_every_checkpoint_full_tree_verified_like_inline)
S5 drops the diff chain: each checkpoint carries a complete tree, verified alone. ... ok
test_fast_normalization_equals_original (__main__.S5.test_fast_normalization_equals_original) ... ok
test_labelled_harness_digest_falls_back_to_dictionary_order_only (__main__.S5.test_labelled_harness_digest_falls_back_to_dictionary_order_only) ... ok
test_lifecycle_binds_replacements_guard_text_and_blobs (__main__.S5.test_lifecycle_binds_replacements_guard_text_and_blobs) ... ok
test_manifest_numbers_keep_their_type (__main__.S5.test_manifest_numbers_keep_their_type) ... ok
test_memo_scope_same_results_and_restores_gc (__main__.S5.test_memo_scope_same_results_and_restores_gc) ... ok
test_path_copy_builders_equal_deepcopy_reference (__main__.S5.test_path_copy_builders_equal_deepcopy_reference) ... ok
test_probe_static_full_tree_blob_and_stream_requirements (__main__.S5.test_probe_static_full_tree_blob_and_stream_requirements) ... ok
test_publish_pairs_bound_to_source_causes (__main__.S5.test_publish_pairs_bound_to_source_causes) ... ok
test_signed_instance_ids_raw_kept_and_excluded (__main__.S5.test_signed_instance_ids_raw_kept_and_excluded) ... ok
test_validate_tree_equals_s1_reference_on_mutations (__main__.S5.test_validate_tree_equals_s1_reference_on_mutations) ... ok
test_fixed_scenario_paths (__main__.SourcesAndMetrics.test_fixed_scenario_paths) ... ok
test_metric_ranges (__main__.SourcesAndMetrics.test_metric_ranges) ... ok
test_source_closure_synthetic_registered_map (__main__.SourcesAndMetrics.test_source_closure_synthetic_registered_map) ... ok
test_source_pin_is_not_caller_controlled (__main__.SourcesAndMetrics.test_source_pin_is_not_caller_controlled) ... ok
test_array_order_and_all_differences (__main__.TypedTrees.test_array_order_and_all_differences) ... ok
test_components_and_sha (__main__.TypedTrees.test_components_and_sha) ... ok
test_deep_state_not_truncated (__main__.TypedTrees.test_deep_state_not_truncated) ... ok
test_duplicate_textual_keys_rejected (__main__.TypedTrees.test_duplicate_textual_keys_rejected) ... ok
test_exact_and_types (__main__.TypedTrees.test_exact_and_types) ... ok
test_nested_order_all_paths (__main__.TypedTrees.test_nested_order_all_paths) ... ok
test_nonstring_keys_keep_types_and_values (__main__.TypedTrees.test_nonstring_keys_keep_types_and_values) ... ok
test_unsupported_and_malformed (__main__.TypedTrees.test_unsupported_and_malformed) ... ok
----------------------------------------------------------------------
Ran 162 tests in 120.853s
OK
@@ -0,0 +1 @@
2797169a7c98b0b5d2f578f28a860dc2819294e023e1019ae8243e41631d5e29 UNIT_OUTPUT_S5_SEATBELT_06.txt
@@ -0,0 +1,168 @@
test_all_operations (__main__.Diffs.test_all_operations) ... ok
test_invalid_operations (__main__.Diffs.test_invalid_operations) ... ok
test_reconstruction_and_proofs (__main__.Diffs.test_reconstruction_and_proofs) ... ok
test_attempt_to_normalize_violation_rejected (__main__.Normalization.test_attempt_to_normalize_violation_rejected) ... ok
test_environment_values_differ_but_normal_form_equal (__main__.Normalization.test_environment_values_differ_but_normal_form_equal) ... ok
test_every_save_event_reversible (__main__.Normalization.test_every_save_event_reversible) ... ok
test_f3_keeps_relative_paths_and_words (__main__.Normalization.test_f3_keeps_relative_paths_and_words) ... ok
test_guard_mismatch (__main__.Normalization.test_guard_mismatch) ... ok
test_nested_lookalike_is_not_eligible (__main__.Normalization.test_nested_lookalike_is_not_eligible) ... ok
test_original_transport_sha_detects_forged_timing (__main__.Normalization.test_original_transport_sha_detects_forged_timing) ... ok
test_partial_timing_payload_rejected (__main__.Normalization.test_partial_timing_payload_rejected) ... ok
test_prefix_boundary_and_reserved_token (__main__.Normalization.test_prefix_boundary_and_reserved_token) ... ok
test_sidecar_missing_duplicate_and_forged_paths (__main__.Normalization.test_sidecar_missing_duplicate_and_forged_paths) ... ok
test_snapshot_and_latest_reversible (__main__.Normalization.test_snapshot_and_latest_reversible) ... ok
test_snapshot_event_outside_recent_is_not_eligible (__main__.Normalization.test_snapshot_event_outside_recent_is_not_eligible) ... ok
test_wrong_event_and_source_are_preserved (__main__.Normalization.test_wrong_event_and_source_are_preserved) ... ok
test_wrong_timing_type_and_negative (__main__.Normalization.test_wrong_timing_type_and_negative) ... ok
test_all_events_beyond_recent_window (__main__.Reports.test_all_events_beyond_recent_window) ... ok
test_all_semantic_layers_compared (__main__.Reports.test_all_semantic_layers_compared) ... ok
test_digest_alone_is_not_enough (__main__.Reports.test_digest_alone_is_not_enough) ... ok
test_event_original_types_and_order (__main__.Reports.test_event_original_types_and_order) ... ok
test_event_start_and_ids (__main__.Reports.test_event_start_and_ids) ... ok
test_exclusions_keep_actual_values (__main__.Reports.test_exclusions_keep_actual_values) ... ok
test_handler_sets_and_counts (__main__.Reports.test_handler_sets_and_counts) ... ok
test_observation_full_layers (__main__.Reports.test_observation_full_layers) ... ok
test_product_digest_self_consistency (__main__.Reports.test_product_digest_self_consistency) ... ok
test_same_report (__main__.Reports.test_same_report) ... ok
test_scenario_existing_failures_preserved (__main__.Reports.test_scenario_existing_failures_preserved) ... ok
test_timing_digest_rule (__main__.Reports.test_timing_digest_rule) ... ok
test_unknown_or_missing_fields_rejected (__main__.Reports.test_unknown_or_missing_fields_rejected) ... ok
test_violation_presence_and_difference (__main__.Reports.test_violation_presence_and_difference) ... ok
test_O_cadence (__main__.S2Format.test_O_cadence) ... ok
test_counter_and_published_ids_binding (__main__.S2Format.test_counter_and_published_ids_binding) ... ok
test_diff_and_same_as_S_transport (__main__.S2Format.test_diff_and_same_as_S_transport) ... ok
test_digest_and_scenario_contradiction (__main__.S2Format.test_digest_and_scenario_contradiction) ... ok
test_event_no_drop_duplicate_remap (__main__.S2Format.test_event_no_drop_duplicate_remap) ... ok
test_event_original_field_types_mandatory (__main__.S2Format.test_event_original_field_types_mandatory) ... ok
test_guard_actual_not_assumed (__main__.S2Format.test_guard_actual_not_assumed) ... ok
test_harness_digest_allows_only_dictionary_order (__main__.S2Format.test_harness_digest_allows_only_dictionary_order) ... ok
test_join_is_copy_and_retains_normalization_proof (__main__.S2Format.test_join_is_copy_and_retains_normalization_proof) ... ok
test_kernel_cache_contradictions (__main__.S2Format.test_kernel_cache_contradictions) ... ok
test_lifecycle_guard_errors_and_boundaries (__main__.S2Format.test_lifecycle_guard_errors_and_boundaries) ... ok
test_missing_full_state_not_digest_only (__main__.S2Format.test_missing_full_state_not_digest_only) ... ok
test_normalized_digest_and_raw_tree_are_both_bound (__main__.S2Format.test_normalized_digest_and_raw_tree_are_both_bound) ... ok
test_product_event_shape_and_typed_array (__main__.S2Format.test_product_event_shape_and_typed_array) ... ok
test_raw_observation_binding (__main__.S2Format.test_raw_observation_binding) ... ok
test_roundtrip_tree_sha_and_raw_sha (__main__.S2Format.test_roundtrip_tree_sha_and_raw_sha) ... ok
test_s2_valid_and_not_formal_acceptance (__main__.S2Format.test_s2_valid_and_not_formal_acceptance) ... ok
test_state_witness_and_observation_mutation (__main__.S2Format.test_state_witness_and_observation_mutation) ... ok
test_stdout_exactly_one_line (__main__.S2Format.test_stdout_exactly_one_line) ... ok
test_autoload_class_and_script_import (__main__.S2Static.test_autoload_class_and_script_import) ... ok
test_comment_does_not_supply_proof (__main__.S2Static.test_comment_does_not_supply_proof) ... ok
test_current_probe (__main__.S2Static.test_current_probe) ... ok
test_full_state_and_godot_roundtrip_required (__main__.S2Static.test_full_state_and_godot_roundtrip_required) ... ok
test_no_changes_outside_preparation_or_step (__main__.S2Static.test_no_changes_outside_preparation_or_step) ... ok
test_no_event_cap_or_duplicate_report (__main__.S2Static.test_no_event_cap_or_duplicate_report) ... ok
test_pause_and_step_arguments (__main__.S2Static.test_pause_and_step_arguments) ... ok
test_textual_stringname_ordering (__main__.S2Static.test_textual_stringname_ordering) ... ok
test_unlisted_live_method_and_late_preparation (__main__.S2Static.test_unlisted_live_method_and_late_preparation) ... ok
test_variant_inference (__main__.S2Static.test_variant_inference) ... ok
test_X_recent_limit_and_counter (__main__.S3a.test_X_recent_limit_and_counter) ... ok
test_duplicate_JSON_key_rejected (__main__.S3a.test_duplicate_JSON_key_rejected) ... ok
test_e3_NA_cannot_be_PASS_or_applied (__main__.S3a.test_e3_NA_cannot_be_PASS_or_applied) ... ok
test_e3_coverage_input_and_event_count_binding (__main__.S3a.test_e3_coverage_input_and_event_count_binding) ... ok
test_e3_invented_codes_and_missing_load_code (__main__.S3a.test_e3_invented_codes_and_missing_load_code) ... ok
test_e3_valid_R_and_O_records (__main__.S3a.test_e3_valid_R_and_O_records) ... ok
test_envelope_duplicates_not_defect (__main__.S3a.test_envelope_duplicates_not_defect) ... ok
test_event_count_defect_not_silently_accepted (__main__.S3a.test_event_count_defect_not_silently_accepted) ... ok
test_exact_phase_keys (__main__.S3a.test_exact_phase_keys) ... ok
test_interval_gap_rejected (__main__.S3a.test_interval_gap_rejected) ... ok
test_invalid_input_accepted_is_not_PASS (__main__.S3a.test_invalid_input_accepted_is_not_PASS) ... ok
test_load_payload_and_pause_outcome (__main__.S3a.test_load_payload_and_pause_outcome) ... ok
test_operation_moved_outside_scenario_rejected (__main__.S3a.test_operation_moved_outside_scenario_rejected) ... ok
test_package_fixed_mutations_and_hashes (__main__.S3a.test_package_fixed_mutations_and_hashes) ... ok
test_probe_connection_required (__main__.S3a.test_probe_connection_required) ... ok
test_rejection_mutation_retained_as_defect (__main__.S3a.test_rejection_mutation_retained_as_defect) ... ok
test_save_refusal_makes_load_NA (__main__.S3a.test_save_refusal_makes_load_NA) ... ok
test_scenario_mutation_static_boundary (__main__.S3a.test_scenario_mutation_static_boundary) ... ok
test_signals_all_minutes_and_order (__main__.S3a.test_signals_all_minutes_and_order) ... ok
test_E5_cached_digest_defect_is_comparable (__main__.S3b.test_E5_cached_digest_defect_is_comparable) ... ok
test_NA_not_PASS (__main__.S3b.test_NA_not_PASS) ... ok
test_aliasing_cannot_be_PASS (__main__.S3b.test_aliasing_cannot_be_PASS) ... ok
test_aliasing_missing_record (__main__.S3b.test_aliasing_missing_record) ... ok
test_all_paths_and_ownership_R_O (__main__.S3b.test_all_paths_and_ownership_R_O) ... ok
test_digest_defect_other_checkpoint_still_rejected (__main__.S3b.test_digest_defect_other_checkpoint_still_rejected) ... ok
test_digest_materialization_required (__main__.S3b.test_digest_materialization_required) ... ok
test_empty_registry_not_NA (__main__.S3b.test_empty_registry_not_NA) ... ok
test_event_count_mismatch (__main__.S3b.test_event_count_mismatch) ... ok
test_facts_normalization_is_reversible (__main__.S3b.test_facts_normalization_is_reversible) ... ok
test_first_placeable_choice (__main__.S3b.test_first_placeable_choice) ... ok
test_interval_gap (__main__.S3b.test_interval_gap) ... ok
test_joined_s3b_self_comparison (__main__.S3b.test_joined_s3b_self_comparison) ... ok
test_load_X_not_digest_only (__main__.S3b.test_load_X_not_digest_only) ... ok
test_load_extra_event (__main__.S3b.test_load_extra_event) ... ok
test_missing_path_and_combination (__main__.S3b.test_missing_path_and_combination) ... ok
test_missing_preview_observation (__main__.S3b.test_missing_preview_observation) ... ok
test_missing_trial (__main__.S3b.test_missing_trial) ... ok
test_nested_mutation_required (__main__.S3b.test_nested_mutation_required) ... ok
test_no_staleness_assertion_for_non_tick (__main__.S3b.test_no_staleness_assertion_for_non_tick) ... ok
test_ownership_fact_dictionary_order_fallback (__main__.S3b.test_ownership_fact_dictionary_order_fallback) ... ok
test_path_order (__main__.S3b.test_path_order) ... ok
test_restore_extra_event (__main__.S3b.test_restore_extra_event) ... ok
test_signal_facts_cannot_be_dropped (__main__.S3b.test_signal_facts_cannot_be_dropped) ... ok
test_sort_rule_rejected (__main__.S3b.test_sort_rule_rejected) ... ok
test_static_handler_and_outside_mutations (__main__.S3b.test_static_handler_and_outside_mutations) ... ok
test_unpreviewed_choice (__main__.S3b.test_unpreviewed_choice) ... ok
test_wrong_registry_in_either_role (__main__.S3b.test_wrong_registry_in_either_role) ... ok
test_checkout_temp_destination_rejected (__main__.S4Bundle.test_checkout_temp_destination_rejected) ... ok
test_existing_output_never_overwritten (__main__.S4Bundle.test_existing_output_never_overwritten) ... ok
test_import_closure_rejections (__main__.S4Bundle.test_import_closure_rejections) ... ok
test_missing_bundle_manifest_seal_and_changed_bytes (__main__.S4Bundle.test_missing_bundle_manifest_seal_and_changed_bytes) ... ok
test_missing_private_evidence_and_extra_rejected (__main__.S4Bundle.test_missing_private_evidence_and_extra_rejected) ... ok
test_missing_profile_not_export_success (__main__.S4Bundle.test_missing_profile_not_export_success) ... ok
test_phase_role_pid_audio_and_guard_rejected (__main__.S4Bundle.test_phase_role_pid_audio_and_guard_rejected) ... ok
test_rebound_lifecycle_and_scenario_contradictions (__main__.S4Bundle.test_rebound_lifecycle_and_scenario_contradictions) ... ok
test_seal_normal_and_changes_not_native_proof (__main__.S4Bundle.test_seal_normal_and_changes_not_native_proof) ... ok
test_synthetic_phase_all_real_checkers_not_native_proof (__main__.S4Bundle.test_synthetic_phase_all_real_checkers_not_native_proof) ... ok
test_copied_manifest_root_and_destination_count_rejected (__main__.S4NativeBundleLogic.test_copied_manifest_root_and_destination_count_rejected) ... ok
test_failure_keeps_raw_and_no_bundle_without_starting_engine (__main__.S4NativeBundleLogic.test_failure_keeps_raw_and_no_bundle_without_starting_engine) ... ok
test_gate_none_success_not_boolean (__main__.S4NativeBundleLogic.test_gate_none_success_not_boolean) ... ok
test_receipt_and_source_rejection_matrix (__main__.S4NativeBundleLogic.test_receipt_and_source_rejection_matrix) ... ok
test_synthetic_full_bundle_positive_not_native_evidence (__main__.S4NativeBundleLogic.test_synthetic_full_bundle_positive_not_native_evidence) ... ok
test_check_accepts_true (__main__.S4ProbeAdmission.test_check_accepts_true) ... ok
test_check_rejects_false_all_errors (__main__.S4ProbeAdmission.test_check_rejects_false_all_errors) ... ok
test_run_admission_accepts_true_mock_launch_only (__main__.S4ProbeAdmission.test_run_admission_accepts_true_mock_launch_only) ... ok
test_run_admission_rejects_false_without_engine (__main__.S4ProbeAdmission.test_run_admission_rejects_false_without_engine) ... ok
test_nine_original_destinations_required (__main__.S4RemainingBindings.test_nine_original_destinations_required) ... ok
test_nonzero_determinism_rejected_after_real_join (__main__.S4RemainingBindings.test_nonzero_determinism_rejected_after_real_join) ... ok
test_owned_lifecycle_exit_diagnostic_and_profile_rejections (__main__.S4RemainingBindings.test_owned_lifecycle_exit_diagnostic_and_profile_rejections) ... ok
test_verifier_accepts_true_recomputes_raw (__main__.S4RemainingBindings.test_verifier_accepts_true_recomputes_raw) ... ok
test_verifier_rejects_false_with_every_error (__main__.S4RemainingBindings.test_verifier_rejects_false_with_every_error) ... ok
test_cached_verdict_not_trusted (__main__.S4StoredResultBindings.test_cached_verdict_not_trusted) ... ok
test_missing_sidecar_rejected_after_seal (__main__.S4StoredResultBindings.test_missing_sidecar_rejected_after_seal) ... ok
test_raw_joined_substitution_rejected_after_seal (__main__.S4StoredResultBindings.test_raw_joined_substitution_rejected_after_seal) ... ok
test_blob_transport_is_verified_and_bound (__main__.S5.test_blob_transport_is_verified_and_bound) ... ok
test_blob_trees_get_the_same_full_validation_as_inline (__main__.S5.test_blob_trees_get_the_same_full_validation_as_inline) ... ok
test_bundled_inputs_replace_unreadable_originals (__main__.S5.test_bundled_inputs_replace_unreadable_originals) ... ok
test_compare_and_digest_equal_s1_reference (__main__.S5.test_compare_and_digest_equal_s1_reference) ... ok
test_event_stream_replacement_is_existing_defect_not_pass (__main__.S5.test_event_stream_replacement_is_existing_defect_not_pass) ... ok
test_every_checkpoint_full_tree_verified_like_inline (__main__.S5.test_every_checkpoint_full_tree_verified_like_inline)
S5 drops the diff chain: each checkpoint carries a complete tree, verified alone. ... ok
test_fast_normalization_equals_original (__main__.S5.test_fast_normalization_equals_original) ... ok
test_labelled_harness_digest_falls_back_to_dictionary_order_only (__main__.S5.test_labelled_harness_digest_falls_back_to_dictionary_order_only) ... ok
test_lifecycle_binds_replacements_guard_text_and_blobs (__main__.S5.test_lifecycle_binds_replacements_guard_text_and_blobs) ... ok
test_manifest_numbers_keep_their_type (__main__.S5.test_manifest_numbers_keep_their_type) ... ok
test_memo_scope_same_results_and_restores_gc (__main__.S5.test_memo_scope_same_results_and_restores_gc) ... ok
test_path_copy_builders_equal_deepcopy_reference (__main__.S5.test_path_copy_builders_equal_deepcopy_reference) ... ok
test_probe_static_full_tree_blob_and_stream_requirements (__main__.S5.test_probe_static_full_tree_blob_and_stream_requirements) ... ok
test_publish_pairs_bound_to_source_causes (__main__.S5.test_publish_pairs_bound_to_source_causes) ... ok
test_signed_instance_ids_raw_kept_and_excluded (__main__.S5.test_signed_instance_ids_raw_kept_and_excluded) ... ok
test_validate_tree_equals_s1_reference_on_mutations (__main__.S5.test_validate_tree_equals_s1_reference_on_mutations) ... ok
test_fixed_scenario_paths (__main__.SourcesAndMetrics.test_fixed_scenario_paths) ... ok
test_metric_ranges (__main__.SourcesAndMetrics.test_metric_ranges) ... ok
test_source_closure_synthetic_registered_map (__main__.SourcesAndMetrics.test_source_closure_synthetic_registered_map) ... ok
test_source_pin_is_not_caller_controlled (__main__.SourcesAndMetrics.test_source_pin_is_not_caller_controlled) ... ok
test_array_order_and_all_differences (__main__.TypedTrees.test_array_order_and_all_differences) ... ok
test_components_and_sha (__main__.TypedTrees.test_components_and_sha) ... ok
test_deep_state_not_truncated (__main__.TypedTrees.test_deep_state_not_truncated) ... ok
test_duplicate_textual_keys_rejected (__main__.TypedTrees.test_duplicate_textual_keys_rejected) ... ok
test_exact_and_types (__main__.TypedTrees.test_exact_and_types) ... ok
test_nested_order_all_paths (__main__.TypedTrees.test_nested_order_all_paths) ... ok
test_nonstring_keys_keep_types_and_values (__main__.TypedTrees.test_nonstring_keys_keep_types_and_values) ... ok
test_unsupported_and_malformed (__main__.TypedTrees.test_unsupported_and_malformed) ... ok
----------------------------------------------------------------------
Ran 162 tests in 120.930s
OK
@@ -77,7 +77,44 @@ def load_dependencies(root=ROOT):
return collector, standard, outer, diag return collector, standard, outer, diag
def actual_pins(root, readonly, fixture, engine, collector, standard): def bundled_inputs(copies, readonly):
"""collector.inputs on the read-only input copies sealed in the bundle (S5).
The formal native-verify runs under the Runner seatbelt, which cannot read the original
read-only directory or the fixture outside the checkout. The same rule applies: every
manifest destination lies in the original read-only directory, and its copy has the
recorded bytes and SHA. The manifest SHA is bound by the caller to the admission pin."""
manifest_path = copies / 'ROOT_INPUT_MANIFEST.json'
manifest = verify.read(manifest_path)
pins = {}
for row in manifest['files']:
destination = Path(row['destination'])
require(destination.is_absolute() and destination.is_relative_to(readonly), 'input escapes read-only directory')
relative = destination.relative_to(readonly)
copy = copies / relative
require(copy.is_file() and not copy.is_symlink(), 'bundled read-only input missing')
require(sha(copy) == row['sha256'] and copy.stat().st_size == row['bytes'], 'read-only input changed')
pins[str(relative)] = row['sha256']
return {'manifest_sha256': sha(manifest_path), 'files': pins}
def bundle_inputs(out, readonly, fixture, pins):
"""Seal copies of the fixture and the read-only inputs in the output (verified first)."""
target = out / 'inputs'
(target / 'fixture').mkdir(parents=True)
shutil.copyfile(fixture, target / 'fixture' / fixture.name)
manifest = verify.read(readonly / 'ROOT_INPUT_MANIFEST.json')
(target / 'readonly').mkdir()
shutil.copyfile(readonly / 'ROOT_INPUT_MANIFEST.json', target / 'readonly' / 'ROOT_INPUT_MANIFEST.json')
for row in manifest['files']:
relative = Path(row['destination']).relative_to(readonly)
(target / 'readonly' / relative).parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(Path(row['destination']), target / 'readonly' / relative)
require(pin(target / 'fixture' / fixture.name) == pins['fixture'], 'fixture copy differs')
require(bundled_inputs(target / 'readonly', readonly) == pins['readonly'], 'read-only input copies differ')
def actual_pins(root, readonly, fixture, engine, collector, standard, copies=None):
local = root / HERE.relative_to(ROOT) local = root / HERE.relative_to(ROOT)
dependencies = {n: sha(root / n) for n in DEPENDENCIES} dependencies = {n: sha(root / n) for n in DEPENDENCIES}
require(dependencies == DEPENDENCIES, 'dependencies changed') require(dependencies == DEPENDENCIES, 'dependencies changed')
@@ -86,9 +123,9 @@ def actual_pins(root, readonly, fixture, engine, collector, standard):
source = collector.source_map(standard, root) source = collector.source_map(standard, root)
require(len(source) == 1407 and collector.digest(source) == eq.SOURCE_SHA, 'full 1407 source pin') require(len(source) == 1407 and collector.digest(source) == eq.SOURCE_SHA, 'full 1407 source pin')
require(sha(fixture) == collector.FIXTURE_SHA and sha(engine) == collector.ENGINE_SHA, 'fixture/engine pin') require(sha(fixture) == collector.FIXTURE_SHA and sha(engine) == collector.ENGINE_SHA, 'fixture/engine pin')
inputs = collector.inputs(readonly) inputs = collector.inputs(readonly) if copies is None else bundled_inputs(copies, readonly)
require(len(inputs['files']) == 9, 'nine original destinations required') require(len(inputs['files']) == 9, 'nine original destinations required')
manifest = verify.read(readonly / 'ROOT_INPUT_MANIFEST.json') manifest = verify.read((readonly if copies is None else copies) / 'ROOT_INPUT_MANIFEST.json')
require(len(manifest['files']) == 9 and len({r['destination'] for r in manifest['files']}) == 9, 'nine unique destinations') require(len(manifest['files']) == 9 and len({r['destination'] for r in manifest['files']}) == 9, 'nine unique destinations')
require(sys.platform == 'darwin', 'native platform') require(sys.platform == 'darwin', 'native platform')
machine = subprocess.check_output(['sysctl', '-n', 'hw.model'], text=True).strip() machine = subprocess.check_output(['sysctl', '-n', 'hw.model'], text=True).strip()
@@ -186,6 +223,7 @@ def run(admission, out, collector, standard, outer, diag):
(out / 'profile_guard.gd').write_bytes((Path(admission['readonly_path']) / 'run-r02/profile_guard.gd').read_bytes()) (out / 'profile_guard.gd').write_bytes((Path(admission['readonly_path']) / 'run-r02/profile_guard.gd').read_bytes())
(out / 'guarded.gd').write_text(wrapper_text(out)) (out / 'guarded.gd').write_text(wrapper_text(out))
(out / 'root-input-manifest.json').write_bytes((Path(admission['readonly_path']) / 'ROOT_INPUT_MANIFEST.json').read_bytes()) (out / 'root-input-manifest.json').write_bytes((Path(admission['readonly_path']) / 'ROOT_INPUT_MANIFEST.json').read_bytes())
bundle_inputs(out, Path(admission['readonly_path']), Path(admission['fixture']), admission['pins'])
for item in admission['plan']: for item in admission['plan']:
phase = item['phase'] phase = item['phase']
require(standard.inventory(stage, stage=True) == expected, 'stage changed before phase') require(standard.inventory(stage, stage=True) == expected, 'stage changed before phase')
@@ -1717,7 +1717,8 @@ import tempfile
def s5_root(): def s5_root():
base = os.environ.get('BUILD_OUTPUT_DIR') or tempfile.gettempdir() base = Path(os.environ.get('BUILD_OUTPUT_DIR') or tempfile.gettempdir())
base.mkdir(parents=True, exist_ok=True)
return Path(tempfile.mkdtemp(prefix='p28-eq-s5-', dir=base)) return Path(tempfile.mkdtemp(prefix='p28-eq-s5-', dir=base))
@@ -2275,6 +2276,31 @@ class S5(unittest.TestCase):
self.assertEqual(outcome(eq.validate_tree, value), expected, case) self.assertEqual(outcome(eq.validate_tree, value), expected, case)
self.assertGreater(len(seen), 12) self.assertGreater(len(seen), 12)
def test_bundled_inputs_replace_unreadable_originals(self):
original = self.root / 'readonly'; copies = self.root / 'copies'
rows = []
for relative, content in (('a.py', b'alpha'), ('run-r02/b.gd', b'beta')):
(original / relative).parent.mkdir(parents=True, exist_ok=True); (original / relative).write_bytes(content)
rows.append({'destination': str(original / relative), 'bytes': len(content), 'sha256': hashlib.sha256(content).hexdigest()})
original.joinpath('ROOT_INPUT_MANIFEST.json').write_text(json.dumps({'files': rows}))
fixture = self.root / 'reference.variant'; fixture.write_bytes(b'fixture')
pins = {'fixture': verifier.pin(fixture), 'readonly': driver.bundled_inputs(original, original)}
driver.bundle_inputs(self.root, original, fixture, pins)
shutil.move(str(original), str(self.root / 'gone'))
self.assertEqual(driver.bundled_inputs(self.root / 'inputs' / 'readonly', original), pins['readonly'])
self.assertEqual(verifier.pin(self.root / 'inputs' / 'fixture' / 'reference.variant'), pins['fixture'])
(self.root / 'inputs' / 'readonly' / 'a.py').write_bytes(b'changed')
with self.assertRaisesRegex(eq.EvidenceError, 'read-only input changed'):
driver.bundled_inputs(self.root / 'inputs' / 'readonly', original)
(self.root / 'inputs' / 'readonly' / 'a.py').unlink()
with self.assertRaisesRegex(eq.EvidenceError, 'bundled read-only input missing'):
driver.bundled_inputs(self.root / 'inputs' / 'readonly', original)
outside = json.loads((self.root / 'inputs' / 'readonly' / 'ROOT_INPUT_MANIFEST.json').read_text())
outside['files'][0]['destination'] = '/elsewhere/a.py'
(self.root / 'inputs' / 'readonly' / 'ROOT_INPUT_MANIFEST.json').write_text(json.dumps(outside))
with self.assertRaisesRegex(eq.EvidenceError, 'input escapes read-only directory'):
driver.bundled_inputs(self.root / 'inputs' / 'readonly', original)
def test_probe_static_full_tree_blob_and_stream_requirements(self): def test_probe_static_full_tree_blob_and_stream_requirements(self):
probe = (verifier.HERE/'eq_probe.gd').read_text() probe = (verifier.HERE/'eq_probe.gd').read_text()
self.assertTrue(checker.check_probe(probe)['ok']) self.assertTrue(checker.check_probe(probe)['ok'])
@@ -292,8 +292,13 @@ def verify(project_root, directory):
execution = read(directory / 'execution.json') execution = read(directory / 'execution.json')
collector, standard, outer, diag = load_dependencies(project_root) collector, standard, outer, diag = load_dependencies(project_root)
admission = execution['admission'] admission = execution['admission']
require(actual_pins(project_root, Path(admission['readonly_path']), Path(admission['fixture']), # S5: inputs outside the checkout are read from the copies sealed in the bundle; the
Path(admission['engine']), collector, standard) == admission['pins'], 'actual input/source/EQ pins differ') # sandboxed validation cannot read the originals (seatbelt), and the copies were checked
# against them by run_eq before any phase.
inputs = directory / 'inputs'
require(actual_pins(project_root, Path(admission['readonly_path']), inputs / 'fixture' / Path(admission['fixture']).name,
Path(admission['engine']), collector, standard, copies=inputs / 'readonly') == admission['pins'],
'actual input/source/EQ pins differ')
result = recompute(directory, execution, collector, standard, diag, parallel=True) result = recompute(directory, execution, collector, standard, diag, parallel=True)
require(result == read(directory / 'results.json'), 'recomputed results differ') require(result == read(directory / 'results.json'), 'recomputed results differ')
for phase, values in result['phases'].items(): for phase, values in result['phases'].items():