Skip to content

Refuse a thread create --part the page would show nowhere - #7155

Merged
max-sixty merged 4 commits into
mainfrom
browser-check-design
Nov 25, 2026
Merged

max-sixty merged 4 commits into
mainfrom
browser-check-design

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

leaf thread create --section <visual> --part <id> admitted any id its visual's declaration admits by prefix, so a thread on node:nope in a diagram was posted and drew no marker, against root AGENTS.md's rule that Python never accepts an anchor the rendered page can't resolve. The command now checks the id against what the page drew of that visual:

  • a part the visual drew is taken;
  • one it didn't, on a visual that puts such a thread on the whole visual (a timeline, a trace: drawsAbsentParts), is taken with a note saying so;
  • one it didn't, on a visual that would show the thread nowhere (a diagram), is refused. The refusal lists the parts it drew and says that leaving out --part puts the thread on the whole visual, so the agent can always post.

What the page drew comes from the render reading page state already lists parts from (#7109), now keeping {parts, whole} per visual. Where no reading holds the live version, as right after a save, the command draws the page once outside the lease, as --quote does since #7140. Where no browser can draw it, the id passes with a note that it went unchecked.

To weigh: READING's shape changed, so the page protocol moves 56 → 57. A visual that lists no parts and doesn't draw absent ones is refused, which goes one step past the rule Max chose. thread reply --part still takes any declared id.

Max chose this design on the issue (comment). Tests: drawn_part per branch and the CLI against a stored reading and with no browser (model tier), the drawing path on a real diagram and timeline (browser tier), and the help regtest.

Closes #7039

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

`leaf thread create --section <visual> --part <id>` admitted any id its
visual's declaration admits by prefix, though the browser puts a thread on
a part the visual didn't draw only where the visual draws parts on request
or once it can (its `lfParts` gives `reveal` or `find`,
`drawsAbsentParts`). A thread on `node:nope` in a `<lf-diagram
parts="all">` was posted and drew no marker, against root AGENTS.md's
rule that Python never accepts an anchor the rendered page can't resolve.

The command now checks the id against what the page drew of the visual
(`anchor_capture.drawn_part`):

- a part the visual drew is taken, as before;
- one it didn't, where the page puts the thread on the whole visual until
  the visual draws the part (a timeline, a trace), is taken with a note:
  `§ deploy-order drew no part 'event:nope' when the page was last
  checked, so the thread stands on the whole visual until the visual
  draws that part; it drew event:deploy-compile, event:deploy-artifact,
  event:deploy-rollout`;
- one it didn't, where the page would show the thread nowhere (a
  diagram), is refused: `can't anchor in revision r1: § flow drew no part
  'node:nope' when the page was last checked; it drew node:build,
  node:test, node:ship. Name one of those, or leave out --part to put the
  thread on the whole visual`, so the agent can always post;
- a visual that lists no parts and finds them by id (a chart) takes any
  id, with no note.

What the page drew comes from the page's render reading of the version
and data it shows. Where none holds them, as right after a save, the
command draws the version once in the host's browser, outside the page
lease, and reads the same facts there ("when Leaf drew the page just
now"). This reuses #7140's retry for `--quote`: `thread.UndrawnPart`
beside `UnsaidQuote` in `cli.thread_create`, and the browser steps of
`render_gate/drawn_anchor.py`, now shared by `drawn_anchor` and
`drawn_visuals`. Where no browser can draw the page, the id is taken by
prefix with a note that it went unchecked.

The render reading keeps, per visual, `{parts, whole}` from the render
check's `drawnVisuals` (formerly `drawnParts`), where `whole` is the
runtime's own `drawsAbsentParts`, which `check-api.js` now exports.
`leaf page state` lists `parts` as before.

Decision reversed: `render_reading.py`'s header said the parts list "is
for finding a part, and decides nothing". It now decides what `thread
create --part` takes, and the header says so.

One call beyond the maintainer's rules: a visual that lists no parts and
doesn't draw absent ones (a diagram that drew nothing) is refused rather
than passed, since its thread would have no marker. The maintainer's rule
for a visual listing none named the chart, which finds parts by id.

Page protocol 56 -> 57. READING's shape changed while its `since` already
named the current protocol, so `layer-registry.md`, "Page protocol", has
the protocol bump and READING's `since` move to 57. Readings at 56 read
as absent, and the next check rewrites them.

`thread reply --part` still takes any declared id, as `thread reply
--quote` still finds quotes only in the file.

Measured on this machine at load average 20-40: a create that draws the
page took 3-4 s, and one that reads a stored reading under 1 s.

Tests: the rule at its pure boundary, one case per branch, and the CLI
against a stored reading and with no browser
(`tests/model/test_interact_anchors.py`); the drawing path on a real
diagram and timeline (`tests/browser/test_render_anchors.py`, the tier of
#7140's quote test). The handover-pass and render-gate tests read the new
record shape.

> _This was written by Claude Code on behalf of max-sixty_
# Conflicts:
#	src/leaf/page-storage.md
#	src/leaf/render_reading.py
#	tests/model/test_handover_pass.py
threads.md repeated what the refusal says in the agent's path (root
AGENTS.md, "Leaf's role"), so the shipped instructions stay as they were
and need no score.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 460594a into main Nov 25, 2026
6 checks passed
@max-sixty
max-sixty deleted the browser-check-design branch November 25, 2026 10:07
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.

leaf thread create --part tells the agent when the visual doesn't draw the part

2 participants