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:
ed
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
-24
View File
@@ -21,10 +21,8 @@ from src.code_path_audit import (
DecompositionCost,
OptimizationCandidate,
AggregateProfile,
to_dsl_v2,
to_markdown,
to_tree,
parse_dsl_v2,
AGGREGATES_IN_SCOPE,
CANDIDATE_AGGREGATES,
synthesize_aggregate_profile,
@@ -56,14 +54,6 @@ def _make_profile(name: str = "Metadata", kind: str = "typealias") -> AggregateP
)
# Phase 8 Tasks 8.2-8.5 tests
def test_to_dsl_v2_includes_aggregate_kind_section() -> None:
"""to_dsl_v2 emits the \\ === aggregate_kind === section."""
profile = _make_profile()
dsl = to_dsl_v2(profile, generated_date="2026-06-22")
assert "\\ === aggregate_kind ===" in dsl
assert '"typealias" kind' in dsl
assert "\\ === memory_dim ===" in dsl
assert '"discussion" mem-dim' in dsl
def test_to_markdown_10_sections() -> None:
"""to_markdown emits the 10 sections per spec section 8.1."""
@@ -87,20 +77,6 @@ def test_to_tree_box_drawing() -> None:
assert "Metadata" in tree
assert "kind: typealias" in tree
def test_parse_dsl_v2_round_trip_aggregate_kind() -> None:
"""parse_dsl_v2(to_dsl_v2(profile)) recovers the aggregate_kind section."""
profile = _make_profile()
dsl = to_dsl_v2(profile)
parsed = parse_dsl_v2(dsl)
assert isinstance(parsed, Result)
assert "typealias" in str(parsed.data)
def test_parse_dsl_v2_malformed() -> None:
"""parse_dsl_v2 returns Result.ok for empty input (no tagged words)."""
result = parse_dsl_v2("\\ empty comment only\n")
assert result.ok
assert result.data == {"_sections": []}
# Phase 9 Tasks 9.1-9.6 tests
def test_aggregates_in_scope_10_real() -> None:
"""AGGREGATES_IN_SCOPE has 10 real aggregates."""