Repository navigation
Serve each to-do once, and fold todo_end once - #3101
Merged
Merged
Conversation
The browser wire carried a to-do up to four ways: top-level `todos` (open) and `ended_todos`, each served thread's `todos` list, and the thread's `attention.todo`. It now carries one `todos` list, open and ended, each with its `state`, and every browser reader selects from it: `localTodos` splits it by state, `readThreadRecords` gives each thread record the agent's open to-dos on it, `threadAttention` reads the to-do a waiting thread waits on from that record, and the margin inventory skips ended to-dos. Queue items and `attention.todo` keep their shapes because `leaf page state` prints them and the banner files read the queue items; the browser no longer reads `attention.todo`. `TodoReading` folded `todo_end` twice. `ends` (every end in force, including an agent's end of a prose ask, which `asks.thread_asks` reads) is now the one fold, and `todos` takes its endings from it beside stamped `--completes`, whichever came first. `todo_error` reads `log.todos` instead of a callable over `page_todos`, `page_todos` returns one list, and `owed_todos`, a second API for `TodoReading(events).owed`, is gone. The `owner` guard in `todo_reading` only served an earlier Leaf's owner-less record; it goes with the test that seeded one. `events.md` no longer lists a thread subject on a `todo` event, and says a pickup is never a `start`. No behavior a user sees changes, and `page state`'s output is the same. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 16, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
A to-do still reached `page state` and the browser three ways: its record in `todos`, a copy of its title, start and voice in its On me or On <agent> row, and a copy of its title and start line in its thread's `attention.todo`. #3101 kept the row and attention copies because the banner's side panel read them. The banner is gone (#3100), so this change shrinks both to ids, as #3184 did for item rows (now obligation rows, #3196). **Served state.** A to-do row now carries what an obligation row does (`kind`, `id`, `owner`, `subject`, `thread`, `live`), and a thread waiting on a to-do names it by id in `attention.todo` (`served_state/queues.py`, `served_state/browser.py`, `state.schema.json`). **Browser.** The publisher (`localQueues` in `application.ts`) joins each to-do row to its current record as `todo`, as it joins an obligation row as `obligation`. `queueTitle`, the panel's On card and the status explanation read the title and start line from that record. `module-reading.md` says a `readQueues()` to-do row carries `todo`. **Agent instruction.** `conversation-loop.md` now says a row names its obligation or to-do by `id`, and that a to-do's record in `todos` holds its `title` and the start `running` on it. The new eval case `on-lists-read-todo-records` gives the agent a shrunk reading whose `todos` are listed in a different order from the rows, then asks what waits on each side. On Claude Code the merge base passed 2 of 2 and the change 2 of 2, both before and after merging #3196's rename. Agents already joined the rows to their records; the new line keeps the reference accurate. **Protocol 11 → 12**, since a page vendored at 11 reads a to-do row's title from the row. The delivery-format snapshots move with it. Tests: `pnpm run check:framework`, `pnpm run test:runtime`, the model todo, workflow, obligation, activity and fold tests, the interact-contract snapshots, the served-state schema test, and two browser tests (a to-do on the user ending from the panel, and the Plan tab's place line). > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
The browser now receives each to-do once. This prepares for giving to-dos a plan structure: a plan view joins its steps against to-dos, so it should find each to-do in one place.
Before this change the wire carried each to-do four ways: top-level
todosandended_todos, the to-do items in each view'squeues, each thread'stodos, and itsattention.todo. Now one top-leveltodoslist holds open and ended to-dos, each with itsstate, and every browser reader selects from it.ended_todosand each thread's servedtodosare gone.localTodossplits the list by state, thread records gain their open agent to-dos inreadThreadRecords, and the margin inventory skips ended ones. Queue to-do items andattention.todokeep their shape, becauseleaf page stateprints both and the banner's side panel (queue-panel.js) reads queue items. They can shrink once the banner is deleted.In Python,
TodoReading.endsis now the one fold oftodo_end, prose asks included, and_todostakes its endings from it.todo_errorreadslog.todosdirectly.owed_todos, a second API forTodoReading(events).owed, is removed, and its callers use the reading. The guard for atodorecord without anowneris deleted along with its test, which wrote such a record from an earlier Leaf straight into the log; AGENTS.md "Stage" keeps no code for old records. Theevents.mdrows forpickupandtodoand the_todo_errordocstring now match the code.Nothing changes for the user. Tests:
pnpm run test:runtime, the browser application and queue tests, 11 model test files, and 6 browser test functions covering the changed readers all pass.