2026-06-05 18:31:09 +01:00
# Gjallar Architecture
## Objective
Gjallar owns framebuffer-native, multi-scale TUI composition: turning many
surface inputs into one dense, inspectable operator display where different
regions may use different text resolutions.
## Authority Map
- Owner: Gjallar owns display composition, pane partitioning, per-pane virtual
text grids, font-scale selection, framebuffer lowering, and future sparse
2026-06-07 05:28:38 +01:00
refresh output. Gjallar also owns local cursor state, title-bar hit testing,
and minimized/restored panel state.
2026-06-05 18:31:09 +01:00
- Inputs: provider catalogs, provider-owned surface trees, display dimensions,
2026-06-07 05:28:38 +01:00
font assets, runtime flags, mouse input, Odin's canonical marquee tape, and
eventually direct CultMesh subscriptions.
2026-06-05 18:31:09 +01:00
- Outputs: `gjallar.overview` composition state, visible framebuffer frames,
2026-06-07 05:28:38 +01:00
cursor presentation, minimized panel presentation, and renderer telemetry.
2026-06-07 00:13:01 +01:00
- Derived state: pane weights, pixel rectangles, chosen font sizes, one-row
2026-06-07 04:39:12 +01:00
gutter blocks, continuous readable marquee ribbon positions, dirty rectangles,
2026-06-07 05:28:38 +01:00
glyph runs, title-bar hit regions, local minimized-panel keys, and compact
agent-readable projections.
2026-06-05 18:31:09 +01:00
- Forbidden writers: discovery systems do not decide Gjallar layout; providers
do not tune themselves for Nightwing; framebuffer backends do not invent
2026-06-07 00:13:01 +01:00
provider truth; Gjallar does not derive marquee content from provider status
2026-06-07 05:28:38 +01:00
summaries; Odin and providers do not own Nightwing-local minimized state.
2026-06-05 18:31:09 +01:00
- Shared paths: full-frame rendering, sparse refresh, future browser previews,
and agent text capture should lower the same overview model.
- Deletion line: any code that both discovers provider truth and decides final
screen composition belongs on one side or the other. Gjallar shows; discovery
systems see.
## Current Pipeline
```text
Odin provider catalog
-> display provider selection
-> provider surface fetch
2026-06-07 00:13:01 +01:00
-> canonical marquee tape passthrough
2026-06-05 18:31:09 +01:00
-> synthetic gjallar.overview surface
-> EveNode panel extraction
-> weighted AABB packing
2026-06-07 05:28:38 +01:00
-> local minimized-state application
-> title-bar hit-region emission
2026-06-07 00:13:01 +01:00
-> one-row gutter cell plan
2026-06-07 04:39:12 +01:00
-> continuous readable marquee ribbon path
2026-06-05 18:31:09 +01:00
-> per-panel text pressure estimate
-> PSF font selection
-> frame draw commands
-> BGRA framebuffer present
```
## Target Pipeline
```text
SurfaceSource[]
-> GjallarOverview
-> PaneTree
-> PaneGrid[]
-> RenderPlan
-> backend
```
Backends:
- `FramebufferBackend` : full BGRA frame writes, current implementation.
- `SparseCellBackend` : dirty cell/glyph/rect pipe for high-frequency remote or
terminal targets.
- `AgentTextBackend` : token-efficient navigation and panel capture for agents.
## First Product Claim
Gjallar is not a terminal multiplexer and not a dashboard theme. It is a
multi-resolution text compositor. The important gap is that each pane can become
its own virtual terminal scale while still belonging to one coherent display.