Skip to content

Finish the conversation naming cutover: Ask field, host receipts, failure route - #1010

Merged
max-sixty merged 1 commit into
mainfrom
conversation-naming-cutover
Sep 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
conversation-naming-cutover

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Finishes the conversation naming cutover in three places where the old name or shape was still in use.

Asks carry conversation. asks.py produced a thread key, and agent_state renamed it to conversation for the agent while the browser read thread. Now the producer writes conversation and the rename is deleted. The browser wire Ask, AskRecord, the runtime readers (semantic-news.js, asks/view.js), and the watchAsks record in packages.md use the same key, and the browser runtime bundle is rebuilt.

Host failed receipts carry failure. cmd_receipt did three jobs: it read the CLI text argument, stamped the session identity, and opened its own transaction around building the event. The host's _fail_page_answer needs its own identity and a recheck under the lock, so it could not call cmd_receipt and built the receipt dict by hand without failure. That made a host failed receipt look the same as an agent-written one. Both writers now build the event through requests.receipt_event, and the host passes its code. The registry allows failure only on a failed receipt with author agent. events.md, workflows.py, and the Worker README no longer say a receipt has no field for the code.

The Worker's failure route is /_leaf/agent/fail. It was /_leaf/agent/reply, though it writes whatever failure the move's answer takes, not only a reply. The rename covers worker/src, worker/server.py, their tests, and the README.

Test changes: the hosted turn-failure case now asserts the receipt's failure, and the Worker's two failure cases check the route URL.

The frozen-markup document kind {"kind": "thread"} in event meaning and widget descriptors was left alone. It names a document, not a subject. The runtime's thread naming for the Threads panel was also left alone, since that is the glossary's UI term.

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

🤖 Generated with Claude Code

…lure route

Asks now carry `conversation` from their producer in `asks.py`, so the
key translation in `agent_state` is gone and the browser wire Ask,
`AskRecord`, and packages.md use the same name.

A host that gives up on a request built its failed receipt by hand
beside `cmd_receipt`, because that writer bundled CLI concerns (text
argument, session identity, its own transaction) with the event shape.
Both now build the event through `requests.receipt_event`, and the host
passes its `failure` code, which the registry admits on a failed,
agent-authored receipt. A host failed receipt is now distinguishable
from the agent's own.

The Worker's failure door `/_leaf/agent/reply` is `/_leaf/agent/fail`,
across the Worker, the website adapter, and their tests and README.

Behavior moved in tests: the hosted turn-failure case asserts the
receipt's `failure`, and the Worker failure cases pin the route URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit ee2f3ff into main Sep 23, 2026
7 of 8 checks passed
@max-sixty
max-sixty deleted the conversation-naming-cutover branch September 23, 2026 16:09
max-sixty added a commit that referenced this pull request Sep 23, 2026
`test_opening_threads_acknowledges_the_first_visible_answer` failed once
on #1010's first CI attempt with no `read` event in the log. The cause
is the harness wait, not the runtime.

`round_trip` treated a trip as over once the outbox held no attempt.
Some posts skip the outbox: a bookkeeping event such as `read` (#987,
`delivery.js`), the page's own `error` report, and a media upload
(`layer-client.js`). So `sending` around a gesture whose event is a read
returned as soon as the read's POST went out, and the log read behind it
raced the server's append. Holding the read's POST for 300ms reproduces
the CI failure every time (`IndexError` on `_read_events(...)[-1]`). 80
copies under `-n 12` did not reproduce it on a Mac.

- `round_trip` also requires every issued post to have ended (`acked ==
sends`), through a `heard_back` predicate on one ledger reading. The
outbox condition still covers a failed post that the page will retry.
- The read-state test holds the read before the server appends it, so
every run hits this timing. While the read is held, it asserts that the
ledger does not yet count as heard back. With the old predicate, that
assertion fails on every run.
- Three paint-failure tests (`test_a_failed_ask_banner_paint…`,
`test_a_failed_ask_list_paint…`,
`test_a_failed_thread_list_update_retries…`) held `/api/event` and
released only the first request. The page's own `error` report of the
injected failure was also held and never ended. The stricter
`round_trip` exposed this. Those tests now wait with `holding` for both
requests, then release both.

`traffic.js`'s header, the `round_trip` comment, and `tests/AGENTS.md`
now describe the wait as both conditions and list the posts that skip
the outbox.

> _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]>
max-sixty added a commit that referenced this pull request Sep 26, 2026
…af thread` (#1193)

Leaf used two words for one thing: `conversation` named the data (ids,
the delivery envelope, Ask records, `leaf conversation …`,
`conversation.py`, `runtime/conversation/`), and `thread` named the UI
(the Threads panel, thread cards, help text). This settles on **thread**
everywhere. It reverses the direction #1010 took; the user chose it.

### Commands

`leaf comment`, `leaf reply`, `leaf edit`, `leaf resolve` and the `leaf
conversation` group become one group:

| Was | Now |
|---|---|
| `leaf comment` | `leaf thread open` |
| `leaf reply` / `edit` / `resolve` | `leaf thread reply` / `edit` /
`resolve` |
| `leaf conversation read` / `title` / `summarize` | `leaf thread read`
/ `title` / `summarize` |
| `leaf events --conversation` | `leaf events --thread` |

Arguments and behaviour are unchanged, and the old names have no alias.

### Data and code
- **Keys:** the `conversation` field becomes `thread` (summary and title
events, Ask records, page-state entries). The envelope's `conversations`
becomes `threads`, and the subject, workflow and update-target kind
`"conversation"` becomes `"thread"`. `browser.conversation` becomes
`browser.thread`, and the event kind `conversation_title` becomes
`thread_title`.
- **Registry and CSS:** `x-conversation` becomes `x-thread-seat`,
because `x-thread-surface` already exists. `.lf-conversation*` becomes
`.lf-thread-seat` / `.lf-page-thread*`, because `.lf-thread*` is the
panel's.
- **Modules:** `leaf/conversation.py` → `leaf/thread.py`,
`served_state/conversation.py` → `served_state/thread.py`,
`assets/runtime/conversation/` → `assets/runtime/thread/`, and
`references/conversation-threads.md` → `references/threads.md`. Tests
are renamed to match.
- **Name collisions:** four places would have put the new name on an
existing `thread` name in the same scope. They are renamed:
`workflows.canonical_workflows`, `semantic-news.js`,
`thread/presentation.js` and `application.ts`.

### Kept on purpose
`references/conversation-loop.md` keeps its name, because it covers the
whole agent–user loop (banner, status, handoff), not threads. The
remaining hits are plain English about an agent's chat, Codex's own
context, or vendored third-party text.

### Checks
- The everyday suite passes, as do the runtime folds (125),
`check:browser` and `test:browser` (64), and the nightly render files
the rename touches (about 1,680 tests).
- One nightly render-gate test
(`test_the_render_gate_holds_a_settled_slot_to_the_logs_decision`) fails
on main as well.
- Snapshots and the corpus are regenerated.

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