html-revisor: reply design

The agent answers in the page. Each element carries its own small conversation, and many run at once while you keep reviewing.

Built as a prototype: it proved useful, and it breaks when the agent and the browser change one page at once. It runs only with --replies on the server; without it, you and the agent take turns. The yak "Get your concurrency together" holds what broke.

Where it stands

built built today waits on you later ✓ Reply format in the file @Human after the last turn ✓ Thread in the box You field, Resolve, bubble ✓ Server writes replies reply.mjs, refused when stale ✓ Live notice the tab hears every change ✓ Docket counts replies a second row: new replies ✓ Announce Resolve with the turns that ended ✓ Thread arrives live in an open box, no duplicate ✓ New stays new until you answer or Resolve ✓ Directive status working: your turn is last ✓ Review off hides the docket's arrows iterate-on-docs replies written, on a branch Deploy and release when you say so Replies on edits a yak of its own now Modes a page with no agent Disk edits, live content swaps in, no reload Who edits the live file agent and server, at once Lighter reply loop one commit per reply

An agent replies today with node reply.mjs <page URL> <id> <thread> <text>, the id and thread from the Announcement. The reply arrives without a reload, in the marker and in an open box. The “built” column in Decided marks each decision the code has.

For you

What's new since you looked. What you've seen goes; what's settled moves to Decided or to a yak.

Pick up here

  1. Everything in html-revisor is built and merged but the waits-on-you column of the road: the iterate-on-docs side, on its branch replies-in-the-page, and the deploy and release that carry both. You said that comes after the yaks are done.
  2. Open yaks under “Replies”: the Contract carry, iterate-on-docs watching Announcements, and lightening the skill's reply loop. Beside them: rethink who edits the live file, modes, disk edits live, replies on edits.
  3. To start the loop again: ./run REPLY-DESIGN.html, with its output to a log the agent watches, so each Done reaches it as you make it. A watch lasts 30 minutes; say anything to restart one.
  4. Main moved while we talked: the away run of 2026-10-24 merged links as markdown, stand-ins paired by their surroundings, focus back to the picked element when the box closes, and the > fix. Its commit messages hold the details.

Answered

Your last questions, settled. Read and drop.

My guesses, to confirm

From the client work. Each is built; say if one is wrong.

  1. A directive you've sent can't be edited in place, only added to or resolved. Once the box closes, the field opens empty; what you type is a new turn. That follows “the directive stays as you wrote it.”
  2. A turn you add joins your open turn in the file, one @AI comment with a newline between, not a second comment. It needed no server change.
  3. When a reply lands in your open box, what you'd saved moves up into the thread, above the reply, and the field keeps only what you typed after. If you'd rewritten the field rather than added to it, the whole text goes as a new turn after the reply.
  4. The guard against a duplicate turn is a count of replies the tab has seen, sent with each directive save. Resolve doesn't carry it.
  5. Clicking the replies row's count toggles review mode, as the directives row does.
  6. A > you type stays a > now. Your turn-4 directive came back as &gt;; on today's code I typed one in Chrome and it held, in the file, the Announcement, and the box. I closed the yak as not reproducible. A -- still shows as - -: that's the comment's escape.
  7. The Contract's Vocabulary and Browser behavior rows changed with the new words (new reply, working, the replies row). They go to iterate-on-docs with the deploy, on the same branch.

Flow

One directive, start to answer. The Announcement on stdout already exists; the rest is new. Magenta arrows are the server pushing to the tab.

Jess, in the browser server HTML file agent types a directive (saves as she types) writes the directive Done Announcement, one JSON line on stdout keeps reviewing, more directives reads, researches, edits elsewhere reply (stale if you added a turn: read it, reply again) writes the reply commits the file marker shows the bubble; box shows the thread answers in the box: marker back to the pencil and around again, until she resolves it one thread per element

Directive box with a thread

