Repository navigation
Conversation
No core test caught `backed_amount` accepting health -1 (ledger.rs:246, `t >= 0` -> `t >= -1`): a ledger left 1 unit short. docs/09 said so in the ledger fuzz row; only the Python differential caught it. The property test g3_backed_amount_is_sound_and_maximal checks the same rule, but its random worlds seldom land on health exactly -1. g3_backed_amount_is_exact_on_small_ledgers enumerates two priced mints: other and own position in -6..=12 (0 is no position); per mint, (low, high) price in (1, 1), (2, 2), (3, 3), (1, 3) and haircut 5,000 or 10,000 with liability weight 10,000 or 15,000; request 0..=40; 3,789,056 cases. Each grant must equal the largest b <= request whose ledger owes nothing or has health >= 0, restated with collateral floored at its low price and haircut and debts ceiled at their high price and weight. In 764,280 cases some b is valid and one unit more leaves health at exactly -1; the test pins that count, and a Python restatement of the same domain prints 3789056 764280. Not covered, and said so: a full ledger, unpriced or unallowlisted mints, a price or weight of 0 (with hi = 0 the no-collateral shortcut grants less than the rule, docs/09 §2), other exponents or decimals. Tests only: no program or core source line moves. Evidence (tasks/g3-exhaustive/mutants.sh, mutants-r4.out): - M5 `t >= -1`: KILLED by the new test; the rest of the core suite (--skip the new test) passes on it, rc 0. - M6 `t > 0`, M7 collateral rounded up, M8 debt rounded down, M9 fast path without `!others_liab`, M11 collateral at the high price, M12 debt at the low price: KILLED. - M10 fast path `after > 0`: survives this test (with every mint priced, health then decides the same); g2_and_fail_closed_without_ prices kills it. - New test 0.27 s release, 4.09 s debug; the exhaustive suite 2.78 to 2.83 s in release (three runs), so 09 §5.2's heading says ~3 s in release, not ~6 s. - tools/claims.py OK (exhaustive 7); scripts/check.sh ALL CHECKS PASSED. Docs: docs/09 §2 and §5.2, README and docs/14 say 7 exhaustive tests over ~588M inputs (584.4M + 3.8M); 03 §4.6 cites the test for G3 (two priced mints, one position each) as it does g2's for G2; the ledger fuzz row says a core test now catches the -1 bound. Sibling search: docs/09 names no other mutant of a core rule that the core suite misses, apart from .cargo/mutants.toml's 22 exclusions (stated equivalents, §6). Those in ledger.rs (contribution, has_liability, backed_amount) concern zero positions and the health overflow fallback, which this domain never reaches; not re-run here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shuv-amp
added a commit
that referenced
this pull request
Oct 19, 2026
…es (#138-#147) Batched squash of the reviewed, stacked PRs #138-#147 (one tree, identical to the reviewed stack's; each PR reviewed adversarially and green in CI on its own head): - #138 Test the Vault's record checks with forged records (finding 120) - #139 Record findings 117 to 124 in docs/09 section 4 - #140 Cut a long RPC error in an alert so the ids after it reach Discord (finding 125) - #141 Pin G3's health bound at its edge with an exhaustive test - #142 Key a failed action's repeated alert on its error's cause (finding 126) - #143 Offer the sweep forged owner-checked accounts, swapped at every slot (finding 127) - #144 Show an RPC's error in an alert whose line has a message (finding 128) - #145 Key an RPC failover's alert on the endpoints it moved between (finding 129) - #146 The sweep copies every account of the swept program, not only named ones - #147 Key a backup's wrong-cluster alert on its endpoint entry (finding 130) Co-Authored-By: Claude Opus 5.5 <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.
What changed
One new core test,
g3_backed_amount_is_exact_on_small_ledgers(crates/bulkhead-core/tests/exhaustive.rs), and the counts and citations that follow from it in README, docs/03, docs/09 and docs/14. Tests and docs only: no program or core source line moves. One commit, ce3db42.G3's health bound now fails a core test when moved by one. No core test caught
backed_amountaccepting health -1 (ledger.rs:246,t >= 0->t >= -1), which leaves a ledger 1 unit short. docs/09 said so in the ledger fuzz row; only the Python differential caught it. The property testg3_backed_amount_is_sound_and_maximalchecks the same rule, but its random worlds seldom land on health exactly -1.The new test enumerates two priced mints: other and own position in -6..=12 (0 is no position); per mint, (low, high) price in (1, 1), (2, 2), (3, 3), (1, 3), haircut 5,000 or 10,000, liability weight 10,000 or 15,000; request 0..=40. That is 3,789,056 cases. Each grant must equal the largest b <= request whose ledger owes nothing or has health >= 0, restated with collateral floored at its low price and haircut and debts ceiled at their high price and weight. In 764,280 cases some b is valid and one unit more leaves health at exactly -1; the test pins that count, and a Python restatement of the same domain prints
3789056 764280.docs/09 §2 and §5.2, README and docs/14 now say 7 exhaustive tests over ~588M inputs (584.4M + 3.8M), and §5.2 says the exhaustive suite takes ~3 s in release, not ~6 s. docs/03 §4.6 cites the test for G3. The ledger fuzz row says a core test now catches the -1 bound.
Proof
Autopilot tasks/g3-exhaustive/ (mutants.sh applies each mutant to ledger.rs and runs the core suite):
t >= -1KILLED by the new test, and the rest of the core suite (with the new test skipped) passes on it, rc 0. M6t > 0, M7 collateral rounded up, M8 debt rounded down, M9 fast path without!others_liab, M11 collateral at the high price, M12 debt at the low price: KILLED. M10 (fast pathafter > 0) survives this test;g2_and_fail_closed_without_priceskills it.1: 5112383 = 1: ce3db42, patch-id ea863bf9 for both; B confirmed and ran each-commit green and the exhaustive suite (7 passed, 2.80 s) itself (REVIEWS/auto-A-g3-exhaustive-r3.md, APPROVE).bin/integrate.shranbin/check-each-commit.shgreen on ce3db42 (tasks/g3-exhaustive/integrate/integrate.log).scripts/check.shon autopilot/integration at ce3db42: ALL CHECKS PASSED; claims OK, exhaustive 7, findings 125, programs 179 (tasks/g3-exhaustive/integrate/check-ce3db42.log).Limits
🤖 Generated with Claude Code