Repository navigation
Machine groups: a thread starts a thread on another machine, and a project moves to one - #1199
Merged
Merged
Conversation
…and projects over Principle 1 says hosts, projects and threads are Tcode's own, so operating them between the hosts of a group is not a harness capability to surface or to leave alone, whatever a harness has of the kind between its own sessions. Principle 2 says a thread belongs to one host at a time, that the hosts of a group start threads on each other and hand a project with its threads over, and that a host keeps a reference and the last known status of another host's thread, never its content. Principle 5 says the machines of a group reach each other over the same transport under their own keys, and that a switch for each decides whether a machine's threads start threads elsewhere, whether it takes threads started on it, and whether it takes projects moved to it; the last is off until switched on. Nothing is built on them yet.
… sets what it takes and what the group's devices may do A machine now admits a tcode/1 connection from another member machine of its group, under that machine's own key, and serves it only machine streams: a `machine` line, one MachineRequest, one machine_reply. A device's connection may not open one, and a machine's connection may open no hello, tunnel, SSH or original. Every request is checked again as it arrives: the caller must still be a member and speak this protocol, and its kind must pass this machine's switches. Threads need Accept threads (on by default), projects need Accept projects (off until switched on), both need the group's devices to be allowed to operate the machine, and replies to what this machine sent out always pass. Requests reach the host as Query::Machine from Principal::Machine through one mux attachment per connection. The host reaches the other machines through a MachineLink the composition roots hand both to the host and to the mux; the machine serves it while it runs and calls fail with no_group otherwise. Outbound requests dial the member with this machine's key, learn its hints, and keep the connection for the next request. The runtime answers Ping and hands the rest to app/machines, whose thread and move halves are stubs answering not_implemented for now, as are the MoveProject and CancelProjectMove commands, the ProjectMovePreview query and the ProjectMoves topic. A group-wide label any member may set for any machine is merged apart from the machine's entry, so a state without labels (an older build's) never takes one away; devices learn it with the roster. Each machine reports what it takes with its own entry. Group devices access sets what the group's full-access devices may do: operate, view (Principal::Viewer, which may read and subscribe but sends no command, terminal, upload, tunnel, SSH, original or hosting query) or none (hello refused as closed, which a device shows as not open to the group's other devices and stops dialling). A change closes those devices' connections with code 5 so they come back under it. Authorization now matches every principal explicitly, so a new principal or variant is refused until it is decided. Thread metadata gains remote_parent and remote_children, started_by its machine, a ControlAction its actor_machine, Settings' control the machines switch, and the event stream and timeline thread_moved. traverse.json is written as version 6 and still reads 3, 4 and 5.
…'s folders or start a measurement A viewer was allowed the folder and icon browsers, the scan for other tools' histories and the disk-usage topic, whose first subscription starts a measurement. They serve dialogs that add or change something and work a viewer cannot start, so they are refused as a space member's are; reading a file a thread names stays allowed.
…ds, staged there and committed at once MoveProject asks the other machine to preflight the move, freezes the project and journals the move in the store before anything else. Its parts are built under moves/out off the host: for a repository one bundle of every ref, each checkout's index and working tree kept as two commits under refs/tcode/move/<move> without touching its index, HEAD, branch or stash, a manifest naming each checkout and its head, and the files .worktreeinclude selects when they go along; for a directory one tar. The threads go as one tar of their metas, event logs in canonical stored form with their images inline, attachments and write journals. The other machine stages the parts under moves/in, answering the bytes it holds so a move resumes where it was, and only MoveCommit makes the project: the repository fetched with fsck on and no submodules, each checkout's state put back so git status reads as it did, each thread worktree where this machine keeps it, then one store transaction with the project, every thread mapped to its new paths and starting its next turn from the relay transcript, its events, a thread_moved entry and the move's record, so a repeated commit answers the same project. Until the commit is sent a move can be cancelled and both machines are as they were; a commit whose answer was lost is settled with MoveStatus, and only a forced cancel ends it then. A machine that cannot be reached pauses the move and it tries again; a restart resumes every journalled move. Once committed the source removes the threads, their worktrees and the project, keeps the directory, and answers a moved thread with where it went (thread_moved, Query::MovedThread, tcode_control). Commands that would change a moving project's threads are refused with project_moving.
… passed the gate The helper told a request that passed the gate by the stub's not_implemented. The host now answers the move requests, so an answer or any refusal of the host's own means the gate let the request through, and only the gate's machine_refuses means it did not.
…ason it cannot move The blocker is declared here so the host and the dialog are built against one list; the host does not raise it yet.
A project whose root lies inside a Git work tree without being its top level moved as a plain directory, which left its history behind, and its threads' worktrees, which belong to the enclosing repository, could not be made again on the other machine. Such a root is now a blocker: the preview lists InsideRepository and MoveProject refuses it with move_blocked. A directory in no repository still moves as a directory, and the top level of a repository still moves as Git.
…t, machines go by their group's label, and a machine that lets this device only view it is read-only here Settings -> Machine group gains, under the group's name, Accept threads other machines start here, Accept projects other machines move here and Other devices of the group (may operate / may only view / cannot open), whose description follows the choice. Narrowing the devices' access asks first, since it disconnects them; while they may not operate the machine both Accept switches show off, cannot be moved and say why. Each sends its GroupAction through the machine's Spaces, as Accept new devices does. Every machine of the group is called by its label where it has one: the group's machine rows (with the machine's own name under it and, for the others, what they say they take), the Machines page, the sidebar's headings, the settings host selector, the palette and toasts. Saved machines go through PairedHost::title and the group's machines through machine_title; an attached machine's store follows a label set after it attached. Rename on a group row, and Set label... in a member's menu on the Machines page, set it through this machine when it is a member, else through the member itself. Settings -> Control gains Let threads start threads on other machines of the group, and the risk shown before creating or joining a group names that power. A ScopeSnapshot's view_only now reaches the store. may_operate() is what a full device that may change the machine has, and can_manage_host and the space policy checks answer no for a viewer, so it loses what a member loses and also starts no thread or draft: its composer is disabled with one line saying the machine only lets other devices view, approvals and questions show and cannot be answered, its menus keep only what reads, rows do not swipe or drag, its heading says View only, its settings are a member's, and nothing it does unasked (fallback draft, preview offer, hosting, read marks, last project) is sent to be refused.
…oup and hears back from it tcode_control offers list_machines and start_thread_on_machine to a thread whose machine reaches a group and lets its threads do so (Settings → Control machines); with that off neither is offered and every call that names a machine is refused, as is any from a space member's turn. list_projects, list_providers, list_threads, get_thread, outline, read, search_in_item, send_message, control_thread, notify_when, cancel_notify, respond_input and respond_approval take a machine and run there through MachineRequest::Control; the answer names the machine, and a thread elsewhere is linked as tcode-thread://<thread_id>@<machine_id>. The origin writes its own record of each write it made there. The machine that is asked parses the call with the server's own parser and decides it with an exhaustive list: reads, start_thread, send_message, interrupt/cancel/steer/drop of control_thread, watches, respond_input, and respond_approval and settle only for a subagent that caller started there. Everything else is refused as not a machine's to ask, and all of it while tcode_control is off there. A thread it starts is an ordinary root thread there, started_by the caller's machine and thread, idempotent per request; as a subagent it carries remote_parent, owes a report and is offered report_result, and its permission is what a local start would give it held to no more permissive a class than the caller's own mode. The caller is recorded in the thread's log with its machine, and acts as an agent, never the user. A subagent's report, approvals and questions go back to its lead through MachineRequest::Callback, with the report's id and the child's state; the lead takes them as it takes a local child's, the report stays kept on the child's machine until ReportTaken, and a report sent again is known as queued or taken. Watches another machine's thread puts on a thread are kept on that thread and their firing is kept until delivered. A lead keeps its subagents elsewhere as remote_children with their last known state; a running one holds the lead's automatic settlement, and a cancel, interrupt or settle that cannot reach its machine is kept and sent later. What could not be sent goes when the transport starts serving the link, on any exchange with that machine, and on a ten-minute check, which also finds machines that left the group. MachineLink tells its host each time it is served.
…p's real transport A test now drives start_thread_on_machine, the subagent's report and its lead taking it, an Accept threads refusal and a refused delete_threads through two real hosts with real endpoints joined into a group: MachineLink, the tcode/1 machine stream, the gate, the mux and Query::Machine under Principal::Machine. The two-host harness the move tests built is shared between both test files. A forwarded call that fails now names the other machine's error code beside its message, so a caller can tell machine_refuses from machine_unreachable. docs/remote.md describes starting threads on another machine.
…nd the window follows its move and its threads there A project row's menu offers Move to machine… on a full device of a machine whose group has another member. The sheet lists the group's other machines with what each says it accepts, asks the machine that holds the project what a move to the chosen one would take, and shows the place on that machine, the code, the threads, the ignored files to bring along and what stands in the way; Move is offered only with nothing in the way, asks first over a relay, and goes to the holding machine's own store. Each full workspace follows its host's ProjectMoves list. A moving project's row says how far its move is, with its bar, and opens the move's progress, where it can be cancelled, forced once the commit's outcome is unknown, or tried again while paused. Its threads take nothing from the composer and their menus, like the project's, keep only what reads. When a move ends the window says so, with Open for the machine it went to; a cancel this client did not ask for is told too. A pane, the remembered thread or a link naming a thread that went with its project follows it to the machine it is on when the window shows that machine, and otherwise says where it went, with Open for a saved machine. tcode-thread://<id>@<machine> names a thread on a machine of the group.
…s as that machine's thread A start_thread_on_machine call that answered stands as the card a local start gets, the machine's name leading its subtitle. Its status comes from that machine's store while the window is linked to it and the store knows the thread; otherwise from what the lead's host keeps of it, where a subagent last heard running on a machine out of reach reads "Cannot be reached" (muted, with the time this device last reached it when known) and one whose machine left the group says so. A cancel, interrupt or settle still to be sent is a muted line under it. The card opens the thread where its machine's store places it, and with that machine not open in the window it opens nothing and says why. A call that failed stays a row, its machine after its argument. list_machines has its own verbs and a count of machines; start_thread_on_machine shares start_thread's. Any tcode_control call that names a machine shows that machine's name after its argument, and the threads its body names open on that machine. A report, approval or question callback from a child elsewhere names the child's machine and opens the child there. The lead's host neither lists such a child's requests nor forwards an answer to it, so its card says it is answered in its thread on that machine, or that it is no longer pending when that machine's store says so. On the started thread, a control line whose actor is on another machine reads "«actor» on ‹machine›", as do Settings → Control's recent activity and the caption of a [control] message from a thread elsewhere, whose title opens it there. A thread a lead elsewhere started as its subagent leads back to that lead, disabled while its machine is not open here. The Agents view lists a lead's subagents elsewhere beside its own, with their machine, the states above, the note in place of the activity line and "Reported" once their report was taken; Settle all covers them, as the host's SettleChildren does. No row action is offered for them: no client command reaches a child on another machine through its lead's host. The header pill and the sidebar's agent count include those last heard running. The window keeps this process's machine id and the saved machines, read when it opens and when the saved machines change, so that one function names a machine by its open store, its saved record or its id; the timeline and the Agents view follow the stores of the machines a lead started threads on.
Machine groups now has a section each for labelling a machine, what a machine accepts from the group, what the group's other devices may do on it (operate, only view, not open), starting a thread on another machine and moving a project to another machine, with the dialog's labels and reasons as the app words them. Security covers what a member machine can now do to another and what a moved-in project is, the troubleshooting table gains the states a user will meet, and the traverse.json note says what version 6 adds and what older files are read as.
…d from the Agents view, and another machine reaches only the threads it started The Agents view offers a remote subagent the actions a local one has, by its state: stop, cancel (asking first) and settle go to the lead's host as ControlRemoteChild, which records the op as owed and sends it through the path tcode_control already uses, answering once it was carried out there, refused there, or kept for when that machine can be reached. It interrupts only a running subagent, cancels one that runs or awaits settling, settles only one that reported or failed, and nothing replaces a cancel still to be sent. An op still owed is not offered again, and nothing is once a cancel is. A full device alone may send it: a space member, a viewer and a machine are refused, as is a thread the lead did not start on that machine. A remote row in the rail opens the thread on its machine as its row in the Agents view does. A machine caller reads, messages, interrupts, watches and answers only the threads its own machine started here (started_by names that machine); any other is refused as an unknown thread is, per item in a batch, and list_threads leaves it out. tcode_control tells the model so. A paused move says why in the client's words: ProjectMoveStatus carries a MovePause (unreachable, refused, no group, version, not a member, or a failure with its message) in place of the host's text. Every machine of the group is named through one resolver: GroupMachineInfo has title(), and crate::machines names an id from the groups of the hosts a caller passes before the open store and the saved machine; the move dialog's, the shell's and the group section's own copies are gone. The chat header's thread menu, like the sidebar's, keeps only what reads while the thread's project moves. A device that may only view a machine is offered no rewind, fork, undo, retry, model switch back, move to background, background stop, plan option or phone settings drawer, and no agent action; its checkout row stays and shows the branch as text where a picker was.
…ed move says why and how a remote subagent is acted on A thread on another machine reaches the projects, providers and models of a machine and only the threads its own machine started there; the Security subsection says the same. A paused move names its six reasons and which continue by themselves. The Subagents view's stop, settle and cancel for a subagent started on another machine, and what a view-only device is not offered, are described.
…ove says why until the other machine answers A move that completed kept its parts under moves/out/<move> on the machine the project left (the code bundle among them) and the snapshot refs under refs/tcode/move/<move> in the repository it left, and kept its journal. The driver let the project go through let_moved_project_go, which took the move out of the outgoing list and with it dropped the driver's own task handle; that cancelled the driver at its next await, before it cleared the parts and refs and removed the journal. A restart found the journal still committed and was cancelled the same way. Letting the project go now only removes it and its threads, and the driver waits for that and for the store to hold the removal, clears the parts and refs, removes the journal, and only then ends the move, detaching its own handle. A cleanup a restart interrupts is done again, as the journal stays committed until it succeeds. A paused move that tried again went back to Preparing, and stayed there for the whole of the next attempt; with the other machine killed, each attempt spent the 20 s dial budget dialling it, so the move read Preparing most of the time and "cannot be reached" only between attempts. A paused move now stays paused, with its reason, until the other machine answers MoveBegin or MoveStatus; Preparing is only shown before a first answer. The first pause after the other machine dies comes when the connection's 30 s idle timeout ends it, as before: the waiting call fails then, not later. The two-host move test asserts that the desk keeps neither the move's parts nor refs/tcode/move once the move completed. The mid-part test now stops the laptop rather than the desk, rebinding the port it had as a machine on a fixed port does, and asserts the move says the laptop cannot be reached, and never Preparing, until it resumes from the bytes held.
…n pages too The sidebar's machine heading, its tooltip on this computer, the sectioned host headings and the Settings caption "‹name› settings" (and its host chooser) took a machine's own name from the store: the attachment's name for a machine this device or browser is linked to, the hosting name for this process's machine. A labelled machine was therefore still called by its machine name on its own browser page and in its own heading. They now go through crate::machines, which takes the label the machine's own group roster gives it (the entry marked this_machine) and its own name only where it has none. The store also keeps the label its hosting state gives its machine, so every place that names a linked machine by the store's host title (the palette, pane and empty-chat captions, the composer's notices) follows once the window follows that machine's hosting state. A device that reaches only a space has no roster and keeps the machine's name. Settings → Remote's Machine name field and the "Machine name ‹name›" line still show the name itself.
…the project, and how its move ended A machine whose device access is below operate reports that it takes no projects, which the move dialog read as Accept projects being off. Its row, the TargetRefuses blocker and a machine_refuses refusal now say it does not take projects from the group now, which is true either way. The Other devices of the group select clipped its label; the options are short (May operate, May only view, May not open), the first one's description says what it lets other devices do, and the confirmations keep the longer wording on their buttons. The progress dialog open as its move ended said only that it had ended. A view showing a move now registers with its store, which keeps how the move ended for it: moved to the machine, cancelled, or continued here once the commit's outcome was unknown. The dialog says which, and the window shows no toast for a move the dialog already tells; a cancel this client asked for still reaches the dialog. Until the store knows how it ended the dialog reads as the move last did. A project inside a larger repository is described as part of one, with no size, beside the blocker. Counts of one read in the singular (branch, checkout, thread, ignored file, and the running, waiting, queued and terminal blockers), and the note leaves out Git LFS and submodules for a project that is not a repository. Section headings sit flush with what they head, as other sheets draw them, instead of at a card's inset.
…d browser layout as the app shows them Machine group, Shared spaces and Traverse are their own Settings pages, and the steps that sent a reader to Remote for them point to the pages. The move section uses the dialog's current labels and says how a move ends in its progress dialog or as a notice, which pauses continue by themselves and how long a vanished machine takes to notice. The device-access choices read May operate, May only view and May not open. A browser tab always has the wide layout, the page and listener share the app's protocol version, and a browser's path reads LAN.
… number it left behind The module comment said the page opens with protocol_version 5. The page and the listener both send and accept PROTOCOL_VERSION, as native devices do; the comment says so.
…s way to one for the group it is now in An invitation's link was built when it was minted. One minted before this machine created or joined a group (or before it left or was removed from one) stayed the active invitation: the hosting state relabelled its group, so Settings → Remote said it joins the group, while invitation_events, the window's Remote page and the headless invitation file carried the link as minted, with no group, and another machine's Join group refused it as not the invitation of a machine in a group. Only a restart minted a usable one. Whenever a commit changes the group this machine is in, an active invitation is replaced by a fresh secret that names the group it is in now, or none, and listeners hear of it; the earlier secret no longer admits anyone. The hosting state no longer relabels an invitation, since what it shows is what was minted. Minting runs under the state lock the commit holds, with its expiry timer holding the host weakly through a self-reference rather than an Arc receiver. The group test keeps an invitation outstanding while the headless machine creates its group, joins with the invitation it offers afterwards, which names the group, and is refused with the earlier secret given the group's id.
…and the access confirmation say what is so The confirmation to cancel a move stayed open after the move completed, still offering Cancel move for a project already gone. The progress view now knows it has a confirmation over it and closes it when the move it asks about ends; a cancel that reaches the host after the move ended is reported as the move having already finished rather than as the host's move_committed or no_project_move code, under how the move ended. A paused move's line did not fit the project's row in the sidebar. One function words the line for its place: the row says why the move waits in a few words (cannot be reached, takes no projects now, no group reached, different version, not in the group, or paused), the progress dialog keeps the whole sentence. The confirmation for closing the machine to other devices named its button "Cannot open this machine" while the option it confirms reads "May not open". Each button repeats its option again, and the two keys that only held the longer wording are gone. A pane showing a draft of a project that moved away said "This thread moved to ‹machine›." though no thread went. The store remembers which of a moving project's open threads were drafts, and such a pane says the project moved there, with the same way to open that machine: its section where the window shows it, else the saved machine.
…is open The alert's footer cancel button closes the alert without calling its on_close, so after Keep moving the progress view still counted a confirmation over it, and when the move ended it closed the topmost dialog, which was the progress view itself, with the outcome it was about to show. Keeping the move clears the mark as closing does.
… how a move's row, cancel and moved draft read
Tryanks
marked this pull request as ready for review
November 27, 2026 02:15
…hat they are given The label dialog took a whole GroupMachineInfo, so the Machines page built one with accept flags of None to open it for a machine the group had not reported. It takes the id, name and label it reads now. A card for a thread started on another machine read its machine id with unwrap_or_default; it now yields no card without one. The name a store gives its machine was written twice in machines.rs and is one function. The group test no longer asserts the projects switch default, which traverse's identity test owns.
…ve's way Move was disabled while the preview listed a blocker, and a machine whose accepts_projects was false or unsaid could not be chosen. The host refuses a blocked move (move_blocked, and the preview itself lists TargetRefuses), so both were a second gate: a preview taken once could not be refreshed short of choosing another machine and back, and a machine whose answer had not come could not be tried. Every machine can be chosen, Move is pressed once a preview has come, and the host's refusal reaches the user through the path that already re-asks the preview. The test that proved the two gates now proves what the dialog sends.
…thread that went nowhere find_moved_thread read the answer with .ok().flatten(), so a host that could not answer ran the caller's 'missing' branch and told the user the thread did not exist. It now says what the host said when it could not.
…nly machine reach the user The sidebar kept its own list of what a moving project may do (a plus button, and an allow list for the project and thread menus) beside the host's move_refusal, and the two differed: Thread rules was dimmed though the host allows it. create_and_show returned silently on a view-only machine where the host refuses with its own words. The host refuses, and says why through the refusal path every command has; the copies are deleted.
… of reading as nothing Five places turned a failure into an empty answer. Whether a checkout was mid-merge and whether the project sat inside a larger repository were read with `unwrap_or(false)`, so a git that could not tell let the move go on; a directory that could not be read counted as zero bytes in the preview; a staged move whose begin file could not be read answered "unknown" to the sender, which then sent everything again, and "nothing staged" to a commit; and an arrival that failed dropped every error of taking back what it had made on disk, leaving a half-made folder the next attempt then called "not empty". Each is now the error it was: the preview and the move are refused with git's or the file system's words, an unreadable staging is refused as such, and a failed arrival names what it could not take back.
…h a repository of a kilobyte Two of the move tests sent 48 MB of random bytes so that a move would still be sending when the test acted: one cancelled it "while it sends", the other stopped the laptop "in the middle of a part". Each took 6 to 17 seconds and passed only if the test's reaction beat the transfer, and the second spent most of its time waiting out the transport's detection of a dead endpoint. Both now make the laptop refuse the commit, by a folder already standing where the first thread's attachments go: every part is sent and staged, and the move rests paused with the laptop's refusal, whatever the speed of anything. The cancel test cancels there and asserts what it asserted. The resume test cuts the staged code to half, as an interrupted send leaves it, presses Try again and asserts the move reports the held bytes as done and arrives whole; a send that did not start from the held byte would report less, or the arrival would fail its SHA-256 check. Both run in about two seconds on one kilobyte of input. Not proved any more: a cancel racing a chunk in flight, which only wall-clock luck could have shown, and a move paused as "cannot be reached", which took the transport's own detection to reach. The first test no longer reads git's own status and branch in the arrived repository, which the services test of the restore owns; it now asserts that an attachment arrives. real_group.rs loses the stop and restart of a machine's endpoint that nothing uses now.
…rting a machine's endpoint The move tests stopped using it and it was removed with them, but the dispatch tests stop a machine and bring it back on the port it had, as a machine on a fixed port does, to show a cancel kept while it is down reaches it when it returns.
…e started here, and how the move dialog lets each machine answer
…nothing find_moved_thread showed the host's error whenever MovedThread failed, so a window restoring its last thread on a link that dropped raised a warning for a thread nobody asked for. The caller now gets the outcome (nothing, or the host's error) and decides: following a link the user clicked shows the error, the restore shows nothing.
…rom the one rule that decides it The machine announced `operate && switch` in its group entry and refused a request by the same rule, while GroupInfo carried the stored switches, so the settings page copied the rule to draw its two switches (checked only while the group's devices may operate). The rule is now HostIdentity::accepts, which the announcement, the per-request gate and GroupInfo all read; accept_threads and accept_projects of GroupInfo are what the machine takes now, and the page reads them as given. The stored switches keep their values below operate and show again when it is back.
…cution and delivery like a local subagent agent_status answered None unless the thread was a local dispatched child, so a thread with a remote parent carried no AgentStatus and the client rebuilt the host's precedence of working, waiting, background, failed and interrupted, and lost the interrupted state. A thread owing a lead's report, here or on another machine, now reports through the same function.
The probe's listing travels over an in-process channel between the host and the transport and is turned into JSON by hand where a tool answers with it; the Serialize and Deserialize derives were read by no one.
… and the group state, and says what the PR's wire is rather than how it grew The note left out the label the group's roster carries and the label and accepts of the state the members exchange over tcode/group/1, and described fields of types this pull request introduces as gains and carries of their own, which no release ever saw. It states the final shape.
The test of what a machine's switches and its device access let through ends by proving that a label one member gives reaches the others over the real group sync, which its name did not say.
… view, and a sheet that is sending cannot be closed The progress dialog opened an alert on top of itself to ask whether to cancel, tracked it in a shared flag, and closed "the topmost dialog" when the move ended. A flag gone stale (the alert closed another way) closed the progress view or an unrelated dialog, and the stacked alert showed the progress dialog's edge and buttons beneath it. The view now turns its own body and footer into the question and back; a move that ends while it is asked simply shows its ending. The move sheet closed the topmost dialog when its request returned, though Cancel, Escape, the close button and the backdrop stayed live meanwhile; while the request is out they are now disabled, as in the pull request dialogs.
… the module that writes and reads callbacks The host wrote a subagent's report, request or a watch firing from another machine with the child as <thread>@<machine> by rewriting the header after it arrived, and the UI split that text apart again. core::notice, which owns the header format, now writes the machine (callback_header and control_header take it), rewrites a header that arrived from the machine it names (on_machine), and reads it back as a typed machine on the parsed callback and on the thread a [control] message is about. The remote path and the UI use those instead of a helper each. The text the model reads is unchanged.
…e nothing reads The cap that read MachineCaller.permission_mode was deleted, and the calling machine always sent None, so the field is gone from the wire type and its literals.
…achine of another version refuses first The receiving machine refuses a mismatched version with PROTOCOL_MISMATCH before it can answer, so a Pong always carried the caller's own version. The probe reads a Pong as a match and the refusal as a mismatch.
…e no longer has its own label-else-name rule MachineInfo::title sits beside the other two titles; machine_named is gone.
… as in effect GroupInfo already says what this machine takes now, from HostIdentity::accepts, so the page no longer ANDs the stored switch with the devices' access a second time.
…t status says, Interrupted included The host now reports an AgentStatus for a thread with a lead, so the window reads it from the machine's store instead of rebuilding the precedence from activity flags (which dropped Interrupted). The lead's own record still stands for a machine that is not open or not reachable.
…me and nothing else ThreadMoved carried both machines' ids and the arrival filled to_machine from a roster lookup ending in unwrap_or_default, which could write an empty machine id into a thread's log. Nothing read to_machine, and nothing read from_machine either: the timeline, the relay transcript and the thread index show the name. Both ids are gone from the event, the timeline entry and the arrival, with the lookup.
Try again sent MoveProject with an empty root and an include_ignored of false, values the host ignored because MoveProject doubled as the resume of a move it already held for the same machine. MoveProject now only starts a move and is refused with move_in_progress while one is under way; ResumeProjectMove names the project and nothing else, is authorized as CancelProjectMove is, and answers no_project_move or move_cancelling where there is nothing to resume.
…ad of continuing at the project root arrived_meta put a thread's cwd and worktree at the project root, and dropped its other worktrees, when the move had not carried the path it worked in (deleted, or no longer a checkout of the repository): the thread silently continued somewhere else. The move now finds those threads before it starts: MoveBlocker::MissingCheckout names the thread and the path, the dialog lists it with the other blockers in all three locales, and a path the move did not carry fails the arrival with what is missing.
…at is left where After a cancel or a finished move the outgoing parts and the refs/tcode/move refs in the user's repository, and on the target the incoming staging after an arrival, were removed with a log line for the failure: the user kept a directory or refs nobody had told them about, and end_outgoing named only one of the two when both failed. Each failure is now a RuntimeError::MoveLeftBehind, which the UI already shows through the runtime notifications, carrying the path or ref prefix and the words of the system or of git. No sweep and no retry are added.
…error, not none resume_project_moves logged and went on with empty maps when the moved_threads, moves_in or project_moves tables could not be read, and skipped a journal it could not parse: a project that was moving started unfrozen, and an arrival already made could be made twice. These reads now go through the host's UnreadableFile, as settings.json and the other files of its own do: the first refusal is a RuntimeError::FileUnreadable naming what could not be read, and a move is neither begun nor accepted here (move_records_unreadable) until the records read again. Journals that do read still resume.
…inferring it
The client worked out how a move ended from the move leaving the list, the
project leaving a hydrated index and the last phase it saw, with departing,
listed, cancelled_here, outcomes and moved_threads to carry that. A move that
ended while the client was away left its entry forever and read as 'went to
machine X'; a cancel asked for and refused stayed in cancelled_here and silenced
a later cancel by someone else.
The ProjectMoves topic now carries ProjectMovesState: the moves under way and an
EndedProjectMove for each move that ended in the host's run (move, project and
its name, machine, the threads, and Moved or Cancelled { forced }), so a client
that subscribes or reconnects late still learns it. The host keeps the records
for its run, since a move is rare and a record is a few strings; nothing counts
or ages them. The moved record is made before the project and its threads
leave the index, so a client that sees them go already knows where. The
progress dialog's ending line, the end-of-move notice and the following of a
moved thread read the record; the dialog tells its move by id. The one thing
kept window-side is the count of progress views, which only keeps a notice from
repeating what an open view says.
…ed version's line The error was added to version 28's list of what a host could not read, which describes what v0.4.1 sent. It is new in this pull request.
…s away learns how a move ended, and what a move could not clear away
…re to put a project only when it could not be reached A machine that answered and declined suggests no folder either, and the location's placeholder then said it could not be asked. Under Cannot move now the dialog already says why it declined. The document says what pressing Move shows when something is in the way: the chosen machine's own reason when it refuses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Machines of a group can now do two independent things for each other: a thread starts a thread on another machine and hears back from it, and a project moves to another machine together with its threads. Principles 1, 2 and 5 carry the sentences this rests on.
Members reach each other over
tcode/1under their machine keys asPrincipal::Machine; each request passes the version check and this machine's switches before the runtime sees it.Starting a thread elsewhere:
request_idstarts nothing twiceCommand::ControlRemoteChild)Moving a project:
.worktreeincludefiles ticked by default; blockers in the UI's words (running turns, pending approvals, queued messages, terminals, unfinished merge, a folder inside a larger repository, the destination's state)Also fixed where met: an invitation outstanding when this machine's group changed kept offering a link without the group, and joining with it failed. It is now replaced, and the old secret stops working.
docs/remote.mddescribes all of it, and corrects pages it named under Settings → Remote, the browser's layout and path label, and its protocol number.Slop audit before merge
One round over this diff (
.agents/skills/slop-audit): five lanes, then themes across the layers.tcode_controlruling; admission between machines stays); a test-only router standing in for the transport; the UI's copies of the host's rules (effective switches, a remote subagent's standing, how a move ended, what a moving project may do); a field written and never read; an empty path sent on Try again.PATTERNS.md.Evidence
Before: members exchanged membership over
tcode/group/1and nothing else.tcode_controlreached its own machine only.After: everything above, with the tests below.
cargo fmt --check, workspace clippy-D warnings,cargo nextest run --workspace(1539 passed),tcode-webwasm andtcode-ioschecks with-D warnings,cargo machete, andtcode-headless --features webclippy passed locally. The machine and group tests passed five runs in a row. The Android check was not run (no NDK here).Tests that drive two real hosts with their own stores, joined over real endpoints:
Dispatch rules (target reached through
handle_machine_request), merge rules and older inputs:Headless UI tests: the Accept switches follow the access level; a view-only machine starts no thread and its thread takes no message; a move is sent only with no blocker; a moving project's thread cannot send while another host's can; an agent elsewhere reads its state from its own machine and becomes Cannot be reached, not Failed, when unlinked.
Two acceptance runs used two
tcode-headlessmachines with their own data directories, driven through their browser pages (the shared shell):.envand a 300 MB file: moved there and back; one move cancelled midway; the destination killed mid-send and restarted.git status --porcelain=v2 --branch, refs andbig.binwere identical after each move, and no parts orrefs/tcode/movewere left on either machine.Not seen in a running app, and not claimed:
Tests changed:
a_move_interrupted_mid_part_resumes_where_the_laptop_isstops the destination rather than the source. The source-side stop, which pauses with no group, has no test of its own now.crates/traverse/tests/machines.rsread a stub'snot_implementedas "passed the gate"; it now reads any answer from the host that way.Merge Danger
Door: one-way for data.
traverse.jsonis written as version 6, which an older build refuses.PROTOCOL_VERSION; machines on different builds refuse each other's requests by protocol version.Blast Radius: Groups