Goal Make the AI proofreader produce atomic phrase-level edits (the style of a real human proofreader), not sentence-level rewrites. The same clause skeleton the student wrote is preserved — only the errors are touched.
Pipeline Constrained Claude prompt → JSON corrections → JavaScript validator (rejects spans that cross sentence boundaries, break word boundaries, or exceed 4 tokens) → goal-style HTML render. The default below was generated by a single API call on a sample letter; paste your own letter and it runs the same pipeline live.
The prompt enforces small-span output through four rules. Full text below — copy and test it yourself on any OET letter.
loading…
After the LLM returns JSON, this validator runs before render. It rejects any correction whose original_text crosses a sentence boundary, starts or ends mid-word, or exceeds the token budget. This pre-render check directly addresses the "broken tracked changes" and "duplicated text" issues from the brief.
loading…
The sample you see above is not hand-authored. The pipeline was run once on the COPD letter with a single Claude Sonnet 4.6 API call. The JSON response was saved and is loaded here as the default. The Try Your Own Letter button calls the same endpoint live.
claude-sonnet-4-6--- delimitersThe validator also demonstrates itself: one of the LLM's 21 corrections ("time. we" → "time. We") technically crosses a sentence boundary, and the validator flags it — an example of the pipeline catching a real LLM slip.