fix(impact,history): tests field false-flagged all files + circular_deps_count always 0#208
Merged
Merged
Conversation
|
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.
|
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.



Found while auditing whether CodeLens's other umbrella commands (impact, history) actually help with real source audit.
Bug 1 (
impact_engine.py): thetestsfield inimpact --check impactoutput listed every affected source file as a "test file" — turned out the Rust/Python_testsuffix 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_countin history snapshots always read 0 even whencircular_deps(populated from the samedetect_circular()call) had entries — wrong dict key (cycle_countvs actualtotal_cycles).dashboard_engine.pyreads this same field so it's fixed too, automatically.Verified both against Coretax-Auto-Downloader extension:
test_files_foundwent from 4 (false) to 0 (correct, no.test.tsexists forsignInWithGoogle);circular_deps_countwent from 0 to 8 (matchingdeps --check circular'stotal_cycles).Test suite: 1 pre-existing failure (
test_history_dir_path, Windows path separator\vs/) confirmed unrelated.