test(subscription_renewal): property-test the renewal state machine with proptest - #1379
Merged
Calebux merged 2 commits intoSep 1, 2026
Merged
Conversation
…Calebux#1238) Add a proptest state-machine harness that drives random sequences of init_sub, approve_renewal, renew, cancel_sub, set_window and set_user_cap, asserting the documented renewal invariants after every generated operation: 1. every accepted renewal respects the per-subscription spending cap 2. cumulative UserSpent never exceeds the global UserCap from a renewal 3. at most one successful renewal per billing window (cycle guard) 4. SubscriptionState transitions follow the declared graph 5. the renewal lock is never held after a completed call The invariant list is documented in a crate-level doc comment (lib.rs) and mirrored in fuzz.rs. Wire the suite into CI with a fixed PROPTEST_SEED and a bounded PROPTEST_CASES on PRs, plus a nightly extended-run job; document the suite in FUZZING_EDGE_CASES.md and fix the PROPTYST_CASES typo.
|
@Classictowo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Repair pre-existing corruption in contracts.yml (from an earlier bad merge)
that made the file invalid YAML, so GitHub Actions never registered or ran
the workflow:
- remove duplicate top-level 'name:' key (invalid duplicate-key YAML)
- fix concurrency.group expression spaces (${{ ... }})
- fix mangled shell: wasm glob ${#wasm_files[@]} and size=$(wc -c < ...)
This unblocks CI for the contracts, so the proptest renewal state-machine
harness (and its fixed-seed PR run + nightly extended run) can actually
execute and verify the Calebux#1238 fix.
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 #1238. Implements the acceptance criteria for property-testing the subscription renewal state machine with \proptest.
Changes
enew, \cancel_sub, \set_window\ and \set_user_cap, and asserts every documented invariant after each generated operation:
Verification