pub fn extract_summary(content: &str) -> StringExpand description
Extract a summary from an agent’s content output.
Why: Downstream workflow phases need a concise summary (~200-500 words)
rather than 30k chars of raw code. Agents are instructed to append a
## Summary section; this helper extracts it so the engine can forward
only the summary into subsequent phase templates.
What: Looks for a case-insensitive ## Summary heading at the end of the
content. If found, returns everything AFTER that header (trimmed). If not
found, returns the first 500 chars of content as a fallback.
Test: See extract_summary_finds_trailing_section and
extract_summary_fallback_uses_prefix.