test(ship-two-001): pin 45 AC_* constants to spec values (drift tripwire)#1046
Merged
Conversation
The 42 PARTIAL_ALGORITHM_LEVEL verdict functions shipped in #1044 all parameterize against `pub const AC_*` thresholds. A contributor editing `AC_SHIP2_003_MAX_VAL_CROSS_ENTROPY_LOSS` from `2.2` → `2.5` without touching the spec would silently loosen the gate — every verdict fn still compiles, every existing test still passes, but the ship criterion has drifted. This test file imports every `AC_*` const across the workspace (4 crates, 45 consts) and asserts its value matches the spec at §4.2 / §5.2 / §6 / §7.1 / §14. 44 independent assertions + 1 tripwire comment-sync counter. If the spec moves, these assertions must move with it. If someone edits a const without updating the spec, this test fails at `cargo test` time, not at next production regression. Coverage: - MODEL-1 §4.2 AC-SHIP1-001..010 + §7.1 SHIP-023/024 → 20 consts - MODEL-2 §5.2 AC-SHIP2-003..010 → 7 consts - §6 Compound Ship Gates 001..012 → 10 consts - §14 Task #132 GPUTRAIN 003..007 → 8 consts - Total pinned → 45 consts - Total `#[test]` fns → 45 (44 value + 1 tripwire) `cargo test -p aprender-train --test ship_two_001_const_pinning` → 44 passed; 0 failed. Independent of #1044 (which already merged to main). No cascade deps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Adds one integration test file that imports every
AC_*constant from the SHIP-TWO-001 verdict modules and asserts its value matches the spec. Catches silent const drift atcargo testtime — before it reaches production.Why
The 42 PARTIAL_ALGORITHM_LEVEL verdict functions shipped in #1044 all parameterize against
pub const AC_*thresholds (AC_SHIP2_003_MAX_VAL_CROSS_ENTROPY_LOSS,AC_GATE_SHIP_011_MIN_PMAT_TDG_SCORE, etc.). A contributor editing one of these from2.2→2.5without touching the spec:This file is the tripwire.
Coverage
Verification
How drift is caught
Example: someone pushes a commit changing
AC_SHIP2_003_MAX_VAL_CROSS_ENTROPY_LOSSfrom 2.2 to 2.5 without updatingdocs/specifications/aprender-train/ship-two-models-spec.md:The test name encodes the expected value — grep discovers the drift, the spec section, and the fix path in one step.
Relationship to other PRs
contracts/readme-claims-v1.yaml(from feat(ship-two-001): full algorithmic coverage bundle + README contract-backed rewrite (v2.30 → v2.43) #1044): that one prevents README drift; this one prevents const drift.🤖 Generated with Claude Code