magi-code 0.63.4

Repository-aware CLI coding agent for terminal work
Documentation
<!--THIS IS A GENERATED FILE - DO NOT MODIFY DIRECTLY, FOR MANUAL ADJUSTMENTS UPDATE `../../../AGENTS_CUSTOM.MD`-->
# src/tui/render KNOWLEDGE BASE

## OVERVIEW
Ratatui projection layer for Mission Control panes, modals, transcript cards, activity details, prompt input, and redacted display text.

## WHERE TO LOOK
| Need | Path | Signal |
|------|------|--------|
| Render entry | `mod.rs` | `draw`, pane dispatch, modal helpers, shared block/text-area utilities |
| Transcript pane | `transcript.rs` | visible transcript lines, scroll labels, context usage title, selection projection |
| Activity panes | `activity.rs` | activity tree rows, selected detail, `DisplayLine` → Ratatui spans, secret redaction |
| Prompt pane | `prompt.rs` | input wrapping, cursor/selection spans, bash-mode styling, autocomplete overlay |
| Header/help | `header.rs` | status bar and help projection |
| Render tests | `tests/`, `primary_agent_render_tests.rs` | TestBackend assertions for layout, modals, prompt, activity, transcript |

## CONVENTIONS
- Render functions consume `&MissionControlState`; no mutation, no event application, no channel sends.
- Keep projection deterministic: same state + same `Rect` = same buffer.
- Use `MATRIX_GREEN` and shared helpers; avoid one-off styles unless visual state demands it.
- Convert domain text through display/rendering helpers before spans; preserve markdown/code/diff roles.
- Redact credentials/auth material before any pane, modal, toast, detail body, or test snapshot sees it.
- Keep modal geometry helpers in `mod.rs`; expose area calculators only when input/tests need hit targets.
- Guard zero-width/zero-height panes; tiny terminal draws must return, not panic.
- Use saturating arithmetic for terminal coordinates, scroll offsets, and wrap widths.
- Keep transcript tail/scrollback windowed; do not project entire large histories per frame.
- Selection/cursor math must respect grapheme boundaries and display columns.
- Activity detail uses `DisplayLine` roles so embedded diffs keep diff styling.
- Prompt rendering owns visual cursor only; input editing semantics live outside render.
- Tachyonfx/configurable visuals must stay display-only per ADR-0029; no runtime truth from effects.
- Add or adjust focused TestBackend tests for visual labels, scroll math, modal areas, redaction, and tiny panes.

## ANTI-PATTERNS
- Do not mutate `MissionControlState` from render code.
- Do not call provider, tool, session, config-write, or worker code from render code.
- Do not persist layout, focus, scroll, cursor blink, modal state, or render caches from this directory.
- Do not render raw API keys, OAuth tokens, auth codes, bearer headers, account IDs, credential JSON, or unredacted URLs.
- Do not render unsanitized control sequences from tool output, diffs, errors, session previews, or prompts.
- Do not duplicate wrapping/card/projection logic in multiple panes; use shared helpers or existing transcript/display modules.
- Do not treat `TestBackend` output as real terminal/TTY performance proof.
- Do not add broad abstractions for one pane; keep widget helpers local until reused.