Algorithm Routes
Project-specific computation invariants, authorities, and evidence.
HEAD a63778eLoad the invariant that selects the implementation and nearest deterministic test:
| Concern | Project invariant | Authority and evidence |
|---|---|---|
| ANSI/Unicode text and Canvas cells | This is the LLM–human communication boundary; syntax, cell layout, Canvas adaptation, and serialization form one semantic round trip. | LLM–Human Text Protocol |
| Canvas coordinates | @chardesk/rendering owns Cell/viewport projection. Anchored zoom preserves the screen anchor; host snapping resolves a wide grapheme to its leading cell. | viewport.ts, coordinates.ts, and canvas-coordinates.test.ts |
| Frame and render scheduling | One scheduler coalesces keyed work and unions layer invalidation bits. Render inputs invalidate only the affected background, scratch, or overlay layer. | FrameScheduler.ts, CanvasRenderManager.ts, scheduler tests, and render tests |
| Camera and edge scroll | The camera owns imperative viewport queues, constraints, and animation cancellation. Fit consumes viewport insets; eligible edge drag pans through the shared frame scheduler after its delay. | CanvasCameraManager.ts, CanvasEdgeScrollManager.ts, camera tests, and edge-scroll tests |
| Static-grid selection | @chardesk/cell-core owns range normalization, row spans, clipping, and Cell-footprint expansion. The Selection domain owns active-cell and product transitions. | range.ts, static-grid.ts, and staticGridModel.test.ts |
| Static-grid text input | A local input session owns its explicit origin. Enter and bounded wrapping return to that column; Cell content never implies a line or paragraph. | static-grid-input-session.ts and staticGridInputSession.test.ts |
| Static-grid deletion | One directional delete plan resolves Range priority, Cell targets, wide-grapheme anchors, and finite bounds. Canvas applies the plan as one document mutation and interaction transition. | static-grid-deletion.ts and staticGridDeletionCommands.test.ts |
| Slide deck and bounds | Sizes use positive integer columns and rows. Grid normalization canonicalizes, deduplicates, sorts, and removes overflow; resize reports and crops cells outside the new finite bounds. | grid.ts, deck.ts, and slides.test.ts |
| Retired Structured input | Legacy nodes are decoded and rendered once into deterministic CellPlane entries. No scene identity, layer behavior, or collaboration contract survives migration. | migrateLegacyStructuredDocument.ts and its nearest migration test |
Canvas/Yjs mutation, projection, history, and persistence direction remain owned by State and data flows.