feat: --components flag for targeted component analysis#16
Open
hankbobtheresearchoor wants to merge 2 commits into
Open
feat: --components flag for targeted component analysis#16hankbobtheresearchoor wants to merge 2 commits into
hankbobtheresearchoor wants to merge 2 commits into
Conversation
Adds a --components CLI flag that accepts a comma-separated list of component names and restricts analysis to only those components (plus their transitive dependencies resolved from graph.json). Key changes: - resolve_component_filter() expands requested names to include transitive deps via BFS on the dependency graph edges - analyze() skips discovery and graph building when component_filter is set, reusing existing artifacts instead - read_discovery() prunes depth_order to only include filtered components, so the analysis pipeline only spawns subagents for them - build_analysis_pipeline() accepts and passes component_filter as initial Burr state This enables incremental CI workflows: detect changed files, map to affected components, and re-analyze only the delta instead of the full codebase.
When the repo directory name matches the service_name (e.g. /tmp/d-inference), the work_dir /tmp/d-inference collides with the repo path, causing _setup_project_dir to refuse symlinking. Detect this and append '-flashlight' suffix to the service_name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--componentsCLI flag for targeted analysis of specific components instead of full codebase sweeps.Motivation
Running the full 9-component RAG pipeline on every commit is brute force. When only 1-2 components changed between commits, re-analyzing everything wastes tokens and time. The existing
--last-sha/--head-shaincremental mode soft-hints to the LLM which components changed, but there is no hard filter at the execution level — the agent can still waste tokens analyzing unchanged components.Changes
agent/cli.py--componentsflag: comma-separated component names (e.g.,--components coordinator,provider-api)resolve_component_filter(): validates names againstcomponents.json, then expands to include transitive dependencies via BFS ongraph.jsonedges (if component A depends on B, analyzing A requires B's upstream context)analyze()skips discovery and graph building whencomponent_filteris set, reusing existing artifacts insteadagent/burr_app.pyread_discovery()applies the filter: prunesdepth_orderto only include filtered components, so the analysis pipeline only spawns subagents for thembuild_analysis_pipeline()acceptscomponent_filterparameter, passed as initial Burr stateUsage
# Targeted analysis (specific components only, requires existing artifacts) flashlight --repo /path/to/repo --output ./artifacts/company/eigenda \ --components coordinator,provider-api --head-sha def5678CI Integration Pattern
The intended workflow for the knowledge-maintenance cron:
git diff --name-onlybetween SHAscomponents.jsonroot_path prefix matching — same logic as the existingmap_files_to_components())--components <affected>instead of full sweepThis keeps flashlight as the engine but makes it callable per-component instead of per-repo.