version 4 · direction C · diagram-as-code (mermaid source, pre-rendered — zero runtime JS for the diagrams)

The Grammar

Here the diagram is text first: each view is ~30 lines of mermaid a model can regenerate in seconds, rendered to SVG at build time so your phone never loads the 3.5MB library. Auto-layout decides positions — the trade: effortless regeneration and clean diffs, weaker control over where boxes land, smaller text. The source of one view is shown at the bottom, because the source IS the point of this direction.

Script — deterministic Python
Model — LLM judgment
Amit — taste, approval
{ } diamond = gate · dashed edge = feedback
dashed border partial · dotted border proposed
The source of the “Improve” view — what a model actually edits
flowchart TD
  subgraph planner["Plan the fixes"]
    direction TB
    p1{"Route: automatic or Amit"}
    p2["Order whole-file fixes first"]
    p3["Merge overlapping fixes"]
    p4["Group fixes into batches"]
  end
  queue{"Decide: the taste calls (A…"}
  subgraph repair["Repair the audio"]
    direction TB
    r1["Remove noise (subtractive …"]
    r2["Refill holes with room tone"]
    r3["Restore the original voice"]
    r4["Fix dropouts, knocks, dupl…"]
  end
  subgraph verify["Check the repairs (scoped audit T1)"]
    direction TB
    v1["Check the stitching (5 rul…"]
    v2["Check no word was lost"]
    v3["Halve the batch to find th…"]
  end
  subgraph converge["Decide: done or another round"]
    direction TB
    c1["Ask the five questions"]
    c2["Re-detect after whole-file…"]
    c3{"Stop after three rounds"}
  end
  planner -- "human-gated classes" --> queue
  queue -. "decisions return" .-> planner
  planner --> repair
  repair --> verify
  verify --> converge
  converge -. "next batch" .-> planner
  style planner fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style p1 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style p2 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style p3 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style p4 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style queue fill:#3b2c14,stroke:#E8A34A,color:#DCE4EC,stroke-dasharray:6 4
  style repair fill:#12343b,stroke:#5FD3C4,color:#DCE4EC
  style r1 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC
  style r2 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC
  style r3 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC
  style r4 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC
  style verify fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:6 4
  style v1 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:6 4
  style v2 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC
  style v3 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style converge fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:6 4
  style c1 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:2 4
  style c2 fill:#12343b,stroke:#5FD3C4,color:#DCE4EC,stroke-dasharray:6 4
  style c3 fill:#3b2c14,stroke:#E8A34A,color:#DCE4EC