Add confidence + confidence_reason fields to cache entries. Enables later phases to prioritize re-investigation of uncertain entries.
Phase 2: Survey Pass
Lightweight pre-investigation pass. Agent characterizes the target before dir loops begin. Replaces hardcoded domain detection.
Planning pass allocates investigation depth per directory. Replaces fixed max_turns with a global turn budget the agent manages.
Resolution strategies beyond local files: web_search, package_lookup, fetch_url, ask_user. All gated behind --no-external.
Calibrate synthesis input and depth to target size: small/medium/large/xlarge tiers.
Grouping pass identifies logical subsystems from dir summaries. Final synthesis receives subsystem summaries, not hundreds of dir summaries.
Synthesis reframed from aggregation to conclusion-with-evidence. Agent forms hypothesis, finds confirming/refuting evidence, then submits.
Post-synthesis targeted re-investigation. Resolves gaps, contradictions, and low-confidence entries. Triggered by --refine flag.
Synthesis produces a superset of output fields; report formatter renders only populated ones. Output scales from minimal to comprehensive.