Skip to content

Name the code's ask and to-do records asks and to-dos, as the interface does - #2658

Merged
max-sixty merged 9 commits into
mainfrom
asks-and-todos-names
Oct 13, 2026
Merged

max-sixty merged 9 commits into
mainfrom
asks-and-todos-names

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

#2506 renamed Leaf's user-facing vocabulary: the user's list is Questions, the agent's is Tasks, and their items are asks, to-dos and resends. The code kept the old words underneath (questions.py, readQuestions, x-question-context, TaskReading, the task keyboard scope). This renames every identifier that names an ask record to ask and every one that names a to-do record to todo. Names for the Questions and Tasks lists, the leaf task command, plain English and UI copy such as "Next question" keep their words.

Main renames

  • Files: leaf/questions.py → asks.py, leaf/tasks.py → todos.py, runtime/questions/ → runtime/asks/, references/authoring-questions.md → authoring-asks.md, and their tests.
  • Widget API (in module-authoring.md): readQuestions → readAsks, watchQuestions → watchAsks, questionWords → askWords, questionActions → askActions.
  • Registry key x-question-context → x-ask-context; data-lf-question → data-lf-ask; --lf-question-ring → --lf-ask-ring and the ring name ask; margin entry ids ask:/todo:; keyboard scope todo and queue.todo.done.
  • Python: QuestionRegistration, ThreadQuestions, TaskReading → TodoReading, and so on; eval cases task-* → todo-*.

Behavior changes

  • lf-tabs reads "2 of 3 answered" / "All 3 answered", as lf-tally counts, instead of calling a tab's asks Questions.
  • layer.incompatible_layer, the one reading every page server and the append door refuse on, now also refuses a page whose vendored layer documents an x- key this Leaf no longer admits, naming leaf page init; page check asks it first too, so it also names the re-vendor for a protocol mismatch. Without it, a page vendored before this rename would keep x-question-context and silently lose its asks' prompt words, and replies would still be admitted on a published one. incompatible_revision applies the same check to each captured revision, so after a re-vendor an older revision that still uses the retired key is refused (409 to open, refused input) as a foreign-protocol revision is. The check is one-sided: a vocabulary lacking a key Leaf added later is not refused. compose_candidate keeps the re-vendor hint when a layer fault surfaces while composing a page's own declarations.

Every page vendored before this lands documents x-question-context, so after it lands each one refuses to serve, check or stamp until leaf page init re-vendors it; the refusal names that command.

Nothing in the event log, the browser's posts or the served state's keys changes, so there is no protocol bump.

The mechanical part is generated by a script (identifier-aware for Python and JS), so if main moves under this PR it is regenerated rather than conflict-resolved; the prose edits are a separate commit.

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

max-sixty and others added 4 commits October 12, 2026 13:40
#2506 renamed the user-facing lists, Questions and Tasks, and their items,
asks, to-dos and resends, but left the code calling an ask a "question" and
a to-do a "task". This is the mechanical half of the rename, generated by a
script that re-applies it to any checkout of main: file moves and
whole-identifier substitutions, then the rebuilt bundle, formatting, corpus
and registry key index.

Contracts that change:

- The widget API exports `readAsks`, `watchAsks`, `askWords` and
  `askActions` (was `readQuestions`, `watchQuestions`, `questionWords`,
  `questionActions`); `module-authoring.md` documents them.
- The registry key `x-question-context` is `x-ask-context`; the runtime
  paints `data-lf-ask` (was `data-lf-question`) and the theme reads
  `--lf-ask-ring` (was `--lf-question-ring`); the ring an ask wears is
  named `ask` in `--lf-focus-ring`.
- The ask view presents as the region `asks`; an ask's margin entry id is
  `ask:<id>` and a to-do's `todo:<id>`.
- The Python modules `leaf.questions` and `leaf.tasks` are `leaf.asks` and
  `leaf.todos`, with `TodoReading`, `todo_reading`, `owed_todos`,
  `todo_error` and the `thread_asks`/`widget_asks`/`all_asks` readings.
