01Keyword lock
Locked phrases stay visible to the model so it can write around them, then a deterministic pass checks that every phrase survived verbatim, at the same count, in its source sentence. I repair failures by re-rewriting only the offending sentence with the phrase masked as ⟦KW0007⟧, trim surplus copies to stop keyword stuffing, and splice the original sentence back byte for byte when anything still fails. 27 of my suite's 60 unit tests cover that one module.
02Refusing the trick
I label the stats panel writing statistics, not a detector verdict, and nothing in the app claims guaranteed evasion. My improvements doc names what I deliberately left out: homoglyph and zero-width injection, blind synonym spinning, recursive rewrite-until-evaded loops, and optimising against any single detector score. Chasing a detector reading costs writing quality, so what I aim at is naturalness with the meaning intact.
03Two fail-open gates
When a deterministic lint on burstiness, lexical diversity, transition density and em-dash rate still reads as AI-ish, the pipeline runs one critique-and-revise pass. Never recursive. An optional N-best reranker draws extra candidates in parallel and keeps the most natural one, and I put both gates behind an embedding cosine-similarity check against the original — a failed candidate or a missing embedding never blocks the rewrite, only cancellation does.
04Eval harness
One command scores input-to-output deltas on burstiness, MTLD, em-dash and transition density, contractions and Flesch across a fixture set, then diffs the report against a saved baseline. I load the library modules directly through Node ESM module-customisation hooks that resolve the path alias and stub Next's server-only shim, so it needs no bundler. Default runs are fully offline; I put the live pipeline, detector and perplexity passes behind opt-in flags.
05Streaming past nginx
The rewrite is Node-runtime SSE on my own machines rather than a managed platform, so the tokens had to survive my own proxy. PM2 on the app server, a separate nginx reverse proxy terminating SSL with proxy_buffering off for the SSE route, and X-Accel-Buffering set to no in the response headers as a second defence. I verified it end to end over HTTPS on deployment day — token events arriving, then settled.