Skip to content

Remove live_work, the title preflight, queue-row ends and the claim's released field - #2451

Merged
max-sixty merged 11 commits into
mainfrom
agent-aef9fb6a7ac2e80a4
Oct 12, 2026
Merged

max-sixty merged 11 commits into
mainfrom
agent-aef9fb6a7ac2e80a4

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Six code-quality survey items, each removing code or restating a comment rather than adding to either.

  • F16 — live_work deleted. It repeated read_page's input gathering and PageRead.work's fold. Status, idle, delivery and the hooks read read_page(page_dir, events).work. PageRead.layer is now read on first use, as data already was: it matters only when serving a page with no active revision, and reading it eagerly made delivery refuse a page whose vendored registry lacks its layer metadata.
  • F22 — title preflight deleted. thread.title_refusal and cli._titled admitted a synthetic thread_title event before a command posted; the append door already refuses a bad title. thread open --title '' now fails with comment event is invalid: … where it said thread_title event is invalid; nothing is appended either way. thread edit --text --title is one cmd_edit (which absorbs cmd_title) that admits the rename before appending the edit under the same lease, so a refused title still leaves the text unedited.
  • F27 — ends dropped from queue rows. It restated a task's owner and a Question's source.kind. Its one reader, endsByDone, offered Done to a task on the user's queue, which every task there is, so queueOffers offers Done to any task row on that queue. conversation-loop.md and module-authoring.md stop describing the field; the eval case's page-state rows drop it.
  • F68 — the claim's stored released deleted. Only the test-only PageTransaction.release_claim ever set it. A claim's life ends through its session record (end, new generation, lost lifetime) or a successor's claim, so claim_is_active, claim_names_session, reconnect and thread titling read only that. The test-only release_claim, close_turn and open_turn are gone; their ~47 test sites call state.end_session, close_session_turn and open_session_turn, and the three parametrized cases that differed only by a stored release are removed. session-lifetime.md and page-storage.md no longer list release as a way ownership ends. Folding browser_state into project_browser_state is left out: three test sites build readings without a PageRead, so it isn't small.
  • F114 — history narration rewritten. The fourteen comments the survey listed now state the reason that holds today, or drop history that carried none.
  • F56 — lf-sample's Full view height goes to --lf-sample-height through layoutPx, like every other measured write.

Checks: pnpm run check, check:bundles and pre-commit pass. The focused Python selection (test_interact_session, _server, _layer, _contract, _document, _product, _preview, test_tasks, test_questions, test_read_state; 1625 tests) passes, as do the named browser tests for the changed sites. Two nightly browser tests, test_a_window_sample_is_a_whole_leaf_window_that_scrolls_inside and test_a_file_row_says_its_whole_path_to_the_keyboard_and_a_held_finger, fail identically on origin/main here, so this change doesn't cause them.

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

max-sixty and others added 10 commits October 11, 2026 15:44
live_work repeated read_page's input gathering and then PageRead.work's
fold, so status, idle, delivery and the hooks now read
read_page(page_dir, events).work. No behavior changes; the hook
snapshot test patches read_page in place of live_work.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
title_refusal admitted a synthetic thread_title event before a command
posted, and cli's _titled ran it ahead of thread edit. The door already
refuses a bad title, so:

- thread open --title now fails with the comment record's own message,
  "comment event is invalid: ...", where it said "thread_title event is
  invalid"; nothing is appended either way.
- thread edit --text --title is one cmd_edit under one lease that admits
  the rename before appending the edit, so a refused title still leaves
  the text unedited. cmd_title folds into it, and cmd_edit returns the
  records it appended.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ends restated what each row already carries: a task's owner, and a
Question's source.kind. Its one code reader, queues.js's endsByDone,
offered Done to a task on the user's queue, which is every task there,
so queueOffers now offers Done to any task row on that queue. Page
state's queues and the runtime's readQueues rows no longer carry ends;
conversation-loop.md and module-authoring.md stop describing it, and
the tests that selected rows by it select by subject or source instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Nothing in production set released: only PageTransaction.release_claim,
which only tests called, wrote it. A claim's life now ends only through
its session record (end, a new generation, or a lost lifetime) or a
successor's claim, so claim_is_active, claim_names_session, reconnect and
thread titling read the session record alone, and a new claim no longer
writes released.

