Skip to content

feat(pm-console): machines: what each can do, what waits for one, and taking it back - #13471

Merged
dezren39 merged 4 commits into
mainfrom
claude/pm-machines
Nov 23, 2026
Merged

dezren39 merged 4 commits into
mainfrom
claude/pm-machines

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Step 5 of the plan in doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/: the laptop stops being "the laptop" to the platform and becomes a machine, one of however many there are, that happens to be able to do more.

What changes

  • A machine says what it is. Each report to the edge carries the machine's name (PM_CONSOLE_MACHINE, or the host's own name) and what it can do: the kinds of action it has and the sections it reads. The edge keeps what it last said beside when it last reported. A console older than this says nothing and is shown as a machine that has not said what it can do; a report that says nonsense is treated the same.
  • The edge answers for the whole. GET /console/api/machines is answered at the edge with no machine asked, so it works with every machine away: what the edge does itself right now (its own actions always, the core when it has the means, less what it was turned away for), each machine and whether it is reporting, and what the owner did that waits for a machine. A machine serving the app by itself answers the same read with itself.
  • What waits can be taken back. held.drop removes one held action before a machine has it and records it as not sent under its name, so the device that sent it shows it under "could not be done".
  • More, Machines. Cloudflare's part; each machine with whether it is reporting, the commit it runs, and what only it reports and only it can do, in words (what Cloudflare does itself is not counted as the machine's); what waits, oldest first, each with "Take back", which asks first and says what it means. It is in the list of screens a device keeps a copy of.

What it does not do

One machine can report today: the one the tunnel leads to, whose key is the only one the edge takes reports under. A second machine under its own key, sending each action to a machine that can do it, and keeping what is held per machine are filed with the gaps, not built here.

After review

Two findings, both real, fixed in d5aea0c1df:

  • Taken back stays taken back. A device that never heard its action was kept offered it again under its name, which was still written down as given to a machine, so it was kept again. Taking back now ends the name; the offer is answered "taken back" (410).
  • The screen keeps itself current. Nothing drew it again when a machine went quiet unless something else changed. While it is open it asks again and is drawn again when what it shows has changed.

Checked

  • 351 tests under bun (was 342); the keeper's 25 unchanged.
  • 28 planted faults in the new code, all caught.
  • Left open in a real Chrome, the screen went to "away" and back to "reporting" by itself.
  • A real Chrome, phone-sized, against the demo laptop and the demo edge, light and dark: the screen with nothing in front of the machine and with the edge in front; a rank held while the machine is out of reach, listed in the owner's words, taken back after the question, gone from the list, and on the record as not sent.
  • axe-core over all 21 screens and the new dialog, light and dark: no violations.
  • The offline, ordering, draft and answer flows from feat(pm-console): the app works with no connection, and sends what was done once when it is back #13287 again, on this branch: all pass.
  • The bundle in the real Worker runtime: all checks passed.

Not checked

  • The Machines read at the real edge with the owner's sign-in (the smoke run has no sign-in to present).

https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF


Generated by Claude Code

… taking it back

The laptop becomes a machine among machines. A machine is anything
that reports to the edge under a key the edge knows; it says what it
is called and what it can do (the kinds of action it has, the sections
it reads) in each report.

- The edge keeps what the machine last said and answers a Machines
  read itself, with every machine away: what the platform does itself
  right now, each machine and whether it is reporting, and what the
  owner did that waits for one.
- held.drop: the owner takes back something that waits, before a
  machine has it. It is recorded as not sent, under its name, so the
  device that sent it learns so.
- More, Machines: the platform's part, each machine with what only it
  reports and can do (in words), and what waits, each with "Take back".
- A machine serving the app by itself answers the same read with
  itself.

One machine can report today (the one whose key the edge holds);
enrolling more is the next step.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
The README and the edge's README say what a machine is, what the
Machines screen shows and what is not built yet; the design record
gains the section for step 5 and the state of step 4 in service. One
more test: a machine says every section it has a reader for from its
first report.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae5ccf72-a908-4858-b0a4-64dc47631396
Commits

Reviewing files that changed from the base of the PR and between 28d20a7 and d5aea0c.

Files selected for processing: 19

  • doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md
  • pm-stack/console/README.md
  • pm-stack/console/edge/README.md
  • pm-stack/console/edge/src/direct.ts
  • pm-stack/console/edge/src/edge.ts
  • pm-stack/console/public/app.js
  • pm-stack/console/public/outbox.js
  • pm-stack/console/scripts/demo-state.ts
  • pm-stack/console/scripts/edge-demo.ts
  • pm-stack/console/src/config.ts
  • pm-stack/console/src/docs.ts
  • pm-stack/console/src/edge-proto.ts
  • pm-stack/console/src/server.ts
  • pm-stack/console/src/sync.ts
  • pm-stack/console/test/app.test.ts
  • pm-stack/console/test/console.test.ts
  • pm-stack/console/test/edge.test.ts
  • pm-stack/console/test/outbox.test.ts
  • pm-stack/console/test/work.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T16:59:50.384508Z d5aea0c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1875ea9717

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +401 to +403
const [gone] = held.splice(at, 1);
await this.saveHeld();
await this.logAct({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Persist cancellation under the original action ID

If the original response saying an action was held is lost, its sending device keeps retrying it. Another device can take that action back here, but this only removes the held entry and writes an activity record; a:<original ID> remains in state given. A subsequent retry therefore passes through the relay path again, and keep() only deduplicates against currently held entries, so the canceled action is queued again—or executed immediately if the machine has returned. Persist a terminal cancellation under the original action ID and honor it before relaying or holding retries.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d5aea0c. Taking back now ends the name: a:<id> is written as done with a 410 and "This was taken back before a machine took it.", so a device that offers it again is answered from that, with the machine away or back, and it is neither kept again nor relayed. Test: offered again after the take-back, and once more after the machine returns; it is never run.


Generated by Claude Code

Comment on lines +2095 to +2096
async function viewMachines() {
const m = await api("machines");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh machine status independently of core document changes

When the core state is unchanged, leaving Machines open never refreshes this answer: the periodic refresh(false) only calls draw() when a document's ETag changes, while machine reporting timestamps, names, versions and capabilities are absent from the core document's ETag. Consequently, a machine that stops reporting can remain labeled “Reporting” indefinitely, and one that reconnects with identical state can remain labeled “away” until the user manually refreshes or navigates back. Refresh the Machines read periodically while this screen is active, independently of core content changes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d5aea0c. While the Machines screen is open the periodic refresh asks the machines read again and draws the screen again when what it shows has changed (who is reporting, versions, what waits, what the platform does; by the minute once a machine is quiet). A report that changes nothing shown does not redraw it. Checked in a real Chrome: left open, the screen went to "away" and back to "reporting" by itself.


Generated by Claude Code

… keeps itself current

Two findings from review, both real.

- Taken back, an action could be kept again: a device that never
  heard it was kept offered it again under its name, which was still
  written down as given to a machine. Taking back now ends the name,
  and the offer is answered "taken back" (410), with the machine away
  or back.
- The Machines screen is drawn from an answer of its own, and nothing
  drew it again when a machine went quiet unless something else
  changed. While it is open it asks again, and is drawn again when
  what it shows has changed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@dezren39
dezren39 merged commit cf40e59 into main Nov 23, 2026
1 check passed
@dezren39
dezren39 deleted the claude/pm-machines branch November 23, 2026 16:58
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