Skip to content

fix(impact,history): tests field false-flagged all files + circular_deps_count always 0#208

Merged
Wolfvin merged 1 commit into
mainfrom
fix/impact-tests-and-history-circular
Jul 11, 2026
Merged

fix(impact,history): tests field false-flagged all files + circular_deps_count always 0#208
Wolfvin merged 1 commit into
mainfrom
fix/impact-tests-and-history-circular

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Found while auditing whether CodeLens's other umbrella commands (impact, history) actually help with real source audit.

Bug 1 (impact_engine.py): the tests field in impact --check impact output listed every affected source file as a "test file" — turned out the Rust/Python _test suffix candidate degenerated into the original filename for any non-.rs/.py file (str.replace no-op), which trivially exists, so it always matched.

Bug 2 (history_engine.py): circular_deps_count in history snapshots always read 0 even when circular_deps (populated from the same detect_circular() call) had entries — wrong dict key (cycle_count vs actual total_cycles). dashboard_engine.py reads this same field so it's fixed too, automatically.

Verified both against Coretax-Auto-Downloader extension: test_files_found went from 4 (false) to 0 (correct, no .test.ts exists for signInWithGoogle); circular_deps_count went from 0 to 8 (matching deps --check circular's total_cycles).

Test suite: 1 pre-existing failure (test_history_dir_path, Windows path separator \ vs /) confirmed unrelated.

@Wolfvin Wolfvin merged commit 929183b into main Jul 11, 2026
@Wolfvin Wolfvin deleted the fix/impact-tests-and-history-circular branch July 11, 2026 18:37
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…eps_count always 0

1. impact_engine.py: test_patterns included
   f.replace('.rs','_test.rs').replace('.py','_test.py') unconditionally.
   For any non-Rust/Python file (e.g. .ts), neither replace matches, so this
   candidate degenerates into the original filename f itself — which
   trivially exists on disk, so EVERY affected file got misclassified as
   its own test file. Found via real validation: impact --name
   signInWithGoogle listed calculator_widget.ts, errors.ts, sidepanel.ts as
   'tests', none of which are test files. Fixed by gating the Rust/Python
   candidates on actual extension match.

2. history_engine.py: circular_deps_count read circ.get('cycle_count', 0),
   but detect_circular() returns 'total_cycles', never 'cycle_count' — so
   this metric silently stayed 0 regardless of how many cycles existed.
   Found via real validation: circular_deps_count read 0 while the
   circular_deps list (populated from the same detect_circular() call,
   right below) had 5 entries. dashboard_engine.py reads this same field
   from the snapshot metrics dict, so it inherits the fix automatically.
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant