Skip to content

2.1.0: coverage gate, charset/bytes/enum/unique/interval/recursive generators, shrink debugging#6

Merged
rasuvaeff merged 2 commits into
masterfrom
feat/2.1.0-wave3
Jul 5, 2026
Merged

2.1.0: coverage gate, charset/bytes/enum/unique/interval/recursive generators, shrink debugging#6
rasuvaeff merged 2 commits into
masterfrom
feat/2.1.0-wave3

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

Wave 3 (ROADMAP): consumer-driven additions — 2.1.0, no BC breaks

Everything is additive: the ArbitraryInterface contract and seed sequences of existing generators are untouched. roave/backward-compatibility-check --from=v2.0.0: no backwards-incompatible changes detected.

Guarantees

  • Classify::cover($condition, $label, $minPercent) — the headline: an under-covered label now FAILS the property with the new CoverageViolationException instead of only printing a distribution line. Discarded runs are excluded from the denominator; all-discarded runs with requirements fail outright. Requirements are drained per property (no leakage after a falsified run).

Generators

  • Gen::stringFrom($alphabet, $min, $max) (CharsetStringArbitrary) — identifiers/hex/slugs, multibyte alphabets, shrink toward the first alphabet character.
  • Gen::bytes($min, $max) (BytesArbitrary) — raw bytes for parsers/codecs, shrink toward "\x00".
  • Gen::enum(SomeEnum::class) — shrinks toward earlier-declared cases.
  • Gen::uniqueArrayOf($el, $min, $max) (UniqueArrayArbitrary) — pairwise-distinct lists; element shrink candidates that would collide are pruned.
  • Gen::intRange($min, $max) — ordered [lo, hi] pairs on top of flatMap; both bounds shrink, order always holds.
  • Gen::floatSpecial() — opt-in NaN/±INF/-0.0/representation edges (default floats stay finite; no seed shift).
  • Gen::recursive($leaf, $wrap, $maxDepth) — bounded recursive structures, 50/50 leaf-vs-branch per level.
  • Optional size bounds on arrayOf/nonEmptyArrayOf/dictOf.

DX

  • Gen::sampleShrinks($arb, $seed, $limit) — value + first shrink candidates, for authors of custom arbitraries.
  • PROPERTY_VERBOSE env — log every run's generated arguments.
  • README: recipes section (dependent sizes, intervals, bounded recursion) + coverage docs.

Verification

  • composer build green: 364 tests
  • Mutation: 802 mutants, 761 test-killed + 22 timeout, 19 escaped (the documented 2.0.0 equivalents; nothing new) — MSI ≈ 97.6% vs minMsi 90
  • bc-check --from=v2.0.0 clean; examples executed; zizmor clean
  • Psalm note: Gen::floatSpecial() builds NaN/INF via fdiv() — Psalm crashes on the NAN constant

rasuvaeff added 2 commits July 2, 2026 22:56
…tRange/floatSpecial/recursive, sampleShrinks, sized collections, PROPERTY_VERBOSE
@rasuvaeff rasuvaeff merged commit eb0de8e into master Jul 5, 2026
7 checks passed
@rasuvaeff rasuvaeff deleted the feat/2.1.0-wave3 branch July 5, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant