Skip to content

docs(demo): runnable demo of the pagination variant design (mindmap #16/#65) - #147

Open
allmonday wants to merge 1 commit into
masterfrom
demo/pagination-variant-design
Open

docs(demo): runnable demo of the pagination variant design (mindmap #16/#65)#147
allmonday wants to merge 1 commit into
masterfrom
demo/pagination-variant-design

Conversation

@allmonday

Copy link
Copy Markdown
Collaborator

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.

uv run python demo/pagination_variant_design.py

What it demonstrates

Scenario Point
1. Four relationships × five consumer points The ideal design's daily life: resolver dispatch / SDL shape / introspect serialization / voyager icon — each consumer in one or two lines, zero truth-table knowledge
2. Side-by-side with the CURRENT production discriminator Real RelationshipInfo instances run through the real is_active_paginated_relationship4/4 verdicts agree, proving the variant design changes structure, not behavior
3. The fate of an inconsistent state Current: kind=COALESCED with a page_loader constructs silently; variant: TypeError — illegal states are unrepresentable, no validation needed
4. Capability vs assembly vs the local toggle Your domain insight, live: local can_paginate=True always (SQL can slice anytime), execute_paginated flips 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, flip Coalesced.paginated, add a new consumer point and count the lines).

Notes

🤖 Generated with Claude Code

#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>
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