Skip to content

feat: a turn carries open work and origin, and a reply notifies at rest (D-259) - #240

Merged
blove merged 22 commits into
mainfrom
blove/live-activity-recordings
Nov 20, 2026
Merged

blove merged 22 commits into
mainfrom
blove/live-activity-recordings

Conversation

@blove

@blove blove commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What

Change 1 of 6 of the runtime turns design (docs/superpowers/specs/2026-11-19-runtime-turns-and-open-work-design.md). It adds the fields and the rules that read them. Nothing writes the fields yet, so behaviour is unchanged until the coordinator change lands.

  • Recordings. Ten live recordings (Claude Code 2.1.282 and codex-cli 0.166.0), scrubbed into fixtures, with tests that hold the runtimes' shapes: background sub-agents outlive the turn, Claude Code starts turns itself, a Codex sub-agent is a thread of its own. Gate record: docs/verification/2026-11-19-live-sub-agent-recordings.md.
  • Fields. Turn.openWork (agents the turn started that are still running) and Turn.origin (nil for a turn the owner sent), decoded leniently. Coordinator migration 0016, hub migration 0023, mirror schema 11.
  • State. A thread with open work on any turn reads as working on the Mac, the phone and the hub, unless its latest turn failed. The shared attention.json fixture gained four threads all three implementations agree on.
  • Notification. The hub's "Replied" is keyed by the thread's latest turn and sent when the thread is at rest (no open work). A failed turn still notifies by its own key. A reply already read is written and withdrawn in the same push, as before.

Behaviour changes to know

  • Several completed turns of one thread arriving in one push now give one "Replied", for the latest.
  • Deploy order once a Mac writes openWork (a later change): both hub tasks must run 0023 code first. See docs/compatibility.md.

Open points (D-259)

  • Settled: a thread keeps at most one unfinished turn. Turns never overlap on either runtime (three more recordings); a message sent as Claude Code wakes itself is folded into the owner's turn in the adapter (a later change), so "latest turn" stays "the active turn". The design text for this follows in the next pull request; this one was queued before it could be pushed.
  • A Stop that ends open work announces an unread latest reply, the same as the agents ending.

Checked

  • swift test: 2284 tests in 258 suites passed, after merging main.
  • Hub: cargo test --workspace --locked passed, cargo fmt and cargo clippy clean (before the merge; the merge touched no hub file).
  • swift format lint --strict and Scripts/docs-index.sh --check clean.

Not checked

  • Anything on a device or in the running app.
  • A hub that already holds data running migration 0023.
  • A phone migrating a schema-10 mirror outside the tests.

🤖 Generated with Claude Code

blove and others added 19 commits November 19, 2026 11:29
Five scrubbed recordings (Claude Code 2.1.282: a foreground agent, two
background agents, a nested agent, a stopped background agent; codex-cli
0.166.0: one sub-agent), tests that hold their shapes, and the gate record
of what they show the activity line does not yet handle.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ted for

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The open set comes from the runtime's live-task frames, each turn stores
its origin, empty wake-ups are folded, and a send during a running turn is
delivered to that turn.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…sign

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…eps a thread working

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…read in the working band

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e attention fixture

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ld back

A touched turn is checked for two notifications, each keyed and
ledgered on its own: its own failure, then the thread's latest reply
when the thread is at rest. The malformed-timestamp test now uses a
value the cast refuses, and the prune, BANDS and API comments say what
is true now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rows

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
blove added a commit that referenced this pull request Nov 20, 2026
#239 takes D-258 and #240 takes D-259.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
blove and others added 3 commits November 19, 2026 17:32
…rn, and a second Codex turn

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The first copy was cut short: the driver exited before its output was flushed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ale objects

Package build and tests failed to link on this pull request: test objects
restored from main's build still named Turn's old initialiser, which gained
two parameters (D-259). Their own sources had not changed, so they were not
recompiled. The key now carries a version to bump when that happens.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@blove
blove added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit d668423 Nov 20, 2026
10 checks passed
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.

1 participant