Skip to content

fix(flows): normalize changed_files to absolute paths for incremental flow detection#572

Open
itxaiohanglover wants to merge 1 commit into
tirth8205:mainfrom
itxaiohanglover:fix/incremental-flow-path-mismatch
Open

fix(flows): normalize changed_files to absolute paths for incremental flow detection#572
itxaiohanglover wants to merge 1 commit into
tirth8205:mainfrom
itxaiohanglover:fix/incremental-flow-path-mismatch

Conversation

@itxaiohanglover

Copy link
Copy Markdown

Fixes #569

Problem

incremental_trace_flows() in flows.py filters re-detected entry points by comparing ep.file_path (absolute path from graph) against changed_file_set (relative paths from git diff --name-only). This format mismatch means ep.file_path in changed_file_set is always False, so new entry points are never found during incremental updates.

The same mismatch affects the SQL query on line 473: WHERE n.file_path IN ({placeholders}) compares relative paths against absolute paths in the database.

What changed

Added one line at the start of incremental_trace_flows() to normalize changed_files to absolute paths:

changed_files = [os.path.abspath(f) for f in changed_files]

This fixes both:

  1. The SQL query (line 473) — now compares absolute vs absolute
  2. The set comparison (line 513) — ep.file_path in changed_file_set now matches

No existing comments modified. No behavior change when paths are already absolute.

Validation

  • The issue reporter confirmed that run_postprocess_tool (non-incremental path) works correctly — this is because it doesn't filter by changed_files
  • After this fix, the incremental path uses the same absolute path format as the graph storage

… flow detection

git diff --name-only returns relative paths (e.g. 'src/main.py') but
the graph stores absolute file_path values (e.g. '/home/user/repo/src/main.py').
The comparison ep.file_path in changed_file_set always failed, causing
incremental_trace_flows to never find new entry points.

Fix: normalize changed_files to absolute paths at the start of
incremental_trace_flows. This fixes both the SQL query (line 473) and
the set comparison (line 513).

Fixes tirth8205#569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incremental flow re-detection never finds new entry points (relative vs absolute path mismatch)

1 participant