test(integration): substrate-gate boundary-state sweep — 10 deterministic cases (Task 1)#426
Conversation
…stic cases (Task 1)
Extends test_substrate_gate_chain.py from one comfortable baseline to
deterministic boundary-adjacent regions. Each case named, mutation
documented, expected verdict mapped to a specific invariant contract
anchored on actual module source.
Cases (10 deterministic, 1 enumeration sanity = 11 total):
Bekenstein/gate (6):
1. near_zero_positive_energy — E=1e-30 J, no NaN/Inf
2. near_zero_positive_radius — R=1e-30 m, ceiling ≈ 0
3. very_large_radius_finite_energy — R=1e10 m, E=1 J, no overflow
4. bekenstein_just_below_bound — claim = ceiling × 0.999999
5. bekenstein_exactly_at_boundary — claim = ceiling (`<=` admissible)
6. bekenstein_just_above_bound — claim = ceiling × 1.000001
Arrow (2):
7. arrow_net_exactly_zero — ΔS=-1, ΔI=+1 (`>=` admissible)
8. arrow_net_just_below_zero — ΔS=-1, ΔI=+0.999999
Bandwidth (2):
9. bandwidth_gamma_equals_sigma_dot — Γ=Σ̇=5 (`>=` admissible);
ANCHORED gate unaffected (tier separation)
10. bandwidth_gamma_just_above — Γ=5.01, Σ̇=5;
ANCHORED gate STILL admissible
Boundary semantics anchored from source:
- bekenstein_axis_holds: observed_information_bits <= ceiling
(anchored_substrate_gate.py)
- arrow_axis_holds: net >= 0.0
(arrow_of_time.assess_arrow_of_time)
- bandwidth_holds: slack_hz = bound_hz - rate_hz >= 0.0
(observer_bandwidth.assess_bandwidth_bound)
Each case asserts: bekenstein verdict, arrow verdict, composite
verdict. Bandwidth cases additionally assert tier separation —
SPECULATIVE bandwidth violation does NOT veto ANCHORED composite.
Quality gates:
pytest tests/integration/test_substrate_gate_boundary_sweep.py
11/11 PASS in 0.31s
pytest chain + boundary suites 17/17 PASS
ruff check / format / black clean (one I001 auto-fix for import sorting)
mypy --strict clean (1 file, 0 issues)
No Hypothesis (deterministic boundary table per protocol §4 — property
layer is post-T1 optional). No randomness. No mocks. Same fixture
style as substrate-gate-chain test (PR #425).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b35896c38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert len(expected) == 10 | ||
| # Smoke: each name is a valid identifier (catches typos / accidental empty | ||
| # names in parametrize tables when refactored). | ||
| for name in expected: | ||
| assert name and name.replace("_", "").isalnum() |
There was a problem hiding this comment.
Validate boundary-case inventory against test parametrizations
This "coverage assertion" only checks properties of the local expected literal (len == 10 and identifier formatting) and never compares those names to the actual @pytest.mark.parametrize case tables, so removing or renaming a real boundary case in the parametrized tests will still pass here and silently weaken coverage while the protocol claim remains green. Because this test is intended to prevent silent case removal, it currently provides a false guarantee.
Useful? React with 👍 / 👎.
Task 1 of 7-task Physics-Invariant Rocketization Protocol. Extends substrate-gate integration from one comfortable baseline to 10 deterministic boundary-adjacent cases.
<=boundary)11/11 PASS (10 cases + 1 enumeration sanity-check). Quality gates clean. No Hypothesis (per protocol §4).