Until the agent replies, the box is today's: Content, Directive, Done. Once it replies, the directive becomes the first turn in the thread, and the field below the thread takes your answer. You read top to bottom and type at the bottom. A rule at the left of each turn says whose it is, magenta yours and green the agent's, and the words “you” and “agent” say it too. Content is monospace; directives, turns, and replies are prose. The thread grows to 240px, then scrolls, and opens scrolled to the end.

Where it's headed

p · Where it's headed
you Add a diagram of the PUT flow here
agent Added a sequence diagram below this paragraph. I left out the retry path: it doubled the size. Want it as a second diagram?
you Yes, a second one
agent Done. It sits under the first, captioned “When a save is stale.”
You
saved

Answered. Two rounds; you're typing a third turn. Done sends it, the same as today. Clear empties the turn you're typing. Resolve, beside Done, ends the thread: it removes the directive and its replies. The thread needs no label: the turns say whose they are.

Once the agent has a directive, the directive stays as you wrote it, and you add a turn instead. That keeps it from changing under the agent. A turn you add while the agent works will give it a stale notification, and then it can notice what you said and post its update again.

Marker

The tile stays: near-black, light ring, square. The glyph on it changes with the state, and nothing moves. The cycle ends where it began, so the magenta pencil stays the usual sight.

The grounds and the color-blind check draw working too, a state for later, so every glyph is tested together.

Waiting

Working

New reply

white

Waiting

Working

New reply

near-black

Waiting

Working

New reply

our pink

Waiting

Working

New reply

our green

Waiting

Working

New reply

stripes

Waiting

Working

New reply

cat behind text

What it shows. The tile carries the marker on every ground, as it does today, so the green needs no halo of its own. On the near-black tile the green has 8.8:1 contrast; the magenta has 3.8:1.

Color-blind check

Each row draws the markers through a simulation (Machado 2009, full severity, as SVG color matrices). The two columns at the right are answered markers we didn't pick.

waiting working new reply not picked: green pencil not picked: pencil + badge
typical
protanopia
deuteranopia
tritanopia
greyscale

