Repository navigation
Keep delivery receipts for moves that owe nothing - #1005
Merged
Merged
Conversation
#983 made each workflow carry `answer`, the operation the agent owes a move, and dropped every page action that owes nothing from the workflow list. That conflated two readings a workflow carries: `stage`, how far a handed-over move has reached the agent, which the margin and Page Map report for every move; and `answer`, what the agent owes it, which Stop, `idle` and the banner's counts read. A moved card or a draft edit lost its Sent / Picked up receipt, and `leaf delivery claim` on it found no outstanding move. A page action that answers no Ask now keeps a workflow with a null answer until the markup records it or a later version takes it in. Activity counts read owed answers only, so Stop, `idle` and the counts still ignore it. A pick before Done still has no workflow: the reader has not handed it over, and the Done carries the receipt. A version settles a move only when its note supersedes the revision the move was made on, since a note stamped over that very revision was written before the move reached anyone. `work_subject` asks the workflow projection whether a widget has a receipt instead of re-deriving it. Behavior that moved in tests: - test_a_page_pick_holds_the_turn_until_the_markup_records_it: the draft edit now has a Sent receipt with a null answer that no count reads, and the next version retires it. - test_a_margin_label_covers_the_target_trace: uses a single-choice group, since a tick before Done has no receipt (as #983 did for its sibling). Fixes the nightly reds in test_render_export, test_render_margin (x2) and test_render_aim. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…obligation # Conflicts: # tests/test_render_aim.py
leaf-agent
approved these changes
Sep 23, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 23, 2026
#1005 restored delivery receipts for page actions that answer no Ask, while keeping their `answer` null so they do not create agent obligations. That changes the contract against which #1004 updated three nightly cases. Restore the original export, Page Map arrival, and shipped-board margin-rail tests. They again cover a draft edit and ordinary card moves with real Sent / Picked up / Working readings. Keep #1004's single-choice fixture in the margin-label test: a tick in a multiple-choice Ask still produces no receipt before Done. Verification on the PR's base at `0cccbdc`: all three restored cases plus the retained margin-label case pass together under `--run-nightly -n0` (4/4). Pre-commit passes on the changed files. The later #988 merge changes only the workflow docstring in the code these cases exercise. > _This was written by Codex on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Sep 23, 2026
A card moved on a board the agent sent in a reply now gets the same delivery receipt a moved card on the page gets, and like it owes the agent nothing. ## What was wrong `canonical_workflows` derived widget moves in two loops, one per document. The frozen-thread loop kept only moves in an answered Ask. #1005 gave page moves that owe nothing a receipt with a null `answer`, but the second loop never picked up that rule. So a moved card or draft edit in thread markup was delivered to the agent (`requires_agent_attention` admits it) with no workflow behind it: it had no Sent / Picked up receipt, and `leaf delivery claim` reported no outstanding move. ## The change - **One derivation for both documents.** One loop decides handover (whether the Ask is answered) and obligation (`answers_ask`). The page and a frozen thread differ only in what settles a move and which operation answers an owed one: - page: the markup records the move, or a later version supersedes it; an owed move's answer is `markup`. - frozen thread: the agent's next spoken turn there, which is the reply addressed to an owed move, or for a move that owes nothing any agent turn after it. A resolution that follows the move also settles it. An owed move's answer is `reply`. A reaction is not a turn, and a host's failure reply does not settle the move: it hands an owed frozen move back to the reader as a failed workflow, the way a failed pickup hands back a page move. Before, a failure reply settled such a move and left no record. - **Thread attention follows the obligation.** `holds_thread` states what keeps a thread the agent's turn: every input and claim of the thread itself, plus a frozen widget move while it is owed or the agent is at work on it (Working or Replying). The thread's status comes from those workflows. A frozen move that owes nothing shows its receipt on the message that carries the widget. It does not make the thread the agent's turn or set the thread's status. `at_work` is now one predicate that both the filter and `priority` read. - **Docs.** `workflows.py`, `session-lifetime.md`, and `events.md` state the rule for both documents. `events.md` no longer says that interim moves before an Ask's completion get receipts; they have had none since #1005. ## Decision The code has no product statement on whether a reader's move on a frozen widget that answers no Ask owes the agent anything. I applied the page rule: it owes nothing (`answer: null`), it keeps a delivery receipt, it leaves Stop, `idle`, and counts alone, and it does not make the thread wait on the agent. The frozen widget's state lives in the log for the page's whole lifetime, so nothing is lost if the agent never answers, which is the page rule's premise too. Before #983 every frozen move was owed a reply. #983 dropped the ones that owe nothing entirely, receipt included. A resolved thread settles the moves made before its resolution, including the Ask answer that resolved it. A move made after the resolution is delivered like any other and keeps its receipt. Before, it was delivered with no workflow. ## Behavior that moved - A frozen-thread move that answers no Ask now has a workflow: `stage` reports delivery, `answer` is null. - A failure reply addressed to an owed frozen move now leaves it a failed workflow, and the reader's turn. - A thread whose only workflows owe nothing and are not Working has no `attention`. - Actions not authored by the reader no longer take part in the page's newest-move-per-unit pick. They already did not in threads. ## Coverage for moved cards and draft edits on the page (task A) #1006 already restored browser coverage at the real boundary. The Page Map arrival test covers two moved cards reaching Picked up and Working. The shipped-board margin test covers the moved card's margin status. The export test covers a draft edit's receipt being dropped from a copy. No new page test was needed. The browser test added here covers the frozen-thread case. ## Tests - `test_interact_session.py::test_a_frozen_move_that_answers_no_ask_keeps_a_receipt_and_owes_nothing`: a Sent receipt with a null answer, no obligation, no thread attention, and no `obligation` in the delivery. `delivery claim` makes it Working and the thread waits. An agent reaction leaves the receipt standing, and the agent's next spoken turn settles it. A move made after the thread resolves keeps its receipt. - `test_frozen_widget_workflow_contributes_to_its_thread_attention` now also covers a failure reply that hands the owed move back to the reader. - `test_thread_attention_names_the_workflow_the_thread_waits_on`: an input covered by a newer one keeps the thread's status while a reply streams to it or after it is picked up, and a frozen move that owes nothing never supplies the status. - `test_render_conversations.py::test_a_card_moved_on_a_board_in_a_reply_reports_delivery_on_that_reply` (nightly): the reply carrying the board reads Sent, then Picked up, while the thread status stays empty. The receipt leaves after the agent's next turn. - Bug-back: reverting `workflows.py` fails both new tests (no receipt), and reverting `served_state/browser.py` fails both on the thread status. Settling on `msgs` instead of `spoken_turns` fails on the reaction, and dropping the failure-reply lookup fails the failure case. - After the review fixes and a merge of main at `ee2f3ff1`: the `test_interact_*` files and `test_website_server.py` pass. With `--run-nightly`, `test_render_conversations.py`, `test_render_projection.py`, `test_render_margin.py`, `test_render_application_boundary.py`, `test_render_semantic_news.py`, and `test_render_startup.py` pass (502). Pre-commit passes on the changed files. No runtime JS changed. > _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]>
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.
A page action that answers no Ask, such as a moved card or a draft edit, now shows its Sent / Queued / Picked up receipt again. It still owes the agent nothing: Stop,
leaf status idle, and the banner's counts ignore it.What #983 conflated
#983 made each workflow carry
answer, the operation the agent owes a move, and dropped every page action that owes nothing from the workflow list. A workflow carries two separate readings, though:stageis delivery progress.conversation-loop.mdpromises it for every reader move, and the margin, the Page Map andleaf delivery claimread it.answeris the obligation, and Stop,idleand the counts read it.Because the move itself was removed, a moved card lost its receipt and
leaf delivery claimon it reported no outstanding move. #1004 then rewrote the four nightly cases to use Ask answers, so the suite no longer covers these moves.The change
answeris null. The workflow stays until the markup records the move or a later version takes it in.outstanding=obligations). This keeps Derive every agent obligation from one workflow answer #983's guarantees: no Stop or idle block and no pending count for a move that owes nothing. The remedy text and theansweringclauses are unchanged.work_subjectnow asks the workflow projection whether a widget has a receipt, instead of callingpage_action_unsettleda second time.workflows.py,session-lifetime.mdandconversation-loop.mdnow describe the two readings separately.Tests
test_a_page_pick_holds_the_turn_until_the_markup_records_it, the draft edit now has a Sent receipt with a null answer that no count reads, and the next version retires it.19a02132^, failing on19a02132, and passing again here.test_render_margin.pyin full plus the aim and export cases (nightly included), and all oftest_interact_session.py. Before the merge, the interact files, website server, semantic news, conversations, projection and navigation suites also passed. The one failure,test_render_startup.py::test_a_widget_a_reply_carries_arrives_with_its_module, also fails onorigin/mainlocally.🤖 Generated with Claude Code