mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-08-02 10:53:15 -05:00
Adds book/tools/audit/ — a five-stage editorial audit pipeline (SCAN -> PLAN -> FIX -> VERIFY -> REPORT) for the MIT Press round 1 style rules in book-prose-merged.md. Implements Phase A of the plan at /Users/VJ/Desktop/MIT_Press_Feedback/15_audit_loop/PLAN.md. Architecture. Five-stage cycle with hard stopping conditions and verification gating. Five safety checks before any file is written: no null bytes, no leftover sentinels, expected byte delta matches actual, quarto structural delta is zero, no new issues introduced. The byte-delta check alone would have caught the discarded bulk-edit run that prompted Pass 15. Files. protected_contexts.py is the load-bearing safety layer with LineWalker and inline_protected_spans (14 adversarial tests covering every failure mode from the discarded bulk run). ledger.py is the JSON schema. scan.py, fix_script_lane.py, verify.py, loop.py are the stage runners. Seven check modules cover vs_period, compound_prefix, percent_symbol, lowercase_prose_references, acknowledgements_spelling, binary_units, and h3_titlecase. Validation. h3_titlecase finds 609 in vol1 (within 2 of plan's expected 611). vs_period finds 0 in vol1 (matching pass 10b) and 16 in vol2 (real residuals). compound_prefix finds 19 in vol1 (real misses pass 10b's regex did not catch) and 46 in vol2 (never swept).
14 KiB
14 KiB