Repository navigation
feat(pm-console): machines: what each can do, what waits for one, and taking it back - #13471
Conversation
… 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
|
Warning Review limit reachedYou'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. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| const [gone] = held.splice(at, 1); | ||
| await this.saveHeld(); | ||
| await this.logAct({ |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
| async function viewMachines() { | ||
| const m = await api("machines"); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
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
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.GET /console/api/machinesis 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.held.dropremoves 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".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:Checked
Not checked
https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
Generated by Claude Code