test(pr-cost): close the last two gaps from the superseded branch - #38
Merged
Conversation
Auditing whether fix/pr-cost-cache-visibility was safe to delete left two of its assertions unrepresented on main. Both are now carried, so nothing in that branch is unique any more. 1. Only claude-opus-4-6 was asserted against the 3x overcharge, but 4-7 and 4-8 are separate table rows. A test covering one row leaves the other two free to be deleted back into the overcharging "claude-opus-4" prefix. The test now covers all three. 2. The corrected-repost test asserted the ledger row COUNT. Two rows holding the same wrong number satisfy a length check while losing the correction entirely, which is the whole point of the flag. It now asserts the figures -- [517.46, 602.99] -- and also pins that the unflagged second call still reports "duplicate", so the idempotent default is covered in the same place. Both proved by mutation against scratchpad copies of the skill tree, so no tracked source was written: - deleting the 4-7 and 4-8 rows fails test_opus_4_6_and_later_are_not_priced_as_opus_4_0 - writing the correction as a copy of the row already in the ledger -- which still lands two rows -- fails test_allow_duplicate_publishes_a_corrected_figure Verified: 81 pr-cost tests OK; ruff clean.
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.
Why
Auditing whether
fix/pr-cost-cache-visibilitywas safe to delete left two of its assertions unrepresented onmain. This carries both, so nothing in that branch is unique any more and it can be deleted without losing coverage.The two gaps
1. Only
claude-opus-4-6was asserted against the 3× overcharge.claude-opus-4-7andclaude-opus-4-8are separate table rows. A test covering one row leaves the other two free to be deleted back into the overchargingclaude-opus-4prefix — the exact defect #35 fixed. The test now covers all three viasubTest.2. The corrected-repost test asserted the row COUNT, not the figures.
That is the whole point of
--allow-duplicate: the second row is a correction. It now asserts[517.46, 602.99], and pins in the same place that the unflagged second call still reports"duplicate", so the idempotent default is covered too.Both proved by mutation
Against scratchpad copies of the skill tree, so no tracked source was written:
4-7and4-8rate rowstest_opus_4_6_and_later_are_not_priced_as_opus_4_0test_allow_duplicate_publishes_a_corrected_figureThe second mutation is the interesting one: it still lands two ledger rows, so the old length check would have passed it while the correction was silently lost. That is what the value assertion buys.
Verification
Tests only — no behaviour change.