Skip to content

feat: make a reaction a message of one emoji, which the agent answers and can send - #7304

Merged
max-sixty merged 6 commits into
mainfrom
agent-ac692a1e39da3ec46
Nov 26, 2026
Merged

max-sixty merged 6 commits into
mainfrom
agent-ac692a1e39da3ec46

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

A reaction is now a message whose content is one emoji, and the turn rules for words apply to it unchanged, from either side. The user's reaction wakes the agent and is owed a reply, and, like their next message in a thread, answers the agent's open questions before it, so the per-emoji settles fact goes. The agent can answer with one: leaf thread reply <ref> --done --emoji 👍, drawn as its message. $reactions is now only the picker's ordered list; admission checks one emoji's form (a pattern on the record's emoji, read as ECMAScript in both runtimes), not membership. One handling clause replaces the two reaction clauses: act on it, ask what the user meant, or answer in a line saying how you read it. Max chose this on a decision page ("Send each reaction to the agent as you put it on").

To weigh: the page protocol moves 59 → 60 (main took 59 for #7303), since a logged reaction changes meaning. Examples must owe nothing at rest for the site build, so ship-review's 👍 now has the agent's answer (catalog previews recaptured) and the feature gallery's twelve seeded reactions are gone. A reaction still draws as a mark until anything is said in its thread, then as a thread; the picker keeps it pressed and takes it back until the thread is resolved, and one the agent answered keeps its place, Deleted, as words do.

queue/mixed eval, Claude Code, 3 runs an arm: base with the user's "I also put a few reactions" line 3/3, head without it 3/3, every reaction arriving on its own. Tests: touched model, process and browser tests by node id, pnpm run test:runtime, pnpm run check.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 3 commits November 26, 2026 12:18
… and can send

A reaction is now a message whose content is one emoji, and the turn rules
for words apply to it unchanged, from either side. The user's reaction
wakes the agent and is owed a reply, and, like their next message in a
thread, answers the agent's open questions before it, so the per-emoji
`settles` fact goes. The agent answers with one through
`leaf thread reply <ref> --done --emoji 👍`, drawn as its message.
`$reactions` is now only the picker's ordered list; admission checks one
emoji's form, a pattern on the record's `emoji`, not membership. One
handling clause replaces the two reaction clauses.

Deleted with the old rule: `is_reaction`, `settles` and its plumbing in
`obligations`, `_reaction_error` and `unknown-reaction`,
`registry/reactions.py`, `page state`'s separate `reactions` list, and
the "a reaction is no turn" exclusions in Python and their browser copies.

The page protocol moves 58 -> 59, since a logged reaction changes meaning.
`ship-review`'s 👍 now has the agent's answer and the feature gallery's
seeded reactions are gone, since examples must owe nothing at rest.

Max chose this on a decision page ("Send each reaction to the agent as you
put it on"). The queue/mixed eval passed 3/3 on each arm, with head's
reactions arriving without the user's prompting line.

Co-Authored-By: Claude <[email protected]>
…reaction's step in the gallery

The picker takes a reaction back while its thread is open and stands where
the reaction was put; the gallery's step now names that press, since its
seeded reactions are gone. A thanks the agent may answer with an emoji is
one in words; a reaction of the user's gets a line, as its handling says.

Co-Authored-By: Claude <[email protected]>
leaf-agent
leaf-agent previously approved these changes Nov 26, 2026
…nd name a waiting reaction on the agent's list

A reaction the agent answered keeps its place once the user takes it back,
as words do, and the tab's press now draws that place at once rather than
dropping the chip until the server's reading adds it back as Deleted. A
chip nothing answers still comes off in the press. The shared fixture
holds both runtimes to the same reading.

A thread holding only the user's waiting reaction now names its On row by
its thread, the emoji, rather than by the row's id.

Co-Authored-By: Claude <[email protected]>
leaf-agent
leaf-agent previously approved these changes Nov 26, 2026
# Conflicts:
#	build/browser/protocol-baseline.json
#	src/leaf/agents/thread.py
#	src/leaf/events.md
#	tests/model/interact_contract/_regtest_outputs/test_layer_contract.test_each_case_of_an_event_is_told_what_the_snapshot_shows__0/snapshot.yaml
leaf-agent
leaf-agent previously approved these changes Nov 26, 2026
# Conflicts:
#	.config/leaf-assets.json
#	README.md
@max-sixty
max-sixty merged commit 531c31b into main Nov 26, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-ac692a1e39da3ec46 branch November 26, 2026 21:29
max-sixty added a commit that referenced this pull request Nov 27, 2026
…er copy

Where Python's reading of the page's files finds an agent's quote once, the
anchor now stores that copy's neighbours as a hint, and the element around it
where the agent named no section. The browser reads the hint only to tell
copies apart, and a sole copy wins whatever it says. This keeps an identifier
quoted in prose off the copy a code block shows, and keeps a thread on its
copy when a later version adds another. The approved option said "no
context"; the maintainer may reverse this.

The trial's move after a new version stays. Removing it in review let a
thread whose prose a version renamed jump onto the old name in a code block,
with no notice to the agent. Its known cost: a version that only splits a word
across two inline elements in a <div> moves the thread.

A section a decision hides, such as the words an accepted suggestion
replaces, no longer counts as removed, so the next revision no longer
detaches its threads for good; undoing the decision shows them again.

Also:
- resolveAnchor places a quote nowhere when its named section is gone,
  rather than searching the whole page.
- The thread card gives no status word to a quote the page shows more than
  once (`quoteRepeats`).
- A sample fixture's own sides replace the capture's.
- Prose follows: events.md, validation.md, threads.md, turn-end-check.md,
  the thread create help, root AGENTS.md's passage sentence, the site's
  revision outcomes.

Tests: the twin test names the section both copies share, so only the
neighbours tell them apart. Two browser tests no longer expect a reanchor
for a repeated passage whose words the count still finds. The reparent
journey no longer asserts that a moved reaction stays out of page state's
threads: since #7304 a reaction is a message, and that assertion fails on main
too.
max-sixty added a commit that referenced this pull request Nov 27, 2026
The browser alone places the words an agent's comment quotes. `leaf
thread create --quote` no longer refuses a quote for its words, and
Python no longer keeps a copy of the browser's passage reading that has
to match it exactly. Python checks only the `--section`. It reads the
page's files as evidence: where it finds the words once, it supplies the
neighbours that tell that copy from another, and where it finds them
zero or several times, it adds a note.

The maintainer picked this direction on the quote-finding review page
(option "Let the browser alone place the words"). That approval covered
the protocol bump, the removal of about 360 lines that existed only to
keep the two readings in step, and the root `AGENTS.md` rule change.

## What changes for an agent and a user

- **A quote is never refused for its words.** Where the file reading
finds the words zero or several times, `thread create` and `thread
reply` post the thread with an `unplaced-quote` note saying where it
stands. For example: "Leaf's reading of the page's files finds 'ship it'
2 times in § rollout, so unless the page as drawn shows it once, the
thread stands on § rollout as a whole, with the quote above its
messages". The note doesn't tell the agent to quote again: an earlier
wording that did led 1 eval run in 4 to post a second thread on the same
question.
- **Where the file reading finds the words once, the anchor stores that
copy's neighbours**, as a selection does. Where the agent named no
section, it also stores the element around that copy. Two cases this
fixes:
- an identifier quoted in prose stays on the prose when the same
section's code block shows it too;
  - a thread stays on its copy when a later version adds another.

The approved option said "no context"; this keeps the neighbours as a
hint instead. The browser reads them only to tell copies apart, and a
sole copy wins whatever they say. So a hint that disagrees with the
drawn page costs at most the exact place. The maintainer may reverse
this call.
- **A thread whose words the page doesn't show once stands on its
section** instead of detaching. That covers words a script replaced, a
misquote, and repeated words no context tells apart. With no section, it
stands in Threads. Its quote reads "Changed" where the page doesn't show
the words at all, and has no status word where the page shows them more
than once.
- **A revision moves a thread to its section where the file reading
finds its words in the version before and nowhere in the new one**, and
tells the agent (`relocated-anchor`). That keeps a thread off a copy of
its old words the file reading doesn't hold, such as one in a code
block, after the prose is renamed. Costs:
- a version that only splits a word across two inline elements in a
`<div>` moves its threads, since the file reading then puts a space
inside the word;
  - a quote the file reading never found gets no move.
- **A section that a decision hides no longer detaches its threads at
the next revision.** An accepted suggestion hides the words it replaces
this way. Undoing the decision shows the section and its threads again.
- **A named section the page doesn't hold places a quote nowhere**,
rather than letting the search run over the whole page.
- **An absent `prefix`/`suffix` means "context unknown".** Browser
selections always write both sides, an empty one at a fence. A logged
value gains a new meaning, so the page protocol moves to 62 (main was at
61).
- **A sample fixture's own context stands.** Where a fixture's anchor
gives a side, the anchor keeps only the sides the fixture gave, with no
note.
- **`page check --render` no longer checks `verbatim` widgets' words**
against the file reading. `verbatim` still decides whether the browser
fences a widget, whether Python withholds its data body, and what a
version comparison reads.
- **Python's reading matches quotes exactly** on its collapsed text. A
quote across two inline elements with no space between them, such as
`<strong>Status</strong><span>Ready</span>` quoted as "Status Ready",
now gets a note, though the browser still places it.

## What was removed and what was kept

Removed:
- the drawn-quote path (`drawn_anchor`'s quote half,
`render-checks/quote.js`, `Unsaid`, the CLI retry), `resolve_quote`, and
the clerk's retry with no passage;
- the `verbatim` render check (`readings._verbatim_findings` and its
helpers, `shownVerbatim`, the owner and boundary identity maps in
`passages.js`, `widget-loader.js` and `check-api.js`);
- Python's tolerant matching across inline-element edges
(`Passages.edges`, `.soft`, `_letters`);
- the generated-word half of the browser's `fileModelsPassage`, now
`holdsEditedValue`.

Kept, because something still needs them:
- the browser's opaque-widget and generated-word passage cells, which
keep a repeated quote's context inside the cell a module moves or
rewrites;
- Python's fences, without which a quote across a diagram's parts would
post with no note;
- Python's spacing rule in `passages._write`, which sets the words `leaf
page state`, deliveries and the turn-end fork show the agent.

## Instructions

`threads.md`, `turn-end-check.md`, `packages.md`, root `AGENTS.md`
("Validate once and share readings") and `browser/AGENTS.md` now state
the new contract. Scores, on Claude Code:

- `evals/quote-names-one-copy`, a new case. Asked about one of two
copies of the same words, the agent quoted words the page shows once in
4/4 runs on head and 4/4 on base. Shown the new note beside a posted
thread, it kept one thread in 8/8. The old note text, which advised
quoting more of the passage, led 1/4 to post a second thread; that run
never opened `threads.md`.
- Root guidance (`pnpm run eval:root-guidance --repeat 3`): a first
wording, "the browser alone finds a comment's quoted words", led the
agent on an unrelated situation (`filter-hooks-simply`) to also move
Python's gate into TypeScript, so it made the narrow fix in 7/18 runs to
base's 18/18. The landed wording drops that clause, makes the call in
7/9 runs, and fails 18 samples across the 52 situations, as base does.
Two later fact corrections in the same paragraph were not rescored.

## Tests

These pass:
- 741 model tests: anchors, threads, the clerk, deliveries, documents,
obligations and authored markup;
- the runtime's 1,165 tests;
- `pnpm run check`;
- the browser and journey tests the branch changes or that read thread
status words, run by node id.

The exception is
`test_a_changed_datum_keeps_its_old_words_open_when_its_label_changes`,
which fails the same way with main's browser runtime.

`test_revising_quotes_reparents_every_open_thread_without_answering_it`
no longer asserts that a moved reaction stays out of `page state`'s
threads. Since #7304 a reaction is a message the agent answers, and the
assertion fails on main too.

## Size

66 files. Code is +467/−848 (net −381, comment rewrites included), tests
+477/−967 (net −490), and prose, registry text and the eval case
+190/−88.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 27, 2026
…es page markup (#7413)

The aim sweep's `PAGE_MARKUP` kept its own hand-written list of the
runtime's paint attributes, and that list was missing
`data-lf-beside-marker`. `readMarkRoom`
(`browser/runtime/dom/geometry.js`) writes that attribute on a list item
while the composer's pending mark stands on it, and leaves it there
after the mark goes. A leftover stamp decides nothing, since
`element-marks.css` applies it only while a mark is showing. Before
#7304, the seeded 👍 on `ship-review` drew a mark at rest, so the stamp
was already in the "before" reading. Now the reaction draws as a thread
with no mark, so the stamp first appears during the sweep's ⌥-click. The
comparison then counted it as a widget reached by the press. Nothing in
#7304's intent is at stake: the only difference was this one
presentation attribute.

`PAGE_MARKUP` now imports `RUNTIME_PAINT_ATTRIBUTE` from
`/runtime/base/page-paint.js` and strips every attribute in it, as
source snapshots already do, plus the element marks' `data-lf-mark` and
`data-lf-projected-mark`. That list has been widened by hand four times
(`git log -L`). A new kind of paint now joins `page-paint.js` and
reaches the sweep with no edit to the test. The sweep still catches what
it protects: a stray pick or tab switch changes authored attributes, and
a stray decision shows up in the log assertion that follows.


`tests/journeys/test_render_aim.py::test_an_aimed_press_does_only_what_the_outline_promised[ship-review]`
fails on `main` at 6a95224 with the `data-lf-beside-marker="left"`
diff. With this change all three parametrizations pass, and so does
`tests/browser/test_render_aim.py::test_design_mode_comments_on_what_a_press_lands_on_and_nothing_else`,
the only other caller of `PAGE_MARKUP`.

Closes #7405 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 27, 2026
…ut on (#7445)

A thread holding only the reaction that opened it was a special case:
the server served `bare_reaction`, the panel neither listed nor counted
it, and the page drew it as the emoji in the margin, with its own Undo
disclosure, Escape scope and `lf-react` wash. Since #7304 made a
reaction a message the agent answers, that state lasts only until the
agent's first line. Now such a thread is carried and drawn like any
other from the moment it is put on: Threads lists and counts it, its
passage wears the comment mark, its margin entry is the thread marker,
and its card opens on the emoji.

| Before | After |
| --- | --- |
| <img alt="An unanswered 👍 on a passage: the emoji in the margin, the
passage in a lighter wash"
src="https://gist.githubusercontent.com/max-sixty/db07c0252b13e3b832c5f8c7e4180b7e/raw/2d1358790d7b24d30954d03eabaccadd49ead158/1-rest-base.png">
| <img alt="The same 👍: the speech-bubble marker by the passage's line,
the passage in the comment mark"
src="https://gist.githubusercontent.com/max-sixty/db07c0252b13e3b832c5f8c7e4180b7e/raw/2d1358790d7b24d30954d03eabaccadd49ead158/1-rest-head.png">
|
| <img alt="Pressing the emoji reveals Undo beside it"
src="https://gist.githubusercontent.com/max-sixty/db07c0252b13e3b832c5f8c7e4180b7e/raw/2d1358790d7b24d30954d03eabaccadd49ead158/3-press-base.png">
| <img alt="Pressing the marker opens the thread's card, whose one
message is the 👍, queued for the agent"
src="https://gist.githubusercontent.com/max-sixty/db07c0252b13e3b832c5f8c7e4180b7e/raw/2d1358790d7b24d30954d03eabaccadd49ead158/3-press-head.png">
|
| <img alt="While the agent works on a ✂️, its emoji entry previews
'reaction actions… On it'"
src="https://gist.githubusercontent.com/max-sixty/db07c0252b13e3b832c5f8c7e4180b7e/raw/2d1358790d7b24d30954d03eabaccadd49ead158/2-working-base.png">
| <img alt="The ✂️ thread's marker previews as any thread's: Me, On it,
1 message"
src="https://gist.githubusercontent.com/max-sixty/db07c0252b13e3b832c5f8c7e4180b7e/raw/2d1358790d7b24d30954d03eabaccadd49ead158/2-working-head.png">
|

The card offers no way to take an emoji message back; pressing the emoji
again in the picker on the passage does, as does Cmd+Z. Max chose this
trade in #7323. Taking back a reaction that opened a thread now brings
any reply begun in its card to the passage's draft, as a comment's undo
does.

Code +127 −467, not counting the compiled JavaScript; tests +157 −424.
`leaf-dev interface --base` reports no package-interface name added or
removed. `pnpm run check`, with `test:runtime`, passes, and so do the 65
tests under `tests/browser` and `tests/journeys` that the change edits
or that build a reaction, run by node id.

Closes #7323

> _This was written by Claude Code on behalf of max-sixty_
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.

2 participants