magi-code 0.80.0

Repository-aware CLI coding agent for terminal work
Documentation
# State agent guide

## Where to look

| Task | Location |
| --- | --- |
| `MissionControlState`, shared models, cache access | `mod.rs` |
| Output events and streaming reconciliation | `output_events.rs` |
| Activity graph and tool/subagent links | `activity_state.rs` |
| Transcript navigation and selection | `transcript_state.rs` |
| Prompt lifecycle and display commands | `prompt_state.rs`, `prompt_actions.rs` |
| Modal selection/input models | `modal.rs` |
| Pane layout and focus | `layout.rs` |
| Agent and provider-context views | `primary_agent_state.rs`, `subagent_viewer.rs`, `provider_context.rs` |

## Local contracts

- `apply_output_event` lives in `output_events.rs`, not the facade. Final assistant/thinking events reconcile text after dropped preview deltas.
- Finish live redaction and control-sanitizer state at hard stream boundaries before appending unrelated rows; fragments must not cross messages.
- Preserve activity ids used by tree selection, transcript links, and active-tool replacement. Explicit parents take precedence over inferred ancestry; reject cycles.
- Invalidate affected transcript/activity caches when source rows change. Normalize tool indices, selected rows, and scroll offsets after removals or replacements.
- `TranscriptEntries` owns row metadata and prunes it during append/removal. State handles selection and targeted render-cache eviction; activity ingestion refreshes typed tool/subagent cards.
- The subagent viewer caches tabs, subtree cards, and row offsets. Reparenting invalidates old and new ancestry; keep visible-row rendering and bounded card projections.
- Modal previews are navigation summaries; modal structs hold selection/input affordances, not ownership of their durable workflows.
- Extend the existing reducer/transition tests in `tests/` or the owning module when changing these rules.