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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user