tui — Context Budget

tui — Context Budget A data-flow diagram generated by Archify. 01 / Input 02 / Budget 03 / Gate 04 / Assemble Operator prompt · new input · 01 / Input Operator prompt new input Session history · old context · 01 / Input Session history old context prune-context · 32k tokens · 02 / Budget · 4 chars/token prune-context 32k tokens 4 chars/token allowed-tool? · sh git cat ls · 03 / Gate · refuse root allowed-tool? sh git cat ls refuse root sanitize-output · strip ANSI · 03 / Gate · truncate sanitize-output strip ANSI truncate assemble · SSE chunks · 04 / Assemble · parallel assemble SSE chunks parallel Reply · to operator · 04 / Assemble Reply to operator new input unbounded old context unbounded budgeted bounded 32k raw output unbounded tool result gated clean chunks bounded assembled reply Legend primary data policy / PII data store data flow

Deterministic budget

  • • Token estimate is chars/4 — crude, predictable, testable
  • • Overflow truncates with a visible marker, never silently

Gate before assemble

  • • Root and off-list tools are refused before execution
  • • ANSI escapes are stripped so output cannot repaint the terminal