Adds a gate in _run_investigation that skips the survey API call when a target has both fewer than _SURVEY_MIN_FILES (5) files AND fewer than _SURVEY_MIN_DIRS (2) directories. AND semantics handle the deep-narrow edge case correctly: a target with 4 files spread across 50 directories still gets a survey because dir count amortizes the cost across 50 dir loops. When skipped, _default_survey() supplies a synthetic dict with confidence=0.0 — chosen specifically so _filter_dir_tools() never enforces skip_tools from a synthetic value. The dir loop receives a generic "small target, read everything" framing in its prompt and keeps its full toolbox. Reorders _discover_directories() to run before the survey gate so total_dirs is available without a second walk. #46 tracks revisiting the threshold values with empirical data after Phase 2 ships and we've run --ai on a variety of real targets. Smoke tested on a 2-file target: gate triggers, default survey substituted, dir loop completes normally. Adds 4 unit tests for _default_survey() covering schema, confidence guard, filter interaction, and empty skip_tools. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| ai.py | ||
| ast_parser.py | ||
| cache.py | ||
| capabilities.py | ||
| code.py | ||
| disk.py | ||
| filetypes.py | ||
| prompts.py | ||
| recency.py | ||
| report.py | ||
| tree.py | ||
| watch.py | ||