Repository navigation
Refuse a thread create --part the page would show nowhere - #7155
Merged
Merged
Conversation
`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_
leaf-agent
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
leaf thread create --section <visual> --part <id>admitted any id its visual's declaration admits by prefix, so a thread onnode:nopein a diagram was posted and drew no marker, against rootAGENTS.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:drawsAbsentParts), is taken with a note saying so;--partputs the thread on the whole visual, so the agent can always post.What the page drew comes from the render reading
page statealready 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--quotedoes 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 --partstill takes any declared id.Max chose this design on the issue (comment). Tests:
drawn_partper 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