Skip to content

Keep delivery receipts for moves that owe nothing - #1005

Merged
max-sixty merged 2 commits into
mainfrom
delivery-progress-vs-obligation
Sep 23, 2026
Merged

max-sixty merged 2 commits into
mainfrom
delivery-progress-vs-obligation

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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:

  • stage is delivery progress. conversation-loop.md promises it for every reader move, and the margin, the Page Map and leaf delivery claim read it.
  • answer is the obligation, and Stop, idle and the counts read it.

Because the move itself was removed, a moved card lost its receipt and leaf delivery claim on 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

  • A page action that answers no Ask keeps a workflow whose answer is null. The workflow stays until the markup records the move or a later version takes it in.
  • Activity counts are now derived from owed answers alone (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 the answering clauses are unchanged.
  • A pick before Done still has no workflow. The reader has not handed it over yet, and the Done carries the receipt. The rule that such a pick hands the agent nothing still holds.
  • A version settles a move only when its note supersedes the revision the move was made on. A note stamped over that same revision was written before the move reached anyone. The rule applies to recordless owed verbs too, and they settled on log order alone before.
  • work_subject now asks the workflow projection whether a widget has a receipt, instead of calling page_action_unsettled a second time.
  • workflows.py, session-lifetime.md and conversation-loop.md now describe the two readings separately.

Tests

  • In 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.
  • On the original tests, before Align four remaining nightly browser cases with Ask workflows #1004 rewrote them, the four nightly cases pass with this change: each was confirmed passing on 19a02132^, failing on 19a02132, and passing again here.
  • On the merged branch, these all pass: test_render_margin.py in full plus the aim and export cases (nightly included), and all of test_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 on origin/main locally.

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

🤖 Generated with Claude Code

max-sixty and others added 2 commits September 23, 2026 06:26
#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
@max-sixty
max-sixty merged commit 0cccbdc into main Sep 23, 2026
5 checks passed
@max-sixty
max-sixty deleted the delivery-progress-vs-obligation branch September 23, 2026 13:52
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]>
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