text
stringlengths
0
252
if isinstance(results, dict):
evidence["execution_euid"] = results.get("euid")
evidence["paths"] = results.get("paths")
evidence["egress"] = results.get("egress")
if run.completed.returncode != 0:
failure = f"probe subprocess returned {run.completed.returncode}"
elif not isinstance(results, dict) or set(results) != {"euid", "paths", "egress"}:
failure = "probe JSON must contain only euid, paths, and egress"
elif results["euid"] != identity.uid:
failure = f"probe ran as UID {results['euid']}, expected runner UID {identity.uid}"
elif not isinstance(results["paths"], dict) or set(results["paths"]) != set(expected_paths):
failure = "probe JSON path set did not match the request"
elif not isinstance(results["egress"], dict) or set(results["egress"]) != set(expected_egress):
failure = "probe JSON egress set did not match the request"
else:
for path in expected_paths:
item = results["paths"][path]
if (
not isinstance(item, dict)
or set(item) != {"readable", "error"}
or item["readable"] is not False
or item["error"] != "PermissionError"
):
failure = f"{path} was not denied with PermissionError"
break
if failure is None:
for endpoint in expected_egress:
item = results["egress"][endpoint]
if (
not isinstance(item, dict)
or set(item) != {"connected", "error", "errno"}
or item["connected"] is not False
or not isinstance(item["error"], str)
or not item["error"]
):
failure = f"{endpoint} was not blocked for UID {identity.uid}"
break
if failure is None:
evidence["status"] = "denied"
else:
evidence["failure"] = failure
evidence_path.write_text(
json.dumps(evidence, indent=2, sort_keys=True) + "\n",
encoding="utf-8",
)
> assert failure is None, (
^^^^^^^^^^^^^^^
f"Isolation probe failed closed: {failure}; returncode={run.completed.returncode}; stderr={run.completed.stderr!r}"
)
E AssertionError: Isolation probe failed closed: probe subprocess returned 91; returncode=91; stderr=''
submission_isolation.py:368: AssertionError
==================================== PASSES ====================================
=========================== short test summary info ============================
PASSED test_outputs.py::test_isolated_runner_uses_read_only_staging_and_drops_privileges
PASSED test_outputs.py::test_nominal_artifacts_solver_and_declared_schema
PASSED test_outputs.py::test_nominal_components_obey_normalization_formula_and_fft_conventions
FAILED test_outputs.py::test_nominal_fields_and_fourier_spectra_match_independent_recomputation
FAILED test_outputs.py::test_nominal_plane_wave_table_and_residual_summary_are_correct
FAILED test_outputs.py::test_submitted_solver_generalizes_to_hidden_crop_and_alternate_configuration
========================= 3 failed, 3 passed in 23.78s =========================
============================= test session starts ==============================
platform linux -- Python 3.12.11, pytest-8.4.1, pluggy-1.6.0 -- /usr/local/bin/python3
rootdir: /verifier
collecting ... collected 6 items
test_outputs.py::test_isolated_runner_uses_read_only_staging_and_drops_privileges PASSED [ 16%]
test_outputs.py::test_nominal_artifacts_solver_and_declared_schema PASSED [ 33%]
test_outputs.py::test_nominal_fields_and_fourier_spectra_match_independent_recomputation PASSED [ 50%]
test_outputs.py::test_nominal_plane_wave_table_and_residual_summary_are_correct FAILED [ 66%]
test_outputs.py::test_nominal_components_obey_normalization_formula_and_fft_conventions PASSED [ 83%]
test_outputs.py::test_submitted_solver_generalizes_to_hidden_crop_and_alternate_configuration FAILED [100%]
=================================== FAILURES ===================================
________ test_nominal_plane_wave_table_and_residual_summary_are_correct ________
def test_nominal_plane_wave_table_and_residual_summary_are_correct() -> None:
bundle = nominal_bundle()
reference = nominal_reference()
assert_record_agreement(
bundle.records,
reference.records,
tuple(bundle.configuration["outputs"]["csv_key_columns"]),
)
> assert_summary_matches_reference(bundle, reference)
test_outputs.py:749:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bundle = Bundle(output_directory=PosixPath('/root'), configuration_path=PosixPath('/root/data/reconstruction_config.json'), con...'kx_inv_angstrom': 0.014776646639964398, 'ky_inv_angstrom': 0.09267977920125965, 'magnitude': 0.010486473999217417}]}})
reference = ReferenceResult(configuration={'schema_version': 'stm-plane-wave-input-v1', 'map': {'shape_yx': [256, 256], 'axis_orde...kx_inv_angstrom': -0.014776646639964398, 'ky_inv_angstrom': -0.09267977920125965, 'magnitude': 0.01048647428564728}]}})
def assert_summary_matches_reference(
bundle: Bundle,
reference: ReferenceResult,
) -> None:
actual = bundle.summary
expected = reference.summary
assert actual["schema_version"] == expected["schema_version"]
assert actual["input_shape_yx"] == expected["input_shape_yx"]