Skip to content

Name a question by the group its author declares, and retire lf-ask - #6256

Merged
max-sixty merged 19 commits into
mainfrom
question-section-frame
Nov 17, 2026
Merged

max-sixty merged 19 commits into
mainfrom
question-section-frame

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A question on a page is now a group its author names, and lf-ask goes. The author writes the section holding the question and its case as <section id role="group" aria-labelledby>, naming the id of the heading that asks it. A <fieldset> is a group too, named by its legend. Leaf reads the group into the obligation: prompt.target is the group, and prompt.text is its name: the words aria-labelledby points at, else aria-label, else the legend. lf-ask, x-encloses, state.encloses, ask.css and the untitled-question advice go.

What the user gets is what lf-ask gave: the obligation is the whole group. m selects the group and lands at its opening however tall it is, the ring and the On Me marker stand on it, and digits answer from anywhere inside it. A group holding several questions leaves each at its own widget. Arrival no longer looks for a heading over the widget or a block before it.

Max picked plain HTML over lf-ask on a survey of places Leaf puts its own layer between authors and HTML. He then picked the named group over a section Leaf finds by its heading (question-region-group on the obligation-names design), so a question's region and name are data the author writes rather than Leaf's reading of headings. That design's other changes, such as removing the leading-title rule, follow in their own pull requests (#6248).

What changes for authors:

  • page check refuses an asking widget no named group holds (unframed-question) and a group without an id (question-group-id). Widgets in thread messages, records widgets, suggestions and widgets in samples are exempt. Every authored question was converted: 58 groups on 25 example pages, 10 on fixture pages, 29 in eval files, and 357 in test sources.
  • A widget can't be the group itself, since widgets take no role, so a question in an lf-tab needs a section inside it.
  • A suggestion's arrival lands at the block holding it, with the section's heading just above the window.
  • A thread message's question takes the name of a named group if it writes one, else the widget's own name; a heading in the message no longer names it.

The reference teaches the group as the section holding the question and its case. In scoring, authors otherwise kept a section's subject heading and nested a small group round a new question heading and the options below the evidence, which left the captures outside what m selects.

A playground alone in a group that is a workspace's body now keeps the panel's room below it: the playground keeps the minimum its rows set, and the workspace body carries the scroll padding that used to sit on the playground. The full-height rule ask.css held moves to section[role~="group"], so an ordinary section keeps its flow. Where the panel seats a thread reply's question, the copy left in the thread drops the question's whole group, as it dropped lf-ask.

Scored on 31 asking eval cases (page asks and playground authoring) against this branch, with Opus 5.5 as author and judge: 28 of 31 passed. record-asks-hold-their-table fails on main too (1 of 1), and audit-calls-are-proposals passed its rerun. proposals-show-what-they-change failed 2 of 2 because authors nested a small group below the evidence, where main passed 1 of 1. After the reference change above, the four cases that place evidence round a question passed 5 of 8:

  • proposals-show-what-they-change, 1 of 2. The failure was a section pointing at a capture in the section before it.
  • record-asks-hold-their-table, 0 of 2. Its table now sits inside the group; it fails, as on main, on where the buffering paragraph goes.
  • audit-calls-are-proposals and record-asks-hold-their-premise, 2 of 2 each.

Thread asks, which the check exempts, and the turn-end check's replays weren't run.

Tests: the focused model and process tests (55 files, 2023 passed), about 140 browser tests on questions, workspaces and playgrounds, a stubbed run of tests/browser that stamps every page through the new check, pnpm run test:runtime, pnpm run check, and the new check over every example, fixture and registry example.

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

An author asked a question by wrapping its heading, premise and answering widget in
`lf-ask`, a tag with no module that said what a `<section>` opened by a heading
already says. Max chose plain HTML (survey item 9, `question-frame`): a question is
now a section, or any element, whose leading title is a heading, and `lf-ask`,
`x-encloses` and `x-flow` are gone.

What the section supplies, and where it is read:

- Prompt. `obligations.framed_widgets` finds each asking widget's frame: the nearest
  element with an id round it, short of the page's column, whose leading title
  (`gesture_words.leading_title_node`) is a heading standing before the widget. The
  heading is the obligation's `prompt.text` and the frame's id its `prompt.target`. A
  titled element without an id frames nothing, so its widget reads as untitled rather
  than taking a heading further out. A widget set among words (`x-inline`, a
  suggestion) has no frame, so its sentence and its own words still name it. Python
  now words a widget in a titled section, as the browser's label already did.
- Arrival. `m` starts at the frame where the run from its opening to the answer fits
  the window, else the heading over the widget, else the words before it, as a bare
  widget's arrival already did. A question taller than the window now starts at the
  words before its answer; an `lf-ask` was aligned at its heading however tall.
- Where the obligation stands. The ring, the arrival's focus, the On Me margin marker
  and "the obligation the user is in" are the widget, not the frame. A section is
  plain markup round any amount of prose, so ringing it, or counting a focus anywhere
  in it as being at its one question, would make every long section holding a draft
  or a choice one obligation. `obligationPlace` drops `node` and the shared-context
  count, and `obligationHolding` reads sources only. On Me still groups a question
  under the part round its section (`queue-walk.js`, `itemHeading`).
- Width. A question's section holding a wide block writes `class="layout-flow"`, as
  any section does; `[data-lf-flow]` leaves `layouts.css`, with the rule that undid
  `lf-ask`'s measure. The render check's `contained-space` advice already names the
  class.
- Full height. The rule that gave a question's answer the height its heading and
  context leave in a full-height workspace moves from `ask.css` to `layouts.css`, on
  a `section` told it has a definite height, except a pane, which lays out its own
  parts, and a pane's body, which scrolls as a whole.

The check: `untitled-question` now advises, on a page's documents, that a widget
asking the user stand in such a frame. A message's widget is named by its message, a
records widget by its data and a suggestion by its words. It is advice,
not a refusal, since an untitled question still asks and On Me still names it by the
nearest words; on 400 pages in the state home it would fire once. `empty-question`
goes: with no tag marking a question, nothing tells an `lf-options` left without
`choose` from a list meant only to show.

