Skip to content

Name a thread by any message, and gather page commands under page - #1355

Merged
max-sixty merged 3 commits into
mainfrom
cli-threads
Sep 27, 2026
Merged

max-sixty merged 3 commits into
mainfrom
cli-threads

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Two CLI restructures:

  • A thread is named by any message in it. Every command that addresses a thread takes the id of any message in the thread. The id of a thread whose opening comment the log lost also works. One resolver handles all of these (thread_context.thread_address):
    • thread read PAGE THREAD, thread title PAGE THREAD, thread resolve PAGE THREAD, thread reply PAGE [THREAD], page events --thread THREAD, status --on.
    • thread edit PAGE MESSAGE takes its message positionally.
  • Every command that acts on one page sits under page. events, transcript, interactions, report (formerly experimental report), stamp and export (formerly version stamp and version export) move there. The version and experimental groups are gone. leaf --version is unchanged.

Before, thread read, thread title and thread summarize required the exact thread id, while reply, resolve and status --on took any message.

Other changes that follow:

  • --to is removed. thread reply refuses THREAD combined with --for: --for already fixes where the reply goes, and before this change a --to beside it had to repeat that address exactly.
  • thread summarize no longer takes a THREAD argument. It summarizes in the thread --from sits in, so the two can't disagree.
  • The thread_title and summary events still record the exact thread id; only the CLI resolves the name.
  • When a thread that owes a reply is named without --for, the refusal now gives the full leaf thread reply <page> --for … command.

Guidance, docs, scripts, the usability harness and tests are updated together. The recorded eval results under notes/usability-eval/results/ are historical and left as they were.

Tests:

  • The full suite passes: 1426 passed.
  • The runtime suite passes: 151 passed.
  • test_interact_layer now checks that title, read and page events --thread accept a reply's id, and that THREAD with --for is a usage error.
  • test_interact_server checks that reply and resolve accept the id of a thread whose opening comment the log lost.

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

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 27, 2026 14:22
Every thread command now takes the thread as a positional id of any message
in it, resolved through one `thread_named` resolver: `thread read`, `title`,
`reply [THREAD]`, `resolve`, and `page events --thread`. `thread edit` takes
its MESSAGE positionally. `--to` is gone; `thread reply` refuses THREAD beside
`--for`, which already fixes the response address. `thread summarize` drops
its THREAD argument and summarizes in the thread `--from` sits in, so the two
can no longer disagree. The title and summary events still record the exact
thread id.

The commands that act on one page move under `page`: `events`, `transcript`,
`interactions`, `report` (from `experimental`), and `stamp` and `export` (from
`version`). The `version` and `experimental` groups are gone.

Tests: CLI calls drop `--to` and use the new paths; `test_interact_layer`
asserts title, read, and events --thread accept a reply's id and that THREAD
with --for is a usage error. An unknown thread now reads "unknown comment id",
and a summary's endpoints must lie in one thread.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`thread_address` in thread_context resolves any message id, or the id of a
thread whose opening comment the log lost, to the thread and the message an
event names. `thread reply` and `resolve` now use it, and `status --on` reads
`thread_names`, so a lost thread's id works everywhere a thread is named. The
reply refusal for an owed thread names the whole `--for` command, since THREAD
beside `--for` is a usage error. Prettier-formats the touched docs pages and
fixes the review's guidance and harness notes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Sep 27, 2026
@max-sixty
max-sixty merged commit 3261109 into main Sep 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the cli-threads branch September 27, 2026 22:09
max-sixty added a commit that referenced this pull request Sep 28, 2026
… as JSON (#1374)

Five more CLI consolidations, following #1355.

- **One reader for a thread or widget: `page state PAGE [ID]`.** `thread
read` was `page state` narrowed to one thread plus a page of its
messages; that is now the ID form of `page state`, with the same
`--after`/`--limit`. An ID naming a widget on the page narrows the
reading to what stands inside it: its element, the moves and reports on
it or its parts, its Asks, workflows and updates, so narrowing to an Ask
carries the pick on its choice. `thread read` and `page events --thread`
are gone, and the delivery's note on an elided thread points at `page
state` instead of the raw log.
- **One resolver for any id a command takes (`work.page_subject`).** A
message, a widget frozen into one, or any other event whose history a
thread holds (an undo through the gesture it withdraws) names that
thread; a page widget, or a move or report on it, names the widget.
`status --on`, `page state ID` and every thread command read ids through
it; a thread command refuses a page widget. `page check` and message
markup now refuse an authored id in the log's event-id shape (eight hex
digits), so a page id cannot name a message.
- **Thread commands: `open`, `reply`, `edit`, `resolve`, `summarize`.**
`--title` on `open` and `reply` names the thread in the same command,
and the delivery clause for an untitled thread says to add it to the
reply. Renaming is `thread edit PAGE MESSAGE --title`. `thread title` is
gone. A title whose text admission would refuse refuses the whole
command before anything is posted; the message prints before its title
record.
- **`page events` is the one log follower.** `page interactions` is
gone; the diagnostic trace is `PAGE/interactions.jsonl`, read directly.
`page events` takes `--after` and `--follow` only, and both paths exit
quietly when the reader closes the pipe (`page interactions | head` used
to end in a `BrokenPipeError`).
- **Output is JSON wherever it is a fact.** Every write (`thread
open/reply/edit/resolve/summarize`, `page stamp`, `page report`) prints
the records it appended, one JSON line each, exactly as `page events`
prints them, `seq` included. `--json` is gone from all eight. `status`
prints the status it wrote (the unanswered-moves note goes to stderr),
`server start`/`run` print `{"url"}`, `server stop` `{"stopped"}`, `page
init` `{"page"}`, `page media` one `{"path", "source"}` line per image,
`page export` `{"file", "version", "bytes"}`, `data set` the source's
reading without the value, `data clear` `{"source", "cleared"}`,
`package init`/`install` `{"package"}`, `codex start` `{"task",
"app_server", "started"}`, and `page guidance PAGE` its audiences as an
array. Documents (`page transcript`, `page guidance PAGE AUDIENCE`) and
diagnostics (`page check`, `package check`, errors) stay text.

The appended record now carries its `seq`, which the log derives from
the line number, and so does a retried append's, so a write's output and
`page events` are the same record. The base-vs-candidate harnesses
(`dev/leaf_dev`, the arrangement eval) find the server URL in either
output shape, since an arm can be built from a revision before this
change.

Guidance, docs, the site's how-it-works transcript, scripts that read
the server URL, and the tests are updated together.
`evals/thread-named-in-its-reply` is new: an untitled long thread, where
the reply should carry `--title` and the elided messages be read with
`page state`.

Tests:
- Guidance evals, all 16 cases ×3 per arm run at once against main
(69bee09): the new case went 0/3 → 3/3 (main's guidance ran a separate
`leaf thread title` every time); no other case fell. Recorded in the
case's header comment.
- `uv run pytest tests`: 1428 passed on the merge with main. `npm run
test:runtime`: 152 passed.
- New: `test_a_write_prints_the_records_it_appended`,
`test_any_id_names_one_subject_for_every_command` (page widget, Ask,
move id, frozen widget and title-event ids across `page state`, `status
--on` and `thread resolve`; the eight-hex id refusal),
`test_a_reader_that_closes_the_pipe_ends_page_events_quietly`.

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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

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