Repository navigation
Expand file tree
/
Copy pathtest_compute_current_output_table_runtime_surface.py
More file actions
134 lines (119 loc) · 7.49 KB
/
Copy pathtest_compute_current_output_table_runtime_surface.py
File metadata and controls
134 lines (119 loc) · 7.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/env python3
"""Guard the disposable runtime status surface against public-surface drift."""
from __future__ import annotations
import importlib.util
import json
import pathlib
import pytest
ROOT = pathlib.Path(__file__).resolve().parents[1]
SCRIPT = ROOT / "particles" / "compute_current_output_table.py"
def _load_module():
spec = importlib.util.spec_from_file_location("compute_current_output_table", SCRIPT)
if spec is None or spec.loader is None:
raise RuntimeError(f"unable to load {SCRIPT}")
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def test_runtime_surface_preserves_rejected_neutrino_rows_and_canonical_refs(tmp_path: pathlib.Path) -> None:
module = _load_module()
current_dir = module.build_runtime(tmp_path / "runtime", with_hadrons=False, verbose=False)
payload = json.loads((current_dir / "results_status.json").read_text(encoding="utf-8"))
exact_nonhadron = json.loads((current_dir / "exact_nonhadron_masses.json").read_text(encoding="utf-8"))
exact_fit_surface = json.loads((current_dir / "exact_fits_only.json").read_text(encoding="utf-8"))
active = payload["surface_state"]["active_local_public_candidates"]
uv = payload["premise_boundaries"]["uv_bw_internalization"]
companion = payload["companion_status_rows"]
markdown = (current_dir / "RESULTS_STATUS.md").read_text(encoding="utf-8")
exact_entries = {entry["particle_id"]: entry for entry in exact_nonhadron["entries"]}
exact_fit_entries = {entry["id"]: entry for entry in exact_fit_surface["entries"]}
assert active["neutrino_repaired_branch"] is False
assert companion
companion_by_id = {row["topic_id"]: row for row in companion}
assert companion_by_id["hierarchy_naturality"]["status"] == (
"conditional_hierarchy_bridge_with_packaging_identity"
)
hierarchy_summary = companion_by_id["hierarchy_naturality"]["summary"]
hierarchy_boundary = companion_by_id["hierarchy_naturality"]["scientific_boundary"]
assert "same-source-antecedent" in hierarchy_summary
assert "packaging identity" in hierarchy_boundary
assert "not a source-derived Higgs-naturalness result" in hierarchy_boundary
assert companion_by_id["strong_cp"]["status"] == "open"
assert all("next_action" not in row for row in companion)
assert all("blocked_by" not in row for row in companion)
assert all("scientific_boundary" in row for row in companion)
assert all("required_scientific_evidence" in row for row in companion)
assert payload["comparison_rows"]
assert payload["inputs"]["hadron_profile"] == "suppressed"
assert uv["prelimit_system_artifact"] == "code/particles/runs/uv/bw_realized_transported_cap_local_system.json"
assert uv["remaining_missing_emitted_witness_artifact"] == (
"code/particles/runs/uv/bw_carried_collar_schedule_scaffold.json"
)
assert uv["smaller_remaining_raw_datum_artifact"] == (
"code/particles/runs/uv/bw_fixed_local_collar_markov_faithfulness_datum.json"
)
assert uv["neutrino_local_bridge_candidate_context"] == (
"code/particles/runs/neutrino/neutrino_lambda_nu_bridge_candidate.json"
)
assert "## Companion Claim Boundaries" in markdown
assert "## Neutrino Oscillation Comparison" in markdown
assert exact_nonhadron["status"] == (
"conditional_nonhadron_candidates_with_classical_carriers_separated_and_target_anchored_witnesses_withheld"
)
carriers = {row["carrier_id"]: row for row in exact_nonhadron["classical_carrier_modes"]}
assert set(carriers) == {"photon", "gluon", "graviton"}
assert all(row["particle_promotion_allowed"] is False for row in carriers.values())
assert exact_fit_surface["artifact"] == "oph_exact_fits_only_surface"
withheld_entries = {entry["particle_id"]: entry for entry in exact_nonhadron["withheld_entries"]}
assert "top_quark" not in exact_entries
assert "bottom_quark" not in exact_entries
assert "electron" not in exact_entries
assert withheld_entries["top_quark"]["reason"] == (
"target_anchored_witness_kept_in_exact_fit_audit_not_public_prediction"
)
assert withheld_entries["electron"]["reason"] == (
"target_anchored_witness_kept_in_exact_fit_audit_not_public_prediction"
)
assert exact_fit_entries["charged_current_family_exact_witness"]["supporting_scope_closure_artifact"] == (
"code/particles/runs/leptons/lepton_current_family_affine_anchor_theorem.json"
)
assert exact_fit_entries["quark_current_family_exact_witness"]["supporting_scope_closure_artifact"] == (
"code/particles/runs/flavor/quark_current_family_selected_sheet_closure.json"
)
assert (current_dir / "P_derivation" / "runtime" / "p_closure_trunk_current.json").exists()
assert (current_dir / "P_derivation" / "runtime" / "measured_endpoint_calibration_current.json").exists()
assert (current_dir / "P_derivation" / "runtime" / "thomson_endpoint_contract_current.json").exists()
assert (current_dir / "P_derivation" / "runtime" / "source_spectral_theorem_current.json").exists()
assert (current_dir / "P_derivation" / "runtime" / "thomson_endpoint_package_current.json").exists()
assert (current_dir / "P_derivation" / "runtime" / "rg_matching_threshold_contract_current.json").exists()
provenance = json.loads((current_dir / "runs" / "status" / "blind_prediction_provenance.json").read_text())
assert provenance["artifact"] == "oph_blind_prediction_provenance_ledger"
assert provenance["promotion_allowed"] is False
assert (current_dir / "PARTICLE_PROVENANCE_LEDGER.md").exists()
assert not (
current_dir / "runs" / "status" / "particle_pipeline_closure_status.json"
).exists()
assert not (
current_dir / "runs" / "status" / "particle_derivation_gap_ledger.json"
).exists()
assert not (current_dir / "PARTICLE_PIPELINE_CLOSURE_STATUS.md").exists()
assert not (current_dir / "DERIVATION_GAP_LEDGER.md").exists()
final_predictions = json.loads((current_dir / "runs" / "status" / "final_end_to_end_predictions.json").read_text())
assert final_predictions["artifact"] == "oph_final_current_end_to_end_particle_predictions"
assert {entry["particle_id"] for entry in final_predictions["predictions"]} == {"higgs"}
assert (current_dir / "runs" / "status" / "carrier_mode_acceptance.json").exists()
assert (current_dir / "CARRIER_MODE_ACCEPTANCE.md").exists()
assert (current_dir / "PARTICLE_PIPELINE_STATUS.md").exists()
direct_top = json.loads((current_dir / "runs" / "calibration" / "direct_top_bridge_contract.json").read_text())
assert direct_top["status"] == "hard_no_go_current_corpus_compare_only_direct_top_codomain"
assert direct_top["promotion_allowed"] is False
def test_runtime_surface_with_hadrons_exercises_intermediate_hadron_lane(tmp_path: pathlib.Path) -> None:
module = _load_module()
current_dir = module.build_runtime(tmp_path / "runtime", with_hadrons=True, verbose=False)
payload = json.loads((current_dir / "results_status.json").read_text(encoding="utf-8"))
hadron_rows = [row for row in payload["rows"] if row["group"] == "Hadrons"]
assert payload["inputs"]["with_hadrons"] is True
assert payload["inputs"]["hadron_profile"] == "serious"
assert payload["surface_state"]["active_local_public_candidates"]["hadrons_enabled"] is True
assert hadron_rows
assert {row["status"] for row in hadron_rows} == {"simulation_dependent"}
assert (current_dir / "runs" / "status" / "status_table_forward_current.json").exists()