Classification
Needs discussion before implementation. These restrictions could make rendering deterministic and prevent performance regressions, but some are policy choices rather than requirements of the renderer.
Goal
Allow applications to opt dedicated page-model packages or types into a stricter closed-world contract.
Candidate checks:
- fail on page-model properties unused by the fully expanded template graph
- reject
Any, Object, raw generic types, and dynamic map-shaped data
- reject JPA entity types and Hibernate persistent collections
- reject mutable properties
- require typed, materialized collections for iteration
- warn or fail on unordered collection iteration where stable output is expected
- reject types whose nullability cannot be established safely
Why
A page model should ideally be immutable data already prepared for rendering. Passing entities or lazy collections can cause database access and N+1 queries during rendering. Unused page properties can reveal stale calculations, unnecessary queries, or incomplete template changes made by agents.
Design questions
- Is strictness enabled by package, naming convention, annotation, or Gradle configuration?
- Which checks are errors versus warnings?
- How can legitimate shared DTOs or infrastructure fields opt out explicitly?
- Should unused-property checking include properties consumed only by backend code, or apply solely to dedicated
*Page types?
- Which collection interfaces are accepted while preserving deterministic, I/O-free rendering?
- Should JPA detection be annotation-based without introducing a JPA dependency?
Constraints
- Keep the default model rules small unless strict mode is explicitly enabled.
- Analyze properties after fragment/layout expansion.
- Do not perform runtime checks or load JPA/Hibernate classes reflectively.
Classification
Needs discussion before implementation. These restrictions could make rendering deterministic and prevent performance regressions, but some are policy choices rather than requirements of the renderer.
Goal
Allow applications to opt dedicated page-model packages or types into a stricter closed-world contract.
Candidate checks:
Any,Object, raw generic types, and dynamic map-shaped dataWhy
A page model should ideally be immutable data already prepared for rendering. Passing entities or lazy collections can cause database access and N+1 queries during rendering. Unused page properties can reveal stale calculations, unnecessary queries, or incomplete template changes made by agents.
Design questions
*Pagetypes?Constraints