Formalize the Asteria Qt text layout engine behavior and establish
comprehensive test coverage across all 94 Allium specification
obligations for two-phase layout, Knuth-Plass line breaking, and
reading session state management.
- Add `specs/text-layout-engine.allium` detailing layout lifecycle,
generation monotonicity, viewport metrics, and contrast safety.
- Implement structural equality operators (`operator==`) across layout
domain value types (`BoxStyle`, `InlineItem`, `BlockItem`,
`ContentChunk`, `KnuthPlass::Item`, positioned line/run elements,
and `BookPosition`) to enable deterministic assertion testing.
- Introduce `TextLayoutEngineSpecTest` verifying entity fields, value
equality, enum comparability, contract signatures, config defaults,
lifecycle state transitions, rules, and invariants.
- Register `TextLayoutEngineSpecTest` in `CMakeLists.txt` and update
test inventory in `AGENTS.md`.
Formalize the behavioral specification for off-thread Knuth-Plass text
chunk layout and virtualized QML rendering in specs/knuth-plass-rendering.allium,
and introduce a test suite covering all 66 specification obligations across
value types, state machine transitions, invariants, and surface contracts.
To satisfy the specification's precondition and invariant contracts:
- Validate and clamp initial restore chunk bounds when opening documents
in ReadingModel to ensure anchor chunks remain strictly within bounds.
- Guard scroll position updates against negative and out-of-bounds chunk
indices to honor the ScrollPositionChanged preconditions.
- Emit positionSaved on publisher color toggles to fulfill the
PositionPersisted contract without triggering unnecessary relayouts.
- Register KnuthPlassRenderingSpecTest in CMakeLists.txt and document the
spec and test hierarchy in AGENTS.md.