refactor(audit): remove dead compute_result_coverage

compute_result_coverage() was implemented during the 14-phase plan but is
never called: synthesize_aggregate_profile() (now at ~line 1075) inlines
its own ResultCoverage construction via the actual AST analysis at
~line 1135-1145. The function has a latent bug at line 754 (was):
  result_producers = total_producers
which hardcodes result_producers to 100% of total_producers regardless of
input — making the function return meaningless numbers.

Tests deleted in lockstep:
- tests/test_code_path_audit_phase78.py: test_compute_result_coverage_no_producers
- tests/test_code_path_audit_phase78.py: test_compute_result_coverage_full

The 'compute_result_coverage' import was also removed from the test file's
import block.

Verification:
- grep -c 'compute_result_coverage' src/code_path_audit.py = 0
- grep -c 'compute_result_coverage' tests/ = 0
- 125 of 125 remaining tests pass (was 127; -2 tests deleted)
This commit is contained in:
ed
2026-06-24 10:00:08 -04:00
parent facaceba36
commit 2561e4ea9e
2 changed files with 0 additions and 52 deletions
-22
View File
@@ -63,7 +63,6 @@ from src.code_path_audit import (
read_input_json,
INPUT_JSON_CONTRACTS,
find_enclosing_function,
compute_result_coverage,
compute_type_alias_coverage,
aggregate_cross_audit_findings,
run_all_cross_audit_reads,
@@ -123,28 +122,7 @@ def test_find_enclosing_function_no_match() -> None:
result = find_enclosing_function(file="src/y.py", line=15, function_refs=refs)
assert result is None
def test_compute_result_coverage_no_producers() -> None:
"""compute_result_coverage returns 0/0 when there are no producers."""
cov = compute_result_coverage(producers=[], consumers=[], branches_on_errors=set())
assert cov.total_producers == 0
assert cov.result_producers == 0
assert cov.total_consumers == 0
assert cov.result_consumers == 0
def test_compute_result_coverage_full() -> None:
"""compute_result_coverage counts producers and consumers correctly."""
f1 = FunctionRef(fqname="src.a", file="src/a.py", line=1, role="producer")
f2 = FunctionRef(fqname="src.b", file="src/b.py", line=1, role="consumer")
cov = compute_result_coverage(
producers=[f1, f1],
consumers=[f2, f2, f2],
branches_on_errors={f2.fqname},
)
assert cov.total_producers == 2
assert cov.result_producers == 2
assert cov.total_consumers == 3
assert cov.result_consumers == 1
assert "100%" in cov.summary
def test_compute_type_alias_coverage_no_sites() -> None:
"""compute_type_alias_coverage returns 0/0/0 when there are no sites."""