docs(demo): runnable demo of the pagination variant design (mindmap #16/#65) - #147
Open
allmonday wants to merge 1 commit into
Open
docs(demo): runnable demo of the pagination variant design (mindmap #16/#65)#147allmonday wants to merge 1 commit into
allmonday wants to merge 1 commit into
Conversation
#65) A self-contained script that lands the greenfield design — four Relationship variants (kind AS the type), pagination knowledge encapsulated as polymorphic properties, capability/assembly/switch as three orthogonal questions — side by side with the REAL production discriminator (is_active_paginated_relationship over real RelationshipInfo instances). Four scenarios: every consumer point in one or two lines; behavior equivalence vs the current truth table (4/4 agree); the fate of an inconsistent state (current: constructs silently / variant: TypeError); capability-vs-assembly-vs-switch separation under the local toggle. Run: uv run python demo/pagination_variant_design.py Co-Authored-By: Claude <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.
Summary
A runnable design document: the greenfield pagination design from the full-project orthogonality review (mindmap map 37, node #16 "分不分页 4 种编码" + its variant-design child node) landed as a self-contained demo script — no production code is touched.
What it demonstrates
RelationshipInfoinstances run through the realis_active_paginated_relationship— 4/4 verdicts agree, proving the variant design changes structure, not behaviorkind=COALESCEDwith apage_loaderconstructs silently; variant:TypeError— illegal states are unrepresentable, no validation neededcan_paginate=Truealways (SQL can slice anytime),execute_paginatedflips with the toggle; remote paged ignores the toggle (capability = execution shape)Three hands-on experiment points at the end of the file (remove
paged_view_loader, flipCoalesced.paginated, add a new consumer point and count the lines).Notes
🤖 Generated with Claude Code