luminos/tests
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 feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_ai_filter.py feat(ai): skip survey pass for tiny targets (#7) 2026-04-06 22:19:25 -06:00
test_cache.py feat(cache): add low_confidence_entries() query to CacheManager (#3) 2026-04-06 21:13:58 -06:00
test_capabilities.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_code.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_disk.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_filetypes.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_recency.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_report.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00
test_tree.py feat(tests): add unit test coverage for all testable modules (#37) 2026-04-06 16:57:26 -06:00