Skip to content

Rewrite AI tells out of the text live, on the device - #18

Merged
peopleworks merged 1 commit into
mainfrom
feat/live-rewrite
Jul 30, 2026
Merged

Rewrite AI tells out of the text live, on the device#18
peopleworks merged 1 commit into
mainfrom
feat/live-rewrite

Conversation

@peopleworks

Copy link
Copy Markdown
Owner

Your text on the left, the de-AI-ified version on the right, both rebuilt on every keystroke, with the score falling as you go. It runs off the rule-pack — no model, no network, no API key — which is what makes a live view possible at all. Every change is listed with alternatives to pick from and a one-click leave this one alone. Three strengths, from only the strongest tells to delete the empty intensifiers too.

The existing BYOK Humanize stays for what genuinely needs a model. Most of what it was doing, though, is a word swap the packs already knew.

The hard part was refusing to rewrite

A word swap breaks prose in ways that are obvious once you see them, and a tool that advises people on writing can't be the thing producing them. Each of these came out of reading the real output, not out of theory:

It would have produced Now
delve into → "examine into the data" declined — and alternatives don't save it: "look into" would give "look into into"
The report showcased → "The report show results" offered, never auto-applied: one rule covers delve/delves/delving
it's not just a tool → "it's not a tool" — inverted declined: the word holds up a flagged construction
a plethora of options → "a many of options" declined: the "a ___ of" frame needs the determiner rebuilt
el panorama → "el situación" declined or gender-matched — read off the article, not the ending, because panorama and problema are masculine despite the -a
a crucial step → "a important step" corrected to "an important step"

Rhythm and rhetorical structure need real rewriting, so they stay in the recommendations — and the panel reports how many tells that covers rather than implying they were handled.

Replacements are data, not parsed prose

suggestion is written for a person ("mix, blend, range — or just name the thing"), so lexical rules now carry explicit replacements / delete fields. Inferring deletion from prose would have meant matching "usually deletable" and "suele sobrar" — and failing silently for any language the packs don't ship. Community catalogs written before these fields still work, but the fallback trusts nothing except an unmistakable comma-separated list: a lone term could be the replacement "use" or the description "muletilla", and guessing wrong rewrites someone's sentence into nonsense. A test keeps every built-in rule explicit.

Checks

  • dotnet build clean; 125 tests pass (118 before this branch's additions → 121 → 125 as each guard landed).
  • Verified in the browser in both languages. English sample 94 → 90, Spanish 91 → 85, and every substitution in both is grammatical and meaning-preserving.
  • Two of the guards above exist because the first working version got them wrong on screen.

🤖 Generated with Claude Code

The existing Humanize sends your text to an LLM: it needs an API key, costs money per run, and
takes seconds. But most of what it fixes is a word swap the rule-pack already knows — the packs
carry alternatives for every overused word. Doing those locally is instant, free, private, and
possible on every keystroke, which is what makes a live side-by-side view work at all.

So: your text on the left, the de-AI-ified version on the right, both rebuilt as you type, with the
score falling as it goes. Every change is listed with its alternatives and a one-click "leave this
one alone". Three strengths, from only-the-strongest-tells to also-delete-empty-intensifiers.

The hard part was not rewriting; it was refusing to. A word swap breaks prose in ways that are
obvious once seen, and a tool advising people on writing cannot be the thing producing them. It now
declines, rather than guesses, in five cases found by testing the real output:

  * governed particles — "delve into" must not become "examine into", and alternatives don't save
    it either, since picking "look into" would yield "look into into"
  * inflections — one rule covers delve/delves/delving, so a non-canonical form is offered but never
    applied on its own ("The report showcased" must not become "The report show")
  * flagged constructions — "just" is an empty intensifier in general, but deleting it from "it's not
    just a tool" inverts the sentence into "it's not a tool"
  * the "a ___ of" frame — "a plethora of options" would become "a many of options"
  * Spanish gender — "el panorama" must not become "el situación"; the gender to match is read off
    the article in the sentence rather than the word's ending, because "panorama" and "problema" are
    masculine despite ending in -a, which is exactly where a guess fails

English "a"/"an" is corrected when a swap changes the initial sound, since that depends on the
alternative chosen and can't be settled in advance. Rhythm and rhetorical structure are left to the
optional LLM pass, and the panel reports how many tells that covers instead of implying they were
handled.

Replacements live in the rule packs as explicit "replacements"/"delete" fields rather than being
parsed out of the human-facing "suggestion" prose, whose wording is language-specific — "usually
deletable" and "suele sobrar" — and would silently fail for any language the packs don't ship. The
fallback for catalogs written before these fields trusts nothing but an unmistakable comma-separated
list: a lone term could be the replacement "use" or the description "muletilla", and a wrong guess
would rewrite someone's sentence into nonsense.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@peopleworks
peopleworks merged commit b2ba3e2 into main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant