You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unreadable < 0 case implies log_files_parsed > log_files_found. This can never be true because get_vscode_summary constructs the accumulator as:
acc=_SummaryAccumulator(log_files_found=len(logs)) # parsed starts at 0forlog_path, file_idinlog_ids:
try:
...
exceptOSError:
continue# parsed NOT incremented on failureacc.log_files_parsed+=1# incremented only on success
log_files_parsed starts at zero and is only incremented on successful reads; it can never exceed log_files_found = len(logs). The unreadable < 0 guard was likely added as a defensive measure when the counts were computed separately, but the invariant parsed ≤ found is now guaranteed by construction.
Impact
The dead branch is harmless but:
Misleads future readers into thinking parsed > found is a realistic runtime state.
The companion test test_inconsistent_counts_shown_when_parsed_exceeds_found in test_vscode_report.py exercises this impossible state, adding noise to the test suite and coverage numbers without guarding against a real regression.
The docstring on _format_log_files_line says "surfacing unreadable or inconsistent counts" — the second clause documents behaviour that can't occur.
Fix
vscode_report.py — remove the if unreadable < 0: branch and update the docstring to drop the "inconsistent counts" reference:
tests/copilot_usage/test_vscode_report.py — remove test_inconsistent_counts_shown_when_parsed_exceeds_found entirely (it tests an impossible state and has no value as a regression guard).
Testing Requirement
After the removal:
Verify the remaining two test cases (test_unreadable_files_shown_when_found_exceeds_parsed and test_happy_path_no_unreadable_annotation) still pass — they cover the only two real branches.
make check must pass (lint + typecheck + all tests).
No new test is needed: the removed branch is unreachable by design.
Warning
⚠️ Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
pypi.org
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
Root Cause
_format_log_files_lineinvscode_report.pyhas three branches:The
unreadable < 0case implieslog_files_parsed > log_files_found. This can never be true becauseget_vscode_summaryconstructs the accumulator as:log_files_parsedstarts at zero and is only incremented on successful reads; it can never exceedlog_files_found = len(logs). Theunreadable < 0guard was likely added as a defensive measure when the counts were computed separately, but the invariantparsed ≤ foundis now guaranteed by construction.Impact
The dead branch is harmless but:
parsed > foundis a realistic runtime state.test_inconsistent_counts_shown_when_parsed_exceeds_foundintest_vscode_report.pyexercises this impossible state, adding noise to the test suite and coverage numbers without guarding against a real regression._format_log_files_linesays "surfacing unreadable or inconsistent counts" — the second clause documents behaviour that can't occur.Fix
vscode_report.py— remove theif unreadable < 0:branch and update the docstring to drop the "inconsistent counts" reference:tests/copilot_usage/test_vscode_report.py— removetest_inconsistent_counts_shown_when_parsed_exceeds_foundentirely (it tests an impossible state and has no value as a regression guard).Testing Requirement
After the removal:
test_unreadable_files_shown_when_found_exceeds_parsedandtest_happy_path_no_unreadable_annotation) still pass — they cover the only two real branches.make checkmust pass (lint + typecheck + all tests).Warning
The following domain was blocked by the firewall during workflow execution:
pypi.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.