luminos/luminos_lib
Jeff Smith 2e3d21f774 feat(ai): wire survey output into dir loop (#6)
The survey pass now actually steers dir loop behavior, in two ways:

1. Prompt injection: a new {survey_context} placeholder in
   _DIR_SYSTEM_PROMPT receives the survey description, approach,
   domain_notes, relevant_tools, and skip_tools so the dir-loop agent
   has investigation context before its first turn.

2. Tool schema filtering: _filter_dir_tools() removes any tool listed
   in skip_tools from the schema passed to the API, gated on
   survey confidence >= 0.5. Control-flow tools (submit_report) are
   always preserved. This is hard enforcement — the agent literally
   cannot call a filtered tool, which the smoke test for #5 showed
   was necessary (prompt-only guidance was ignored).

Smoke test on luminos_lib: zero run_command invocations (vs 2 before),
context budget no longer exhausted (87k vs 133k), cost ~$0.34 (vs
$0.46), investigation completes instead of early-exiting.

Adds tests/test_ai_filter.py with 14 tests covering _filter_dir_tools
and _format_survey_block — both pure helpers, no live API needed.
2026-04-06 22:07:12 -06:00
..
__init__.py chore: initial project scaffold 2026-03-30 09:57:11 -06:00
ai.py feat(ai): wire survey output into dir loop (#6) 2026-04-06 22:07:12 -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