Skip to content

Appendix B — Engine Guidelines

Core Runtime Guarantees

Recommended guarantees for robust engines:

  1. Graph data is immutable after load and validation.
  2. State mutation happens only in one update path.
  3. History is maintained as a strict LIFO stack.
  4. Rendering is deterministic for equivalent state.

TEA-Oriented Flow

Input Event -> Action -> Update(State) -> Render(View)

This flow keeps behavior testable and avoids hidden side effects.

Layout Templates and ratatui Mapping

These mappings are practical defaults, not protocol requirements.

Fireside layoutratatui Strategy
defaultVertical stack with standard margins.
centerSingle centered container with horizontal/vertical flex.
split-horizontalTwo-column Layout::horizontal split.
split-verticalTwo-row Layout::vertical split.
fullscreenSingle full-frame region, minimal chrome.
align-leftPrimary content constrained left, right gutter empty.
align-rightPrimary content constrained right, left gutter empty.
focus-codeHeader + code panel + optional output/status panel.
agendaTitle row + list rail + detail pane.
compareSymmetric two-column compare with shared header.
image-leftLeft media pane + right narrative pane.
image-rightLeft narrative pane + right media pane.

Container Rendering Guidance

For container blocks:

  • Treat children as a local composition tree.
  • Resolve container layout first, then render children in slots.
  • Preserve child order unless the selected layout explicitly reflows.

Extension Rendering Guidance

For extension blocks:

  • Dispatch on type when supported.
  • Render fallback when unsupported.
  • Never discard unsupported extension content silently.

Input and Error Strategy

  • Map key events to semantic actions before state updates.
  • Keep presenter-facing failures recoverable where possible.
  • Favor placeholders over crashes for content-level issues.