Files
Hmbown 0de86c7836 test(tui): pin injection sizes — child envelope, parent surface, turn_meta
R6 (finish-operator 2026-08-02): the only envelope number anyone quoted
was a stale fixture comment (workflows/stopship.workflow.js:1-5,
17,457–17,550 tokens from an old live run). Nothing failed when the
assembled payloads grew. Three regressions now build — never send —
the real payloads and pin them at measured-current +10%:

- read_only_child_envelope_stays_within_measured_ceiling: scout system
  prompt + seed messages + child tool catalog = 80,856 bytes measured
  (~20k tokens — the old 17.5k figure was already low); ceiling 89,000.
- parent_agent_surface_stays_within_measured_ceiling: BASE_PROMPT +
  full parent tool catalog = 72,679 bytes measured; ceiling 80,000.
- turn_meta_block_stays_within_measured_ceiling: per-turn <turn_meta>
  block via the production snapshot path = 254 bytes measured
  (includes the new sandbox-posture line); ceiling 280.

Each failure message says how to raise the ceiling honestly (re-measure
in the same commit). The stopship fixture comment now points at the
pinned test instead of the stale token figure.

Proof the ceilings bite: a scratch diff padding BASE_PROMPT +15,000B,
the child system prompt +17,000B, and turn_meta +1 line (~+20% each)
failed all three tests; reverted, all green.

Verification:
- cargo fmt --check -p codewhale-tui: clean
- cargo test -p codewhale-tui --bin codewhale-tui -- turn_meta_block_stays
  read_only_child_envelope parent_agent_surface: 4 passed; 0 failed
2026-08-02 09:13:34 -07:00
..