artifacts (tier 2)

This commit is contained in:
ed
2026-06-24 14:54:29 -04:00
parent 84c0b4ecc4
commit a18b8ad69c
5 changed files with 753 additions and 0 deletions
@@ -0,0 +1,49 @@
"""Add Revision History section to spec_v2.md (Task 4.3 of code_path_audit_polish_20260622).
Preserves CRLF line endings.
"""
from pathlib import Path
path = Path("conductor/tracks/code_path_audit_20260607/spec_v2.md")
data = path.read_bytes()
# Em-dash in UTF-8: 0xE2 0x80 0x94
EMDASH = b"\xe2\x80\x94"
old = (
b"- `conductor/tracks/result_migration_cruft_removal_20260620/` " + EMDASH +
b" the 100% complete result migration\r\n\r\n---\r\n\r\n**End of spec_v2.md.**\r\n"
)
new = (
b"- `conductor/tracks/result_migration_cruft_removal_20260620/` " + EMDASH +
b" the 100% complete result migration\r\n"
b"\r\n"
b"---\r\n"
b"\r\n"
b"## Revision History\r\n"
b"\r\n"
b"**2026-06-24 " + EMDASH + b" MVP pivot (follow-up: code_path_audit_polish_20260622).** The v2 spec described a 14-phase DSL implementation that never reached production. The actual shipped implementation is:\r\n"
b"\r\n"
b"- **MVP output:** A single `AUDIT_REPORT.md` (6797 lines, 311KB) with `summary.md` as a TOC pointer. Per-aggregate markdowns via `to_markdown` + `to_tree` are produced.\r\n"
b"- **DSL deprecated:** The v2 postfix DSL format (`to_dsl_v2` + `parse_dsl_v2`, `DSL_WORD_ARITY_V2`, `_atom`) was implemented but never produced. `run_audit()` writes `.md` files only. The DSL parser carried latent arity bugs (e.g. `DSL_WORD_ARITY_V2[\"result-coverage\"] = 5` but `to_dsl_v2` emits 4 args). Removed in `code_path_audit_polish_20260622` Task 2.2 (commit `b385cd44`).\r\n"
b"- **`compute_result_coverage` removed:** The function had a latent bug (`result_producers = total_producers` hardcoded to 100%). `synthesize_aggregate_profile` inlines its own `ResultCoverage(...)` construction. Removed in `code_path_audit_polish_20260622` Task 2.3 (commit `2561e4ea`).\r\n"
b"- **Test count:** 125 (was 131 in the v2 spec; -6 tests deleted across polish Tasks 2.2 and 2.3).\r\n"
b"- **Audit-gate state:** `audit_weak_types.py --strict` and `generate_type_registry.py --check` now pass (fixed in polish Phase 1). The 2 pre-existing violations (4 exception-handling + 7 Optional[T]) are documented as NG1/NG2 in the polish track's spec and explicitly out of scope.\r\n"
b"\r\n"
b"**No changes** to the v2 spec's overall design intent, the 13 aggregates, the 4-direction decomposition cost, or the cross-audit integration. The MVP pivot is purely about the OUTPUT format (markdown instead of DSL) and code-smell cleanup; the analytical core (PCG, MemoryDim, APD, CFE, cross-audit) is unchanged.\r\n"
b"\r\n"
b"---\r\n"
b"\r\n"
b"**End of spec_v2.md.**\r\n"
)
if old not in data:
raise SystemExit(f"old text not found (len={len(old)})")
data2 = data.replace(old, new, 1)
path.write_bytes(data2)
print(f"Wrote {len(data2) - len(data)} byte delta (was {len(data)}, now {len(data2)})")
# Verify CRLF preserved
crlf = data2.count(b"\r\n")
print(f"CRLF count after edit: {crlf}")
@@ -0,0 +1,7 @@
from pathlib import Path
p = Path("docs/reports/TRACK_COMPLETION_fix_test_failures_20260624.md")
data = p.read_bytes()
data2 = data.replace(b"\r\n", b"\n").replace(b"\n", b"\r\n")
p.write_bytes(data2)
crlf = data2.count(b"\r\n")
print(f"CRLF: {crlf} lines, {len(data2)} bytes")
@@ -0,0 +1,21 @@
import json
with open('tests/artifacts/tier2_state/code_path_audit_polish_20260622/weak_types_audit.json') as f:
data = json.load(f)
by_file = data['by_file']
cpa = [e for e in by_file if 'code_path_audit' in e['filename']]
print(f'code_path_audit files with findings: {len(cpa)}')
total = 0
for entry in cpa:
fname = entry['filename']
findings = entry.get('findings', [])
total += len(findings)
print(f'\n{fname}: {len(findings)} findings')
for f in findings:
line = f.get('line', '?')
cat = f.get('category', '?')
ctx = f.get('context', '')[:80]
ts = f.get('type_str', '')
print(f' line {line}: {cat} {ts} ctx={ctx}')
print(f'\nTotal findings: {total}')
@@ -0,0 +1,18 @@
import json
with open('tests/artifacts/tier2_state/code_path_audit_polish_20260622/weak_types_audit.json') as f:
cur = json.load(f)
print(f"Total: {cur['total_weak']}")
print(f"Files: {len(cur['by_file'])}")
print()
# Show each file with its findings to understand
for entry in cur['by_file']:
fname = entry['filename']
cnt = entry['weak_count']
findings = entry['findings']
cats = {}
for f in findings:
c = f['category']
cats[c] = cats.get(c, 0) + 1
print(f"{fname}: {cnt} cats={cats}")