luminos/luminos_lib
Jeff Smith 8fb2f90678 feat(ai): skip survey pass for tiny targets (#7)
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.
2026-04-06 22:19:25 -06:00
..
__init__.py chore: initial project scaffold 2026-03-30 09:57:11 -06:00
ai.py feat(ai): skip survey pass for tiny targets (#7) 2026-04-06 22:19:25 -06:00
ast_parser.py refactor: extract AST parsing into luminos_lib/ast_parser.py 2026-03-30 14:34:02 -06:00
cache.py feat(cache): add low_confidence_entries() query to CacheManager (#3) 2026-04-06 21:13:58 -06:00
capabilities.py chore: remove dead clear_cache from ai.py, deduplicate CACHE_ROOT 2026-03-30 13:52:38 -06:00
code.py feat: in-place per-file progress for classify, count, and large-file steps 2026-04-06 14:26:37 -06:00
disk.py feat: add -x/--exclude flag to exclude directories from scan and AI analysis 2026-04-06 14:32:12 -06:00
filetypes.py feat: add -x/--exclude flag to exclude directories from scan and AI analysis 2026-04-06 14:32:12 -06:00
prompts.py feat(ai): wire survey output into dir loop (#6) 2026-04-06 22:07:12 -06:00
recency.py feat: add -x/--exclude flag to exclude directories from scan and AI analysis 2026-04-06 14:32:12 -06:00
report.py feat: add chain-of-thought observability tools 2026-03-30 13:02:19 -06:00
tree.py feat: add -x/--exclude flag to exclude directories from scan and AI analysis 2026-04-06 14:32:12 -06:00
watch.py feat: add --watch mode with change diffing 2026-03-30 09:57:39 -06:00