The test-only PageTransaction.release_claim, close_turn and open_turn are
gone; their sites call state.end_session, close_session_turn and
open_session_turn, the functions the harness hooks run. The cases that
differed only by a stored release (reconnect's "release", the Codex
receipt's "release", a superseded response's "released") are removed,
since session end covers them. session-lifetime.md and page-storage.md
no longer name release as a way ownership ends.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The reserved height is a length measured off the page, so it goes to
--lf-sample-height through layoutPx like every other measured write
(runtime/keeps.js). The rounding is below layout precision; nothing a
reader sees changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Fourteen comments and headers explained a rule by what the code used to
do. Each now states the reason that holds today, or drops the history
where it carried none: reach.js, geometry.js (shownBox, clipWalk),
chrome.css's selectable islands, lf-options (undeclared attributes, mark
placement, g sequences), lf-diff's key order, lf-board's #release,
presence's viewed, scheme.py's served readings, page_code.py's header,
hook_transport's shared protocols, and the website adapter's exception
recording and signal close. Comments only; no behavior changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PageRead.layer is read only to serve a page that has no active
revision, yet read_page read it eagerly, so delivery reading a page's
work through read_page refused a page whose vendored registry lacks its
layer metadata. The layer is now read on first use, like stored data, and
delivery on such a page carries no handling, as it did through live_work.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Done's aria-pressed carries the answered paint and the settled row's
aria-expanded the disclosure; the answer verb declares no record form.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 11, 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 required pre-commit gate fails on this head: final-newline flags served_state/work.py, and ruff-format flags the changed assertion in tests/test_tasks.py. I reproduced both with uv run pre-commit run --all-files on the merged checkout. The Python test step is still running.

Comment thread tests/test_tasks.py Resolved
@leaf-agent
leaf-agent dismissed their stale review October 11, 2026 23:56

The required pre-commit gate fails on this head: final-newline and ruff-format.

@max-sixty
max-sixty merged commit 62ef179 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-aef9fb6a7ac2e80a4 branch October 12, 2026 01:01
max-sixty added a commit that referenced this pull request Oct 12, 2026
…-card sample, and bring the What-needs-you note up to date (#2619)

Three small changes from the code-quality survey.

**Catalog previews wait the way every other browser command does.**
`leaf-dev refresh-previews` keeps launching the locked headless shell
the browser suite uses, so published preview pixels do not follow each
host's Chrome (#342). It now opens its tab with `leaf_dev.browser.tab()`
and waits with `load()`, which runs `settle()`: ready, fonts loaded, and
the runtime's `pageSettled`. Its own `wait_until_ready` call is gone.
Captures also take reduced motion, as other stills do. A one-example
capture through the real command (publishing stubbed out) produced the
expected still.

**The feature gallery's "Move a card" live sample is cut.** It repeated
the drag the delivery board on the Data & work tab already offers. The
Interactions guide now links to that board (`#bg-delivery`, which opens
its tab), the eyebrow drops the board elements, the site test expects
three interaction samples, and the corpus is regenerated.

**`notes/what-needs-you/page.html` matches the current model.** It said
an Ask is a task on you and that a record says how it `ends`. Since
#2240, #2451 and #2506, an ask is its own record the lists select
directly, the shared work record is a to-do with no `ends` field, the
lists are `queues.questions` and `queues.tasks`, and replies ask with
`--ask`. The lede, plan, naming sections, "How it works" (with a fresh
`page state` reading) and open questions now say so. The step-5 tab
keeps its decision record in the past tense and notes what holds now.
The `#task-hierarchy` and `#task-done` anchors cited by TODO.md are
unchanged.

No user-visible Leaf behaviour changes beyond the gallery losing one
sample.

> _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