Skip to content

Restore nightly coverage for ordinary move receipts - #1006

Merged
max-sixty merged 1 commit into
mainfrom
codex/restore-leaf-receipt-tests
Sep 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
codex/restore-leaf-receipt-tests

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

#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

The delivery model now gives non-Ask board moves and draft edits a receipt without making them agent obligations. Restore their export, Page Map arrival, and shipped-board rail cases; the single-choice Ask fixture remains in the margin-label test.
@max-sixty
max-sixty merged commit 89902be into main Sep 23, 2026
7 of 8 checks passed
@max-sixty
max-sixty deleted the codex/restore-leaf-receipt-tests branch September 23, 2026 14:32
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