Private
Public Access
0
0

refactor(audit): remove dead DSL parser (DSL files no longer produced)

The v2 postfix DSL parser (DSL_WORD_ARITY_V2, _atom, to_dsl_v2, parse_dsl_v2)
was implemented during the 14-phase DSL plan but never reached production:
run_audit() (line ~1217 after this change) only writes .md files (AUDIT_REPORT.md
plus per-aggregate markdowns via to_markdown/to_tree), never .dsl files. The DSL
parser carried latent arity bugs (DSL_WORD_ARITY_V2 declared 5 for 'result-coverage'
but writer emits 4; 4 for 'type-alias-coverage' but writer emits 3) which would
have caused silent parse failures.

Also removed the now-unused 'import re' statement (was only used by parse_dsl_v2).
The 'from datetime import date as date_mod' is retained (still used at line ~1259,
1275, 1291 in the markdown renderer).

Tests deleted in lockstep:
- tests/test_code_path_audit_phase78.py: test_dsl_word_arity_v2_14_new_words
- tests/test_code_path_audit_phase89.py: test_to_dsl_v2_includes_aggregate_kind_section,
  test_parse_dsl_v2_round_trip_aggregate_kind, test_parse_dsl_v2_malformed

Verification:
- grep -c 'to_dsl_v2|parse_dsl_v2|DSL_WORD_ARITY_V2' src/code_path_audit.py = 0
- 127 of 127 remaining tests pass (was 131; -4 tests deleted)
This commit is contained in:
2026-06-24 09:57:17 -04:00
parent 59f48d1a0a
commit b385cd441b
3 changed files with 0 additions and 187 deletions
-15
View File
@@ -67,7 +67,6 @@ from src.code_path_audit import (
compute_type_alias_coverage,
aggregate_cross_audit_findings,
run_all_cross_audit_reads,
DSL_WORD_ARITY_V2,
)
from src.result_types import Result, ErrorInfo, ErrorKind
@@ -206,17 +205,3 @@ def test_run_all_cross_audit_reads_partial() -> None:
result = run_all_cross_audit_reads(tmp)
assert "audit_weak_types" in result
assert "audit_exception_handling" in result
# Phase 8 Task 8.1 test
def test_dsl_word_arity_v2_14_new_words() -> None:
"""DSL_WORD_ARITY_V2 has 14 new tagged words."""
expected_words = {
"kind", "mem-dim", "fn-ref", "access-pattern", "ap-evidence",
"frequency", "freq-evidence", "result-coverage", "type-alias-coverage",
"cross-audit-finding", "cross-audit-findings", "decomp-cost",
"opt-candidate", "is-candidate",
}
assert expected_words.issubset(set(DSL_WORD_ARITY_V2.keys()))
assert DSL_WORD_ARITY_V2["kind"] == 1
assert DSL_WORD_ARITY_V2["fn-ref"] == 4
assert DSL_WORD_ARITY_V2["decomp-cost"] == 8