Behavior a user or author meets differently:

- After `m`, the user stands on the answering widget, so the widget's own keys act
  there as its forwarded ones do; from the question's heading or premise they don't.
- A thread anchored on the question's section is still about its obligations, but
  its panel view no longer stands at the obligation; one anchored on the widget,
  where `c` at the obligation puts it, does.
- The composer and Page Map name a question by its widget ("options · Which
  material?") rather than "question · …".
- `leaf page state` no longer narrows to a question's section id, which is no widget.
- A page still writing `lf-ask` fails `page check` as an unknown widget.

Cut over every example, fixture, eval case, test and shipped instruction
(`authoring-on-me.md` "On the page" and "Permission", `threads.md`, `page-layout.md`,
`module-input.md`, `module-reading.md`, `module-scroll-and-motion.md`,
`package-data.md`, the default, deck and playground registries and the playground,
deck, monitoring and detail author instructions). Tests that pinned the frame as the
ring, focus, marker or location now expect the widget;
`test_an_obligation_arrival_starts_with_the_context_that_frames_it` states the new
arrival in a window shorter than the question; the layout tests ask the question's
section to be a flow.
# Conflicts:
#	browser/registry.json
#	browser/runtime/obligations/place.js
#	browser/types/contract.d.ts
#	examples/developer/feature-gallery.html
#	examples/developer/versions/feature-gallery.v2.html
#	examples/motion-playground.html
#	notes/feeds/page.html
#	packages/default/registry.json
#	src/leaf/schema.py
#	tests/browser/test_render_options.py
#	tests/browser/widgets/test_obligations.py
#	tests/journeys/test_render_gate.py
#	tests/model/test_interact_product.py
An obligation's place is the part of the page the author assigned to it, so
`m` selects the whole question, its premise and evidence included, rather than
only the widget that answers it. With `lf-ask` retired, the author assigns that
part with the section or article round the widget that its heading opens and
that has an id (`obligations.framed_widgets`), so `obligationPlace` reads the
frame from `prompt.target` where it names an element other than the widget, in
place of a registry declaration (`x-encloses`).

That restores what `lf-ask` gave the frame: the location ring and the focus
`m` lands on, the arrival that starts at the frame's opening however tall it
is, being at the question anywhere inside it, digits answering from there, the
On Me marker beside its heading, and the ring and digits for a thread anchored
on it. A frame holding several obligations still leaves each at its own
widget, and a widget no section frames stands at itself.

The tests that the previous commit moved to the widget return to the frame.
# Conflicts:
#	examples/developer/feature-gallery.html
#	examples/ship-review.jsonl
#	skills/leaf/references/threads.md
#	tests/browser/navigation/test_obligation_walk.py
#	tests/browser/navigation/test_reading_place.py
#	tests/browser/startup/test_modules.py
#	tests/browser/test_render_application_boundary.py
#	tests/browser/test_render_options_settled.py
#	tests/browser/widgets/test_threads.py
#	tests/journeys/test_interact_anchors.py
#	tests/journeys/test_interact_contract.py
#	tests/model/interact_contract/test_thread_resolution.py
#	tests/model/test_interact_anchors.py
#	tests/model/test_interact_document.py
#	tests/model/test_interact_product.py
#	tests/process/test_interact_server.py
#	tests/process/test_read_state.py
#	tests/process/website_server/test_turn_answers.py
#	tests/render_cases_interaction.py
…tion's widget

With the frame standing for the question, the composer and the Page Map name it
as they name any section, "section · Which material?", where an `lf-ask` read
"question · …". A widget in a titled section with an id, which no `lf-ask`
framed before, is now framed by it, so `m` lands on that section. The tests
that held either say so, and the comments that the widget-only change rewrote
describe the ring round the question again.
# Conflicts:
#	browser/layouts.css
#	browser/registry.json
#	browser/types/contract.d.ts
#	examples/developer/versions/feature-gallery.v1.html
#	examples/developer/versions/feature-gallery.v2.html
#	examples/review-a-plan.html
#	examples/versions/review-a-plan.v1.html
#	examples/versions/review-a-plan.v2.html
#	packages/playground/instructions/author.md
#	packages/playground/registry.json
#	skills/leaf/references/page-layout.md
#	src/leaf/registry/kernel.py
#	src/leaf/render-checks/layout.js
#	src/leaf/schema.py
#	tests/browser/projection/test_revision_patches.py
#	tests/browser/test_native_document_layout.py
#	tests/browser/test_render_floating_panel.py
#	tests/browser/test_render_read_state.py
#	tests/browser/threads/test_agent_replies.py
#	tests/browser/threads/test_panel_list.py
#	tests/browser/threads/test_summaries.py
#	tests/browser/widgets/test_playgrounds.py
#	tests/fixtures/pages/root-parts.html
#	tests/fixtures/pages/root-tabs.html
#	tests/journeys/controls/test_rings.py
#	tests/journeys/test_render_read_state.py
#	tests/model/interact_contract/test_authored_markup.py
#	tests/model/test_interact_product.py
#	tests/model/test_workflows.py
#	tests/render_cases_layout.py
… heading opens

Max ruled that an On Me obligation is the whole region the author assigned to the
question, and that Leaf should not read an obligation's name or region out of
headings. He picked the named group (`question-region-group` on the markup-meaning
page): a question is `<section id role="group" aria-labelledby>` with an id on its
heading, or a `<fieldset>`.

What reads the group:

- `obligations.framed_widgets` takes the innermost authored ancestor of an asking
  widget that has `role="group"` or is a `<fieldset>`, in place of the nearest
  element with an id whose leading title is a heading. Python reads only the authored
  source, so the runtime's own group chrome holds no question.
- `prompt.text` is the group's name (`gesture_words.group_name`): the words of the
  elements `aria-labelledby` names, else `aria-label`, else a fieldset's legend, and
  the widget's own name where there is no group. A new `prompt.labelledby` holds the
  id of the first element the name comes from, or null, in the served schema and the
  browser's update records.
- `page check` refuses (`unframed-question`) an asking widget no named group holds,
  naming the group where one stands unnamed, and (`question-group-id`) a group with no
  id. The advice `untitled-question` goes. Thread messages, records widgets,
  suggestions and widgets in a sample stay exempt.
- `arrivalRegion` reads `prompt.target` and the block holding a change set among
  words, and no longer the heading over a widget (`partOver`) or the block before it,
  which walked every text block of the page on each arrival. One obligation in a group
  still stands at the whole group; shared groups and record units stay at their
  sources (`place.js`, unchanged).
- An arrival now reveals the obligation's source through its own scrollers before it
  aligns the group, and counts the obligation as in front of the user only where its
  source is readable too, so a group round a card that scrolls its answer brings the
  answer into the card.
- A section told it has a definite height gives its last child the height even when
  that child is its only one, so a playground alone in a group a workspace's header
  names fills the window as a bare playground did.

Shipped text teaches the group: `authoring-on-me.md` "On the page" with an example
and "Permission", `module-reading.md`'s prompt fields, `package-data.md`, the deck
and playground author instructions, the `lf-options`, `lf-draft` and `lf-deck`
author text, `docs/how-it-works.html`, and two eval rubrics that described a section
framing a question.

Every authored question was converted by script from the section the old rule found,
and checked by running the new check over each page and registry example: 58 groups
on 25 example pages, 10 in 8 fixture pages, 29 in 18 eval files, and 357 in test
sources. `PAGE`'s Plan section in `interact_support` is a group named by
`aria-label`, so a widget a test writes there asks as it did.

Tests whose behavior changed:

- `test_a_question_on_a_page_stands_in_a_group_its_author_names` replaces the
  untitled-question advice test, holding names, `labelledby`, refusals and
  exemptions.
- `test_a_bare_choice_hands_its_ring_to_the_row_the_user_tabs_to` is deleted: a bare
  choice can no longer stand on a page.
- `test_an_arrival_does_not_reach_back_into_the_obligation_before_it` and its page
  are deleted with the block-before walk they guarded.
- `test_an_obligation_inside_a_card_is_brought_into_that_card` now puts the answer
  in a card inside the group; it fails without the source reveal above.
- The suggestion arrival test expects the sentence holding the change at the
  landing band's top, with the heading above it.
- Tests of bare widgets put them in a named group and expect the group where `m`
  lands (`test_a_questions_options_own_their_digit_bindings`, the draft's Back test).
…s in a workspace

A playground alone in a named group that is a workspace's body left its Reset under
the floating panel after a Tab at 900x500, where the same playground standing as the
body kept it clear (`test_inline_playground_keeps_half_a_short_workspace_for_its_stage`).
Measured after the Tab: bare, the playground is the body's scroller, its scroll height
490px (418px of rows plus the 72px panel room) with a 72px scroll padding, scrolled
100px, Reset at 383-411px above the panel at 442px; grouped, the section is the
scroller, its scroll height 418px and its scroll padding auto, scrolled 21px, Reset at
462-490px under the panel.

Two rules assumed the playground is the body:

- The playground declared `min-block-size: 0` under a full height, so inside the
  section it shrank to the section's 318px content box and its 418px of rows
  overflowed it. The section's end padding stands after its child's box, not after
  that overflow, so the panel's room left the scroll range. A box that scrolls has no
  automatic minimum, so the declaration only ever acted where the playground does not
  scroll; it now keeps the minimum its rows set, as the section's rule already asks
  of every answer.
- The scroll padding that keeps a revealed control clear of the panel sat on the
  playground, which scrolls only when it is the body. It moves to the workspace body,
  the box that pads its end with that room, as a pane's body already does (base.css),
  so it holds for any widget alone in a group.

Measured after the fix, both pages scroll 100px and stand Reset at 383-411px. Each
change alone leaves the test failing.
Brings in #6234 (grouped declarations; an `lf-options` asks with no attribute;
`selected` and `required`), #6238, #6244, #6232 and #6214.

- Each named group stays, with main's attributes inside it: no `choose`, `selected`
  for `chosen`, `required` for `needed`, swept over the branch's own converted
  examples, fixtures, evals and tests.
- `lf-ask` stays deleted, and with it `state.encloses`, which only `lf-ask`
  declared: dropped from the declaration schema, `$keys` and the generated types.
- Main's `author.instructions` and examples carry the branch's text: the named group
  in place of `lf-ask` for `lf-options`, `lf-option`, `lf-draft`, `lf-tally`,
  `lf-deck` and `lf-playground`.
- The kernel marks take main's `paint.flow`, which the earlier merge had dropped, so a
  tab set written `flow="page"` is painted as one again.
- `PAGE` keeps main's settled `PAGE_GROUP` inside the branch's named groups.
- Main's fixtures whose option groups now ask stand in named groups where they were
  bare on a page.
Scored on the asking eval cases, authors given the named group often kept the
section's subject heading and nested a small group round a new question heading and
the options after the evidence, so `m` skipped the captures and tables the user
judges: `proposals-show-what-they-change` failed 2 of 2 on that, where `lf-ask` on
main passed. "On the page" now says the group is the section holding the question
and its case, opened by a heading that asks, and that a smaller group after the
evidence leaves it outside what `m` selects; its example holds a table.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two of these are about what the change adds rather than how it does it: the new prompt.labelledby field has no reader, and the full-height layout rule that replaced ask.css now applies to every <section> in a full-height box, not just question groups. Both are inline, along with two registry descriptions that still describe lf-ask and the enclosing widget.

The focused model tests over obligations, authored markup and the interact document/product suites pass at this head (512 passed).

Comment thread src/leaf/obligations.py Resolved
Comment thread browser/layouts.css Resolved
Comment thread browser/registry.json Resolved
Comment thread browser/registry.json Resolved
# Conflicts:
#	src/leaf/validation/instances.py
CI (run 44027746183) failed four tests, all passing on main at fe402e3:

- `test_a_completed_obligation_stays_reachable_through_on_me` [390], [1200]: the
  served obligation record carried `prompt.labelledby`, which the test's expected
  record lacks. Fixed by dropping the field (below); the test protects an answered
  obligation staying reachable under On Me's Done.
- `test_a_seated_reply_lends_its_widget_to_the_panel_and_takes_it_back`: a reply's
  widget stands in one drawing at a time, and a drawing that doesn't hold it shows the
  reply's words alone. `heldElsewhere` dropped each custom element, which took an
  `lf-ask` whole, but a named group is plain markup, so the seat kept the question's
  heading with nothing to answer it. A question's group now goes whole with the widget
  it holds.
- `test_every_table_the_theme_sets_honestly_passes_the_gate`: it cut two questions
  out of fixture pages by their old opening tags, which now carry the group's
  attributes; it matches them by their id.

Review findings:

- `prompt.labelledby` goes from the schema, the four writers, the browser's update
  record, `contract.d.ts`, `module-reading.md` and the tests: nothing read it, and
  the group's own `aria-labelledby` is one DOM read from `prompt.target`.
  `group_name` returns the words alone.
- The full-height rule in `layouts.css` is scoped to `section[role~="group"]`, so an
  ordinary section that is a workspace's body or a page tab's one block keeps its
  document flow; `module-scroll-and-motion.md` says a question's group passes the
  height on.
- `browser/registry.json`'s `words.word` no longer names `lf-ask`, and
  `state.awaits` reads a thread anchored inside the group the author declares round
  a widget, not inside an enclosing widget. No other registry or reference
  describes either.
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
# Conflicts:
#	browser/runtime/obligations/view.js
#	browser/styles/components/reading.css
#	tests/browser/projection/test_current_location.py
#	tests/browser/test_native_document_layout.py
#	tests/browser/widgets/test_obligations.py
…with its alternative

Root AGENTS.md (#6210, #6212) keeps a decision's date and the incident behind it in
the commit, and has a header state the decision, its reason, whether the user made
it and the alternative a later change might reach for.

- `framed_widgets` states that the author declares a question's region and name, as
  the user chose, and names the two alternatives, the section a heading opens and a
  widget of Leaf's own, with why each fails. Its history moves here: an `lf-ask`
  declared the question until 16 November 2026, when the user chose plain HTML, and
  of the section rule and the named group built that day chose the group.
- `arrivalRegion` says what landing on a change alone would do, and why a heading or
  the block before a change is no region.
- The full-height rule says why every other section keeps its flow, and the
  playground's rule why a minimum of zero fails inside a group that scrolls.
- Two test docstrings and a subtest comment say what would go wrong rather than what
  once did.
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
max-sixty added a commit that referenced this pull request Nov 17, 2026
…ading inside it (#6264)

Leaf now names plain markup by the caption HTML gives it: a disclosure
by its `<summary>`, an `<hgroup>` by its heading, and a `section` or
`article` by the heading it opens with, alone or in an opening
`<hgroup>`. No other plain element is named by a heading inside it.
`titledElement`, the package API that says which element a heading
titles for the contents' stretches, a heading's link address and its
preview's thread count, follows the same rule, plus a widget the heading
leads unless the widget's `label` names it. Both replace longer rules
that let any element take a leading heading found inside a `<header>`,
past an eyebrow, or wherever every other heading inside ranked lower;
the outline walk behind them goes. Registered widgets keep their
leading-title rule until their titles move to `label`. A section's
`aria-labelledby` or `aria-label` doesn't yet win over its heading: that
follows #6256, whose `group_name` already reads `aria-labelledby` in
Python, so the two runtimes share one reader rather than gaining a
second.

Max picked this rule on his design page for where Leaf takes facts about
a page, as the one reading of position "Read what the page states"
(#6255) allows.

What to weigh: on 274 real pages, 2,373 of 2,852 sections and articles
open with a heading and keep their names. 109 lose theirs: 54 open with
a paragraph such as an eyebrow, which page-authoring.md already teaches
to put in an `<hgroup>`, 28 have their heading later, 22 open with a
`div`, and 5 wrap another section. Another 232 wrap an `lf-ask` and lose
the question's name; #6256 makes the question itself the section. In the
examples, `alert-thresholds.html`'s six evidence articles opened with a
`<header>`; their heading and threshold now stand in an `<hgroup>`,
which keeps them named and measures the same.

Tests: runtime suite, `test_obligations.py`, a heading-link and a
contents browser test. Codex reviewed it; its two findings, widget
titling and chrome inside an `<hgroup>`, are fixed with tests, as is the
auto-review's note on that example.

> _This was written by Claude Code on behalf of max-sixty_
# Conflicts:
#	examples/developer/feature-gallery.html
#	examples/ship-review.jsonl
#	tests/browser/navigation/test_obligation_walk.py
#	tests/browser/navigation/test_reading_place.py
#	tests/browser/test_render_application_boundary.py
#	tests/browser/test_render_floating_panel.py
#	tests/browser/test_render_options_settled.py
#	tests/browser/threads/test_agent_replies.py
#	tests/browser/threads/test_panel_list.py
#	tests/browser/threads/test_summaries.py
#	tests/journeys/test_interact_contract.py
#	tests/model/test_clerk.py
#	tests/model/test_interact_anchors.py
#	tests/model/test_interact_document.py
#	tests/process/website_server/test_turn_answers.py
#	tests/runtime/addressable-name.test.mjs
#	tests/runtime/place-preview.test.mjs
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
# Conflicts:
#	tests/browser/projection/test_revision_patches.py
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
# Conflicts:
#	tests/browser/navigation/test_obligation_walk.py
#	tests/browser/navigation/test_reading_place.py
#	tests/browser/startup/test_modules.py
#	tests/browser/test_render_application_boundary.py
#	tests/browser/test_render_floating_panel.py
#	tests/browser/test_render_options_settled.py
#	tests/browser/test_render_read_state.py
#	tests/browser/threads/test_agent_replies.py
#	tests/browser/threads/test_panel_list.py
#	tests/browser/threads/test_summaries.py
#	tests/browser/threads/test_targets.py
#	tests/browser/widgets/test_threads.py
#	tests/journeys/test_interact_anchors.py
#	tests/journeys/test_interact_contract.py
#	tests/journeys/test_render_read_state.py
#	tests/message_html_cases.json
#	tests/model/interact_contract/test_revendoring.py
#	tests/model/interact_contract/test_thread_resolution.py
#	tests/model/test_interact_anchors.py
#	tests/model/test_interact_document.py
#	tests/model/test_interact_product.py
#	tests/process/test_interact_server.py
#	tests/process/test_read_state.py
#	tests/process/website_server/test_turn_answers.py
#	tests/render_cases_interaction.py
#	tests/render_harness.py
@max-sixty
max-sixty merged commit 97791d2 into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the question-section-frame branch November 17, 2026 08:39
max-sixty added a commit that referenced this pull request Nov 17, 2026
…a page tab's end room (#6284)

This answers the review of #6256 (which retired `lf-ask` for a group the
author names) that arrived after it merged. "Group" now names only the
question, `page check` reports each question group once with everything
it lacks, a thread copy keeps a figure's caption, and a playground in a
short page tab keeps its actions clear of the floating panel.

## What changed, by finding

1. **"Group" names the question only.** Where shipped text meant the
options element it now says "the `lf-options`" or "the options": the
`lf-options`, `lf-option`, `lf-shot` and `lf-board` instructions, the
`$keys` entries (`words.visual`, `unit`, `when`, `answered`, `retired`,
`$restated`), monitoring's author and coordinator instructions,
`threads.md`, `event-batches.md`, `module-input.md`, `package-data.md`,
the handling text a delivery gives the agent, and two site pages. The
risky one, `authoring-on-me.md`'s Permission section, now says the pick
belongs to the `lf-options` `publish-report`, not the section round it,
and that the `lf-options` is what `restated` marks.
2. **The deleted ring test is back.**
`test_a_choice_sharing_its_group_hands_its_ring_to_the_row_the_user_tabs_to`
uses two `lf-options` in one named group, where each obligation stands
at its own source.
3. **Stale text.** A playground always asks, so its instructions put it
in its question's group, and `page-layout.md`'s "A workspace" shows that
group as the body, named by the header's heading (the form
`SHORT_WORKSPACE_PLAYGROUND` uses). `authoring-on-me.md` now says
`aria-labelledby` names the heading that asks the question, usually the
group's opening one. The feature gallery, a docstring and two CSS
comments stopped describing headings, a playground that is the body, and
`lf-ask`.
4. **`question_errors` reports each group once.** `ungrouped-question`
fires once per widget no group holds. `question-group` fires once per
group and lists everything it lacks: an id, a name, or both. A
fieldset's finding asks for a `<legend>`, and any other group's asks for
`aria-labelledby`. The codes `unframed-question` and `question-group-id`
are gone.
5. **`heldElsewhere` drops only a question's group.** It removes the
innermost group round a widget that asks (`state.awaits`, not
`words.inline`), which is how Python's `widget_groups` reads it. A
`<figure role="group">` round an `lf-chart` keeps its caption. The new
runtime test fails on the old code.
6. **Nits.** The `discussed_by` docstring now covers a name that stands
outside its group. `frameHolding`, `inFrame`, `framed` and the header's
"frame" are now `groupHolding`, `inGroup`, `alreadyArrived` (the
function asks whether the user already sees the arrival) and "group".
Python's `framed_widgets` became `widget_groups`.

## The page-tab check

Dropping `lf-playground`'s `min-block-size: 0` in #6256 changed nothing
the user sees. I measured a full-height workspace at 900×500, with a
playground's group as a page tab's only block. On #6256's parent (with
`lf-ask`) and on main alike, Send stood at 455–487 px once the tab set
was scrolled to its end, and the floating panel covered Reset and Show
instruction. The only difference was where the playground's own box
ended.

The cause was the one-block tab's own `min-block-size: 0` in `tabs.css`.
It let the tab shrink below its block, so the tab's end room landed
inside the window instead of after the bar. That rule is gone: the tab
now keeps its block's height, the set scrolls 106 px instead of 26, and
the bar stands above the panel. A pane or side list alone in a page tab
measures the same as before, because each scrolls inside the height it's
given. The new browser test tabs to each action and checks the panel
doesn't cover it. On the old rule it fails with "Reset stands under the
panel".

I didn't add a check that refuses `restated` on plain markup. Today that
markup passes `page check` silently, but no real page has shown an agent
writing it, and `checks-and-guidance.md` asks for that evidence before
adding a narrow check.

## Scored

The wording changes to shipped instructions were scored on nine asking
cases, with Opus 5.5 as author and judge: 8 of 9 passed. The one
failure, `playground-choice-has-one-surface`, passed its rerun on this
branch, and main failed that same case beside it.

## Tests

- `test_a_question_on_a_page_stands_in_a_group_its_author_names` (the
check test, rewritten), plus all of `test_interact_product.py`,
`test_obligations.py`, `test_clerk.py` and `test_product_page.py`: 170
passed.
- 29 browser test runs passed: the restored ring test, the new page-tab
test, and tests on obligation arrival, thread choices, the stream-reply
copy, page tabs, side lists, workspace end room and workspace
playgrounds.
- `test_layer_contract`'s snapshot was reset for the new handling text,
and the stop-guard test updated to match.
- `pnpm run check`, which includes `pnpm run test:runtime` (1007
passed): passed.
- The feature gallery and both edited site pages build through `page
check`.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 17, 2026
…ape, and give `$marks.paint` and `$state` names of their own (#6257)

A widget's registry entry now holds every fact beside `description`,
`attributes` and `content`, with no group objects, as Max chose after a
design review of #6234. The PR also carries four smaller fixes from that
review.

## The flat declaration

Each fact keeps its own shape and loses only its group: `state.verbs` is
`verbs`, `data.inputs` is `inputs`, `author.example` is `example`,
`words.word` is `word`. `lf-options` on `main` and here:

```json
"lf-options": { "description": …, "attributes": …, "content": "members",
  "state": { "awaits": …, "verbs": … }, "author": { "instructions": …, "example": … } }

"lf-options": { "description": …, "attributes": …, "content": "members",
  "awaits": …, "verbs": …, "instructions": …, "example": … }
```

The 29 fact names are all distinct (`encloses` left with `lf-ask` in
#6256), and none is `description`, `attributes` or `content`. Readers
use plain property access (`entry.get("verbs")`, `entry.verbs`), so
`declared_fact`, `declaredFact`, `FACT_GROUPS`, the group-path joins in
`DECLARATION_KEYS` and the `_facts` helper are gone. `$marks` is keyed
by fact name. The `{when}` form, and the import-time refusal of it on a
fact that isn't a mark, read flat names.

The needs table and its `needs-fact` finding are gone too. The
declaration schema now says it with `dependentRequired`: `retired-when`
needs `owners`, and `shows` needs `owners` and `refers`. The refusal
reads:

```text
main:  registry.json: <lf-old> state.retired-when needs markup.owners
here:  registry.json: <lf-old> is not a valid declaration ($keys): 'owners' is a dependency of 'retired-when'
```

**A declaration refusal names where it points.** `invalid-declaration`
adds the path the schema's words leave out, and findings that name a
fact by its key mark it as code:

```text
main:  <lf-activity> is not a valid declaration ($keys): 'top' is not one of ['start', 'end']
here:  <lf-activity> is not a valid declaration ($keys) at `bound`: 'top' is not one of ['start', 'end']
main:  <lf-log> is not a valid declaration ($keys): Additional properties are not allowed ('bound' was unexpected)
here:  <lf-log> is not a valid declaration ($keys) at `views`: Additional properties are not allowed ('bound' was unexpected)
```

A fact left in its old group, a misplacement at the top, reads the same
on both: `Additional properties are not allowed ('paint' was
unexpected)`.

**Smaller shape fixes.** Every flag fact is `const: true` (`exhibit`,
`verbatim`, `shadow` and `inline` were booleans no declaration wrote
`false` to), and `exhibit` keeps its `{when}` form. `shows` names the
attribute naming its widget `reference`, as an input's `reference` does;
both are an attribute `refers` declares.

**What `{when}` conditions.** A reader asking of one occurrence reads a
fact through `holds_for`: delivery's paint, and for `exhibit` the
quoting (input, admission, compound membership). A reader asking whether
the tag declares the fact reads the declaration: for `exhibit`, whether
widgets inside put anything on On Me (`obligations.shown_in`). An
interactive sample needs the two apart, since its widgets take input and
ask nothing, so `exhibit` stays one fact and `$keys.exhibit`,
`holds_for` and the schema now say which reader asks which.

**`$keys` is flat and carries no layout.** It is keyed by fact name, and
its members run in the site reference's order. The reference's section
headings (State, Structure, Words, Paint, Data, Authoring, and Element
over `attributes` and `content`) live in `dev/leaf_dev/docs.py`
(`KEY_SECTIONS`), each placed before the key it opens on with one line
on who needs its keys declared; `docs.py` refuses a section that opens
on a key `$keys` doesn't document. Sections are h3 headings over h4 key
entries. Each entry's anchor is the fact's name (`/extending/#verbs`),
each section's `keys-<title>`.

Every registry in the tree is flattened: the bundled packages, the
examples' page-owned registries, the fixtures, and the JSON in the
references, site pages and eval cases. No dotted fact path is left
anywhere. Bare paths in prose became the fact's name in code formatting,
and a parenthetical that only repeated its word ("verbs
(`state.verbs`)") became the name alone. No page protocol bump, as with
#6234: a page's own `page/registry.json` in the grouped shape fails
`page check` with `invalid-declaration`.

## The four earlier fixes

- **A conditional fact is recognised by its shape**, `{when: {attribute:
[values]}}`, in `holds_for` and `holdsFor`. Delivery, the browser's
message paint and the condition check apply it to every mark, so the
three lists naming `exhibit` and `flow` are gone. Only a mark may take
the form, and `leaf.schema` fails at import when a fact `$marks` doesn't
name takes it.
- **Two renames.** The `$marks` member naming each mark's DOM attribute
is `attribute` (was `paint`), and the layer fact documenting a verb's
fields is `$verbs` (was `$state`), as `$awaits` documents `awaits`.
- **Two lists.** The key table in `src/leaf/passages.py`'s header and
the bullets in `aimableAt`'s comment are lists again.
- **The option guard.** The 21 live-group guards in
`packages/default/styles/options.css` are weightless,
`:not(:where([data-lf-exhibit]) *)`, as `board.css` and `draft.css`
write them. The two competitions their weight decided now say so where
they happen: a picked card's caption room takes the card rule's weight
(`:where([selected])`), and a `top: 8px` the live seat always overrode
is deleted. Every computed property of every option group and each
element and pseudo-element in it matches base on feature-gallery,
alert-review and ship-review, at rest and in nine other states, except
`top` on the key-badge spans paper hides.

## Calls to reverse

- The reference's sections are placed by the key each opens on, so a key
added to `$keys` falls in the section before it; an Element heading
covers `attributes` and `content`, which no section held.
- `exhibit` keeps both meanings in one fact; splitting asking from
quoting would add a fact for the interactive sample alone.
- `$states`, composition's stamp of each verb's writer and definition,
keeps its name: it belongs with `state_definition`, `stampedState` and
`sameStateDefinition`.
- The schema of the `verbs` map is `VERBS_SCHEMA` (was `STATE_SCHEMA`).
- The schema names each fact that takes `{when}` rather than letting any
boolean mark take it, since `verbatim` and `inline` have readers outside
delivery that would each need `holds_for` first.

## Checks

- `pnpm run check`: pass (1,006 runtime tests).
- `uv run pytest tests/model -n 4`: 3,612 passed.
- Browser, by file or node id: the three option files, obligations,
tabs, sample delivery, live samples, render gate, revision delivery,
workspaces and bounds, the message-mark, bounded-reply and
inline-suggestion tests, and the 78 browser tests whose body or fixture
the flattening changed: 373 passed, 4 xpassed. Two fail, and fail the
same way on a snapshot of `main`:
`test_the_state_wait_covers_a_status_that_moves_neither_log_nor_data`
(the leaf reads "Claude awaits" where the test expects "Ready") and
`test_a_tab_strip_is_named_as_the_chrome_names_its_set`.
- `tests/journeys/widgets/test_pressed_controls.py`, all 16 packages'
params: pass. Its page script had read `?.state?.verbs`, which the
optional chain hid; it reads `?.verbs` now.
- `page check` on all 55 authored sources and product documents, built
as pages: pass.
- `leaf package check --render` on the 13 bundled packages with a
registry: status 0; the 12 `keeps-first-box` advice findings (diff,
playground, timeline) are the same on base.
- A tree-wide search finds no dotted fact path. Its three matches name
other things: CodeMirror's `markup.inline` scope, a message event's
`event.data.height`, and the Python call `words.says(event)`.
- Evals, Claude Code, head beside `main`, two runs each:
`package-text-widget-keeps-the-measure`, `recorded-effect-payloads` and
`widget-checked-before-handoff` pass 6 of 6 on each arm, $3.06 for the
authors. In the two cases whose answers write declarations, every head
answer writes the flat shape (`verbatim` and `verbs` beside
`attributes`, no group object) and every base answer the grouped one;
`widget-checked-before-handoff` answers write none.
- Independent Codex reviews of each round found no issues; the schema
and independent reviews' findings are folded in.
- After the review fixes: `tests/model` 3,614 passed, `pnpm run check`
passed, `page check` on seven sources with their own registries or the
reference passed, `package check --render` on default, playground, diff
and reading unchanged, and the board, sample and message-mark browser
tests passed.
- The option-guard proof, the `{when}` import check and the earlier
rounds' checks are in the commits.

- After merging `main` through #6284 (#6256 retired `lf-ask` and
`encloses`): `pnpm run check` passed (1,007 runtime tests),
`tests/model` 3,615 passed, the obligation, option, sample,
pressed-controls and message-mark browser tests and the browser tests
#6284 changed passed, and `page check` on seven sources and `package
check --render packages/default` passed. Everything `main` added is
flat, including a new runtime test's fixture, and no dotted fact path is
left.

Not run: the rest of `tests/browser`, the journeys tier, Codex evals,
Firefox.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 17, 2026
…red (#6295)

Seven browser tests on `main` broke because #6256's markup migration
left test pages behind. This fixes those pages, not the runtime. Each
test failed on `main` at 2aabb54 and passes on this branch. So do the
rest of `test_commenting.py`, which shares one of the edited pages, and
the model tests that read the fixture corpus.

#6256 made every question a named group and gave its heading an id for
`aria-labelledby`. Four pages didn't follow that:

- **Live-keys pages** (`test_current_location.py`, three tests).
`LIVE_KEYS_APPARATUS` and both rewritten pages replaced `<h2>Which
one?</h2>`, which no longer matched once the heading had an id. The
replacement silently did nothing, so `#lk-note` and `#lk-tick` never
reached the page and each test waited out its 120 s timeout. The pages
now replace the heading through one constant, `LIVE_KEYS_ASKS`.
- **Tabs revision** (`test_tabs.py`). The revision added an
`<lf-options>` outside any group, which `page stamp` now refuses. It now
writes the question in a named group.
- **Runbook fixture** (`sidebar-contents.html`, the contents-marks
test). The migration made the whole "Switch the services" section the
group, including the paragraph and the Ledger subsection where its
threads are anchored. A comment inside a question's group hands the
question to the agent, so the question left the user's On Me list and
the row showed `thread`. The group now wraps only the options, named by
`aria-label` so the contents gain no row.
- **Where-I-stand page and the first-line aim case**
(`test_key_scopes.py` aim subtest, `test_render_aim.py[first line]`).
Leaf takes the nearest element with an id as a comment's target. With an
id on the heading, Alt-clicking it commented on the heading rather than
the question. Escape then returned focus to the heading, and the comment
stood in the heading's own margin row. Both pages now name the group
with `aria-label`, so the heading has no id and the tests check aiming
at the question again.

The last item is a choice about what the evidence leaves open. Pages
written the way the reference teaches still comment on the heading.
#6296 asks the maintainer whether a heading its group names should aim
at the group, which would be one rule in `aimTargetAt`. This PR moves no
runtime behavior.

#6289 edits lines near these in the same files, so whichever lands
second will need a small rebase.

Closes #6292 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 17, 2026
…question (#6308)

Four journeys that run only in the daily scheduled run have failed since
#6256, which made `page stamp`, `page check` and `/api/samples` refuse
an asking widget that no named group holds. Each journey's page still
wrote a bare question. This PR fixes those pages and changes no runtime
behavior.

- **Scroller-edge focus journey**
(`tests/journeys/controls/test_focus.py`). The `options` and
`playground` entries of `EDGE_CONTROLS` now stand in a group named by
`aria-label`, so no heading joins the bounded log. Only that journey's
`edges_page` reads these entries, so the browser-tier tests in the same
module are untouched.
- **Live-shell artifact journey**. Its `#study` section is now the named
group around `#choice`.
- **`notes/feeds/page.html`**
(`test_page_fixtures_pass_check[notes/feeds/page]`). Each of the feed
sample's three asks (`ask-venue`, `ask-numbers`, `ask-ci`) is now a
group named by its heading.
- **Feature gallery**
(`test_presses_and_fills_leave_no_element_naming_stale_keys[feature-gallery]`).
When the journey pressed Create sample,
`feature-gallery.page/generated-sample.js` posted a sample page whose
`<lf-options>` had no group, and `/api/samples` refused it with the 400
the teardown reported. The generated source now writes its question in a
named group.

Verification: the feature-gallery node failed locally with that 400 on
main before the change. Scheduled run
[44068597322](https://github.com/max-sixty/leaf/actions/runs/44068597322)
records the other three failing. With the change, all 65 tests of the
four named tests and modules pass locally (`-n 3`), and so do
pre-commit's hooks on the edited files.

Closes #6298 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 18, 2026
… drawing it (#6312)

An agent's message whose widget opens on the same line as its content,
such as `<lf-code id="x"><pre>…</pre></lf-code>`, is refused for what
CommonMark does to it, and only that. CommonMark reads a custom tag
sharing its line as inline HTML, so Markdown draws a paragraph around it
and the `<pre>` closes that paragraph along with the widget. Before, the
agent got a browser stack trace (`<lf-code> has no data body`) from the
draw check, which runs before the markup gate. Now the draw check leaves
markup the HTML parser repairs to the gate, and the gate's fragment
stage reports a repair's findings alone, as its later stages already do.
The refusal reads:

```
the HTML in the comment doesn't validate. Its Markdown draws this HTML, where the findings count lines:
   1  <p>Here:</p>
   2  <p><lf-code id="snippet"><pre><code class="language-python">print(1)</code></pre></lf-code></p>
Findings:
  - unclosed tags: <lf-code> (line 2)
```

Max asked what the standard handling is for widgets written on one line
(open item #8 from #6247). It's what Leaf's readers already do: a parser
can't tell whether a custom element is block or inline, so CommonMark
starts a block of HTML at one only when its tag is alone on its line
(jgm in commonmark/commonmark-spec#758 and
commonmark/commonmark-spec#239; commonmark/commonmark-spec#770, which
would make hyphenated tags block-level, is still open). GitHub and
markdown-it follow that. VitePress departs from it by treating every tag
missing from a list of inline tags as block-level. Since #6256 a
question is a `<section role="group">` or `<fieldset>`, which CommonMark
reads as a block even on one line, so this rule now matters only for a
data widget written on one line.

Ran the model and process tests around message markup, and the journey
test for a widget that fails to draw.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 18, 2026
…ding aims at the question (#6345)

A question takes its name from `lf-group`'s `label` since #6315, so
nothing reads the ids on headings that open an `lf-group`. Those ids
were added in #6256 for `aria-labelledby`. Leaf aims a comment at the
nearest element with an id, so with them in place, pointing at a
question's heading commented on the heading instead of the question.
This PR removes them, so pointing at the heading aims at the question
again, as @max-sixty decided in #6296. Without an id, such a heading
offers no copy-link control, as it did before #6256. No runtime code
changes.

- Removes the id from all 63 headings that open an `lf-group` in
`skills/leaf/references/authoring-on-me.md`, `examples/` (including the
page source the feature gallery's generated sample writes), `docs/`, and
the playground package's `instructions/author.md` and `registry.json`
example. I checked that no other tracked file refers to these ids. The
one match, `ship-ask-h`, is in a test's own fixture.
- Drops the sentence "An id a heading needs for `aria-labelledby` is not
the section's address" from `page-authoring.md`. #6315 left it stale.

Test fixtures and `leaf-dev bench` pages still put ids on such headings.
They are outside the decision's scope, and leaving them changes nothing
a user sees.

Checks I ran: the registry-example, docs and published-page tests in
`tests/model/test_product_page.py` and
`tests/model/test_interact_product.py` pass. `leaf page check` reports
no markup findings on preview builds of `alert-review` and
`notification-playground`. Chrome couldn't launch in the sandbox, so the
browser half of that check didn't run.

Closes #6296

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 18, 2026
…ons that still showed a section (#6365)

#6256 retired `lf-ask` and #6315 made a question's group an `lf-group`
named by its `label`, so `page check` refuses a bare `lf-options`
outside a group as `ungrouped-question`. Some shipped text still showed
the old shape, and an agent copying it got refused. This PR corrects
that text.
`lf-board`'s "One answer in its question and on a board" instructions
(`packages/default/registry.json`) now wrap the snippet's `lf-options`
in an `lf-group` whose label asks the question, and the prose says "its
question's `lf-options`" rather than its section's. The matching heading
in `authoring-on-me.md` follows.
`packages/detail/instructions/author.md`, `authoring-on-me.md` (the
finding-then-question paragraph and the permission example's "not to the
section round it") and `package-data.md`'s "Views of an answer" now name
the question's `lf-group` where they named a section.
Eval comments that named `lf-ask` now name the question's `lf-group` or
a page widget (`words-question-takes-a-thread`,
`option-cards-take-their-width`, `options-draw-their-arrangement`,
`options-stay-words-for-wording`, `workflows/usability_eval.yaml`).
Fixture data that records past state is left as it was.
`view-reveal-arrival`'s prompt no longer claims `layoutChanged` returns
a promise, since `browser/runtime/widget-upgrade.js` returns nothing
from it.
Verification: I wrote the board snippet into a scratch page and ran
`bin/leaf page check` on it. Before the change it failed with
`ungrouped-question` on `<lf-options id=rail-choice>`. After the change
it passes. Across every package registry's `instructions` there are only
two HTML snippets, `lf-text-document`'s and `lf-board`'s, and both pass
`page check` now. I added no regression test: two snippets don't make it
cheap enough to pay for, a registry-only test would leave the package
`instructions/*.md` snippets uncovered, and an agent that copies a bad
snippet already gets the refusal from its own `page check`. A grep of
`skills/`, `packages/*/instructions`, `packages/*/registry.json` and
`docs/` finds no other `lf-ask` or section-as-group wording. Focused
tests on registry instructions pass, as do `dev/tests/test_evals.py`
cases apart from one that needs `pnpm install` in this environment.

Co-authored-by: leaf-agent <[email protected]>
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