Skip to content

Serve each to-do once, and fold todo_end once - #3101

Merged
max-sixty merged 1 commit into
mainfrom
todo-tree-ontology
Oct 16, 2026
Merged

max-sixty merged 1 commit into
mainfrom
todo-tree-ontology

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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 todos and ended_todos, the to-do items in each view's queues, each thread's todos, and its attention.todo. Now one top-level todos list holds open and ended to-dos, each with its state, and every browser reader selects from it. ended_todos and each thread's served todos are gone. localTodos splits the list by state, thread records gain their open agent to-dos in readThreadRecords, and the margin inventory skips ended ones. Queue to-do items and attention.todo keep their shape, because leaf page state prints both and the banner's side panel (queue-panel.js) reads queue items. They can shrink once the banner is deleted.

In Python, TodoReading.ends is now the one fold of todo_end, prose asks included, and _todos takes its endings from it. todo_error reads log.todos directly. owed_todos, a second API for TodoReading(events).owed, is removed, and its callers use the reading. The guard for a todo record without an owner is 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. The events.md rows for pickup and todo and the _todo_error docstring 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.

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

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]>
@max-sixty
max-sixty merged commit 12d960c into main Oct 16, 2026
3 checks passed
@max-sixty
max-sixty deleted the todo-tree-ontology branch October 16, 2026 22:52
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]>
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