|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| set[str] | _keys_layer1_reads () |
| test_every_key_layer1_reads_is_declared () | |
| test_the_scan_actually_finds_keys () | |
| test_previously_undeclared_keys_now_round_trip (key) | |
Variables | |
| str | LAYER1 = Path(__file__).resolve().parent.parent / "engine/optimizer/layers/layer1_static_optimization.py" |
| set | RUNTIME_ONLY = set() |
| tuple | READ_PATTERNS |
Every requirement key Layer 1 reads must be DECLARED in DesignRequirementsConfig. A pydantic model silently DROPS unknown keys. So a key the optimizer reads but the schema does not declare cannot be set at all: `PUT /api/config` returns 200 and discards it, a YAML carrying it loads without it, and the value the optimizer uses is always its hardcoded fallback. Four such keys even had labelled controls in the Configuration editor, so the UI offered knobs that did nothing. Sixteen keys were in that state when this test was written (2026-09-14), including `max_chamber_length_m`, the throat-area search bounds, and the whole injector ring-geometry group. This test fails if anyone adds a seventeenth. The reverse direction is deliberately NOT checked: a declared field with no reader is harmless (it may be read by Layer 2/3, the frontend, or a future consumer).
|
protected |
Definition at line 40 of file test_requirements_schema_completeness.py.
Referenced by test_every_key_layer1_reads_is_declared(), and test_the_scan_actually_finds_keys().
| test_requirements_schema_completeness.test_every_key_layer1_reads_is_declared | ( | ) |
Definition at line 48 of file test_requirements_schema_completeness.py.
References _keys_layer1_reads().
| test_requirements_schema_completeness.test_previously_undeclared_keys_now_round_trip | ( | key | ) |
These four were readable-but-unsettable and are the reason this test exists.
Definition at line 76 of file test_requirements_schema_completeness.py.
| test_requirements_schema_completeness.test_the_scan_actually_finds_keys | ( | ) |
Guard the guard: if the regexes stop matching, the test above passes vacuously.
Definition at line 62 of file test_requirements_schema_completeness.py.
References _keys_layer1_reads().
| str test_requirements_schema_completeness.LAYER1 = Path(__file__).resolve().parent.parent / "engine/optimizer/layers/layer1_static_optimization.py" |
Definition at line 25 of file test_requirements_schema_completeness.py.
| tuple test_requirements_schema_completeness.READ_PATTERNS |
Definition at line 31 of file test_requirements_schema_completeness.py.
| set test_requirements_schema_completeness.RUNTIME_ONLY = set() |
Definition at line 29 of file test_requirements_schema_completeness.py.