feat: wire whiteness/holdout claim gates, reserve D21-D23, name U1 floor - #76
Merged
Merged
Conversation
Closes the additive, non-anchor-touching gaps from issue #71 (wire remaining implemented-but-unwired pieces): - B2: export the residual-whiteness (Ljung-Box) and temporal-holdout anti-overfit gates from `liouscope.fitting`, and add `fitting/claim_gate.py::assess_relaxation_claim` mapping their verdicts onto the StabilityReport SAFE/REVIEW/BLOCK vocabulary fail-closed (worst-wins). Purely additive: `diagnose()` behaviour unchanged; callers opt in and can feed the result to `build_stability_report(claim_level=)`. - C2: record D21-D23 as reserved-but-not-implemented in `_consts.RESERVED_DIAGNOSTIC_SLOTS`, an explicit code-level contract next to `DIAGNOSTIC_SCHEMA_VERSION` so the `D1-D24` name stays honest. - B5: read U1 from the named `_consts.U1_NOMINAL_FLOOR` instead of a bare `1e-10`; clarify in the docstring that U1 is a conservative placeholder (not a measured residual) unless the caller runs an ODE-tolerance sweep. No anchor, classifier-semantics, manifest-schema or taxonomy change. New tests: `tests/test_claim_gate.py` (truth table) and `tests/test_reserved_slots.py` (slot + U1 contract). CHANGELOG updated. Gates: pytest 419 passed (21 anchors green), ruff clean, mypy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01StgHHKB6YGxxjTKdWjcCtq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the additive, non-anchor-touching gaps from issue #71 ("wire remaining implemented-but-unwired pieces"): the anti-overfit gates are exported and connected to the claim vocabulary, D21-D23 get an explicit reserved-slot contract, and the U1 placeholder gets a named source. No runtime default changes;
diagnose()behaviour is untouched.Scope
assess_relaxation_claimclaim-gate helper (Ljung-Box 1978; temporal holdout LIOU-A-012)What changed
fitting/whiteness.py(Ljung-Box) andfitting/holdout.py(temporal out-of-sample) were implemented and unit-tested but exported by nothing and connected to no claim concept. They are now exported fromliouscope.fitting, and newfitting/claim_gate.py::assess_relaxation_claimmaps their verdicts onto the StabilityReportSAFE/REVIEW/BLOCKvocabulary fail-closed / worst-wins: rejected holdout →BLOCK; non-white residuals or an un-run gate →REVIEW; both run and passing →SAFE. The result feeds straight intobuild_stability_report(claim_level=...). Purely additive — callers opt in._consts.RESERVED_DIAGNOSTIC_SLOTSrecords D21-D23 as reserved-but-not-implemented, next toDIAGNOSTIC_SCHEMA_VERSION, so theD1-D24schema name stays honest and the gap is discoverable in code.compute_uncertainty_layernow reads_consts.U1_NOMINAL_FLOORinstead of a bare1e-10, and the docstring states plainly that U1 is a conservative placeholder (not a measured residual) unless the caller runs an ODE-tolerance sweep — whichdiagnose()does not.Verification
pytest -qpasses locally — 419 passed (was 405; +14 new)tests/test_anchors.pyunchanged and green — 21 passedruff check src tests benchmarksclean;mypy src/liouscopeclean (50 files)MANIFEST_SCHEMA.json, taxonomy, or classifier-semantics change.github/workflows/changeNew tests:
tests/test_claim_gate.py(full SAFE/REVIEW/BLOCK truth table, incl. fail-closed no-gate case) andtests/test_reserved_slots.py(reserved-slot + U1-floor contract). CHANGELOG updated.Quality contract
Reproducibility note
No numerical-result change. The claim-gate tests use fixed fixtures (
np.random.default_rng(0), deterministic exponential trajectories); anchor fixtures are byte-for-byte unchanged.Linked issues
Part of #71 (items B2, B5, C2). The classifier-semantics items (#68, #69, #70) and D17 (#69) are intentionally out of scope — those change canonical verdicts and per AGENTS.md §3 each needs a dedicated PR with physics rationale and deliberate anchor updates.
🤖 Generated with Claude Code
Generated by Claude Code