- The keyboard scope that stands on a to-do waiting on the user is `todo`,
  and its Done command is `queue.todo.done`.
- The floating panel takes the ask view as `asks` (was `questions`).
- The render gate's `q` screens are `<width>px-ask-<n>.png` (was
  `-question-`).
- `runtime/questions/` is `runtime/asks/`; `authoring-questions.md` is
  `authoring-asks.md`; three eval cases named for a task now name a to-do.

No protocol bump: nothing a page's log holds, its runtime posts, or its
server serves changes name, and the event contract check passes. The
registry key rename is drift: a page vendored earlier keeps
`x-question-context` in its layer, so its frames supply no prompt words, and
`page check` refuses that layer and names the `leaf page init` that
re-vendors it.

The Questions and Tasks lists (`queues.questions`, `queues.tasks`) and the
`leaf task` command keep their names.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The judgment half of the rename: module headers, docstrings, comments, test
names and agent-facing messages that still called an ask a "Question" or a
to-do a "task" now say ask and to-do. Uses that name the Questions list or
panel, the Tasks list, the `leaf task` command, a browser task, a Codex
task, or a question in plain English keep their words.

Behavior that changes:

- `page check` names an `lf-ask`-style frame "an ask context" in its
  refusals ("an ask context must have exactly one direct heading", "an ask
  context registers no ask"), and the registry lint says "the ask it
  frames".
- The render gate's readings say "the Questions walk", and its `q` screens
  are labeled by ask ("at the next open ask", "of the page's open asks").
- The ask view's presentation failure reads "Ask presentation and retention
  failed".
- The site's how-it-works anchor `#task-completion` is `#todo-completion`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…em Questions

A side-list `lf-tabs` row describes the asks its panel holds, and said
"2 of 3 Questions answered" or "All 3 Questions answered", naming each ask
with the user's list. Its accessible description now says "2 of 3 answered"
and "All 3 answered", as `lf-tally` counts "7 of 8 to answer".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…admits

A page keeps the layer of the Leaf that vendored it. When an x- key is
renamed, as `x-question-context` became `x-ask-context`, the new Leaf reads
the new name from that layer, finds nothing, and silently drops what the key
said: an older page's `lf-ask` frames stopped supplying prompt words, and
`page check` called the page valid.

Every reader of a vendored layer (`load_registry`, which serving, admission
and `page check` go through) now refuses a layer whose `$keys` names a key
outside this Leaf's admitted set, with the refusal that names `leaf page
init`. The rule lives in `LAYER_FACTS_SCHEMA` and is one-sided: a layer
lacking a key this Leaf added is still read. Composing a candidate also keeps
the re-vendor hint when the page declares its own vocabulary, provided the
layer fails on its own; a fault only the page's declarations cause stays
the page's. The layer lint's $keys check now reports only missing
paragraphs, since the facts schema already refuses unadmitted ones.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 12, 2026

@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.

The retired-key check misses event admission on an already published page. write_refusal catches the new RegistryError from load_registry and returns no refusal; admission then reads the active revision's captured vocabulary, which bypasses the $keys check. I reproduced this by replacing x-ask-context with x-question-context in both copies after page stamp: response reply exited successfully, although load_registry and page check reject the page. The shared admission path needs to refuse that retired key too, with a regression case that appends after a revision has been published.

…here a protocol mismatch is refused

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 12, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@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.

Re-vendoring repairs the active page but leaves its older published revisions with the captured x-question-context declaration. The new retired-key check runs only for the current layer; incompatible_revision accepts those older revisions at the same protocol. When one is opened, the ask reader searches only for x-ask-context, so its framed ask loses its prompt and landing region. Please carry the compatibility decision through captured revisions as well, either preserving their declared meaning or refusing to serve them. The published-page regression changes $keys but leaves its captured lf-ask declaration at the new spelling, so it does not exercise this case.

@max-sixty
max-sixty disabled auto-merge October 12, 2026 22:15
…retired key

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty enabled auto-merge (squash) October 12, 2026 22:33
leaf-agent
leaf-agent previously approved these changes Oct 12, 2026
max-sixty added a commit that referenced this pull request Oct 12, 2026
…mented ask to the agent (#2695)

Seven browser and journey tests have failed on main since #2677
(bisected: 927abcf passes, 8d6898f fails). Main's push runs were
each superseded and cancelled, so nothing reported it; a pull request
that edits these test files selects them and fails its required `test`
job (#2658).

#2677 hands an open ask to the agent while a thread anchored on it
awaits the agent's reply, so the ask leaves Questions and the `q` walk
passes over it. These tests seeded a bare user comment on an ask only to
give it a thread or a margin note, then walked to it with `q` or a Page
Map hint, and timed out waiting for focus. Their subject is how an ask
and its thread are held and navigated, so their fixtures now seed a
comment the agent has answered (`answered_comment`), which leaves the
ask on the user. What they assert is unchanged.

`test_a_live_revision_reapplies_the_authored_thread_seat_predicate` is
deleted: it held that a seat's thread stops taking the ask off the
user's list once a revision removes the seat, and #2677 deliberately
made any thread inside the ask do so, which
`tests/model/test_questions.py` covers. The seated test widget's
`seatAttribute` option existed only for it.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 2505952 into main Oct 13, 2026
3 checks passed
@max-sixty
max-sixty deleted the asks-and-todos-names branch October 13, 2026 00:08
max-sixty added a commit that referenced this pull request Oct 13, 2026
Registry problems now reach `page check` and `package check` as records,
like the markup and render findings from #2662 and #2686. Before, each
one was a `RegistryError` sentence, and `page check --json` wrapped it
as one `invalid-registry` record whose only value was that text.

## What changed

- **One finding per registry problem.** Each of the ~100 raise sites
under `registry/`, plus the example and incoming-layer checks in
`validation/composition.py`, now raises `registry_error(code, registry,
tag, **values)`. The result is a `RegistryError` that carries one
`Finding`:
- `code`: one of 104 codes. Sites that raise the same kind of problem
share one, so `unknown-declarations` covers `x-owners` and `x-unique`
(`values.key`), and `predicate-*` covers `x-awaits` and `x-thread-seat`.
- `at`: the element declaration the problem concerns, such as
`<lf-local>`, or empty for a `$` fact.
  - `values.registry`: the file or composition it was read in.
- `values.revendor`: present when the fault is in a vendored layer that
re-vendoring fixes.
- The remaining `values` hold what the check read: the verb, the
attribute, the offending names or value. A JSON Schema complaint also
carries `keyword`, `path` and `reason`, from
`registry.schema.schema_reading`. The markup check's `attribute-schema`
now uses the same helper.
- **Words in one place.** The words for every code are in `findings.py`,
under `_declared`. That helper adds the file prefix and the re-vendor
suffix.
- **Commands report the record.** `page check` adds the refusal's
findings to its errors. When `package check --json` meets a refusal that
carries findings, it reports those findings in place of a `package`
record.
- **`findings.Rejected`** is now `Rejected(findings, heading=None)`.
With no heading, its text is the findings' own words. `RegistryError`
subclasses it.
- `layer_facts_error`, which returned a string, is replaced by
`check_layer_facts`, which raises. `reference_relation_error` is now
`reference_relation_problem` and returns a code and values. The
`invalid-registry` code now covers only the refusal #2658 added for a
layer this Leaf cannot serve (`layer.incompatible_layer`). That refusal
is still a sentence that the page servers, the event door and the
website also read.

## Human output: before and after

Human output is byte-identical. I ran `leaf page check` from the merge
base and from this branch on two broken pages and diffed stdout, stderr
and the exit status. The only difference was the base run's
`leaf-version` advice line, which comes from running an exported tree,
so I filtered it out.

A page whose own `page/registry.json` declares an `x-awaits` answering
verb it doesn't have:

```
Error: index.html has 1 validation issue
  - …/authored/page/registry.json: <lf-local> x-awaits answers with verbs ["submit"], which are not x-state verbs the user writes
```

A page whose vendored `registry.json` has `$languages.names: 3`:

```
Error: index.html has 1 validation issue
  - …/vendored/registry.json: $languages.names: 3 is not of type "array"; run `leaf page init …/vendored` to re-vendor it
```

I also compared the refusal text of about 100 broken registries between
the two trees. Each one mutated the shipped registry, a registry file,
an example, the incoming layer or a fixed `$events` member, and together
they reached nearly every code. All were identical.

`page check --json` for the second page:

```json
before: {"code": "invalid-registry", "severity": "error", "values": {"error": "…/vendored/registry.json: $languages.names: 3 is not of type \"array\"; run `leaf page init …/vendored` to re-vendor it"}, "text": "…"}
after:  {"code": "layer-facts", "severity": "error", "values": {"keyword": "type", "path": ["$languages", "names"], "reason": "3 is not of type \"array\"", "registry": "…/vendored/registry.json", "revendor": "…/vendored"}, "text": "…"}
```

For the first page:

```json
after:  {"code": "awaits-verbs", "severity": "error", "at": "<lf-local>", "values": {"verbs": ["submit"], "registry": "…/authored/page/registry.json"}, "text": "…"}
```

## Tests

- I cut the tests in `test_interact_layer.py`, `test_server_lifetime.py`
and `journeys/test_interact_contract.py` that matched registry words
over to codes and fields. They use two new `interact_support` helpers:
  - `registry_refusal(read)` returns the finding a refusal carries.
- `command_refusal(*args)` runs a leaf command in process and returns
its refusal's finding. It covers commands with no `--json`, such as
`page init` and `package init`.
- `test_package_check_requires_a_non_empty_widget_description` now
expects `no-description` where it expected a `package` record. That is
the user-visible change to `package check --json`.
- `test_interact_contract.py` still matches the words, which are
unchanged. A follow-up PR cuts it over.
- I ran `tests/model/test_interact_contract.py`,
`test_interact_layer.py` and `test_server_lifetime.py` in full, and the
changed journeys test by node ID. To check the cut-over, I replaced
every registry finding's words with a constant and reran those files and
seven other model files that write registries, with the follow-up's
conversion of `test_interact_contract.py` applied. All 876 tests passed,
so no other test in them reads registry words.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 16, 2026
Follows #2698 (merged). Capture refusals and sample-history refusals now
reach `page check` as coded records. Before, each was one
`capture-failed` or `sample-history` record whose only value was the
refusal's text. The tests that matched registry, capture and
sample-history words now read the records.

## What changed

- **Capture.** `ArtifactError` is now a `findings.Rejected` carrying one
finding. Its 24 raise sites call `artifact_error(code, file, specifier,
**values)`. The codes include `dependency-unreadable`,
`dependency-not-local`, `module-outside-page`, `module-type`,
`dependency-symlink`, `css-import` and `manifest-digest`. `values.file`
is the file the problem was read in and `values.specifier` is the
reference in it. The words are written in `findings.py` (`_captured`).
`page check` adds the refusal's findings to its errors.
- **Sample history.** `initial_sample_events` raises a `Rejected`
instead of a `ValueError` that wrapped the inner refusal's text. Its
finding names the script (`values.reference`) and, for a problem with
one of its events, which one (`values.event`). The codes include
`sample-script`, `sample-json`, `sample-array`, `fixture-kind`,
`fixture-ts` and `fixture-id-taken`.
- `fixture-markup` holds the message gate's own findings in
`values.findings`, under its kind, and `fixture-media` holds the media
check's findings the same way.
- An event the append door refuses is `fixture-event`, holding the
door's findings (`EventRefused`, or `command_error`'s) in
`values.findings` the same way. An anchor-capture refusal keeps its
words as `fixture-refused` (`values.error`).
- `page check` sets the template ids on each finding's `samples`, as it
does for markup findings. The HTTP sample door catches `Rejected` beside
`ValueError` and answers with the same text.
- **Codes deleted.** `capture-failed` and `sample-history` no longer
exist.
- **Test helper.** `command_findings(*args)` replaces `command_refusal`,
and every caller moves to it. It returns every finding a refused command
carries, or none when the command succeeds. The sample tests read the
message door's refusal through it.

## Human output: before and after

One wording changed, for consistency. The three CSS refusals from the
stylesheet walk (`css-invalid`, `css-url`, `css-import`) used to name no
file. They now carry and print the file whose CSS they read, as every
other capture refusal does. For the page's own `<style>` and `style`
attributes, that file is `/index.html`. Without it, a page with several
stylesheets got a coded refusal with no way to tell which sheet to fix:

```
<   - invalid CSS: bad URL token
>   - /page/style.css: invalid CSS: bad URL token
<   - CSS @import requires a stylesheet with CSS MIME type
>   - /page/style.css: CSS @import requires a stylesheet with CSS MIME type
```

I ran `leaf page check` from the merge base and from this branch on 33
pages. Three changed, all with the CSS wording above. On the other 30,
stdout, stderr and exit status were byte-identical. They cover every
sample-history case the suite exercises (including the three
message-markup ones) and every module and stylesheet capture case. I
filtered out the `leaf-version` advice line, because the two trees run
as different Leafs.

A page whose module imports a missing file:

```
Error: index.html has 1 validation issue
  - /page/missing.js: cannot capture dependency: No such file or directory
```

A page whose sample history has a bad timestamp in its second event:

```
Error: index.html has 1 validation issue
  - sample 'practice': data-sample-events 'fixture', event 2: ts must be an ISO timestamp with a time zone
```

`page check`'s JSON, before and after (`text` omitted):

```json
before: {"code": "capture-failed", "severity": "error", "values": {"error": "/page/missing.js: cannot capture dependency: No such file or directory"}}
after:  {"code": "dependency-unreadable", "severity": "error", "values": {"error": "No such file or directory", "file": "/page/missing.js"}}

before: {"code": "sample-history", "severity": "error", "samples": ["practice"], "values": {"error": "data-sample-events 'fixture', event 2: ts must be an ISO timestamp with a time zone"}}
after:  {"code": "fixture-ts", "severity": "error", "samples": ["practice"], "values": {"reference": "fixture", "event": 2}}
```

## Tests

- **Registry tests.** The rest of the tests that matched registry words
in `test_interact_contract.py` now read records: about 45 tests, through
`check_findings`, `registry_refusal` and, for `page init`,
`command_findings`. So does
`test_a_layer_stamped_with_its_revision_still_names_the_revendor`, which
arrived from main. They pin facts the words only suggested, such as both
verbs that claim one record slot, the slot's kind and attribute, and a
schema complaint's keyword.
- **Capture and sample tests.** The sample-fixture, sample-document and
capture tests in `test_interact_contract.py`,
`test_interact_document.py` and `test_revision_delivery.py` assert codes
and fields.
- The two activation tests still refuse through `activate_source`. They
now read the reason from `page check`'s findings, because
`Activation.error` is a joined string.
- `test_check_validates_each_sample_document` lost its
`sample_holder_check` helper. It asserts codes and `samples` for both
holders now.
- **Runs.** I ran `test_interact_contract`, `test_interact_layer`,
`test_interact_document`, `test_revision_delivery` and
`test_server_lifetime` in full.
- **Word scramble.** I replaced the words of every registry, capture and
sample finding with a constant and ran those files, plus
`test_interact_product`, `test_product_page`, `test_interact_preview`,
`test_live_shell_artifact`, `test_todos`, `test_stop_guard` and
`test_render_gate`. 917 of 919 passed. Both failures read a capture
refusal's file name through text that is still a sentence: the `Refused`
that `page stamp` raises from `Activation.error`, and that same joined
string.

## Left for follow-ups

- **`Activation.error`.** It joins `check_source`'s findings into one
string, and `thread`, `agent_state`, `samples`, `served_state` and
`revisioning` read it as text. Carrying the findings would let those
consumers and their tests read fields.
- **`layer.incompatible_layer`.** Its refusal (#2658) reaches `page
check` as the one remaining `invalid-registry` text record. The page
servers, the event door and the website also read it as a sentence.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[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