Migrate to property-testing-testo and pin the catalogue boundary - #13
Merged
Conversation
Swap the frozen rasuvaeff/property-testing 2.x for the split family's Testo adapter, pinned at ^0.4 (core ^0.3) — ^0.1, which MIGRATION.md still shows, installs core 0.1 and leaves every 0.2/0.3 engine feature unreachable. Both existing properties only ever asked about names that are in the catalogue, so nothing said what happens to a name that is not. That boundary is the whole safety story of this rule: a rewriter that mapped a name it does not know would rewrite user code into a call that does not exist, and one that answered yes across catalogues would treat an already-immutable factory as needing the rewrite it is the target of. eachLookupAnswersYesOnlyForItsOwnCatalogue checks all three lookups against all three catalogues, generating catalogued names alongside near misses built from the same alphabets through Gen::regex — so `date_created` and `createFromImmutable` are ordinary draws rather than lucky ones. Examples() pins createFromImmutable specifically: the source documents it as deliberately absent, and nothing enforced that. The case-insensitivity property gained a floor on runs where the mask actually changes the name — a mask of zero asserts nothing about case handling. Also wire rasuvaeff/rector-named-literals and apply it, carry the property regression corpus across CI runs (restore and save split, because the combined cache action's post-if: success() never saves on the red run that recorded the counterexample), and give mutation its own narrow change filter.
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
rasuvaeff/property-testing: ^2.4rasuvaeff/property-testing-testo: ^0.4rasuvaeff/rector-named-literalsWhy
^0.4and not^0.1MIGRATION.mdstill shows^0.1; that line was written at 0.1.0. The adapterchains to the engine by minor —
-testo 0.3requirescore ^0.3— so^0.1installs core 0.1 and leaves
Gen::regexand the rest of 0.2/0.3 unreachable.Nothing asked about names outside the catalogue
Both existing properties drew from
Gen::oneOf(...)over names that are in thecatalogue, then checked case-insensitivity. Nothing said what happens to a name
that is not — and that boundary is the whole safety story of a rewriting rule:
factory as needing the rewrite it is the target of.
eachLookupAnswersYesOnlyForItsOwnCataloguechecks all three lookups(
immutableEquivalent,isProceduralImmutableFactory,isSharedStaticFactory)against all three catalogues, drawing catalogued names alongside near misses
built from the same alphabets via
Gen::regex('date_[a-z_]{0,12}')andGen::regex('createFrom[A-Za-z]{0,10}')— sodate_createdandcreateFromImmutableare ordinary draws rather than lucky ones.Examples()pinscreateFromImmutablespecifically: the source documents it asdeliberately absent ("it has no counterpart on
DateTimeImmutableand markscode that wants mutability"), and no test enforced that.
Case-insensitivity, gated
lookupsAreCaseInsensitiveapplies a random 16-bit case mask. A mask of zeroleaves the name as written and asserts nothing about case handling;
Classify::covernow requires at least 60% of runs to actually change it.Checklist items deliberately skipped
Gen::commands/StateMachine— the map and the catalogue are lookup tables.Gen::datetime— this package rewritesDateTimecode, it does not computewith dates.
Verification
composer buildgreen locally.