feat(ai): wire survey output into dir loop (#6) #45

Closed
archeious wants to merge 0 commits from feat/issue-6-wire-survey into main
Owner

Closes #6

Prompt injection + hard tool-schema filtering (gated on confidence >= 0.5). Smoke test: zero run_command invocations, context budget no longer exhausted, investigation completes. 14 new unit tests for the pure helpers.

Closes #6 Prompt injection + hard tool-schema filtering (gated on confidence >= 0.5). Smoke test: zero run_command invocations, context budget no longer exhausted, investigation completes. 14 new unit tests for the pure helpers.
archeious added 1 commit 2026-04-07 04:07:21 +00:00
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.
archeious closed this pull request 2026-04-07 04:07:25 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archeious/luminos#45
No description provided.