Repository navigation
Make Working a task: a start in the log names the item in hand - #1808
Conversation
Adds notes/what-needs-you: a Leaf page proposing six directions for tracking what the user owes the agent and what the agent owes the user (total turn, one queue, loops, a ledger in the page, page rounds, and review passes), with a recommendation for loops, and research.md holding the evidence behind it: prior art across review tools, agent harnesses and the theory of commitments, a hand classification of 169 real Leaf threads, and each mechanism's falsifier measured on the logs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…and what loops keep Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Each flow (a background subagent, a dispatch to another session, a mixed message resolved at once) lists its events and a sequence diagram, then a tab per model showing what each step leaves on the user's list and the agent's. Tracing the dispatch showed C's hand-off closed the request and unblocked its Ask before the result existed, so handing now moves the request to the receiving session. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The per-model tabs hid the comparison: each flow is now one table at the available width, a row per event and a column per model, with cells that lose work or depend on the agent tinted. Below 900px the rows stack, each cell labelled with its model. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
C's cells said "answer: pulse", after its drawer heading, which read as something other than the pulse Ask the other columns list. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A wide table names each model's record, where it lives, what counts as on the user and on the agent, and the verbs each item offers; four JSON tiles show the query's answer at flow 2, step 6. Today's answer spans asks, workflows and the browser-only thread attention. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Directions, Flows, What changes and Evidence, with each flow's sequence diagram folded above its table. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…uestion Adds a Plan tab proposing Pi Durable's task as the one record behind both queues (yours and the agent's), shipped in four steps, and rebuilds the Compare tab around timelines answering: is running work on the agent, what one item spans across a back-and-forth, and how many items one message makes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Adds `leaf task open PAGE THREAD TITLE` and `leaf task end PAGE TASK done|failed|dropped [DETAIL]`, written as new `task` and `task_end` log kinds (tasks.py owns the fold, the door's gate and the writers). A task stands on an open thread until its outcome is written: a reply, a resolution, a version or the end of the session leave it open, which is what holds work that outlasts the turn that took it on. Behavior that moved: - A thread an open task holds reads `waiting` with reason `task` when no workflow holds it; its card reads "Task open", and the margin and Page Map carry that label. - The banner's explanation names every open task, so one on a thread the user resolved stays visible. - `leaf page state` carries each thread's `attention`, the open `tasks` (also per thread in `page state PAGE THREAD`), and `queues`: `on_you` (open Asks, prose questions, failed responses) and `on_agent` (owed answers, claimed work, open tasks), selected from readings the served state already makes. - A waiting card whose attention names no workflow no longer folds its status (thread-card.js matched undefined ids). - conversation-loop.md tells the agent to open a task for work that outlasts the turn and end it when the result lands; the new eval case task-outlasts-the-turn scored base 0/2, change 2/2 on Claude Code. Tests that asserted the exact `page state` thread shape now include `attention`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The page now covers only the task model: what is built, the task record and its states, the two queues, the cases a task keeps, the evidence behind it, and an Ask for the next step. The six directions, the B/C/D comparisons and the prior-art survey are gone from the page; research.md keeps the research. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The user wants "item" left arbitrary for now, so the page no longer lists the kinds as a fixed table; it names today's sources and says the set isn't a contract. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Answers the user's page comments: a table of the five records that hold someone to something (Ask, prose question, owed reply, claim, task), how each is registered and what it looks like, how they meet today, and how Pi Durable separates message delivery from work. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The user set the model in a page thread: an Ask parallel to a task, a queue each, either side adding to the other's, and a paging through the user's queue. The plan now runs from that, and the superseded step Ask is kept settled under finished work. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The banner's explanation switched to a bare count once a third task opened, so a task on a thread the user had resolved lost the one place that named it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # notes/what-needs-you/page.html
`a` and Shift+a now page through everything on the user, in page order: each open Ask, each other thread whose attention is the user's (a question left in prose, a failed reply to send again), and each page move handed back to them. A thread holding an open Ask is reached once, as that Ask. `t` still walks every open thread. The banner's status sentence ends with "N on you · M on <agent>", and its disclosure names the kinds. What is on the user has one rule, now stated on both sides of the wire: `agent_state.queues` selects it from the served Asks, thread attention, workflows and tasks, and `runtime/queues.js` selects the same items from the publisher's reading of those four, which already folds this tab's sends into attention. The publisher carries the result as `effective.queues`. `served_records.py` folds a reading both selections must agree on, and a runtime test holds them to it. The Python rule changed to list a thread once: a thread with a failed reply is one `recovery` item named by the thread, and a page widget's failed move stays a `recovery` item of its own. Arrival stays with each item's owner. `queue-walk.js` replaces the Ask walk (`ask.walk` becomes `queue.walk`): an Ask arrives through the Ask view's `arriveAtAsk`, the drawer's arrival, and a thread through the arrival the t walk makes (`navigation.js`, `arriveAtThread`), so a change to where a walked thread lands applies to both walks. The walk announces "Ask 2 of 3 waiting on you" or "Thread 1 of 3 waiting on you". The render gate's Ask screens walk past the threads `a` now stops at. Behaviour the tests moved: - The Ask walk's position reads "waiting on you" where it read "open", and the command reference names the walk "Ask or thread waiting on you". - Two narrowing tests press Shift+a: the thread the list shows waits on the user too, so the hidden Ask now stands before the user's place. - Status sentence and disclosure assertions include the queue counts. - The status-press test grows its sentence to "running tests", since the counts now share the row at 390px. - Two widget tests wait for the arrival's glide before reading where it started; they read the scroll mid-glide and failed on main too. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…n it is sent
Follows the review of the queue walk.
The banner's row gives the agent's side only as the queue count. The
delivery counts ("1 waiting", "1 queued") and "N saved" leave the row; the
disclosure keeps them, and names each open task's title inside the "Waiting on
<agent>" sentence instead of an "Open tasks" one. The counts stand in their own
span after the sentence, inside the same press, at their own width, so a long
sentence truncates before them. The status box declares itself a text reflow
region: the sentence and the counts repack inside it as news rewrites either.
The shift watch let a text region's controls neither grow nor shrink; it now
holds them to what it holds every box to, staying put without being carried,
so a press growing at its trailing edge is allowed and a carried one is not.
A thread message this tab is still sending is an `answer` on the agent's queue,
with no answer named and the stage `sending`, so a reply leaves the user's
count and joins the agent's in the same turn. A widget move still sending
owes nothing yet, and the Ask it answers stays open until the server says so.
The walk's position names its whole list and then the kind it stands on:
"3 of 4 waiting on you · Thread". The command descriptions, the shipped
references and the gallery name the third kind of item, a move to send
again.
`served_records.py` now folds claimed work and a page move whose pickup failed
into the reading both queue selections must agree on; `model_folds.reading`
takes the status store's work claims to do it. The stage check for work under
way has one home, `thread/workflow.js` `atWork`, which the queues, the live
workflow check and the margin's receipt face read. Comments that still named
the Ask walk name the queue walk.
Behaviour the tests moved:
- Status row assertions drop "· N waiting" and "· N saved" and read the counts
from `.lf-status-queues`; disclosure assertions include the queue sentence.
- The status-press test checks the counts stay whole when the sentence
truncates at 390px.
- The queue walk test holds the reply's POST and sees both counts move
before it answers.
- Walk positions read "N of M waiting on you · Ask".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…n the test The queue counts leave the status press and stand at the trailing edge of the status room, beside the banner's controls, at their own width. That edge never moves, so a changing agent sentence cannot carry the counts and a changing count grows them leftward only, which the stability contract already allows; the sentence still gives up its room to the ellipsis first. The previous commit's text reflow region on the status, and the shift watch change it needed, are gone: the shift watch is as it was on main. Inside the banner's control row the counts would not fit beside Approval, which leaves about 84px at 1280px. test_a_thread_says_what_the_agent_is_doing_about_it has failed since #1694, which holds news that would move an open short panel thread behind the card's news notice. The test appended the user's follow-up and the agent's answer straight to the log, so both waited behind that notice and never drew. The follow-up is now sent from the card, as the user's own words show at once, and the test opens the notice for the agent's answer before reading it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/navigation.js # skills/leaf/assets/runtime/reading-place.js # tests/test_render_startup.py
The queue counts at the status row's trailing edge grew leftward when a count changed, so their words moved. Chrome reported that as a layout shift, and the shift watch then audited the whole frame and caught a panel motion it misses on main: a reaction arriving from another tab grows an open short card in the Threads panel by 28px (its reaction strip is not held behind the news notice), and the filter labels widen by 2px. That defect is main's and is left as it is. The counts now take the idiom every generated control with changing words takes (`reserve`, as Threads does for "Threads: 999"): their box keeps the width of the counts they usually reach, under ten a side, and their words start at its fixed leading edge. A count changing moves none of them, and a sentence changing reaches them only as the press's ellipsis. The status-press test grows its sentence to "testing", which fits beside the reserved box at 390px. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…pdates to their input Two narrowing tests failed under the typed-words check from #1707, on main as well as here: walking to an Ask whose thread a Threads search hides clears the search, and the check said the words left with no key. Both sides of that were wrong, and each fix alone leaves the tests red. The runtime reached the Ask after `await materializeAsk(...)` even when the Ask's nodes already stood, so the reveal that widens the narrowing, and clears the search the user typed, ran after a native await, outside the key's turn. `materializeAsk` now answers at once for an Ask that stands and returns a promise only when the thread's markup has to be built, so the arrival, and what it does to the page, is the key's doing in its own turn. The check's causal tracking did not follow reactive element updates. Lit's `requestUpdate` defers the update behind a native await, so a Web Awesome field redrawn for a key, as the Threads search is, lost its cause. `input_work_watch.js` now records the source of the request that starts an update and runs `scheduleUpdate` under it, for every element class that defines Lit's update lifecycle. New tests in `test_render_words_watch.py` hold a key's deferred update as the key's and keep the same update with no input behind it a loss. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ve update by its connection Follows the final review of the queue walk. A follow-up the user sends in a thread the agent already owes counted as a second `answer` while its POST was in flight, so "N on Claude" read N+1 and then N once the server answered: the server owes a thread one answer, to its latest move. A thread message still being sent now takes the place of the served answer for its thread in `selectQueues`. The runtime test and the held-POST browser test both cover the follow-up. `input_work_watch.js` credited an element's first update to whatever made it, though Lit holds that update until the element is connected: an element made under a key and connected by passive work had its first update credited to the key. Connecting the element now names that update's source. The negative words test gains that case. The queue counts' digits are tabular, and their reserved box only grows while the page is open, so counts past nine a side widen it once instead of moving on every change. `materializeAsk` is now only the thread materialization, awaited where an Ask's nodes are missing, beside a synchronous lookup. Comments no longer place the counts beside the banner's controls: at desktop width they end the status area, mid-banner. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Pages no longer start with a "Writing the page" status, so tests that read status.json or a working banner from a fresh page now write the declaration or the start they mean, and end a page task before waiting where the old waiting status replaced a working one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… gate Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…enario test Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… for page tasks A page task is an item on the agent's queue, so the banner's counts and disclosure name it beside the replies it owes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…en tasks Review follow-ups: - A waiting or idle declaration puts down every start at or before its event floor, so the banner shows what the agent wants back: a started move goes back to its delivery stage and a started task stays open with nothing running. A start on an idle page writes the reopening waiting just before itself. - leaf status idle refuses while a task is open, naming each and how to end it. - A start on a task over a widget holds that widget's moves delivered before it, reading Working and covering them for the Stop hook, as widget claims did. - A start's line is refused with a written message when empty or multi-line, and has no length cap. - Thread attention names a running task's line as `line`; the resolve clause says a task opened on the thread still stands; registry, feature gallery and docstrings no longer describe claims. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… task-outlasts-the-turn Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… page task before idling in the Stop test Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tarts down Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Brings in step 3 (#1745: the `a` walk and the banner's queue counts), the experimental Queue panel (#1789), the harness rename (#1747) and the rest of main through b1705d4, onto step 4's model of work: a `start` event names the item in hand, and `leaf status` takes only `waiting` and `idle`. The merge was computed against the branch's own merge of what-needs-you (156463c) rather than the history's merge base, since step 3 reached main as a squash and the plain base would have re-added the `work[]` claims step 4 removed wherever main's copy of them merged cleanly. Where main's new code read claims, it now reads starts: - `served_state.browser` serves the open tasks as the activity fold aged them, with their `running` start, beside main's `ended_tasks` for the Queue panel's Done list. - The Queue panel reads a task with a running start as in hand: live, with its start's line and age. - `tasks.task_error` keeps `open_tasks`, which main had dropped. - The registry's work clause, the docs, references and glossary keep step 4's `leaf task start` wording with main's later edits (`< reply.md`, `handling` clauses, the harness rename, the narrow-column reply clause). - Main's new tests that wrote claims (`status working --on`, `set_status(work=...)`, `cmd_status`) now start the move or declare `waiting` the step 4 way; a fresh page has no "Writing the page" status, so the banner-kind test declares the work it expects. Snapshots, `served_records.json` and the browser bundle are regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
#1788 wraps the label in .lf-msg-workflow in the Threads panel, so the two startup tests that check it closes the message's meta row read the slot. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
A waiting declaration puts down a start in the served workflow, but admission still counts that start as work in hand. admission_workflows calls canonical_workflows without the status after cutoff that served_state/browser.py passes, so obligation_reading keeps the old start when it decides an event's attention bit. I reproduced this with an lf-draft: its first edit is quiet (attention: false), then task start on that edit and status waiting leave the served move at Sent, but a second quiet edit gets attention: true. That unnecessarily delivers and wakes the agent after it put the work down. Pass the same status cutoff through the admission fold, and keep the admission and served readings of work in hand aligned.
A `waiting` or `idle` declaration put down every earlier start through a cutoff held in `status.json` (`after`), which each caller of `canonical_workflows` had to pass. Admission reads only the document and the log, so it never saw the cutoff: a started move stayed in hand there after the served reading had put it down, and a later quiet edit on its widget was stamped `attention: true` and woke the agent. - `leaf status waiting` and `idle` now append a `put_down` agent event (registry kind and events.md row) when a start stands, so a declaration with nothing to put down adds no line to the log. - `tasks.item_starts` drops every start before the latest `put_down`, and `canonical_tasks` takes each task's running start from it, so admission, served state, page state, source history, activity and the Stop hook agree by construction. `canonical_workflows` loses its `put_down` parameter. - `status.json` loses `after`, which nothing else read; a start on an idle page reopens it with a bare `waiting` that writes no put-down. Behavior change: a quiet widget edit after a start and a `waiting` stays quiet (new test beside the attention tests); `leaf status` output no longer carries `after`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ript and Python (#2326) Removing a caller never flagged its callees, so exports, application trampolines and Python helpers kept outliving their last use (#2020 and #1808 left several). This deletes them and adds two gates, so the next orphan fails in the change that creates it. ## Gates - `tests/test_unused_exports.py` fails on any JavaScript or TypeScript export that no other tracked file names as a word. A default export counts as read where another file names its module's file name, since tools such as eslint and Pi load those modules by path. A JavaScript comment or a stylesheet counts as no reader, apart from a JSDoc `import("…").Name`; code, Python strings, pages and contract prose do. It runs over the whole tree rather than through knip because the browser tests import runtime modules inside Python strings and the render gate calls probes by name. Committed bundles are skipped, and the `build/` inputs of third-party bundles are skipped as exporters, since the bundled dependency reads their exports. A name that collides with another word can hide an unused export. - vulture runs as a pre-commit hook over every Python tree (`build`, `dev`, `hooks`, `skills`, `tests`, `worker`), configured in `[tool.vulture]`. A function a framework calls is excluded by the decorator that registers it (click commands, pytest fixtures, `atexit.register`, jsonschema format checks) or by the name the framework's protocol fixes (`do_*`, `pytest_*`, uvicorn's `main_loop`, and so on), never one dead name at a time. ## Deleted or narrowed - `application.js` loses the trampolines nothing imports (`approvalBlockingQuestions`, `beginRead`, `midComposition`, `receiveState`, `startFeed`, `unaccountedGesture`, `undoable`, `undoLast`). Pure helpers stop routing through the mounted application: `widget-api.js` re-exports `watchReports` from `reports.js`, and `leaf.js` imports `beginRead` and `approvalBlockingQuestions` from theirs. The mount drops the unread `updateFab` and the `feed` dependency bag, which repeated `state`, and the six `openPageThread` forward references share one forwarder. The mounted object lists the members boot reads instead of spreading the projection commands and engagement into it, so `undoable`, `undoLast`, `retainReversal`, `unaccountedGesture`, `dispatchWidget`, `refreshAnnotationInventory` and `receiveState` leave it. - `export` comes off every symbol only its own module uses, across the runtime, the default package, the browser framework's types, `eslint.config.mjs`, the Worker and the rust-sort example. `widget-api.js` stops re-exporting `submitBindings` and `submitLabel`, which no package uses. `history.js` and `banner-toolbar.js` use `focus.js`'s `drawn` instead of their own copies, `context.js` loses the unread `events` and `activity` getters and shares one live-revision test, `pointed-place.js` names its function `pointInto` instead of aliasing `rowIn`, `geometry.js` loses the uncalled `documentPoint`, and `composing/input.js` gets its contract comment as a header. - Python: `events.current_anchors`, `anchored_ids` and `anchored_parts`, `tasks.canonical_tasks`, `log_tasks_open`, `OUTCOMES` and the `ENDS_BY_*` constants, `PageTransaction.voice`, and the test-only wrappers `unattended_pages` and `layer_generation`, whose tests now call what production calls. `task_error` reads the task's `owner` directly, which is what the `ends` comparison meant; the `ends` field itself stays. Test helpers `xfail_browser_problem` and `draft_owner` had no callers; a fixture requested only for its effect moves to `usefixtures`, and protocol overrides collect arguments they ignore in underscore-named `*` or `**` parameters. - Behavior changed in tests: five visual-part tests in `test_interact_anchors.py` asserted that a version may drop a part a detached, moved, resolved, reopened or bare-reaction thread had pointed at. Since #2020 no thread blocks that removal, so each passed without its premise; `test_a_removed_visual_part_moves_its_thread_to_the_surviving_section` keeps the live-thread case. ## Rule `skills/leaf/assets/AGENTS.md` gains "Facts both runtimes know": a fact Python and the browser both use is owned by one language and consumed as data, or generated from the registry, and a new parity fixture or source-scanning test is a review flag asking why it is not generated. `/developing-leaf` points reviewers at it. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Working now always names an item on the agent's queue.
leaf status working [--on]folds into the task commands, so one command takes work on, andstatuskeeps onlywaitingandidle. This is step 4 of the plan onnotes/what-needs-you/page.html. The task and queue code stays marked experimental.The model
leaf task start PAGE ID "line"writes astartevent naming the item in hand, with the line the banner shows. The item is one of:task end, or a version stamped with--completeson its widget. That stamp now also ends the widget's open tasks as done, citing the version.waitingandidleput down every earlier start. A started move goes back to its delivery stage, and a started task stays open with nothing running. The put-down is aput_downevent in the log, written when a start stands.tasks.item_startsclears at it, so every reader agrees on what is in hand. That includes admission, which reads only the document and the log when it decides an event'sattention.status.jsonloses itsafterfield, which nothing else read.idleis refused while any task is open, and the refusal names each task and how to end it. A start on an idle page writes a barewaitingfirst, so carriers that stood down resume.x-workor holds an unsettled move, or onpage. A start on a widget task covers the user's earlier moves on that widget.page initno longer writes "Writing the page".Claims leave
status.jsonstatus.jsonkeeps thewaiting/idledeclaration and the harness's stream. Every reader of claims now reads starts from the log throughtasks.item_starts:started_bypage stateThe standalone claim workflow and the
claimupdate source are gone.On the Queue panel (#1789), a task row with a running start now reads live and shows the start's line and age, as a move in hand already did. Open tasks are served from the activity fold, which carries
running. Ended tasks still come fromcanonical_tasks.Instructions
These now tell the agent to
task startan item instead of claiming withstatus --on:SKILL.mdconversation-loop.md,event-batches.mdandthreads.mddocs/how-it-works.htmlevals/work-names-its-itemgrades that a session names its item and hands back. It is a guard on the new wording, not a before/after score, because the base wording has notask startto measure.A session running the old instructions gets one refusal, since
statusno longer takesworking. The command's help namestask start.Tests
Tests that wrote claims now write starts or tasks. The board, choice and draft cases start the exact move or open a widget task. The CLI help, the delivery clauses, the served records and the regtest snapshots are re-recorded.
Locally on the merge with main:
uv run pytest tests -n autonpm run test:runtimenpm run test:browsernpm run check:browserThe failures left in the browser and nightly files fail identically on main, including
test_a_label_press_keeps_the_controls_keyboard_standing. Each was checked in a detached worktree at main.🤖 Generated with Claude Code