What it shows. Green alone fails. Under deuteranopia, the most common kind, the magenta turns khaki (#878168) and the green turns a lighter khaki (#c2b36e): the two pencils differ in lightness alone, and a 14px glyph beside busy page text doesn't hold that difference at a glance. So the shape carries the state and the color backs it up. This green, #51cf66, kept the most distance from the magenta of five greens under protanopia and deuteranopia, and it is lighter than the magenta, which helps in greyscale. The bubble changes the whole glyph, so it reads at 14px in any vision; the badge's 8px square gets lost beside a neighbor marker.

Where it's headed

Added a sequence diagram below this paragraph. I left out…

Hover. The tip shows whatever was said last in the thread. On a new reply that's the reply, in prose type with the green rule.

Docket

Two rows. The top row counts directives: every open thread. The bottom row counts new replies: threads where the agent spoke last. Adding a turn takes one off the bottom row, and its thread stays in the top one; Resolve takes it off both. Opening the box changes nothing. ⌥↑ and ⌥↓ step through directives, as today. The replies row has its own arrows. Stepping to a reply works as stepping to a directive: the element scrolls to the middle, shows its crop marks, and its marker shows its tip.

5 directives
↑
↓
2 new replies
↑
↓

Two new replies. Five open threads; in two, the agent spoke last.

5 directives
↑
↓
3 new replies
↑
↓

A reply just came. The docket takes a green ring for 2 s, the way an error takes a red one, since the element may be off screen.

5 directives
↑
↓

No new replies. The bottom row hides, and the docket is today's.

5 directives · review off
2 new replies

Review off. Clicking the docket turns review mode off, so you read the page as its readers will: markers and crop marks hide, and a click goes to the page instead of opening a box. The docket stays, says “review off”, and its glyphs go grey. Its arrows hide, and ⌥↑ and ⌥↓ don't step: there are no marks to step to. Click it again to bring the marks back.

Open questions

Out of scope for now

Replies on edits

Scopes

h3 · Scopes
Content
you edited Prose chunks Scopes
agent I also changed 3 other places that used the old word.
You
⌘↵ or esc to close

The agent tells you what it did.

Scopes

h3 · Scopes
Content
you edited Prose chunks Scopes
agent OVERVIEW.html and DESIGN.html say “prose chunk” too. Want me to update the other documents to match?
You
⌘↵ or esc to close

The agent asks.

Working

Where it's headed

p · Where it's headed
you Add a diagram of the PUT flow here
agent working
You
⌘↵ or esc to close

The field stays open while the agent works: what you add goes to the agent as your next turn, and makes the reply it's writing stale.

Decided

question answer built see
Where do replies live? In the page's HTML file, as HTML comments beside the directive, outside the element's content hash. A reply goes after the last turn in the thread, and the whole thread sits where a directive does: a run of turns before an image or a pre is that element's, so its parent's thread goes last. Cleanup removes them. ✓
Who writes the live file? The server, and it should be the only process that does. The agent hands it replies and status through a CLI that calls the running server, so the server orders the agent's writes with the browser's saves. ✓ flow
Who commits? The agent, each time it adds a reply, in whatever way it commits. The server never commits. A commit may catch half an edit of yours; the next one picks up the rest. So every turn is in history before Resolve removes its thread. on a branch flow
What is a turn now? A point to diff from. The agent notes the commit at the last turn boundary, so a diff from it shows every edit and directive since. That's a backup: the agent already hears each one from the server's output. on a branch
What if the directive changes while the agent replies? The server refuses the agent's write as stale, the same way it refuses a browser save on an element that changed. ✓
How does the tab learn of a reply? The server pushes each change it makes to the open tab. It also watches the file, for a write that goes around it. ✓ flow
Where does a reply show? In the box, below the directive: a thread, one per element. ✓ box
How do you answer a reply? Add a turn to the thread. The directive stays as you wrote it. ✓ box
Which type is monospace? Content alone. Directives, your turns, and replies are prose. ✓ box
How do you know the agent has it? The marker says. Magenta pencil while you write; three green squares once you close the box, while your turn is last; a green bubble once the agent has spoken last. Opening the box changes nothing. ✓ marker
Does anything move? No. Nothing blinks or pulses. ✓ marker
Whose color is whose? Magenta is yours, green the agent's. The glyph's shape and the words “you” and “agent” say it too, so color is never the only cue. DESIGN.html's palette changes to match when this ships. ✓ marker
What does a hover show? Whatever was said last in the thread. ✓ marker
What does the docket count? Two rows. Directives: every open thread. New replies: threads where the agent spoke last. ⌥↑ and ⌥↓ step through directives. ✓ docket
How does a thread end? You end it, with Resolve beside Done. It removes the directive and its replies. Clear, on your field, empties the turn you haven't sent. ✓ box
Does the agent end a thread? No. When it has nothing more to say, it replies 👍. on a branch
What if you add a turn while the agent works? The agent sees it the next time it reads the server's output. Its reply comes back stale; it reads your turn and replies again. ✓ flow
How does the file tell whose turn is whose? By the prefix, which names who the words are for. Your turns are <!-- @AI: … -->, as directives are today. The agent's replies are <!-- @Human: … -->. A thread is the run of them beside the element, in order. ✓
What changes in the Contract? The @Human prefix, the CLI that writes a reply, and the words you see: reply, new replies, Resolve. README only
What can get a reply? A directive. Replies on edits come later. ✓ later
How does the agent hear a Resolve? Through the box's Done: its Announcement carries resolved, the turns that ended. One box session is one Announcement. ✓
How does the agent find the server? reply.mjs takes the page URL the server prints when it starts. ✓
When does the agent reply in the page? Whenever it can watch the server's output. Markdown, or an agent that can't watch, takes turns. on a branch