Repository navigation
Close the sweep: teach the pagination invariant about "next"-only pages - #682
Merged
Merged
Conversation
Five models (anime/manga reviews, recent reviews, top anime, user friends) sit on pages that link only a "next"/"More ..." page. The rule "hasNextPage implies lastVisiblePage >= 2" assumed numbered links, so it reported the ten recordings as violations and they were allowlisted per fixture. The rule now names those five models in one place and explains why. The ten allowlist files are deleted; invariant debt is 0. Nullable getLastVisiblePage() stays the v6 alternative, recorded in DECISIONS.md.
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.
Settles #679. The last ten model-invariant allowlists were not parser bugs — they were a rule's blind spot.
What the rule assumed
That is sound when
lastVisiblePagecounts numbered pager links. Five pages have none: they link a single "More reviews"/"next" target:Anime\AnimeReviews,Manga\MangaReviews,Reviews\ReviewsTop\TopAnimeUser\FriendsThe parsers were right on both getters; the invariant was applying a numbered-pager rule to pages that do not have one.
The change
ModelInvariants::NO_NUMBERED_PAGERnames those five classes, with a comment explaining the exemption and pointing at the decision. The rule skips them; all ten allowlist files are deleted (not emptied), so:getLastVisiblePage()(the honest long-term answer) is recorded inDECISIONS.mdas the v6 alternative with the model overhaul, since it changes five public signatures and the v4 JSON mappingRejected here: reporting
lastVisiblePage = 2from the "next" link — a number that looks authoritative and is not.Verification
composer qualitygreen: 1070 tests / 12530 assertions, PHPStan, php-cs-fixer, endpoint manifest.test/unit/__invariants__/is now empty — no per-fixture exception survives the sweep.DECISIONS.mdunder a new "Pagination" section;PLAN.md's sweep summary updated to 34 → 0.