feat(ai): skip survey pass for tiny targets (#7) #47

Closed
archeious wants to merge 0 commits from feat/issue-7-survey-min-size into main
Owner

Closes #7

Gate skips survey when files < 5 AND dirs < 2. AND semantics handle deep-narrow targets correctly. _default_survey() with confidence=0.0 ensures the synthetic value never triggers _filter_dir_tools enforcement. #46 tracks revisiting thresholds with empirical data.

Closes #7 Gate skips survey when files < 5 AND dirs < 2. AND semantics handle deep-narrow targets correctly. _default_survey() with confidence=0.0 ensures the synthetic value never triggers _filter_dir_tools enforcement. #46 tracks revisiting thresholds with empirical data.
archeious added 1 commit 2026-04-07 04:19:34 +00:00
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.
archeious closed this pull request 2026-04-07 04:19:38 +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#47
No description provided.