diff --git a/docs/j5/product/a2a/agent-tools.md b/docs/j5/product/a2a/agent-tools.md index cb2a93018e9b7..3bd460aef755d 100644 --- a/docs/j5/product/a2a/agent-tools.md +++ b/docs/j5/product/a2a/agent-tools.md @@ -70,11 +70,11 @@ Read-only; no events. **Scope and paging.** A listing covers one project and follows the pattern of upstream's own listing tools (`t3_thread_list`): an offset cursor, a capped limit, optional filters, and pages read from current state, so they can shift between calls. The caller's own row comes first, then the people, then agents with the most recently active first. The caller's row and the people are kept whatever the filters say. The result carries `next_cursor` (null on the last page) and `total`, the number of rows that match. A project that does not exist is refused, and one that exists with no thread in it yet lists its people and no agents; `settled` with `server` is refused, because a peer server does not report it. An outside agent may list whatever level it signed in at, read-only included. It has no project and no row of its own, so it must pass `project_id` and no row is marked `self`. Its listing reports what it can do: an agent accepts a message and no Exchange, and a person and a peer server's agent accept nothing. Outside agents are never listed. -**Result rows:** `display_name` (the agent's thread title, or the Role name once Roles exist), `project_id` and `project_title` (on the self row, the caller's own project), `participant_id`, the participant kind, `self`, `archived`, `can_receive_message`, `can_open_exchange`, `accepts_urgency`, plus `provenance` (spawned by whom, forked from what, unrecorded, or not applicable for a person) and `placement_parent_id`. A person's row reports that it cannot receive a plain message and can be asked. A machine participant's row carries kind `machine`, its registered name as `display_name`, provenance `not-applicable`, and reports that it can receive nothing and open no Exchange. An archived agent's row, when requested, reports that it can receive nothing. A peer server's agents are listed when `server` names it, with the people; this server's agents are not in that listing. Server names are not unique: a name a peer carries always selects that peer, this server's own name included, and this server's agents are the listing with no name. Once this server has a peer, the result names every server in `servers`, and every row carries `server`: its `name`, `local` (true for this server), and, for a participant on a peer server that polls this one, `available` and, once that server has polled, `last_available_at`. Nothing measures a peer server this one sends to directly, so its rows carry neither; a server with no peers omits the field. A peer that could not be read is reported as unread in the result rather than omitted, and the rows of a peer server that polls are its last snapshot, kept while it is offline. Provenance and placement are carried for callers and the UI; they are not part of the description's pitch. +**Result rows:** `display_name` (the agent's thread title, or the Role name once Roles exist), `project_id` and `project_title` (on the self row, the caller's own project), `participant_id`, for an agent its `thread_id` (the id upstream's thread tools take, such as `t3_thread_interrupt`), the participant kind, `self`, `archived`, `can_receive_message`, `can_open_exchange`, `accepts_urgency`, plus `provenance` (spawned by whom, forked from what, unrecorded, or not applicable for a person) and `placement_parent_id`. A person's row reports that it cannot receive a plain message and can be asked. A machine participant's row carries kind `machine`, its registered name as `display_name`, provenance `not-applicable`, and reports that it can receive nothing and open no Exchange. An archived agent's row, when requested, reports that it can receive nothing. A peer server's agents are listed when `server` names it, with the people; this server's agents are not in that listing. Server names are not unique: a name a peer carries always selects that peer, this server's own name included, and this server's agents are the listing with no name. Once this server has a peer, the result names every server in `servers`, and every row carries `server`: its `name`, `local` (true for this server), and, for a participant on a peer server that polls this one, `available` and, once that server has polled, `last_available_at`. Nothing measures a peer server this one sends to directly, so its rows carry neither; a server with no peers omits the field. A peer that could not be read is reported as unread in the result rather than omitted, and the rows of a peer server that polls are its last snapshot, kept while it is offline. Provenance and placement are carried for callers and the UI; they are not part of the description's pitch. ### `j5_spawn_agent` -Agents have two ways to get help: a subagent (their provider's own, or `delegate_task`) or members on a Crew (`j5_propose_crew`, `j5_request_crew_member`). `j5_spawn_agent` serves neither. Its description keeps it for a Peer Agent or standalone agent the person explicitly asks for, and for callers that name it, such as an outside agent or a skill; when nobody asked for one it says to use a subagent or a Crew. Nothing a caller depends on was removed. +Agents have two ways to get help: a helper that reports back to them (their provider's own subagent, or a delegate from `delegate_task`) or members on a Crew (`j5_propose_crew`, `j5_request_crew_member`). `j5_spawn_agent` serves neither. Its description keeps it for a Peer Agent or standalone agent the person explicitly asks for, and for callers that name it, such as an outside agent or a skill; when nobody asked for one it says to use a subagent or a Crew. Nothing a caller depends on was removed. **Description (contract):** "Use this when the user explicitly asks for a Peer Agent or a standalone agent they will talk to, or when an outside agent or a skill you are following names it. When nobody asked for one, it is not a @@ -121,19 +121,21 @@ safely; reusing it with any change to the request is refused, so use a fresh one | `runtime_mode` | permission mode | no | Not broader than the caller's; not with `persona` | | `interaction_mode` | interaction mode | no | Not broader than the caller's | | `attachments` | attachment list | no | One to eight pending uploads for the brief | +| `environment_id` | a linked J5 machine's environment id | no | Start the agent on that machine; this one when | +| | | | omitted (On another machine, below) | | `client_request_id` | string, non-empty | no | Supply and reuse to make retries safe | **Rules.** The new agent is an ordinary root-lineage thread created through upstream's creation seam, never through delegation. It is created in the caller's project unless the caller names another with `project_id` or sets `scratch`, and it joins that project's ledger. An [outside agent](index.md#participants) has no project, so it passes one of the two on every spawn. These are what upstream's own launch tool offers and J5's lacked (Jackson, 2026-10-11). In another project the caller is still recorded as the spawner, but the placement tree is one project's, so the agent is a root there and stays at the top level of the sidebar. An outside agent is in no project's tree, so every agent it starts is a root, with the outside agent's `outside:` id recorded as its spawner. Without a persona the agent runs in the caller's permission and interaction modes, or in ones the caller chose, which may be no broader than the caller's own. Without a persona its model must also be one the project's [Models for custom members](../features/crews.md) list allows, the project being the one the agent joins. The check runs before anything is created and only on a first attempt, so a retry that finds its agent already created is not held to a list saved since; a refusal names the model, the project and the setting and lists the eligible models. A persona's own model is never checked. For an outside agent the caller's modes are the level its sign-in was approved at, and a read-only sign-in spawns nothing. A persona's policy sets its permissions. For a thread caller it has no ceiling (2026-09-16). For an outside agent it must be within the approved level, because that level is a promise the approval page makes about an agent the person does not watch. Either caller may still choose a narrower interaction mode for a persona. A retry finishes the agent its first attempt created, in the modes it was created with, so it is refused when those are now broader than the caller's own; a caller's modes can be narrowed between the two. An outside agent's retry keys belong to its sign-in, whose level never changes. `attachments` are pending uploads, claimed into the new thread once it exists and carried by the brief. Placement and provenance are recorded atomically with creation; then the brief starts as the first turn. The new agent's first turn also states its own participant id and project as platform-provided facts, beside the brief and never inside it. When an outside agent started it, those facts name the outside agent by its label and say that `j5_send_message` cannot reply to it. Provider and model are required and explicit even when a Role is given, and so is reasoning when the model has a reasoning option: a select option such as `effort` or `reasoningEffort`, not a boolean such as `thinking`. A model with no reasoning option runs on its provider's defaults, and its model is still held to the project's list; it has no level to check. Passing reasoning for such a model is refused rather than dropped, naming the options it does have, and omitting it for a model with a reasoning option is refused, naming the levels. A Role's allowlist constrains the choice and an out-of-list pick is an error naming the Role, never a silent default. The brief carries the task and the reply expectation; the spawner does not follow a spawn with a reply-expected `j5_send_message` — that form is for later work owed by an existing participant. Selection guidance and brief-writing conventions live in the [Spawning Guide](../features/spawning-guide.md). **Workspace.** The spawner chooses where a Peer Agent works every time; there is no default, because the spawner knows whether it is starting a reviewer that must see uncommitted work, a builder that must not collide, or a scout that can't collide at all (Jackson, 2026-10-03). `{type: "shared"}` is the caller's own checkout and branch, and asks nothing of git; it is refused for an agent that joins another project, and for an outside agent, which has no checkout. `{type: "root"}` is the project's main checkout, upstream's name for it, and the only choice with `scratch`. As upstream's launch does, a main-checkout thread in the "No project" project gets a fresh folder of its own, whether the caller set `scratch` or named that project by its id. `{type: "worktree"}` is a new worktree from `base_ref`, which is required and must resolve to a commit (with `start_from_origin`, an already fetched origin copy counts; the spawn checks this without fetching, and preparation does the fetch); a `branch` that already exists is refused. `{type: "existing_worktree"}` is one of the project's git worktrees other than its main checkout, named by path; the agent works on the branch git has checked out there, and any other path is refused with the valid ones listed. A choice that needs git is refused when the repository can't be read, before anything is created. A new worktree's thread is created unbound, with its registration and placement committed, so `j5_spawn_agent` returns as soon as the agent is registered and its brief accepted, not once the worktree is ready. Upstream's ThreadLaunch then creates the worktree, names a temporary `j5code/` branch and renames it from the brief in the background, and holds the brief as a preparing run until the worktree is bound and the project's setup script has started. The setup script is awaited first only when it is set to finish before the agent starts (`async: false`); otherwise the agent may begin while it is still running. If preparation fails, the agent's thread shows the failed preparation, as any upstream launch does; it is not retried or retired, and the spawner is not told. The agent is then unbound, which upstream reads as the project's checkout, so a later message to it runs there, where every Peer Agent worked before workspaces existed. J5 doesn't guard this upstream behaviour: in Jackson's install, 3 of 61 preparations failed, all on the first day, and none was messaged again (Jackson, 2026-10-06). A shared checkout or an existing worktree binds at creation, so its brief starts at once. A `client_request_id` is bound to the whole request it was first accepted with, before anything is created, and the binding survives a restart. A retry with any change, including another workspace, `base_ref` or `worktree_path`, is refused, naming the agent the first attempt created; new work needs a fresh `client_request_id`. A request refused before it is accepted, such as one with duplicate attachment ids or an unusable workspace, binds nothing, so it can be corrected under the same key. A retry of a spawn from before request binding binds its first retry when the workspace type matches its accepted create receipt, and is refused otherwise; later request changes under that key are refused. A second start for the same thread while one is in flight is refused with a retry instruction, so two concurrent retries cannot both create it. An existing worktree is looked up in upstream's ref listing, which refreshes every few seconds, so one created moments ago may be refused once; retry in a moment. Closing or archiving a Peer Agent never removes its worktree. -**Result:** the new agent's `participant_id` and `thread_id`, its `project_id` and `project_title`, and its placement with the caller recorded as spawner: under the caller in the caller's own project, and with no parent in another or when the caller is an outside agent. +**On another machine.** With `environment_id` naming a linked J5 machine, the Peer Agent starts on that machine, in a project there that `project_id` names (from `t3_project_list` with the same `environment_id`) or with `scratch`. The caller's server calls that machine's `j5_spawn_agent` over the link and names the caller as the spawner; the other machine accepts a named spawner only from a link session. There the agent is registered like any spawn, its spawner recorded the way an outside agent's is: the agent is a root of its project, and archiving either one leaves the other alone. Its first turn carries the same facts as a local spawn and names the spawner's server, so it can reply with `j5_send_message`. The caller's own checkout is refused, as for any other project. The other machine applies its own rules: its Models for custom members, its persona library and models, and the level of the link, which caps the spawn as an outside agent's level does; the caller's server also sends the caller's own access, and the other machine caps the spawn at the narrower of the two. One `client_request_id`, scoped to the caller, makes a retry safe across both machines, so an answer lost on the way back never starts a second agent. Before the call returns, each machine records the route to the other's participant, so the caller can message the new agent at once and the agent can reply, even when one of them polls. This needs a Full access link, so the agent can use J5's tools there, and peering, so the two can talk; for now the caller's server must be able to reach the other machine. -**Errors**, each naming state and next command: the caller is a provider Subagent; the caller's membership is missing or ambiguous; the caller's project ledger cannot be read; the caller sits in a Crew (naming its Captain as the escalation and `delegate_task` for its own subagents; only a Captain grows a Crew, through the gate); the chosen workspace can't be used (a path that isn't one of the project's worktrees, a `base_ref` that doesn't resolve, a `branch` that exists, an unreadable repository); the model or its reasoning level, with no persona, is off the project's lists of models for custom members; the `client_request_id` is bound to a different request, or a start for it is already in flight; creation failed. For an outside agent: no `project_id` and no `scratch` (naming `t3_project_list`); the `shared` workspace (naming the three it may choose); a persona whose policy is broader than the approved level (naming the level, and a persona within it or a new sign-in at a higher level). +**Result:** the new agent's `participant_id` and `thread_id`, its `project_id` and `project_title`, and its placement with the caller recorded as spawner: under the caller in the caller's own project, and with no parent in another, on another machine, or when the caller is an outside agent. An agent on another machine also carries the `server` it lives on, as an address-book row does. -**Events:** participant joined, placement created. +**Errors**, each naming state and next command: the caller is a provider Subagent; the caller's membership is missing or ambiguous; the caller's project ledger cannot be read; the caller sits in a Crew (naming its Captain as the escalation and `delegate_task` for its own delegates; only a Captain grows a Crew, through the gate); the chosen workspace can't be used (a path that isn't one of the project's worktrees, a `base_ref` that doesn't resolve, a `branch` that exists, an unreadable repository); the model or its reasoning level, with no persona, is off the project's lists of models for custom members; the `client_request_id` is bound to a different request, or a start for it is already in flight; creation failed. On another machine: an `environment_id` that names no linked J5 machine (naming `t3_environment_links`), a link below Full access, a machine this server is not peered with, or one it cannot reach now (naming the machine). For an outside agent: no `project_id` and no `scratch` (naming `t3_project_list`); the `shared` workspace (naming the three it may choose); a persona whose policy is broader than the approved level (naming the level, and a persona within it or a new sign-in at a higher level). -### `j5_stop_agent` +**Events:** participant joined, placement created. **Persona spawn:** the persona's ordered model entries are the allowlist SP3 describes. The explicit provider instance and model must match an entry, and any declared reasoning level must match the requested level. An entry without a declared reasoning level accepts an explicitly requested supported value; models with no reasoning control omit it. Other declared model options are carried into the assignment. Unsupported or limited entries refuse without creating a child or silently selecting another entry. Legacy driver-wide targets remain supported. The matching entry becomes the child's immutable persona assignment, with its index, snapshot and digest, and its authority policy sets the child's runtime mode. The child's permissions come from its own persona's policy, never from the parent's: J5 carries no parent-child @@ -141,26 +143,34 @@ permission ceiling between Peer Agents (Jackson, 2026-09-16), since any such gua to a trusting peer away from bypass. Disabled, removed, and unknown personas refuse before creation. A plain spawn without `persona` is unchanged and inherits the parent's runtime mode as before. -**Description:** "Stop one Peer Agent the way a user Stop does: its running turn is interrupted now, turns already queued behind it, messages you sent it included, are held until a person resumes its queue or the next message reaches it (that message resumes the queue and runs after them, in order), its pull request watches end, and the tasks it delegated stop too. The agent remains, stays readable, and can be messaged again later — stopping halts work, it retires nothing. It reaches any agent on this server, in any project. Reuse client_request_id to retry safely." +### `t3_thread_interrupt` — stopping an agent + +Agents stop another agent with upstream's `t3_thread_interrupt`, which J5 registers with one rule of its own. It is addressed by `threadId`, like every upstream tool that acts on a thread; an agent's `thread_id` is on its address-book row. `j5_stop_agent` is retired: once upstream gave interrupt a full Stop, the only thing J5's tool still added was the Captain's rule below. + +**Description:** upstream's, as upstream ships it. -| Input | Type | Required | -| ------------------- | ------------- | --------------------------- | -| `participant_id` | ParticipantId | yes — the one agent to stop | -| `client_request_id` | string | no | +| Input | Type | Required | Meaning | +| ----------------- | -------- | -------- | ------------------------------------------------------------------------ | +| `threadId` | ThreadId | yes | The thread to stop | +| `stop` | boolean | no | `true` stops the thread as its Stop button does; otherwise only its turn | +| `runId` | RunId | no | Without `stop`, the run to interrupt; the newest running one if omitted | +| `reason` | string | no | Recorded with the interrupt | +| `environmentId` | id | no | A linked machine, to stop a thread there | +| `clientRequestId` | string | no | Reuse to retry safely | -**Result:** exactly one of `interrupt_requested` (the agent has an active run, which is being interrupted) or `already_idle` (the agent has no active run; its queue is still held). A run that is preparing, starting, running or waiting is active. An interrupt acknowledgement and an observed terminal run state are separate facts; the tool never claims a turn stopped merely because interruption was requested. The target is any agent on this server, in any project, archived ones included; an id this server does not know is an error pointing at `j5_list_participants`. +**Result:** upstream's: whether an interrupt was requested, there was no active run, or the run had already ended. An interrupt acknowledgement and an observed terminal run state are separate facts; the tool never claims a turn stopped merely because interruption was requested. -**Rules.** A caller's runtime policy never gates `j5_stop_crew` or `j5_archive_crew`: a read-only persona may run them, because identity (the Captain, its own Crew) and the human's confirmation token are the gates, and the sandbox guards the workspace rather than the platform's verbs (Bryant, 2026-09-14). `j5_stop_agent` follows upstream's rule for a write to another thread: the target may not run with broader permission or interaction modes than the caller, so an agent in a narrower mode asks the target's Captain or the person. A Captain stopping a seat of its own Crew is exempt, as it is for `j5_stop_crew`. An outside agent may stop an agent under the same rule, measured against the level its sign-in was approved at. It is never a Captain, so it has no exemption, and `j5_stop_crew` and `j5_archive_crew` are refused to it. This reverses the 2026-09-14 rule for `j5_stop_agent` alone (Jackson, 2026-10-11). Stop and archive are single-target; the unit cascade belongs to Crews, which stop and archive as units through their own verbs when they exist. Stop is upstream's Stop. Besides interrupting the turn, it holds the turns queued behind it, ends the thread's pull request watches and stops the tasks it delegated, so a message already queued for a stopped agent waits until a person resumes its queue or the next message is delivered to it. Upstream would start that next message at once and leave the held ones waiting; J5's delivery resumes the queue instead, so messages run in the order they were sent, with no exception for the agent that did the stopping (Jackson, 2026-10-12). Upstream does not continue a stopped run after a restart. +**Rules.** Without `stop`, interrupt ends the running turn and the next queued turn starts. With `stop: true` it is upstream's Stop. Besides interrupting the turn, it holds the turns queued behind it, ends the thread's pull request watches and stops the tasks it delegated, so a message already queued for a stopped agent waits until a person resumes its queue or the next message is delivered to it. Upstream would start that next message at once and leave the held ones waiting; J5's delivery resumes the queue instead, so messages run in the order they were sent, with no exception for the agent that did the stopping (Jackson, 2026-10-12). Upstream does not continue a stopped run after a restart. Interrupt follows upstream's rule for a write to another thread: the target may not run with broader permission or interaction modes than the caller, so an agent in a narrower mode asks the target's Captain or the person. J5's one rule: a Captain stopping a seat of its own Crew is exempt, as it is for `j5_stop_crew`. An outside agent may stop an agent under the same rule, measured against the level its sign-in was approved at; it is never a Captain, so it has no exemption. A caller's runtime policy never gates `j5_stop_crew` or `j5_archive_crew`: a read-only persona may run them, because identity (the Captain, its own Crew) and the human's confirmation token are the gates, and the sandbox guards the workspace rather than the platform's verbs (Bryant, 2026-09-14); `j5_stop_crew` and `j5_archive_crew` are refused to an outside agent. Stop and archive are single-target; the unit cascade belongs to Crews, which stop and archive as units through their own verbs. **Amendment (Jackson, 2026-08-29):** the A6 build cascaded over the placement subtree; that blast -radius makes the tool less useful, so `j5_stop_agent` and thread archive are single-target. The +radius makes the tool less useful, so stopping and thread archive are single-target. The unit-cascade concept already has its home in the crew rulings (2026-08-21: crews spawn and archive as units) — `j5_stop_crew`/`j5_archive_crew` arrive with Crews, and the A6 `PlacementCascadeService` survives as their engine (a cascade of one is its degenerate case). ## `t3_thread_organize` — archive and restore -Use `action: "archive"` with an agent's `threadId`, or omit it to archive the calling thread. Upstream's access check is the only rule: the tool reaches any thread in the environment, within the limits upstream sets for the caller. The tool archives one thread, hides it from the active directory, and closes its open Exchanges through the shared lifecycle reactor. It does not interrupt an existing run. Use `j5_stop_agent` when work must stop. +Use `action: "archive"` with an agent's `threadId`, or omit it to archive the calling thread. Upstream's access check is the only rule: the tool reaches any thread in the environment, within the limits upstream sets for the caller. The tool archives one thread, hides it from the active directory, and closes its open Exchanges through the shared lifecycle reactor. It does not interrupt an existing run. Use `t3_thread_interrupt` with `stop: true` when work must stop. Use `action: "unarchive"` to restore the same identity. Old Exchanges remain closed and cancelled messages do not replay. Historical permanently retired agents remain retired. The human UI retains its archive warning; this tool uses upstream archive semantics without a separate confirmation-token flow. `archive_agent` has been retired. @@ -321,7 +331,7 @@ application storage, never in the sandboxed workspace. | `client_request_id` | string, non-empty | no | Supply and reuse to make retries safe | Result: `crew_instance_id` and `members` (seat, participant_id, result: `interrupt_requested`, -`already_idle`, or `archived`). Semantics: the unit form of `j5_stop_agent`. Only the Captain may call +`already_idle`, or `archived`). Semantics: the unit form of stopping one agent. Only the Captain may call it; anyone else is refused and pointed at asking the Captain; an archived Crew is refused naming its state. Every seat is stopped through the ordinary single-agent stop, upstream's Stop; an idle seat is reported as such and its queue is held too; nothing settles, nothing is retired, no Exchange closes, and the seats stay addressable. @@ -364,7 +374,7 @@ the job; new work on any seat makes it stale and yields a fresh token. Partial f seats retired so far and the seat that failed; retry with the same `client_request_id` and token. **Members are never archived one by one (R14):** `t3_thread_organize` refuses archiving an active Crew seat, just as client archive/delete does. Retire the unit through `j5_archive_crew` or Archive crew on the Fleet page. Archiving its Captain retains the crew cascade. A member that finishes with nothing owed is -reported to its Captain; the platform never settles a seat because its run finished, and settlement is not archive. `j5_stop_agent` on a member is still allowed; +reported to its Captain; the platform never settles a seat because its run finished, and settlement is not archive. `t3_thread_interrupt` on a member is still allowed; stopping retires nothing. ### Crew playbook runs @@ -390,7 +400,7 @@ run; `j5_stop_crew` doesn't, and unarchiving doesn't restart it. ### Kept upstream tools - `orchestrator_capabilities` — providers and models (ids, labels, option descriptors) for spawn targeting, plus runtime and interaction-mode facts. It deliberately stays silent about delegation even though `delegate_task` is back on the surface: that tool's own description carries its persona use, and J5 verbs are advertised by their own descriptions. -- `delegate_task`, `task_status`, `task_cancel` — upstream's provider-owned child delegation. J5 re-declares `delegate_task` with its own description, which names the way to get help it serves and leads with the optional `persona` (a persona id from an `@persona:ID` mention or the Settings → Agent Setup library) and presents the plain child as the fallback for cross-provider or T3-tracked work rather than the default for any subagent request. With `persona`, the server pins that persona's instructions, ordered model list, reasoning, and access level and refuses `target` and `runtimeMode`; without it, the child is upstream's plain subagent, and the model it will run on, one inherited from its parent included, must be one the project's [Models for custom members](../features/crews.md) list allows. J5's wrapper hands upstream's `delegateTask` a hook that is called with that resolved model before anything is created, so the check sees what the child will really run on; a retry of a delegation already accepted is not checked again. A refusal is a `model_unavailable` error naming the model, the project and the setting and listing the eligible models, which the agent passes in `target`; a persona's own model is never checked. Upstream's `isolation: "worktree"` gives a child a checkout of its own, started from the parent's local commit, and the description says so in upstream's words. J5's description says it is the first of the two ways to get help (a subagent; the second is a Crew member). The child is backing storage under the calling thread, not a Peer Agent; `j5_spawn_agent` is the tool for a participant the user asked for. Its wait mode is safe where `t3_thread_wait` was not: a child that messages its parent ends its own turn, so the wait returns and the parent reads the message on its next turn (latency, never starvation). +- `delegate_task`, `task_status`, `task_cancel` — upstream's delegates: a helper for one task that reports back to its parent. J5 re-declares `delegate_task` with its own description, which names the way to get help it serves and leads with the optional `persona` (a persona id from an `@persona:ID` mention or the Settings → Agent Setup library) and presents the plain child as the fallback for cross-provider or T3-tracked work rather than the default for any subagent request. With `persona`, the server pins that persona's instructions, ordered model list, reasoning, and access level and refuses `runtimeMode` and a `target` that sets a provider, model or options; a `target` that only names a linked J5 machine, and a project there, sends the persona to that machine, which resolves it from its own library against its own models. Without `persona`, the delegate is upstream's plain one, and the model it will run on, one inherited from its parent included, must be one the project's [Models for custom members](../features/crews.md) list allows. J5's wrapper hands upstream's `delegateTask` a hook that is called with that resolved model before anything is created, so the check sees what the child will really run on; a retry of a delegation already accepted is not checked again. A refusal is a `model_unavailable` error naming the model, the project and the setting and listing the eligible models, which the agent passes in `target`; a persona's own model is never checked. Upstream's `isolation: "worktree"` gives a child a checkout of its own, started from the parent's local commit, and the description says so in upstream's words. J5's description says it is the first of the two ways to get help (a subagent; the second is a Crew member). A delegate on another machine follows upstream as shipped; on a J5 machine its plain model is held to that machine's lists. A delegate is a helper under the calling thread, not a Peer Agent: it stays out of the ledger and messages no one, any follow-up is a new `delegate_task`, and `j5_spawn_agent` is the tool for a participant others talk to. - `schedule_task` (which also updates a task since upstream folded `update_scheduled_task` into it at v0.1.3), `list_scheduled_tasks`, `delete_scheduled_task`, `run_scheduled_task_now` — consumed as-is. - `t3_thread_list`, `t3_thread_read` — consumed as-is; if an upstream description mentions delegation, J5 re-declares that tool with corrected prose. - `html_preview`, `html_render`, `request_secret`, `preview_dialog`, `preview_act`, `watch_pull_request`, `unwatch_pull_request` — consumed as-is. `preview_act` is upstream's one browser-control tool since v0.1.3, in place of `preview_click`, `preview_drag`, `preview_hover`, `preview_press`, `preview_scroll`, `preview_select`, `preview_type` and `preview_upload`. @@ -400,7 +410,11 @@ run; `j5_stop_crew` doesn't, and unarchiving doesn't restart it. - `t3_pending_request`, `t3_thread_configure` — consumed as-is. A placed agent's native-question notice tells its parent to read and answer with `t3_pending_request`'s `read` and `respond` actions. - `t3_background_wait` — upstream's new tool in v0.1.3: a Claude agent names background work it waits on, so its thread stays Working. Consumed as-is; Jackson admitted it on 2026-10-27. - `t3_project_create`, `t3_project_update`, `t3_environment_preferences_update` — consumed as-is. `t3_project_delete` is not on the J5 surface until J5 settles what deleting a project does to the state it keeps for each project. -- `t3_thread_wait` is **withdrawn** from the J5 surface. Platform notices queue behind a running turn, so a participant that blocks inside its turn waiting on another thread can never receive the notice that thread's finish produces; a Captain that waited on a seat this way starved itself of its own Crew's news (Bryant, 2026-09-14). Whatever a participant is waiting for arrives as a message once it ends its turn. +- `t3_thread_wait` — consumed as-is. Messages and notices queue behind a running turn, so an agent that waits on another thread doesn't see them until the wait returns; upstream bounds the wait and steers agents to end their turn instead, so the cost is a wasted wait. A parent still gets its placed agents' questions and completion as notices once it ends its turn. +- `t3_thread_interrupt` — J5's version of upstream's tool, with the Captain's rule; see above. +- `t3_thread_launch` — admitted only to link sessions, the sessions another machine's server opens, because upstream's remote delegation launches a delegate here through it; agents on this machine start Peer Agents with `j5_spawn_agent`. A thread launched with `delegatedFrom` is a delegate and stays out of the ledger. J5's version holds a plain delegate to this machine's Models for custom members and resolves a persona delegate from this machine's library. +- `t3_environment_links`, `t3_environment_link`, `t3_environment_unlink` — consumed as-is: listing linked machines, asking the person to link one, and forgetting one. +- `t3_thread_send` is not on the J5 surface: a raw send is communication the ledger can't see. `create_threads` is not either. ## Acceptance criteria @@ -409,10 +423,10 @@ run; `j5_stop_crew` doesn't, and unarchiving doesn't restart it. 3. A further ask to a person opens a new Exchange and inbox item; an ask that names an open Exchange in `regarding` joins it and is shown beneath the original ask. 4. Between agents, a further ask to a peer holding an open Exchange from the caller joins it as a follow-up. 5. A `j5_send_message` to the caller itself is refused with an error naming the caller's own id. -6. `j5_list_participants` marks the caller's row `self`, reports a person's row as unable to receive a plain message and able to be asked, and omits provider Subagents. +6. `j5_list_participants` marks the caller's row `self`, reports a person's row as unable to receive a plain message and able to be asked, gives every agent row its `thread_id`, and omits provider Subagents and delegates. 7. `j5_spawn_agent` refuses a call that omits provider or model, refuses one that omits reasoning for a model with a reasoning option or passes it for a model without one, naming the options, accepts one that omits it for a model without one, refuses a choice outside the Role's allowlist with an error naming the Role, and refuses a caller that sits in a Crew with an error naming escalation to its Captain. 8. A spawned agent's first turn contains its own participant id and project. A Crew seat receives its approved instructions, shared brief, current roster with responsibilities and participant ids, and any playbook on its first assignment; the assignment keeps its own envelope and reply obligation. Later assignments reuse the same thread without repeating that introduction, unless the provider conversation was replaced, which sends it again. Started members receive net roster changes at the top of their next delivery, including a message steered into a running turn, without a separate turn. -9. `j5_stop_agent` and `t3_thread_organize` act on one target; neither cascades. `j5_stop_agent` reaches an agent in any project on this server, and refuses a target that runs with broader permission modes than the caller unless the caller is that seat's Captain. A stopped run is never resumed after a server restart, even when restart continuation is enabled. +9. `t3_thread_interrupt` and `t3_thread_organize` act on one target; neither cascades. `t3_thread_interrupt` with `stop: true` stops a thread as its Stop button does, and refuses a target that runs with broader permission modes than the caller unless the caller is that seat's Captain. A stopped run is never resumed after a server restart, even when restart continuation is enabled. 10. `t3_thread_organize` archives and restores any thread in the environment that upstream's access check lets the caller act on. Archive closes Exchanges through the shared reactor without a confirmation-token exchange or interrupting an existing run; human archive warnings remain. 11. `j5_clear_own_ask` closes only an Exchange the caller opened and records the closure as sender-cleared. 12. Every error from every verb names the actual state and the next command. @@ -435,13 +449,18 @@ run; `j5_stop_crew` doesn't, and unarchiving doesn't restart it. 29. `j5_spawn_agent` gives the agent the caller's permission and interaction modes, or narrower ones the caller chose; a broader choice is refused and creates nothing, and a choice of permission mode is refused with a persona. 30. `j5_spawn_agent` carries attachments on the brief, claimed into the new agent's thread. 31. A `steer` or `restart` to an agent on a peer server crosses with the sender's limit and lands there as asked; that server refuses it for an agent above the limit, and the sender is told. The tool refuses it at once for a peer server that does not advertise that it lands a message as asked. -32. An outside agent may call `j5_list_participants` at any sign-in level, and `j5_send_message`, `j5_stop_agent` and `j5_spawn_agent` at any level but read-only. Its sends and stops are refused when the target runs with broader permission modes than that level. +32. An outside agent may call `j5_list_participants` at any sign-in level, and `j5_send_message`, `t3_thread_interrupt` and `j5_spawn_agent` at any level but read-only. Its sends and stops are refused when the target runs with broader permission modes than that level. 33. `j5_list_participants` refuses an outside agent that passes no `project_id`, marks no row `self` for one, lists no outside agent, and shows it no row that accepts an Exchange or an urgency and no person that accepts a message. 34. `j5_propose_crew`, `j5_request_crew_member`, `j5_stop_crew`, `j5_archive_crew`, `j5_clear_own_ask`, `delegate_task` and the playbook tools, the ones that only read included, are refused to an outside agent with an error naming what it can do instead. 35. `j5_spawn_agent` refuses an outside agent that passes neither `project_id` nor `scratch`, and one that asks for the `shared` workspace, each with an error naming the legal move. 36. An agent an outside agent spawns has no placement parent, records the outside agent as its spawner, and is told in its first turn that an outside agent started it and that `j5_send_message` cannot reply to it. 37. `j5_spawn_agent` gives an outside agent's spawn the level its sign-in was approved at, or a narrower mode it chose. A broader mode is refused. A persona whose policy is broader than that level is refused with an error that names the level and the legal moves. 38. A custom Crew seat, a `j5_spawn_agent` without a persona and a `delegate_task` without a persona run only on a model and reasoning level the project's lists for custom members allow, inherited ones included; a refusal names the model or level, the project and the setting, lists the eligible ones, and creates nothing. A persona's own selection is never checked, and a retry of an accepted call is not checked again. +39. Agents on this machine have `t3_thread_wait` and `t3_thread_interrupt` and do not have `t3_thread_send`, `t3_thread_launch`, `create_threads` or `j5_stop_agent`; a link session from another machine also has `t3_thread_launch`. +40. A thread a link session launches with `delegatedFrom` never becomes a participant; a plain delegate launched that way is refused on a model this machine's lists don't allow, and a persona delegate is resolved from this machine's library. +41. `delegate_task` with a persona and a `target` that names only a linked J5 machine runs the persona there; a `target` that sets a provider, model or options with a persona is still refused. +42. `j5_spawn_agent` with `environment_id` starts the agent on that linked and peered J5 machine, records the caller there as its spawner with no placement parent, gives it a first turn that names the spawner and its server, and returns its participant id and server; a message the caller sends it at once is delivered, its reply comes back, and a retry under the same `client_request_id` never starts a second agent. The spawn is capped by the link's level and by the caller's own access, whichever is narrower. +43. `j5_spawn_agent` with `environment_id` is refused, naming the machine, when that machine is not linked at Full access, is not peered, or cannot be reached now; nothing is started. ## History @@ -499,3 +518,4 @@ run; `j5_stop_crew` doesn't, and unarchiving doesn't restart it. - 2026-11-03 — persona listings report every ordered model entry and spawn matching permits supported reasoning when the entry leaves it unspecified ([#778](https://github.com/Jacksondr5/j5code/issues/778)). - 2026-11-04 — `regarding` and the several-asks rule built on `j5_send_message`, and added to its description ([#111](https://github.com/Jacksondr5/j5code/issues/111)). +- 2026-11-07 — the agent tools after linked environments: `j5_stop_agent` retires for upstream's `t3_thread_interrupt`, whose `stop: true` is the full Stop, with J5's rule that a Captain may stop its own seats; `t3_thread_wait` is admitted again; `t3_thread_launch` is admitted to link sessions only, and threads it launches with `delegatedFrom` stay out of the ledger; the link tools are kept; `j5_list_participants` rows carry `thread_id`; `j5_spawn_agent` gains `environment_id` to start a Peer Agent on another J5 machine; a persona can be delegated to another J5 machine; a `delegate_task` child is called a delegate. AC6, AC9 and AC32 rewritten, AC39–AC43 added. The contract descriptions change when the tools do (Jackson, 2026-11-06 and 2026-11-07; [record](../../worklog/2026-11-07-agent-tool-boundary-session.md), [#952](https://github.com/Jacksondr5/j5code/issues/952)). diff --git a/docs/j5/product/a2a/index.md b/docs/j5/product/a2a/index.md index 300b1fc5b9c76..47f1907e35763 100644 --- a/docs/j5/product/a2a/index.md +++ b/docs/j5/product/a2a/index.md @@ -57,7 +57,7 @@ There are three kinds of message. ## Participants -A participant is anything that takes part over the ledger: an agent, a person, a machine participant, or an outside agent. Every thread that is not a provider-native Subagent is an agent participant in the ledger of its project, from the moment the thread exists. A thread's project is fixed when upstream creates the thread, so a participant never moves between ledgers. People are global — one person id, known across every project on the server — and nothing anywhere may assume there is exactly one of them. Provider-native Subagents are never participants. +A participant is anything that takes part over the ledger: an agent, a person, a machine participant, or an outside agent. Every thread that is not a provider-native Subagent or a delegate is an agent participant in the ledger of its project, from the moment the thread exists. A thread's project is fixed when upstream creates the thread, so a participant never moves between ledgers. People are global — one person id, known across every project on the server — and nothing anywhere may assume there is exactly one of them. Provider-native Subagents and delegates, including a delegate another machine started here, are never participants. A **machine participant** is a registered non-agent sender — a scheduled scraper, a watchdog, a shell script — and is how machine events enter the fleet as first-class work sources. Like an agent it belongs to one project, which never changes; it has a server-unique name and, unlike an agent, no thread. It sends plain messages only, and nothing can be delivered to it, so no Exchange is ever open with it and no silence is measured about it. It acts only through a token bound to its own participant id; nothing else can send as it. @@ -97,11 +97,11 @@ Silence is **never measured about a person**. A person has no turn that ends. Ho The platform names five kinds of silence: the turn ended without the owed reply; the turn errored; the agent was stopped, which tells the waiter not to retry; the agent is itself waiting on a person, and whether that person has seen the ask; and the agent is blocked on a peer, naming the peer. A notice informs the waiter. It never closes the Exchange, and it never claims to know whether the agent forgot or is waiting on something first — that is the waiter's judgment to make with the facts in hand. -A J5-spawned Peer Agent's native question is separate from an Exchange. The platform tells its placement parent which thread and request to read. A live question is described as blocked; a message question may leave the agent working. The parent may answer through upstream's `t3_pending_request` tool when permitted and the answer follows the task or the person's instructions; otherwise it asks the person to answer in the original thread. Resolving the question removes a notice still queued for the parent; a notice already delivered stays as history. This applies to live Crew seats too, when their harness still permits native questions. Archived or deleted threads and retired Crew seats do not raise these notices. With no reachable placement parent, no parent notice is sent; an actionable question still appears as an Inbox link to the agent's thread. Forks and ordinary threads placed under an agent do not gain this routing; J5-spawned agents retain it when their placement parent changes. A J5-spawned Captain still notifies its placement parent about its own questions, while those questions stay inline rather than being duplicated in the human Inbox. Native delegated children use upstream's own parent notification. +A J5-spawned Peer Agent's native question is separate from an Exchange. The platform tells its placement parent which thread and request to read. A live question is described as blocked; a message question may leave the agent working. The parent may answer through upstream's `t3_pending_request` tool when permitted and the answer follows the task or the person's instructions; otherwise it asks the person to answer in the original thread. Resolving the question removes a notice still queued for the parent; a notice already delivered stays as history. This applies to live Crew seats too, when their harness still permits native questions. Archived or deleted threads and retired Crew seats do not raise these notices. With no reachable placement parent, no parent notice is sent; an actionable question still appears as an Inbox link to the agent's thread. Forks and ordinary threads placed under an agent do not gain this routing; J5-spawned agents retain it when their placement parent changes. A J5-spawned Captain still notifies its placement parent about its own questions, while those questions stay inline rather than being duplicated in the human Inbox. Delegates use upstream's own parent notification. Native-question answers use upstream's `t3_pending_request` tool and response command. Access follows the caller's runtime and interaction modes across the environment; being a placement parent grants no extra permission, and being unrelated is not an additional refusal. The existing request records the answer and resolution, but does not identify the responder or create a J5 ledger act. Native questions stay outside Exchanges and their attributed replies. -A parent does independent work or ends its turn so question and completion notices can reach it. `t3_thread_wait` stays unavailable for waiting on placed Peer Agents and Crew seats: blocking the receiving turn can strand the notices queued behind it. Upstream's delegated-task wait remains separate and can return when its child asks a blocking question. +A parent does independent work or ends its turn so question and completion notices can reach it. An agent may wait on another thread with upstream's `t3_thread_wait`, but notices and messages queue behind the turn that is waiting, so they reach it only once the wait returns; ending the turn gets them there sooner. Upstream's delegated-task wait returns when its delegate asks a blocking question. Notices follow native-question updates and relevant run changes; there is no startup sweep. A question left pending across a restart needs a later qualifying event to notify its parent. Provider approvals and private secret requests do not use this notification. @@ -227,3 +227,4 @@ message, ask, reply, plain message, Exchange, intent, urgency, obligation, envel - 2026-10-20 — native-question answering retains upstream permission checks and unattributed response records; placed agents receive notices without raw thread waiting ([#674](https://github.com/Jacksondr5/j5code/pull/674), [#281](https://github.com/Jacksondr5/j5code/issues/281), [existing access decision](https://github.com/Jacksondr5/j5code/issues/345#issuecomment-6092125478)). - 2026-10-27 — upstream's pending-request tools are one `t3_pending_request` tool since its stable v0.1.3. - 2026-11-04 — a person's reply names the ask it answers in its envelope, now that several can be open; AC18 ([#111](https://github.com/Jacksondr5/j5code/issues/111)). +- 2026-11-07 — a delegate is never a participant, a delegate another machine started here included; an agent may wait on another thread with `t3_thread_wait`, at the cost of the notices queued behind its turn (Jackson, 2026-11-06 and 2026-11-07; [record](../../worklog/2026-11-07-agent-tool-boundary-session.md)). diff --git a/docs/j5/product/a2a/substrate.md b/docs/j5/product/a2a/substrate.md index ffec5056ca193..9d06aa6db4ab3 100644 --- a/docs/j5/product/a2a/substrate.md +++ b/docs/j5/product/a2a/substrate.md @@ -13,18 +13,18 @@ J5 is a tracking fork of T3 Code. Upstream ships a great deal of machinery that ### The organizing line -The Subagent and Peer Agent distinction (see the [glossary](../glossary.md)) sorts upstream code. **Subagents belong to providers**: the platform cannot control their creation and does not try; upstream renders them; J5 only observes. **Peer Agents belong to J5**: everything the platform says about spawning, membership, placement and messaging applies to Peer Agents and only to them. +The distinction between helpers and Peer Agents (see the [glossary](../glossary.md)) sorts upstream code. **Helpers belong to their parent**: a provider-native Subagent belongs to its provider, which creates it without the platform; a delegate belongs to upstream, which starts it for its parent and follows it to its result. Upstream renders both; J5 only observes, and adds personas to delegates. **Peer Agents belong to J5**: everything the platform says about spawning, membership, placement and messaging applies to Peer Agents and only to them. Every upstream mechanism is judged by one question: _does it carry an opinion about agent organization?_ Topology-free plumbing is consumed as-is. Organization-shaped opinion is replaced by J5's own systems. ### The four dispositions -| Disposition | Upstream mechanism | Why | -| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Consume as-is** | Provider adapters and turn machinery; the event-sourced core (commands, events, projections, receipts, the outbox); thread creation with settings inheritance; per-thread interrupt and archive; thread-send delivery with its queue and steer modes; checkpoints; run-lifecycle events as an observation feed | Topology-free plumbing. J5 calls these through their public command seams and never writes into upstream projections directly. | -| **Consume as record, never behavior** | Thread lineage (the parent thread and the relationship to it) | Needed for forks and for rendering provider-native Subagents, and a read-only source for deriving provenance when a creation bypassed J5. Never a source of lifecycle, display or organization for Peer Agents, which are created with root lineage and need nothing from it. | -| **Rebuild — J5 owns the organization** | Spawning (upstream's delegation) becomes J5's spawn verb: root-thread creation, placement, and a brief that carries the task and whether a reply is expected. Lifecycle uses single-target j5_stop_agent and t3_thread_organize under upstream's same-project rule; the shared reactor closes Exchanges on archive. Organization display (upstream's lineage panel) becomes a hierarchy read from placement and provenance; the lineage panel remains for Subagents and forks. | These carry upstream's structure-is-the-spawn-tree opinion. | -| **Build — nothing exists on either side** | Re-surfacing an open Exchange to a receiver that deferred it (inbox and Memo territory); orphan and runaway observability (observe through silence machinery, never auto-kill). | Named build items, each with its own definition. | +| Disposition | Upstream mechanism | Why | +| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Consume as-is** | Provider adapters and turn machinery; the event-sourced core (commands, events, projections, receipts, the outbox); thread creation with settings inheritance; per-thread interrupt and archive; thread-send delivery with its queue and steer modes; checkpoints; run-lifecycle events as an observation feed | Topology-free plumbing. J5 calls these through their public command seams and never writes into upstream projections directly. | +| **Consume as record, never behavior** | Thread lineage (the parent thread and the relationship to it) | Needed for forks and for rendering provider-native Subagents, and a read-only source for deriving provenance when a creation bypassed J5. Never a source of lifecycle, display or organization for Peer Agents, which are created with root lineage and need nothing from it. | +| **Rebuild — J5 owns the organization** | Spawning (upstream's delegation) becomes J5's spawn verb: root-thread creation, placement, and a brief that carries the task and whether a reply is expected. Lifecycle uses upstream's single-target stop and t3_thread_organize; the shared reactor closes Exchanges on archive. Organization display (upstream's lineage panel) becomes a hierarchy read from placement and provenance; the lineage panel remains for Subagents, delegates and forks. | These carry upstream's structure-is-the-spawn-tree opinion. | +| **Build — nothing exists on either side** | Re-surfacing an open Exchange to a receiver that deferred it (inbox and Memo territory); orphan and runaway observability (observe through silence machinery, never auto-kill). | Named build items, each with its own definition. | ### Transport versus communication @@ -36,22 +36,22 @@ Delivery to a busy agent queues behind the active turn; steering is the person's **Upstream owns existence and lifecycle state, including the project a thread belongs to; J5 tables overlay only organization facts** — placement, provenance, Exchange obligations. J5 writes flow through upstream's public command seams, never into its projections; J5 reads either join upstream state or say explicitly that they may be stale. -**Every thread is a participant in its project's ledger, except a provider Subagent.** A thread's home is its project, which upstream sets when it creates the thread and never changes, so registration follows creation and asks for nothing. Participanthood is still never inferred from addressability: Codex-native Subagents get real shadow threads holding live, resumable provider references; they are thread-having and send-capable, and they are still Subagents, so registration reads a thread's lineage and leaves Subagent-lineage threads out. +**Every thread is a participant in its project's ledger, except a provider Subagent.** A thread's home is its project, which upstream sets when it creates the thread and never changes, so registration follows creation and asks for nothing. Participanthood is still never inferred from addressability: Codex-native Subagents get real shadow threads holding live, resumable provider references; they are thread-having and send-capable, and they are still Subagents, so registration reads a thread's lineage and leaves Subagent-lineage threads out, and leaves out a delegate another machine started here, which carries `delegatedFrom`. ### The agent tool surface J5 replaces upstream's orchestrator toolkit registration with its own subset: a J5-owned toolkit reusing upstream's tool constants, thin handlers delegating to the same service, and a one-line swap in the MCP server layer. Upstream's toolkit stays compiled and untouched — non-exposure, not deletion. The subset is **fail-closed on upstream evolution**: a rebase that brings new upstream tools does not extend the agent surface until someone admits them deliberately, so new agent powers get reviewed against J5's definitions by default. -| Disposition | Tools | Why | -| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Keep | `orchestrator_capabilities` (its handler no longer advertises delegation or app-owned subagents), the scheduling verbs (`schedule_task`, which also updates a task since v0.1.3, `list_scheduled_tasks`, `delete_scheduled_task`), and the observation verbs (`t3_thread_list`, `t3_thread_read`; `t3_thread_wait` was withdrawn on 2026-09-14 because blocking inside a turn starves a participant of queued notices, see [agent tools](agent-tools.md)) | Observation and self-scheduling carry no organization opinion. | -| Adapt/keep | `delegate_task`, `task_status`, `task_cancel` | Saved-agent child tasks use the J5 delegate extension; status and cancellation retain upstream semantics. Peer Agents still use j5_spawn_agent. | -| Omit | `t3_thread_send`, `t3_thread_interrupt` | Untracked twins of `j5_send_message` and `j5_stop_agent` — they bypass the ledger, the Exchange, and silence measurement. | -| Omit | `create_threads`, `t3_thread_start` | Raw creation from the agent surface would bypass the spawn verb and its placement. Admitting either requires a contract in [agent-tools](agent-tools.md) first, never a registration change alone. | +| Disposition | Tools | Why | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Keep | `orchestrator_capabilities` (its handler no longer advertises delegation or app-owned subagents), the scheduling verbs (`schedule_task`, which also updates a task since v0.1.3, `list_scheduled_tasks`, `delete_scheduled_task`), the observation verbs (`t3_thread_list`, `t3_thread_read`, `t3_thread_wait`), single-target stop (`t3_thread_interrupt`, with J5's Captain rule), and the link tools (`t3_environment_links`, `t3_environment_link`, `t3_environment_unlink`) | Observation, self-scheduling, stopping and links carry no organization opinion. | +| Adapt/keep | `delegate_task`, `task_status`, `task_cancel`; `t3_thread_launch` for link sessions only | Persona delegates use the J5 extension, on this machine or another J5 machine; status and cancellation keep upstream's semantics. A link session launches a delegate another machine sent here, which stays out of the ledger. Peer Agents still use `j5_spawn_agent`. | +| Omit | `t3_thread_send` | The untracked twin of `j5_send_message`: it bypasses the ledger, the Exchange, and silence measurement. | +| Omit | `create_threads`, `t3_thread_start` | Raw creation from the agent surface would bypass the spawn verb and its placement. Admitting either requires a contract in [agent-tools](agent-tools.md) first, never a registration change alone. | Upstream's orchestration prompt text steered agents toward delegation and away from thread creation; J5 carries a small tracked edit to it, recorded in the fork inventory. -The J5 verbs themselves — `j5_send_message`, `j5_list_participants`, `j5_spawn_agent`, `j5_stop_agent`, `t3_thread_organize`, and `j5_clear_own_ask` — are defined in [agent-tools](agent-tools.md). +The J5 verbs themselves — `j5_send_message`, `j5_list_participants`, `j5_spawn_agent`, J5's `t3_thread_interrupt`, `t3_thread_organize`, and `j5_clear_own_ask` — are defined in [agent-tools](agent-tools.md). ### The legacy cohort @@ -62,7 +62,7 @@ Agents spawned through upstream's delegation path before the spawn verb existed 1. No J5 code writes into an upstream projection; every J5 mutation goes through an upstream public command seam or a J5-owned table. 2. The agent surface exposes exactly the J5 verbs and the kept upstream tools listed above; every other upstream tool is absent by construction, and a new upstream tool arriving in a rebase is absent until admitted through a contract change. 3. An agent-to-agent message sent through the platform always has a ledger row, an envelope, and a delivery outcome; no raw thread-send is reachable from the agent surface. -4. Every thread is a participant in its project's ledger from its creation, however it was created; a Subagent-lineage thread never becomes one. +4. Every thread is a participant in its project's ledger from its creation, however it was created; a Subagent-lineage thread, and a delegate another machine started here, never becomes one. 5. A Peer Agent created through the spawn verb has root lineage; nothing about it is derived from upstream's lineage record. ## History @@ -77,3 +77,4 @@ Agents spawned through upstream's delegation path before the spawn verb existed - 2026-10-12 — the Codex Astra exception covers every Codex GPT 6 model (Jackson, [#569](https://github.com/Jacksondr5/j5code/pull/569)). - 2026-10-22 — the exception covers Claude (Bryant). - 2026-10-27 — `update_scheduled_task` is part of upstream's `schedule_task` since its stable v0.1.3. +- 2026-11-07 — helpers (provider Subagents and delegates) and Peer Agents sort upstream code; `t3_thread_wait`, `t3_thread_interrupt` and the link tools are kept, `t3_thread_launch` is kept for link sessions only, and a delegate another machine starts here never registers (Jackson, 2026-11-06 and 2026-11-07; [record](../../worklog/2026-11-07-agent-tool-boundary-session.md)). diff --git a/docs/j5/product/cross-device.md b/docs/j5/product/cross-device.md index 658cdb4339a18..5879b38ea3720 100644 --- a/docs/j5/product/cross-device.md +++ b/docs/j5/product/cross-device.md @@ -39,7 +39,7 @@ Servers do not find each other; **the client introduces them.** The client is th **A server's name is its own.** Each server reports one name for itself, the one every client already shows for it, taken from its machine's name; a peer record carries the other server's current name, refreshed when they greet, poll, or read each other's address book, so agents and every client see the same name. Renaming a server means renaming its machine. Peer servers also state their protocol version on everything they send each other, each side checks the other's, and a server updated past the other's protocol stops exchanging with it and says which server to update, rather than misreading it. -**Agents see where participants live.** An agent addresses a participant by its id exactly as it does locally; the platform resolves the participant to the server it lives on — the sender's own or a peer server. Once a server has a peer, its address book names the server each participant lives on, and whether a peer server that polls this one is available; a send to a participant on a peer server names that server in its result, and the envelope of a message from one names the server it came from. People give their servers different capabilities — Xcode on a laptop, a database connection on a work server — and an agent that can see where each participant lives can pick the right one. No agent tool takes, chooses or manages a server: where a participant lives is a fact the platform states, never one an agent acts on, and which server can do what is the person's to tell their agents. +**Agents see where participants live.** An agent addresses a participant by its id exactly as it does locally; the platform resolves the participant to the server it lives on — the sender's own or a peer server. Once a server has a peer, its address book names the server each participant lives on, and whether a peer server that polls this one is available; a send to a participant on a peer server names that server in its result, and the envelope of a message from one names the server it came from. People give their servers different capabilities — Xcode on a laptop, a database connection on a work server — and an agent that can see where each participant lives can pick the right one. No messaging verb takes, chooses or manages a server: where a participant lives is a fact the platform states, never one a message names, and which server can do what is the person's to tell their agents. **A person stays server-local.** A person's participant, their asks, and their inbox belong to each server they use; an ask to a person is delivered on the sender's own server, and the person's view of several servers is the client's merge described above. Peering carries messages between agents, and nothing else. @@ -49,7 +49,21 @@ Peering is also where another person's server attaches, when that time comes — History durability is **client-pulled backup**: each connected client periodically pulls a consistent snapshot from every server it connects to, so the client's existing always-connected fan-out is the backup fabric, with no new infrastructure. Its design — the snapshot endpoint, cadence, retention, restore — is later; the direction is settled. -What this never does: no replicated state, no multi-master, no moving a project's ledger between servers, no global agent registry (peering is pairwise), no server an agent chooses or manages, no dependence on a relay or tunnel (direct peering; a relay could later be one transport among others, never a required service). +What this never does: no replicated state, no multi-master, no moving a project's ledger between servers, no global agent registry (peering is pairwise), no messaging verb that chooses or manages a server, no dependence on a relay or tunnel (direct peering; a relay could later be one transport among others, never a required service). + +### Starting work on another machine + +Messages are not the only thing that crosses. Upstream's **linked environments** let an agent act on another machine: one server signs in to the other's MCP server as a client, and an agent names that machine to use upstream's tools there. A link is a direct, synchronous call, so it works only while the caller's server can reach the other machine; peering carries messages, which may wait for a machine that is asleep or polls. Links are upstream's, and J5 takes them as upstream ships them. They are J5's way to start work on another machine: + +- **A delegate there.** `delegate_task` aimed at a linked machine starts the delegate on that machine, as upstream does: the caller's server launches it there and follows it until its result comes back to the parent. A delegate on a J5 machine stays out of that machine's ledger, as every delegate does. A persona can be delegated there too, resolved from that machine's persona library against that machine's models; a plain delegate there runs only on a model that machine's Models for custom members allows. +- **A Peer Agent there.** `j5_spawn_agent` aimed at another J5 machine starts the Peer Agent on that machine, in a project there. The caller's server makes the call over the link and names the spawner, and the new agent gets the same first turn as a local spawn: who spawned it, on which server, and how to reply. The spawner is recorded on that machine the way an outside agent is: the new agent is a root of its project there, and archiving either one leaves the other alone. The caller gets the new agent's participant id and can message it at once. This needs both relationships: a Full access link to start it and to let it use J5's tools, and peering so that the two can talk. + +For now, starting work this way needs the caller's server to reach the other machine; a laptop that cannot be reached can start work on a reachable server, but not the other way round. + +**Later** + +- Reaching a machine that cannot be reached directly, through a line that machine holds open ([#951](https://github.com/Jacksondr5/j5code/issues/951)). +- A Captain seating Crew members on another machine ([#953](https://github.com/Jacksondr5/j5code/issues/953)). ## Acceptance criteria @@ -74,7 +88,7 @@ What this never does: no replicated state, no multi-master, no moving a project' 13. A peer server's credential is an ordinary session of the issuing server, bound to the peer server's environment identity and to a scope that permits only accepting deliveries, polling for stored ones and reading the address book; it appears in Settings → Connections. It is long-lived rather than renewed, and the holder's record shows when it expires. When it is revoked, because the issuer removed the peer or its session was revoked, or it has expired, the holder's deliveries are refused and alarm with that reason, a holder that polls stops polling, the holder's record reads " ended this peering" in either link mode with removal as what is left to do, the issuer's record shows the peer server without a live session, and the address book reports it as unread, never omitted. 14. Peering is done from a client connected to both environments with administrative scope. Before anything is recorded, the client checks which way connections can go and how each server is run, states how messages will travel in each direction, and asks only what the check could not settle; a failed check shows the error it got. The person confirms the origin to use, which may differ from the one the client uses; the server names come from the servers. The client offers a setup only when both servers support poll mode; when either does not, it names the server to update and offers nothing else, while an operator can still peer an older server to send directly from the command line. 15. A peer server that is sent to directly or polled is recorded only after the recording server has reached it at the stated origin with the credential it issued; an unreachable origin is refused with the reason, never recorded, and a known peer server is not moved to a new origin unless the person says so. Moving one keeps the credential this server holds for it, and records the new origin only once the peer server answers there to that credential; nothing waiting for it is cancelled and no Exchange is dropped. A polling peer is recorded by the storing server when it first presents the credential issued for it. -16. An agent addresses a participant homed on a peer server by the same participant id it would use locally, and no agent verb takes, chooses or manages a server; once a server has a peer, the address book, send results and envelopes name the server a participant lives on. +16. An agent addresses a participant homed on a peer server by the same participant id it would use locally, and no messaging verb takes, chooses or manages a server; once a server has a peer, the address book, send results and envelopes name the server a participant lives on. 17. The address book lists participants on peer servers beside local ones with their project's id and title. It reads the roster of each peer server it sends to directly live on each call, so an unreachable one costs the call its timeout and is reported as unread in the listing, never omitted silently. A polling peer's roster comes from the snapshot it last sent when it polled: current while it is online, "as of" that time while it is offline, and unread until its first poll. 18. A message to a participant on a peer server is recorded in the ledger of the sender's project before the call returns, for a participant the address book resolves or one this server has already exchanged messages with; a first message to a participant on a peer server that cannot be read is refused with the reason. The peer server records its own received row before delivering to the agent's thread, and that acknowledgement is the sender's delivery receipt: it means the peer server accepted the message, and delivery into the thread is the peer server's to retry and alarm on. Failure to reach a peer server sent to directly retries and alarms on the sender's server as any delivery does. A message to a polling peer is stored without retrying or alarming until the peer polls, and the poller's acknowledgement is the receipt; one the poller refuses is reported to its sender. 19. Retrying one message to a peer server, or handing it out again to a polling peer, never yields a second received row or a second delivery. @@ -86,6 +100,12 @@ What this never does: no replicated state, no multi-master, no moving a project' 25. A message waiting for a polling peer that is cancelled — because its sender was archived, for example — is withdrawn only if the peer has not yet been handed it; one already handed out stays deliverable and its acknowledgement records it delivered. Removing the peer cancels every waiting message, handed out or not. When an Exchange closes whose ask was cancelled before it was delivered or handed out, no closing notice goes to the peer server, which never held it. 26. A server tells its peers what it can do in every greeting, poll and roster answer, and a peer's record keeps the latest. A message sent with `steer` or `restart` crosses with that request and the sender's permission limit only to a peer that says it lands a message as asked; the receiving server refuses it for an agent that runs above the limit. +### Starting work on another machine + +27. `delegate_task` aimed at a linked J5 machine starts the delegate there, follows it to its result and keeps it out of that machine's ledger; with a persona, the persona is resolved from that machine's library and models, and a plain delegate there is refused on a model that machine's Models for custom members does not allow. +28. `j5_spawn_agent` aimed at a linked and peered J5 machine starts the Peer Agent in a project there, records the calling agent as its spawner with no placement parent, gives it the same first-turn facts as a local spawn naming the spawner's server, and returns its participant id; a message the caller sends it straight away is delivered. A retry with the same `client_request_id` never starts a second agent. +29. Starting work on another machine that the caller's server cannot reach fails visibly, naming that machine; nothing is recorded as started. + ## Scenarios - **Two servers, one inbox.** The user's client connects to the work server and the home server. An ask from an agent in Billing Migration (work) and one from an agent in Support Rotation (home) appear in one inbox, each tagged with its environment; answering each reaches the right server. (AC2, AC3) @@ -110,3 +130,4 @@ What this never does: no replicated state, no multi-master, no moving a project' - 2026-10-12 — a steer or restart crosses to a peer server: two optional fields on a delivery, a `landing` capability, and a `landing_refused` answer. The protocol version stays 2, since each is an additive change ([#519](https://github.com/Jacksondr5/j5code/issues/519)). - 2026-10-18 — a message sent directly that alarms is reported to its sender, as a refused one is; an alarm on the peer server after its receipt is not reported back (Jackson, [#260](https://github.com/Jacksondr5/j5code/issues/260)). - 2026-10-25 — a peer server's address changes in place, keeping the credential, after a host move left the only repair as removing the peer; AC15 extended. Several addresses per peer with fallback was considered and not chosen: servers do not roam the way clients do, and fallback would hide a dead address (Jackson, [#721](https://github.com/Jacksondr5/j5code/issues/721)). +- 2026-11-07 — starting work on another machine: J5 takes upstream's linked environments as shipped, and they carry starting work, while peering carries messages. A delegate or a Peer Agent can start on a linked J5 machine; a Peer Agent there needs peering too. "No agent tool chooses or manages a server" narrows to J5's messaging verbs; AC16 rewritten, AC27–AC29 added; reaching an unreachable machine and Crews across machines are Later (Jackson, 2026-11-05 and 2026-11-07; [record](../worklog/2026-11-07-agent-tool-boundary-session.md)). diff --git a/docs/j5/product/features/crews.md b/docs/j5/product/features/crews.md index aae354347ff9e..4e3a2873d16c8 100644 --- a/docs/j5/product/features/crews.md +++ b/docs/j5/product/features/crews.md @@ -21,7 +21,7 @@ A **Crew** is a group of agents formed as a unit from a **roster its Captain pro **Several people.** Where more than one person can write to a Captain's thread, "the person" in this definition is any of them. The roster and a seat's tool approvals go to everyone who can write to that thread, and the first answer settles each; anyone who can write to the Captain's thread can write to its seats too ([shared conversations](shared-conversations.md), [people and access](people-and-access.md)). -**Communication is direct.** Members exchange findings, questions, and results directly with one another and their Captain, and run their own review loops (AC9); Captains can coordinate with other Captains. Neither an artifact nor a human approval is required for these messages. Members send their final result with evidence and unresolved issues to the Captain. How a message reaches a running turn depends on the provider (Messages and steering, below). A persona owes no file (see the [persona contract](../agent-personas/index.md)); a file the assignment asks for is written as a project artifact and shown on the Artifacts page. **Every seat tells its Captain when it finishes**, as measured facts: how the run ended first, the run's error when it failed, and the member's reply, cut when long (the rest is in the member's thread). A first turn that fails is a launch outcome, told once by the launch report and not again as a finish; and a seat's failure that its Captain hears this way is not repeated by the silence detector as an unanswered ask. The notice is posted the first time a seat finishes and again only when those facts change; a finish that would repeat the last notice word for word is silent, because the seat's own reply already reached the Captain. Notices that arrive while the Captain's turn is running fold into the one seat notice already queued behind that turn, so the Captain absorbs its Crew's news in one turn rather than one per seat. Notice delivery retries on a later finish or the next server startup if dispatch fails; it is not guaranteed promptly while the seat stays idle. Sign-in and permission failures also raise a platform notice in the person’s Inbox, with replies routed to the Captain; other failures remain for the Captain to assess. A Captain normally does not have to interview its Crew to learn a seat is done, and it never waits for one inside a turn: `t3_thread_wait` is not on its surface, because a turn that blocks cannot receive the notice it is waiting for. +**Communication is direct.** Members exchange findings, questions, and results directly with one another and their Captain, and run their own review loops (AC9); Captains can coordinate with other Captains. Neither an artifact nor a human approval is required for these messages. Members send their final result with evidence and unresolved issues to the Captain. How a message reaches a running turn depends on the provider (Messages and steering, below). A persona owes no file (see the [persona contract](../agent-personas/index.md)); a file the assignment asks for is written as a project artifact and shown on the Artifacts page. **Every seat tells its Captain when it finishes**, as measured facts: how the run ended first, the run's error when it failed, and the member's reply, cut when long (the rest is in the member's thread). A first turn that fails is a launch outcome, told once by the launch report and not again as a finish; and a seat's failure that its Captain hears this way is not repeated by the silence detector as an unanswered ask. The notice is posted the first time a seat finishes and again only when those facts change; a finish that would repeat the last notice word for word is silent, because the seat's own reply already reached the Captain. Notices that arrive while the Captain's turn is running fold into the one seat notice already queued behind that turn, so the Captain absorbs its Crew's news in one turn rather than one per seat. Notice delivery retries on a later finish or the next server startup if dispatch fails; it is not guaranteed promptly while the seat stays idle. Sign-in and permission failures also raise a platform notice in the person’s Inbox, with replies routed to the Captain; other failures remain for the Captain to assess. A Captain normally does not have to interview its Crew to learn a seat is done, and it doesn't need to wait for one inside a turn: the notice reaches it once its turn ends, while a turn that waits with `t3_thread_wait` gets it only when the wait returns. **Members report their finish.** When a member's run ends and it owes no open reply, the platform tells its Captain how the run ended and carries its reply; a later message runs normally. The platform never settles a seat because its run finished: upstream settles by hand, by merged PR, or by idle days, and a seat marked settled seconds after launch read as wrong (Jackson, 2026-09-17). Settling the Captain settles its seats (AC17). **A Crew's state is its seats' states**, summarized from measured facts — how many seats are running, need a person, or were settled — on the Crew's row of the Fleet page and on the Captain's expander in the sidebar, where each seat's row also says how its last run ended (failed, interrupted, or completed); the person never has to interview a Crew to learn where it stands. **The Captain's timeline keeps approval compact and shows what needs attention.** The launch report and finish notices reach the Captain unchanged, but the person sees, as [platform notices](thread-a2a-rendering.md), one line per seat that couldn't start, was never created, hasn't confirmed it started, or failed, each opening the seat's thread when it has one; a roster approval shows “Crew approved · N members” from the stored gate notice, including in existing threads; a clean finish shows nothing, and an interruption after the first turn, which comes from a stop, is silent there too. Members stay out of the thread sidebar unless pinned; the Captain's row carries the Captain's anchor mark and an expander into its members; the Fleet page lists every agent by project and placement with each Crew under its Captain. Crews are a web and desktop surface; mobile has no Crew surface today, deliberately. @@ -61,6 +61,10 @@ A message to a member or Captain with a running turn lands one of three ways, se A steer that races a Stop is a known case ([FORK.md](../../../FORK.md) case 26). +**Later** + +- Seating members on another J5 machine ([#953](https://github.com/Jacksondr5/j5code/issues/953)). + ## Acceptance criteria ### Launch and the gate @@ -92,7 +96,7 @@ A steer that races a Stop is a known case ([FORK.md](../../../FORK.md) case 26). ### Captains 15. A Captain shows the anchor mark, derived from placement and nothing else, with the Crews it commands in its tooltip; each Crew it commands renders as its own named, collapsible group with that Crew's state summary, and solo agents it spawned sit in a separate group; members stay out of the sidebar unless pinned. -16. A Captain may archive a Crew placed directly under it and nothing else; a member's attempt to grow or archive a Crew, or to spawn a Peer Agent, is refused naming escalation to its Captain. Members may still run provider-native Subagents. +16. A Captain may archive a Crew placed directly under it and nothing else; a member's attempt to grow or archive a Crew, or to spawn a Peer Agent, is refused naming escalation to its Captain. Members may still run provider-native Subagents and delegates. 17. A Crew follows its Captain: a person's archive or deletion of the Captain's thread, from any surface, retires the Crews it commands as units when it commits, and the web dialog lists each live Crew's seats with their running turns and open asks before the person confirms; unarchiving the Captain brings back every Crew that retired with it, seat threads included; settling the Captain settles every seat of its live Crews that is not running or waiting on the person, and unsettling it unsettles the settled seats. An archive or deletion the event stream missed while the server was down retires the Captain's Crews at the next boot; an unarchive, settle, or unsettle it missed is not caught up. The person can also retire one Crew from its Fleet header behind the same seat-by-seat dialog, and a seat can never be archived on its own from the app. ### Lifecycle @@ -179,3 +183,4 @@ A steer that races a Stop is a known case ([FORK.md](../../../FORK.md) case 26). - 2026-11-02 — AC19: the worktree approval is per archive, withdrawn when the Crew comes back, and only for work its branch holds ([#749](https://github.com/Jacksondr5/j5code/issues/749), review). - 2026-10-31 — a member's introduction and roster changes are visible in its own thread, as a collapsed card that opens to what the model read, where they had been sent to the model only (Jackson, 2026-10-31; register D43). - 2026-11-02 — Crew notices take the look of every other platform notice: one grey line that opens, a red or amber icon on a seat in trouble, including the member's introduction and roster changes, which had been a collapsed card ([#698](https://github.com/Jacksondr5/j5code/issues/698)). Which notices appear is unchanged. +- 2026-11-07 — a Captain may wait on a seat with `t3_thread_wait`, at the cost of the notices queued behind its turn; members may run delegates as well as provider Subagents; Crews across machines are Later (Jackson, 2026-11-06 and 2026-11-07; [record](../../worklog/2026-11-07-agent-tool-boundary-session.md)). diff --git a/docs/j5/product/features/fleet-page.md b/docs/j5/product/features/fleet-page.md index cc60480643b58..18f5c79adf417 100644 --- a/docs/j5/product/features/fleet-page.md +++ b/docs/j5/product/features/fleet-page.md @@ -67,7 +67,7 @@ The Fleet page is **not** the inbox: it never demands a reply. It is **not** a p 8. The rows are every agent participant of the projects read, with no cap on their number; a large fleet is paged or virtualized, never silently truncated. 9. Rows are arranged as the placement tree, siblings in creation order, and are never reordered by activity or by problems. -10. People are never rows; a person appears only as the counterparty on an agent's asks. Provider-native Subagents never appear. +10. People are never rows; a person appears only as the counterparty on an agent's asks. Provider-native Subagents and delegates never appear. 11. A retired agent is not a row; an agent still live beneath it renders at its project's root. 12. Rows carry no inline origin tag; placement shows which agent spawned a child. An outside spawner's name is available on hover over the agent's title, using its participant id when no name was recorded. Unknown provenance adds no label. 13. Retired (see History). @@ -149,3 +149,4 @@ The Fleet page is **not** the inbox: it never demands a reply. It is **not** a p - 2026-10-21 — clarified AC15 and AC21: queued follow-ups preserve the active run's status, only completion-holding background work prevents Idle, and dispatch is overdue only when no other run is in progress ([#360](https://github.com/Jacksondr5/j5code/issues/360); [#662](https://github.com/Jacksondr5/j5code/pull/662)). - 2026-10-24 — receiving servers expose later peer delivery alarms through their own Fleet read, and the client attaches them to the remote sender only while both environments are readable; unavailable receivers of open asks leave badge coverage incomplete, with no alarm returned over A2A (Jackson, 2026-10-24; [#662](https://github.com/Jacksondr5/j5code/pull/662)). - 2026-11-04 — rows lose their inline origin tag, since placement already shows which agent spawned a child; an outside spawner's name moves to hover on the agent's title, and unknown provenance adds no label; AC12 (Jackson, 2026-11-04; [#291](https://github.com/Jacksondr5/j5code/issues/291)). +- 2026-11-07 — AC10 names delegates beside provider Subagents: neither is a participant, so neither is a row ([record](../../worklog/2026-11-07-agent-tool-boundary-session.md)). diff --git a/docs/j5/product/features/people-and-access.md b/docs/j5/product/features/people-and-access.md index 1f8e7b28fec11..2424c40e7bd43 100644 --- a/docs/j5/product/features/people-and-access.md +++ b/docs/j5/product/features/people-and-access.md @@ -69,7 +69,7 @@ The **first owner** is the person the server's own machine belongs to. The deskt ### Scopes and levels -A person's access is a level at a scope. A **scope** is the server, a project, or a thread. A thread's scope is the thread and the agents beneath it: the Subagents it ran, the Peer Agents placed under it and their Crew seats, at any depth and in any project. It does not include the thread above it, agents it only exchanged messages with, or a fork of it. A scope covers what is in it now: a thread started in a project, an agent spawned beneath a thread, or a project added to the server appears for everyone whose scope covers it. +A person's access is a level at a scope. A **scope** is the server, a project, or a thread. A thread's scope is the thread and the agents beneath it: the Subagents and delegates it ran, the Peer Agents placed under it and their Crew seats, at any depth and in any project. It does not include the thread above it, agents it only exchanged messages with, or a fork of it. A scope covers what is in it now: a thread started in a project, an agent spawned beneath a thread, or a project added to the server appears for everyone whose scope covers it. There are three **levels**: @@ -229,3 +229,4 @@ Set aside on purpose, each tracked where it is linked. An item leaves this list - 2026-10-27 — a link for one person always names who it is for, so the Share dialog and the People page can say who each unused link is for (AC31, AC32; Jackson). - 2026-10-31 — the mobile app asks whose device it is, takes its new session when its person's level changes, and keeps Settings an Owner's, as web does, with its own list of the device's pages; managing sharing stays on web and desktop (AC5, AC6, AC17, AC28; Jackson, [#831](https://github.com/Jacksondr5/j5code/issues/831)). - 2026-11-01 — on the mobile app the name question has a way out that touches only that server: Remove this server, and for a device the server cannot place, Not now until the app next opens; the first owner, who already holds the server, gets no Not now (AC5, AC6; Jackson at Checkpoint 1, [#870](https://github.com/Jacksondr5/j5code/issues/870)). +- 2026-11-07 — a thread's scope names the delegates it ran beside its Subagents (the term, [#952](https://github.com/Jacksondr5/j5code/issues/952)). diff --git a/docs/j5/product/glossary.md b/docs/j5/product/glossary.md index c5cadbfe3dd1f..6832dd6504de7 100644 --- a/docs/j5/product/glossary.md +++ b/docs/j5/product/glossary.md @@ -36,18 +36,19 @@ The J5 vocabulary, in one place, so that a name used anywhere in these docs reso These entries are the distinctions the whole team must share; the glossary owns them. -| Term | Definition | -| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| agent | An LLM-driven participant running in a provider session. The ordinary word, lowercase. Never the library entry: that is a persona (2026-09-17). | -| **persona** | A saved definition in the library (Settings → Agent Setup): instructions, an ordered model list, and an access level. An agent may run as a persona; a persona is not itself running. "Saved agent" is retired vocabulary. | -| **handoff artifact** | A versioned document under `handoffs/` in the project's artifacts, which an agent writes when an assignment asks for one. A persona no longer declares one; older tasks keep the status they recorded. Never a context handoff. Owner: [agent-personas/index.md](agent-personas/index.md#deliverables). | -| context handoff | Upstream's mechanism, not a J5 concept: the automatic transfer of a budgeted slice of a thread's history into a new provider conversation of the same thread when it changes provider or model, forks, or restarts. Never a handoff artifact. Owner: upstream's [portable handoffs](../../user/portable-handoffs.md). | -| participant | Anything that takes part over the communication ledger: agents (every thread that is not a provider-native Subagent), people, machine participants, and outside agents. Provider-native Subagents are not participants. | -| **Peer Agent** | An agent spawned by another agent as a full citizen: it has its own top-level thread, the user can read and talk to it like any other agent, it has an independent lifecycle, and it may run on any provider. The user cannot tell it from a human-created agent without checking its provenance. All platform law about spawning, membership, placement and messaging applies to Peer Agents and only to Peer Agents. | -| **Subagent** | Upstream's word, adopted: a worker an agent runs inside its own provider session (Claude Task workers, Codex collab children, Cursor task subagents). The user cannot talk to it, it cannot be moved out of its parent's tree, and it ends with its parent's session. What the user _sees_ of it varies by provider; what never varies is that it is not addressable. The platform cannot control Subagent creation and does not try; it only observes what the provider surfaces. | -| spawn | The verb for creating either kind, always qualified — "spawn a Subagent," "spawn a Peer Agent." Unqualified "spawn" in J5 docs means a Peer Agent. | -| Foreground, Background | The two ends of the human-contact spectrum: a Foreground agent talks with the person through chat often; a Background agent reaches the person only through the inbox or its Captain. Agents can sit in between. Owner: [principles.md](principles.md), the human-contact spectrum lens. | -| **Spawning Guide** | The user-authored guide consulted when spawning: which provider, model and reasoning for which work, and how to write a brief. Owner: [features/spawning-guide.md](features/spawning-guide.md). | +| Term | Definition | +| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| agent | An LLM-driven participant running in a provider session. The ordinary word, lowercase. Never the library entry: that is a persona (2026-09-17). | +| **persona** | A saved definition in the library (Settings → Agent Setup): instructions, an ordered model list, and an access level. An agent may run as a persona; a persona is not itself running. "Saved agent" is retired vocabulary. | +| **handoff artifact** | A versioned document under `handoffs/` in the project's artifacts, which an agent writes when an assignment asks for one. A persona no longer declares one; older tasks keep the status they recorded. Never a context handoff. Owner: [agent-personas/index.md](agent-personas/index.md#deliverables). | +| context handoff | Upstream's mechanism, not a J5 concept: the automatic transfer of a budgeted slice of a thread's history into a new provider conversation of the same thread when it changes provider or model, forks, or restarts. Never a handoff artifact. Owner: upstream's [portable handoffs](../../user/portable-handoffs.md). | +| participant | Anything that takes part over the communication ledger: agents (every thread that is not a provider-native Subagent or a delegate), people, machine participants, and outside agents. Provider-native Subagents and delegates are not participants. | +| **Peer Agent** | An agent spawned by another agent as a full citizen: it has its own top-level thread, the user can read and talk to it like any other agent, it has an independent lifecycle, and it may run on any provider. The user cannot tell it from a human-created agent without checking its provenance. All platform law about spawning, membership, placement and messaging applies to Peer Agents and only to Peer Agents. | +| **Subagent** | Upstream's word, adopted: a worker an agent runs inside its own provider session (Claude Task workers, Codex collab children, Cursor task subagents). The user cannot talk to it, it cannot be moved out of its parent's tree, and it ends with its parent's session. What the user _sees_ of it varies by provider; what never varies is that it is not addressable. The platform cannot control Subagent creation and does not try; it only observes what the provider surfaces. A `delegate_task` child is a delegate, not a Subagent. | +| **delegate** | Upstream's word, adopted: a helper an agent starts with `delegate_task` for one task. It runs as its own thread, on any provider, as a saved persona, or on a linked machine, can have a checkout of its own, and reports its result back to its parent; a person can open it from the parent. Any follow-up is the parent's or the person's call. It is not a participant and messages no one; a helper others need to talk to is a Peer Agent. | +| spawn | The verb for creating any of the three, always qualified — "spawn a Subagent," "start a delegate," "spawn a Peer Agent." Unqualified "spawn" in J5 docs means a Peer Agent. | +| Foreground, Background | The two ends of the human-contact spectrum: a Foreground agent talks with the person through chat often; a Background agent reaches the person only through the inbox or its Captain. Agents can sit in between. Owner: [principles.md](principles.md), the human-contact spectrum lens. | +| **Spawning Guide** | The user-authored guide consulted when spawning: which provider, model and reasoning for which work, and how to write a brief. Owner: [features/spawning-guide.md](features/spawning-guide.md). | ## Communication @@ -101,12 +102,12 @@ These entries are the distinctions the whole team must share; the glossary owns ## Retired names -| Name | Now | -| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| member, guest | Not a concept. A person holds a level at a scope; records before 2026-10-17 use "member" for a person at server scope and "guest" for anyone else | -| grant; View, Collaborate | Not a concept. A person holds a level (Viewer, Collaborator, Owner) at a scope; records before 2026-10-17 say a grant at View or Collaborate | -| share link, join link, open link | One concept: a link, for one person or for many | -| epic, Squadron | Not a concept. A thread's home is its project, with upstream's meaning. Records before 2026-10-05 use "Squadron" ("epic" before 2026-08-17) for a J5 grouping that referenced a project | -| team | Not a concept. Crew is the group that works as a unit; there is no other grouping | -| thread (as the reply obligation) | Exchange. "Thread" means only upstream's conversation | -| delegate_task | On the J5 agent surface as a way to create a subagent, across providers or as a saved persona; it never creates a Peer Agent, and an Exchange carries any later obligation | +| Name | Now | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| member, guest | Not a concept. A person holds a level at a scope; records before 2026-10-17 use "member" for a person at server scope and "guest" for anyone else | +| grant; View, Collaborate | Not a concept. A person holds a level (Viewer, Collaborator, Owner) at a scope; records before 2026-10-17 say a grant at View or Collaborate | +| share link, join link, open link | One concept: a link, for one person or for many | +| epic, Squadron | Not a concept. A thread's home is its project, with upstream's meaning. Records before 2026-10-05 use "Squadron" ("epic" before 2026-08-17) for a J5 grouping that referenced a project | +| team | Not a concept. Crew is the group that works as a unit; there is no other grouping | +| thread (as the reply obligation) | Exchange. "Thread" means only upstream's conversation | +| delegate_task | On the J5 agent surface: it starts a delegate, on another provider, as a saved persona, with a checkout of its own, in the background, or on a linked machine; it never creates a Peer Agent, and an Exchange carries any later obligation | diff --git a/docs/j5/product/upstream-convergence.md b/docs/j5/product/upstream-convergence.md index b755ce6273e26..472756c68570d 100644 --- a/docs/j5/product/upstream-convergence.md +++ b/docs/j5/product/upstream-convergence.md @@ -14,19 +14,19 @@ Checked against `pingdotgg/t3code` stable `v0.1.3` @ `d2c440312e` (upstream `mai Delegated-question routing is unchanged since it was rechecked on 2026-10-20: upstream's [question reactor](https://github.com/pingdotgg/t3code/blob/d2c440312e5f39d59827ed466838a623516454d6/apps/server/src/orchestration-v2/DelegatedTaskQuestionReactor.ts) still resolves parents through delegated tasks and native lineage, leaving J5 placement to J5; v0.1.3 changed only the name of the pending-request tool its guidance points at. - **Upstream:** the orchestrator MCP toolkit can send into another thread, wait on it, interrupt it and launch threads (`t3_thread_send`, `t3_thread_wait`, `t3_thread_interrupt`, `t3_thread_launch`, `create_threads`), answer another thread's pending requests (`t3_pending_request`) and reconfigure it (`t3_thread_configure`). Thread tools reach any thread in the environment. Every tool declares who may call it, including writes that belong to no thread, such as a pull request's review guide. An agent outside the app can sign in to the MCP server with OAuth; a full-access sign-in may also change environment preferences and clone repositories. Messages sent by agents carry `senderThreadId` and render "Sent by another agent" with a link, and a wake the app writes itself, such as a restart continuation, renders as a notice from the app. Agents link threads to the person as `t3-thread://v1/`, and `request_secret` blocks a turn until the person enters a secret privately. A delegated child's question now wakes its parent and ends a blocking wait, and the parent can answer it through the pending-request tools. A message to a finished delegated child starts a fresh task in it that notifies the parent when done. The later [async-question fix](https://github.com/pingdotgg/t3code/pull/15430) adds a blocking hint to pending-request summaries so working agents can keep working; it does not add placement-based parent routing. Revoking a session, or its expiry, closes the sockets it has open. New since the last check: a thread read names the thread that sent each message (`senderThreadId`) and lists linked pull requests; an interrupt an agent started no longer says "by user" in the timeline; a delegated child's result reaches its parent as one queued message instead of a history handoff; and messages from other agents fold into one-line rows. A change that let MCP agents answer another thread's approvals and inspect its diffs landed and was reverted in the same range. New in v0.1.3: 18 tools merged into action tools (`t3_queue`, `t3_pending_request`, `t3_thread_transfer`, `preview_act`; `schedule_task` also updates) and the instructions and tool copy cut by 60%; thread tools return a ready `t3-thread` link; a running delegate or task result tells the agent to end its turn; parents are notified after a delegated child's background run; and delegated children no longer see the pull-request watch tools. `t3_pending_request` still cannot approve a permission request. -- **J5:** a ledger for each project, addressable participants, Exchanges (asks and replies), Inbox and delivery receipts. J5 takes upstream's merged action tools, re-declaring the transfer and queue tools for its own rules. J5 follows upstream's access model, its environment-wide reach and its outside-agent sign-in ([divergence D2](upstream.md)). It still hides upstream's send, wait, interrupt and launch tools; the exact list is pinned by the registration test. An outside agent is a participant in J5's ledger, sends with `j5_send_message` and starts agents with `j5_spawn_agent`, capped by the level approved at its sign-in. A Crew seat asks its Captain rather than the person. Native questions that still arise on J5-spawned Peer Agents or live seats notify their placement parent with upstream-style pending-request guidance; queued notices cancel when the question resolves. Delegated children retain upstream's reactor. Actionable native questions on J5-spawned agents also reach the human Inbox as links to their original thread forms. Pending-request answers follow upstream's mode checks and response records, with no additional parent-only restriction, responder identity or ledger act. Parent agents finish their turns to receive notices; `t3_thread_wait` stays hidden, while upstream's delegated-task wait can return on a blocking question. J5's platform notices are stored as system messages, so upstream's notice label does not reach them. +- **J5:** a ledger for each project, addressable participants, Exchanges (asks and replies), Inbox and delivery receipts. J5 takes upstream's merged action tools, re-declaring the transfer and queue tools for its own rules. J5 follows upstream's access model, its environment-wide reach and its outside-agent sign-in ([divergence D2](upstream.md)). It hides upstream's send and bulk-create tools, admits wait and interrupt (interrupt with J5's Captain rule, in place of `j5_stop_agent`), and admits launch only for link sessions, so a delegate another machine sends here can run; the exact list is pinned by the registration test. An outside agent is a participant in J5's ledger, sends with `j5_send_message` and starts agents with `j5_spawn_agent`, capped by the level approved at its sign-in. A Crew seat asks its Captain rather than the person. Native questions that still arise on J5-spawned Peer Agents or live seats notify their placement parent with upstream-style pending-request guidance; queued notices cancel when the question resolves. Delegated children retain upstream's reactor. Actionable native questions on J5-spawned agents also reach the human Inbox as links to their original thread forms. Pending-request answers follow upstream's mode checks and response records, with no additional parent-only restriction, responder identity or ledger act. Parent agents finish their turns to receive notices; an agent may wait with `t3_thread_wait`, at the cost of the notices queued behind its turn, and upstream's delegated-task wait can return on a blocking question. J5's platform notices are stored as system messages, so upstream's notice label does not reach them. - **Watch for:** reply or ask semantics, an inbox, responder attribution, or delivery guarantees upstream. Routing a child's question to its parent is the first of these, for delegated children only; if upstream does the same for top-level threads an agent started, J5's Crew-seat question rule and Exchanges could sit on top of it. An outside client that can _receive_ messages would be upstream's version of the Inbox. Any of those is the signal to rethink the J5 verbs as a layer on top of upstream's. Two specific candidates: the [approval-answering change](https://github.com/pingdotgg/t3code/pull/15464) landing again, which would let agents answer each other's approvals, and the [cross-environment links stack](https://github.com/pingdotgg/t3code/pull/16653), still 13 open layers with no maintainer approval, whose thread import and handoff between linked servers would overlap peering and J5's delivery across servers. Neither moved in this range: the approval change has not landed again and the links stack is still open. ## Launch, workspaces and parallel agents - **Upstream:** workspace-aware launches (new worktree, existing worktree, project root), configurable branch names with a prefix setting, tracked worktree setup and clone progress. A "No project" (Scratch) project exists in each environment for threads started without one; it is hidden when the server's state lives inside a checkout, which includes every J5 dev worktree. Multi-model send starts the same first message on several models, each in its own worktree, for comparing outputs. `delegate_task` can give a child its own worktree, started from the parent's local commit with project setup run; providers can be turned on or off per project; and storage cleanup can remove settled threads' worktrees, keeping any worktree an active thread still shares, and delete a pull request's branch after it merges or closes. New since the last check: a project can be added to another machine from Run on, copying chosen ignored files, and `delegate_task` merges model options by id and reports the options a child runs with. An app-owned delegated child already has a composer the person can type into; what it lacks is discoverability, because the sidebar and Cmd+K hide it. New in v0.1.3: a thread whose worktree was deleted recovers on the next message, and the instruction to start one child per model is gone. -- **J5:** `j5_spawn_agent` and Crews create Peer Agents with briefs. A spawn joins the caller's project, another project, or upstream's "No project" project, and takes a permission choice within the caller's own and attachments, as upstream's launch does. Every Peer Agent and seat names its workspace: the caller's checkout, an existing worktree, or a new worktree prepared through upstream's ThreadLaunch on a thread J5 has already created and placed; a spawn may also name the project's main checkout. J5 still doesn't expose `t3_thread_launch` or `create_threads`. J5's `delegate_task` takes upstream's worktree option as upstream ships it. Multi-model send is refused from a persona draft, because a persona locks its model. J5 accepts upstream's "No project" project as shipped. +- **J5:** `j5_spawn_agent` and Crews create Peer Agents with briefs. A spawn joins the caller's project, another project, or upstream's "No project" project, and takes a permission choice within the caller's own and attachments, as upstream's launch does. Every Peer Agent and seat names its workspace: the caller's checkout, an existing worktree, or a new worktree prepared through upstream's ThreadLaunch on a thread J5 has already created and placed; a spawn may also name the project's main checkout. J5 doesn't give agents `t3_thread_launch` or `create_threads`; a link session gets launch, to run a delegate another machine sent. `j5_spawn_agent` can start a Peer Agent on another J5 machine, over a link. J5's `delegate_task` takes upstream's worktree option as upstream ships it. Multi-model send is refused from a persona draft, because a persona locks its model. J5 accepts upstream's "No project" project as shipped. - **Watch for:** grouping or coordination of fanned-out threads, which would come close to Crews. A delegated child with its own worktree and its own composer is already a Peer Agent in all but discoverability; if upstream lists delegated children in the sidebar or Cmd+K, the two shapes converge. Launching a thread on another connected environment is being built in the links stack, after a separate attempt was closed in its favor; it would meet `j5_spawn_agent` on a peer server. ## Lineage, subagents and fleet views - **Upstream:** a thread-details panel with a Lineage section, lineage hover cards, one collapsible subagent card per turn, and subagent history in workspace cards. Stop is a command of its own (`thread.stop`): it interrupts the turn, holds the queue, ends pull-request watches and stops the thread's delegated children. Lineage has a Stop control, and `task_cancel` stops a child the same way, now cancelling the child's queued turn too. A breadcrumb leads back to the parent thread; Claude workflows show in Lineage, grouped by phase with their members, and a person or an agent (`t3_workflow_stop`) can stop one without stopping the thread; a native subagent can be stopped without its owner; Muse Code and Copilot subagents get child threads of their own. New since the last check: a rework of Stop in v0.1.1 and v0.1.2 stopped cascading to delegated children, and the target restores the cascade; Stop on a stuck delegate always clears it, and a delegate finishes once leftover background work settles. The sidebar's Waiting status now also covers a thread blocked only on another thread. OpenTelemetry export carries run and resource metrics. Upstream's copy calls the sidebar's active section "the inbox", which is not J5's Inbox. New in v0.1.3: Working holds only background work the agent waits on, and a Claude agent names that work with the new `t3_background_wait`; completed Claude workflows stay reachable; a thread's state shows at the end of its timeline instead of above the composer; devices an agent opens in a background thread show up; and a cold connect skips idle subagent threads and older settled ones. -- **J5:** placement and provenance, the Fleet page, sidebar spawned-children and Crew chips, persona identity on lineage and subagent rows. Upstream's Lineage panel shows none of J5's command relationships. `j5_stop_agent` and Crew stop send upstream's `thread.stop`, which cascades to delegated children again. +- **J5:** placement and provenance, the Fleet page, sidebar spawned-children and Crew chips, persona identity on lineage and subagent rows. Upstream's Lineage panel shows none of J5's command relationships. `t3_thread_interrupt` with `stop: true` and Crew stop send upstream's `thread.stop`, which cascades to delegated children again. - **Watch for:** cross-thread grouping beyond one thread's subagents, or an attention queue across threads. Either would mean upstream is approaching the placement tree, the Fleet page or the Inbox. Claude workflow phases are the first grouping beyond single subagents, still inside one thread. Run metrics exported over OpenTelemetry are a fleet-wide measure outside the app; a view of them in the app would come close to the Fleet page. ## Handoffs and history transfer @@ -88,3 +88,4 @@ Fixes J5 carries that belong upstream are tracked in the give-back backlog. V2 i - 2026-10-24 — agents have upstream's queue tools; edit is held to an agent's own messages (Jackson, [#136](https://github.com/Jacksondr5/j5code/issues/136)). - 2026-10-24 — rewritten against upstream's nightly `v0.1.3-nightly.20261024.3630` (upstream `main`, with stable v0.1.1 and v0.1.2): sender ids on reads, the restored Stop cascade, Waiting on another thread, run metrics, idle compaction, the person-only queue release and the stopping-run steer refusal, which hits J5's GPT 6 steer; plugin skill discovery, webhook filters and dedupe; delegated children's composer named as a discoverability gap; new watches for approval answering, `t3_queue_resume` and the links stack's import, handoff and cross-environment launch. - 2026-10-27 — rechecked against upstream's stable v0.1.3 (396 commits past the nightly): the merged action tools, `t3_background_wait` and Working, the follow-up steer default, the landed resume-fallback fix, Vercel's fx provider; a new section for upstream's guest links, hidden in J5 (D40). +- 2026-11-07 — the agent tools after linked environments: wait and interrupt admitted, `j5_stop_agent` retired, launch for link sessions only, and Peer Agents on another J5 machine (Jackson; [register of divergences](upstream.md), D1, D2 and D42). diff --git a/docs/j5/product/upstream.md b/docs/j5/product/upstream.md index cadb9b7399ad2..86281234f5417 100644 --- a/docs/j5/product/upstream.md +++ b/docs/j5/product/upstream.md @@ -46,29 +46,29 @@ Letter codes in the Decided lines (SC2, QS1, AR3, and so on) are rulings recorde ### Agents and orchestration -#### D1. Help is a Subagent or a Crew member, chosen from the work unless the person names one +#### D1. Help is a subagent, a delegate or a Crew member, chosen from the work unless the person names one -**Upstream:** the instructions every agent receives point it to `delegate_task` for help from another provider, or from a model its own subagent tool can't run, and to `t3_thread_launch` or `create_threads` to start new threads. +**Upstream:** the instructions every agent receives point it to `delegate_task` for help from another provider, or from a model its own subagent tool can't run, for a background agent, and for work on a linked machine, and to `t3_thread_launch` or `create_threads` to start new threads. -**J5:** an explicit request for a Crew, a Peer Agent or a subagent gets that mechanism, and a word mentioned in passing or in quoted text is not a request. When the person asked for none, agents are told to choose among working directly, subagents for independent assignments, and a Crew for work whose workers must respond to each other, from the work, and may reassess mid-work without restarting completed work. There are two ways to get help: create a subagent (their provider's own, or `delegate_task` across providers), or put members on a Crew (`j5_propose_crew` to start one, `j5_request_crew_member` to grow one). `j5_spawn_agent` stays for a user's explicit request for a Peer Agent or a standalone agent they will talk to, and for callers that already use it (outside agents, skills); when nobody asked for one it is not described as a way to get help. `delegate_task` is kept for narrow cases: running a saved persona as a subagent, work on another provider that the person doesn't need to talk to directly, and, as upstream says, a model the provider's own subagent tool can't run or a child that needs a checkout of its own (a worktree started from the parent's local commit). A review that takes several rounds gets a new `delegate_task` call for each round. +**J5:** an explicit request for a Crew, a Peer Agent or a subagent gets that mechanism, and a word mentioned in passing or in quoted text is not a request. When the person asked for none, agents are told to choose among working directly, subagents and delegates for independent assignments, and a Crew for work whose workers must respond to each other, from the work, and may reassess mid-work without restarting completed work. There are two ways to get help: a helper that reports back to its parent, which is either the provider's own **subagent** or a **delegate** started with `delegate_task`, or members on a Crew (`j5_propose_crew` to start one, `j5_request_crew_member` to grow one). A delegate is built for one task. It reports through its parent, a person can open it from the parent, any follow-up is the parent's or the person's call, and it stays out of J5's ledger, so it messages no one. Work an agent hands off and keeps going on is a delegate, as upstream routes it. `delegate_task` covers what the provider's own subagent can't: another provider, or a model the provider's subagent tool can't run; settings beyond the parent's, including a saved persona; a checkout of its own (a worktree started from the parent's local commit); and background work. A delegate can also run on a linked machine, and on a J5 machine a persona delegated there is resolved from that machine's library. A review that takes several rounds gets a new `delegate_task` call for each round. A helper that others need to talk to is a Peer Agent: `j5_spawn_agent` stays for a user's explicit request for a Peer Agent or a standalone agent they will talk to, on this machine or another J5 machine, and for callers that already use it (outside agents, skills); when nobody asked for one it is not described as a way to get help. -**Why:** upstream's delegated child is "a Peer Agent in a Subagent costume": the person can't talk to it, yet it outlives the agent that started it. That is the awkward middle J5's vocabulary exists to remove. The Crew shape was added after an agent asked to "spawn a crew" made subagents instead, because nothing it had been told mentioned a Crew. The rule that the word "crew" decides was narrowed on 2026-10-27: it sent agents to a Crew because the user said "crew", and to a standalone Peer Agent when a subagent would do. An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism again (Jackson, 2026-10-31); the choice from the work applies only when the person asked for none. Personas later gave `delegate_task` a purpose again: a persona needs a way to run as a subagent. +**Why:** J5 first removed `delegate_task` because its child looked like "a Peer Agent in a Subagent costume": the person couldn't talk to it, yet it outlived the agent that started it (2026-08-24). Upstream has since made it a helper for one task: upstream keeps a composer on its thread so a person can write to it, the parent's Stop and `task_cancel` stop it, and upstream's own instructions send each new round to a new delegate. So J5 keeps the line between a helper and a teammate where upstream draws it: a delegate helps its parent with one task, and a teammate others talk to is a Peer Agent (Jackson, 2026-11-06). The Crew shape was added after an agent asked to "spawn a crew" made subagents instead, because nothing it had been told mentioned a Crew. The rule that the word "crew" decides was narrowed on 2026-10-27: it sent agents to a Crew because the user said "crew", and to a standalone Peer Agent when a subagent would do. An explicit request for a Crew, a Peer Agent or a subagent gets that mechanism again (Jackson, 2026-10-31); the choice from the work applies only when the person asked for none. Personas gave `delegate_task` a purpose again: a persona needs a way to run as a helper. **Consequences:** upstream's launch and workspace guidance never reaches J5 agents. `j5_spawn_agent` and Crew seats require their own workspace choice instead, with upstream's `existing_worktree` name and shape beside `shared` and `worktree`, and reuse upstream's ThreadLaunch to prepare a new worktree (#274). A spawn may also name upstream's `root`, the project's main checkout, and may join another project or upstream's "No project" project (#519); a Crew seat stays in its Captain's project with the first three choices. J5's text lives in a J5 folder inside upstream's shared provider package, and the constant upstream exports for its own text points at it. So J5's text reaches every harness that reads that constant: Codex, Claude, Cursor, OpenCode, the ACP agents and Pi, and any provider upstream later moves into a package of its own. Every upstream advance ports upstream's prompt changes into it by hand, and a test pins J5's wording. J5 takes upstream's own sections as upstream writes them: secrets, thread links, showing visuals, the browser, and the `delegate_task` rules above. Since v0.1.3 they are upstream's shorter text, with its rule on settings: a native subagent is right when the child needs no settings beyond the parent's, and only settings the user asked for send a child through `delegate_task`. J5's own description of `delegate_task` is its persona rules followed by upstream's short text; upstream's mechanics (the worktree option, a wait that ends at the child's question, runtime modes, options) are on the input fields J5 reuses. -**Decided:** Jackson with Product, 2026-08-24 (ST1–ST5); the Crew shape on 2026-09-17; the persona route in Jackson's review of 2026-09-13, which partly reverses ST5; the sections taken from upstream by Jackson, 2026-10-08; the text's home in the shared package, so that Pi and later provider packages get it, by Jackson, 2026-10-09; the worktree rule ported at the 2026-10-17 advance; the choice from the work and the two ways to get help by Bryant, 2026-10-27 ([#746](https://github.com/Jacksondr5/j5code/issues/746)). Whether `delegate_task` stays at all is under discussion (#336). Recorded in FORK.md case 8 and the saved-agent mentions section. +**Decided:** Jackson with Product, 2026-08-24 (ST1–ST5); the Crew shape on 2026-09-17; the persona route in Jackson's review of 2026-09-13, which partly reverses ST5; the sections taken from upstream by Jackson, 2026-10-08; the text's home in the shared package, so that Pi and later provider packages get it, by Jackson, 2026-10-09; the worktree rule ported at the 2026-10-17 advance; the choice from the work and the two ways to get help by Bryant, 2026-10-27 ([#746](https://github.com/Jacksondr5/j5code/issues/746)); delegates as one-task helpers, kept for what the provider's own subagent can't do, which settles #336, and personas delegated to another J5 machine, by Jackson, 2026-11-06 and 2026-11-07 ([record](../worklog/2026-11-07-agent-tool-boundary-session.md)). Recorded in FORK.md case 8 and the saved-agent mentions section. #### D2. Agents see a fail-closed subset of upstream's MCP tools **Upstream:** agents can send into another thread, interrupt it, wait on it, launch threads, and create threads in bulk. Every tool declares who may call it. Thread tools reach any thread in the environment, not only the caller's project. An agent outside the app can sign in to the MCP server and use the tools that don't need a calling thread; a full-access sign-in may also change environment preferences and clone repositories. -**J5:** the raw send, interrupt, wait, launch and bulk-create tools are hidden from agents, with upstream's project delete. Everything else follows upstream: its access model, its reach across the environment (writes included), and its outside-agent sign-in as shipped. J5's own tools declare their access the same way. An outside agent uses J5's tools with an identity in J5's ledger: it lists participants, sends plain messages, stops agents and starts them. The tools that need a thread for something to come back to stay refused to it, each with an error that names what it can do instead. J5 rewrites the few descriptions that would mislead J5 agents, and reviews every new upstream tool at each advance. Upstream's queue tool, `t3_queue`, is kept with one J5 rule: its `edit` action edits only a queued message the agent sent, and the new text of a J5 message goes inside its envelope. Cancel, reorder and promote work on any queued message, as upstream ships them. +**J5:** the raw send and bulk-create tools are hidden from agents, with upstream's project delete. Upstream's launch tool is hidden from agents on the machine and admitted only for link sessions, the sessions another machine's server opens, because upstream's remote delegation launches a delegate through it. Upstream's wait and interrupt tools are admitted to agents and to link sessions; J5 re-declares interrupt with one rule of its own, that a Captain may stop its own seats whatever their access, and interrupt with `stop: true` is how an agent stops another. Everything else follows upstream: its access model, its reach across the environment (writes included), and its outside-agent sign-in as shipped. J5's own tools declare their access the same way. An outside agent uses J5's tools with an identity in J5's ledger: it lists participants, sends plain messages, stops agents and starts them. The tools that need a thread for something to come back to stay refused to it, each with an error that names what it can do instead. J5 adds personas and refusals to upstream's tools under upstream's names, and gives a tool a J5 name only when J5 changes what it means; it rewrites the few descriptions that would mislead J5 agents, and reviews every new upstream tool at each advance. Upstream's queue tool, `t3_queue`, is kept with one J5 rule: its `edit` action edits only a queued message the agent sent, and the new text of a J5 message goes inside its envelope. Cancel, reorder and promote work on any queued message, as upstream ships them. -**Why:** J5 built its own versions of the hidden tools, integrated with J5's model: `j5_send_message` and Exchanges instead of raw send, `j5_stop_agent` instead of interrupt, and `j5_spawn_agent` and `j5_propose_crew` instead of launch. A raw send is communication the ledger can't see, so a reply that never comes stalls silently. Raw thread creation skips the placement a spawn records. Waiting on another thread blocks the turn that would receive that thread's news. Placed agents report questions and completion through notices instead; a parent ends its turn to receive them. Upstream's delegated-task wait is a separate path that can return on a blocking child question. The tools are hidden, not deleted, to keep the fork's edits small. J5 used to hold thread tools to the caller's project as upstream did; upstream dropped that rule and J5 had no reason of its own to keep it. +**Why:** J5 owns how agents talk and who they are; upstream owns starting delegates, stopping, waiting and acting on another machine. So J5 keeps its own versions where its model is the point: `j5_send_message` and Exchanges instead of raw send, and `j5_spawn_agent` and `j5_propose_crew` instead of launch. A raw send is communication the ledger can't see, so a reply that never comes stalls silently. Raw thread creation skips the placement and brief a spawn records. Interrupt was hidden while it could only end a turn; since upstream gave it `stop: true`, the full Stop, `j5_stop_agent` had nothing of its own left but the Captain's exemption, which J5 keeps on upstream's tool. Wait was hidden because a turn that blocks can't take the messages queued behind it; upstream's wait is bounded and upstream itself steers agents to end their turn, so the worst case is a wasted wait, and two agents waiting on each other is a case for the live tests. Placed agents still report questions and completion through notices; a parent that ends its turn receives them. A link session needs launch, wait and interrupt to run a delegate another machine sent here, and the reasons for hiding them were about agents in a thread. The tools are hidden, not deleted, to keep the fork's edits small. J5 used to hold thread tools to the caller's project as upstream did; upstream dropped that rule and J5 had no reason of its own to keep it. -**Consequences:** upstream's toolkit stays compiled, with part of it unused. A test pins the exact tool list, so a tool upstream adds fails the build until someone reviews it; all ten that arrived on 2026-10-08 were admitted (HTML previews, `request_secret`, five more browser controls and pull-request watches), and so were the three that arrived on 2026-10-17 (stopping one Claude workflow, and writing and reading pull-request review guides). At v0.1.3 upstream merged 18 of its tools into action tools (pingdotgg/t3code#25423): fork, merge back and transfer status into `t3_thread_transfer`, the queue tools into `t3_queue`, the pending-request tools into `t3_pending_request`, reading and setting a thread's configuration into `t3_thread_configure`, schedule updates into `schedule_task`, and eight browser controls into `preview_act`. J5 re-declares the merged transfer and queue tools to keep its own rules and takes the rest as merged, so the list went from 99 tools to 82. v0.1.3's one new tool, `t3_background_wait`, which keeps a Claude thread Working while background work it names runs, is admitted. Each advance also checks J5's access declarations and re-reads upstream's descriptions. An outside agent is a participant in J5's ledger for each sign-in, named by the label its client registered ([agent-to-agent communication](a2a/index.md)). It sends through `j5_send_message`, because upstream's send from an outside client lands as bare text with no sender named, and the receiving agent can't tell it from the person. Nothing can be delivered to it. The level the person approved at sign-in caps everything it does: every send is checked against it, one that asks for no steer or restart included, and so is every stop. The check happens when the call is made. Revoking a sign-in stops new calls, and a message already sent is still delivered. A thread sender is checked only when it steers or restarts, because the person watches a thread and chose its modes. The sign-in level is different. It is a promise the approval page makes about an agent the person does not watch, so J5 holds it on every act. An outside agent reaches this server only; for a peer server it signs in there. It starts agents with `j5_spawn_agent`, in a project it names and at the top level of that project, because upstream's launch records no spawner. The level caps a spawn as well, a persona's policy included. A thread caller's persona spawn has no such ceiling. `delegate_task` and the playbook tools, reads included, are J5's own declarations, and they refuse an outside agent with the same kind of error: it names starting an agent with `j5_spawn_agent` and briefing it. `t3_pending_request` (its `respond` action) and `t3_thread_configure` act on other threads under upstream's own checks, which settles #345 as "follow upstream". Native-question responses keep upstream's answer and resolution records without adding responder identity or a J5 ledger act. Placement selects the recipient of a question notice; it does not add answer permissions or restrict answering to a parent. One J5 rule stays on top of upstream's: a Crew seat can't be archived alone (D13). Upstream's project create and update and its environment preferences tool were hidden with no J5 reason on record, probably left from when Squadrons existed; they are admitted as upstream ships them. Project delete stays hidden until J5 settles what deleting a project does to the state it keeps for each project (#552). One admitted tool's description named a tool J5 hides; J5 edits that sentence in place (`t3_worktree_handoff` points at `j5_spawn_agent`). Upstream's `thread` CLI command (`start`, `send`, `show` and `list`) drives the launch, send and wait tools J5 hides, so the `j5` CLI doesn't register it; bringing it back is #695. Upstream lets anyone who can write to a thread edit any queued message in it. J5 holds an agent to its own messages, because an envelope names the sender and an edit by anyone else would put words in that sender's mouth; a person still edits any queued message, as upstream allows. J5's ledger follows every edit to a queued agent message, a person's included, so a removed message's notice can say who changed it. +**Consequences:** upstream's toolkit stays compiled, with part of it unused. A test pins the exact tool list, so a tool upstream adds fails the build until someone reviews it; all ten that arrived on 2026-10-08 were admitted (HTML previews, `request_secret`, five more browser controls and pull-request watches), and so were the three that arrived on 2026-10-17 (stopping one Claude workflow, and writing and reading pull-request review guides). At v0.1.3 upstream merged 18 of its tools into action tools (pingdotgg/t3code#25423): fork, merge back and transfer status into `t3_thread_transfer`, the queue tools into `t3_queue`, the pending-request tools into `t3_pending_request`, reading and setting a thread's configuration into `t3_thread_configure`, schedule updates into `schedule_task`, and eight browser controls into `preview_act`. J5 re-declares the merged transfer and queue tools to keep its own rules and takes the rest as merged, so the list went from 99 tools to 82. v0.1.3's one new tool, `t3_background_wait`, which keeps a Claude thread Working while background work it names runs, is admitted. Each advance also checks J5's access declarations and re-reads upstream's descriptions. An outside agent is a participant in J5's ledger for each sign-in, named by the label its client registered ([agent-to-agent communication](a2a/index.md)). It sends through `j5_send_message`, because upstream's send from an outside client lands as bare text with no sender named, and the receiving agent can't tell it from the person. Nothing can be delivered to it. The level the person approved at sign-in caps everything it does: every send is checked against it, one that asks for no steer or restart included, and so is every stop. The check happens when the call is made. Revoking a sign-in stops new calls, and a message already sent is still delivered. A thread sender is checked only when it steers or restarts, because the person watches a thread and chose its modes. The sign-in level is different. It is a promise the approval page makes about an agent the person does not watch, so J5 holds it on every act. An outside agent reaches this server only; for a peer server it signs in there. It starts agents with `j5_spawn_agent`, in a project it names and at the top level of that project, because upstream's launch records no spawner. The level caps a spawn as well, a persona's policy included. A thread caller's persona spawn has no such ceiling. `delegate_task` and the playbook tools, reads included, are J5's own declarations, and they refuse an outside agent with the same kind of error: it names starting an agent with `j5_spawn_agent` and briefing it. `t3_pending_request` (its `respond` action) and `t3_thread_configure` act on other threads under upstream's own checks, which settles #345 as "follow upstream". Native-question responses keep upstream's answer and resolution records without adding responder identity or a J5 ledger act. Placement selects the recipient of a question notice; it does not add answer permissions or restrict answering to a parent. One J5 rule stays on top of upstream's: a Crew seat can't be archived alone (D13). Upstream's project create and update and its environment preferences tool were hidden with no J5 reason on record, probably left from when Squadrons existed; they are admitted as upstream ships them. Project delete stays hidden until J5 settles what deleting a project does to the state it keeps for each project (#552). One admitted tool's description named a tool J5 hides; J5 edits that sentence in place (`t3_worktree_handoff` points at `j5_spawn_agent`). Upstream's `thread` CLI command (`start`, `send`, `show` and `list`) drives the launch and send tools J5 hides from agents, so the `j5` CLI doesn't register it; bringing it back is #695. A thread a link session launches for another machine's delegate carries `delegatedFrom` and stays out of J5's ledger, as every delegate does. Upstream's fence on work started through a link below Full access refuses J5's own write tools too, and its refusal names scheduled tasks; J5 words it for its own tools. Upstream lets anyone who can write to a thread edit any queued message in it. J5 holds an agent to its own messages, because an envelope names the sender and an edit by anyone else would put words in that sender's mouth; a person still edits any queued message, as upstream allows. J5's ledger follows every edit to a queued agent message, a person's included, so a removed message's notice can say who changed it. -**Decided:** Jackson, 2026-08-29 (substrate session). Omitting bulk creation was a Director disposition (an agent role), 2026-08-31. Withdrawing `t3_thread_wait` was Bryant's decision, 2026-09-14. `delegate_task` returned after Jackson's review of 2026-09-13. Following upstream's access model, its environment-wide reach and its outside-agent sign-in, and admitting the ten new tools, is Jackson's decision of 2026-10-08. Admitting project create, project update and the environment preferences tool is Jackson's decision of 2026-10-11 (#519). Giving an outside agent a ledger identity, and capping all it does at its sign-in level, is Jackson's decision of 2026-10-11 (#498). Admitting `t3_workflow_stop`, `write_pull_request_guides` and `read_pull_request_guide` is Jackson's decision of 2026-10-17. Admitting the four queue tools, with edit held to an agent's own messages, is Jackson's decision of 2026-10-24 (#136). Leaving out the `thread` CLI command is Jackson's decision of 2026-10-24. Taking upstream's merged action tools follows the 2026-10-24 decisions on the tools they replace; Jackson admitted `t3_background_wait` on 2026-10-27. Recorded in FORK.md cases 2, 4 and 38. +**Decided:** Jackson, 2026-08-29 (substrate session). Omitting bulk creation was a Director disposition (an agent role), 2026-08-31. Withdrawing `t3_thread_wait` was Bryant's decision, 2026-09-14; admitting it and `t3_thread_interrupt` again, retiring `j5_stop_agent` for interrupt with J5's Captain rule, admitting launch for link sessions only, and the naming rule are Jackson's decisions of 2026-11-06 and 2026-11-07 ([record](../worklog/2026-11-07-agent-tool-boundary-session.md)). `delegate_task` returned after Jackson's review of 2026-09-13. Following upstream's access model, its environment-wide reach and its outside-agent sign-in, and admitting the ten new tools, is Jackson's decision of 2026-10-08. Admitting project create, project update and the environment preferences tool is Jackson's decision of 2026-10-11 (#519). Giving an outside agent a ledger identity, and capping all it does at its sign-in level, is Jackson's decision of 2026-10-11 (#498). Admitting `t3_workflow_stop`, `write_pull_request_guides` and `read_pull_request_guide` is Jackson's decision of 2026-10-17. Admitting the four queue tools, with edit held to an agent's own messages, is Jackson's decision of 2026-10-24 (#136). Leaving out the `thread` CLI command is Jackson's decision of 2026-10-24. Taking upstream's merged action tools follows the 2026-10-24 decisions on the tools they replace; Jackson admitted `t3_background_wait` on 2026-10-27. Recorded in FORK.md cases 2, 4 and 38. #### D3. J5's tools are pre-approved on Codex and Claude only @@ -126,9 +126,9 @@ Letter codes in the Decided lines (SC2, QS1, AR3, and so on) are rulings recorde **Why:** the lists are one decision that custom Crew seats, `j5_spawn_agent` and `delegate_task` all follow ([Crews](features/crews.md), AC27, AC30). The wrapper cannot see the model or level a child inherits, so the check needs the one place that resolves it. -**Consequences:** one optional input and four lines in `OrchestratorMcpService.ts` (FORK.md case 107), with no change to upstream's behavior when no hook is passed. The reasoning levels are a second setting key beside the models one in `packages/contracts/src/settings.ts`, in the same five places, and need no further upstream edit. Check at each advance that the call still sits after the target resolves and before the command is dispatched. `t3_thread_launch` and `create_threads`, which J5 hides from agents, are not checked. The lists hold when an agent is created and not afterwards: `t3_thread_configure` sets any thread's model and options with only a thread-write check, so a later model or reasoning change is not limited. +**Consequences:** one optional input and four lines in `OrchestratorMcpService.ts` (FORK.md case 107), with no change to upstream's behavior when no hook is passed. The reasoning levels are a second setting key beside the models one in `packages/contracts/src/settings.ts`, in the same five places, and need no further upstream edit. Check at each advance that the call still sits after the target resolves and before the command is dispatched. `t3_thread_launch` and `create_threads`, which J5 hides from agents, are not checked. The lists hold when an agent is created and not afterwards: `t3_thread_configure` sets any thread's model and options with only a thread-write check, so a later model or reasoning change is not limited. A delegate sent to a J5 machine from another machine is launched there through upstream's launch tool, by a link session; J5's version of that launch for link sessions holds a plain delegate to the target machine's own lists, and resolves a persona delegate from the target's library against its models. A persona is passed to the other machine through one J5 edit in upstream's remote delegation. -**Decided:** Bryant, 2026-10-27 ([#744](https://github.com/Jacksondr5/j5code/issues/744)). Recorded in FORK.md case 107. +**Decided:** Bryant, 2026-10-27 ([#744](https://github.com/Jacksondr5/j5code/issues/744)); delegates on another J5 machine by Jackson, 2026-11-07 ([record](../worklog/2026-11-07-agent-tool-boundary-session.md)). Recorded in FORK.md case 107. #### D43. A thread can keep a message the platform wrote without a run @@ -658,3 +658,4 @@ J5 kept a run from resuming after a usage-limit reset when the person had presse - 2026-10-27 — D1: when the person asked for none, agents choose between working directly, subagents and a Crew from the work, and get help in two ways, a subagent or a Crew member; an explicit request for a Crew, a Peer Agent or a subagent still gets that mechanism; `j5_spawn_agent` is described as for a Peer Agent the user asks for, not as a way to get help (Bryant, with Jackson's 2026-10-31 decision; [#746](https://github.com/Jacksondr5/j5code/issues/746)). - 2026-10-31 — D43 added: a thread can keep a message the platform wrote without a run, so a Crew member's introduction and roster changes show in its own thread (Jackson, 2026-10-31). - 2026-11-02 — D38 now covers J5's platform notices and prompts, built on web ([#698](https://github.com/Jacksondr5/j5code/issues/698)); the raw card is retired. Upstream's platform messages stay on upstream's own rows, since upstream no longer draws them as user messages (Jackson, 2026-10-24 and 2026-10-31; Captain's call on the build, Jackson told). +- 2026-11-07 — the agent tools after linked environments: D1 names delegates beside subagents, keeps `delegate_task` for what the provider's own subagent can't do (settling #336) and lets a persona be delegated to another J5 machine; D2 admits `t3_thread_wait` and `t3_thread_interrupt`, retires `j5_stop_agent` for interrupt with J5's Captain rule, admits launch for link sessions only, keeps delegates launched from another machine out of the ledger, and replaces the naming rule; D42 holds a delegate on another J5 machine to that machine's lists (Jackson, 2026-11-06 and 2026-11-07; [record](../worklog/2026-11-07-agent-tool-boundary-session.md)). diff --git a/docs/j5/user/personas.md b/docs/j5/user/personas.md index 4fdc54c43e3ea..f5093ec82fb19 100644 --- a/docs/j5/user/personas.md +++ b/docs/j5/user/personas.md @@ -50,7 +50,7 @@ To edit an imported or personal persona, choose **Edit** from its row's **⋯** To invoke a persona in Codex or Claude, type **@** in the composer and select a persona, or type `@persona:` directly. For example: `@persona:scout review the authentication flow`. Available personas come from the current environment. You can remove a selection by deleting its mention before sending. -The selected persona runs as a subagent under the current conversation and returns its result there. It uses its saved instructions, ordered model list, reasoning, and access level, even if its model uses a different provider from the parent. It cannot broaden the parent’s permissions. Running subagents keep their saved definition when the library changes. Crews and new-task crew launches are not part of persona invocation. +The selected persona runs as a delegate under the current conversation and returns its result there. It uses its saved instructions, ordered model list, reasoning, and access level, even if its model uses a different provider from the parent. It cannot broaden the parent’s permissions. Running delegates keep their saved definition when the library changes. Crews and new-task crew launches are not part of persona invocation. An agent can also start a persona as a peer with its own top-level task by naming it in a spawn. The peer keeps the persona's instructions and access level, and the spawning agent must match one of the persona's declared provider instances and models. A declared reasoning level must match; when the entry leaves reasoning unspecified, the spawner can choose a supported level. Models without a reasoning option omit it. The peer runs with its own persona's permissions, not the spawning agent's. Spawning is not limited by the spawning agent's own access, so a persona set to Full access can be started this way without asking you whenever the spawning agent's provider doesn't ask first: on Claude in any access mode, and on Codex when the spawning agent runs with Full access or as a persona. A Codex conversation in Supervised mode asks you to allow the spawn. The library marks Full access personas. diff --git a/docs/j5/worklog/2026-11-07-agent-tool-boundary-session.md b/docs/j5/worklog/2026-11-07-agent-tool-boundary-session.md new file mode 100644 index 0000000000000..5bd10638cf26b --- /dev/null +++ b/docs/j5/worklog/2026-11-07-agent-tool-boundary-session.md @@ -0,0 +1,57 @@ +--- +title: "Agent tool boundary session (2026-11-07)" +kind: record +--- + +# Agent tool boundary session (2026-11-07) + +Jackson and an agent (Claude Opus 5.5) settled which of J5's agent tools stay J5's and which follow upstream, now that upstream v0.1.7 brings linked environments. The session ran over 2026-11-06 and 2026-11-07. Its outcome is register entries D1, D2 and D42 in [J5 and upstream](../product/upstream.md), the [agent tool surface](../product/a2a/agent-tools.md), the [substrate](../product/a2a/substrate.md), the [A2A definition](../product/a2a/index.md), [Cross-device](../product/cross-device.md) and the [glossary](../product/glossary.md). Those are the place to read what is current; this record is how the session got there. + +## What prompted it + +The advance to upstream v0.1.7 left one decision open: whether a delegation from one J5 machine to another should work. Upstream's `delegate_task` to a linked machine calls that machine's `t3_thread_launch`, `t3_thread_read`, `t3_thread_wait` and `t3_thread_interrupt`, and J5 hid launch, wait and interrupt, so the call failed with `Tool 't3_thread_launch' not found`. Jackson deferred it on 2026-11-05 because "these tools are something we're still deciding on for other things". He then asked to resolve the wider tension between J5's and upstream's tools for spawning, managing and messaging agents, starting from the foundations. + +## Earlier rulings it built on + +- 2026-08-24: `delegate_task` removed as "a Peer Agent in a Subagent costume" (spawn terminology session). +- 2026-08-29: upstream's send, interrupt, wait and launch hidden from agents (substrate session). +- 2026-09-13 and 2026-09-17: `delegate_task` back for personas and for work on another provider. +- 2026-10-11 and 2026-10-12: the per-tool evaluation in #519 kept J5's spawn, send and stop and kept `delegate_task` as it was. +- 2026-10-18: Jackson proposed "upstream owns spawning (possibly with us adding some code), we own A2A", and wanted agents to spawn on remote machines; parked on 2026-10-19 until upstream's links settled. +- 2026-11-05: linked environments adopted as shipped, with no fork cases "to shut down upstream's functionality for the sake of the rule". + +## What was found + +From reading upstream at v0.1.7 (`322f6544df`) and `main`, and J5 at `j5/main`. Nothing was run. + +- J5's tools already run on upstream's engine underneath: `j5_send_message` delivers through upstream's send, J5's stop sends upstream's Stop, and a spawn's worktree is prepared by upstream's launch code. What ran in parallel was the tool the agent sees, plus J5's records. +- v0.1.7 gave `t3_thread_interrupt` a `stop: true` option, upstream's full Stop, the same act `j5_stop_agent` sent. +- Upstream now tells its own agents not to wait on delegates ("Completion wakes this thread, so end your turn"), bounds `t3_thread_wait` at ten minutes by default, and forbids `t3_thread_send` for a new review round. +- Upstream's instructions and evals settle the choice between a native subagent, `delegate_task` and launch with two questions: did the person ask for a thread to talk to, and can the native tool do it. J5's instructions already used the same two, with `j5_spawn_agent` in launch's slot. +- A `delegate_task` child keeps a composer in upstream's app; only a provider's own subagent loses it. +- Upstream's general forwarding to a linked machine passes a call on unchanged, so the other machine can't tell which agent asked. A Peer Agent started there needs J5's own path, as upstream's remote delegation has its own. +- J5's fork placement record comes from the 2026-08-29 Fleet tree design, not from Squadrons. +- Archiving an agent never archived the Peer Agents beneath it (2026-09-22); only a Captain's Crews go with it. + +## Rulings + +- **The line.** J5 owns who agents are and how they talk, making J5 machines reach each other and messaging across them, Crews, and personas as a parameter. Upstream owns delegates, stopping, waiting, thread housekeeping, scheduling and acting on another machine. Jackson's first draft gave J5 "all cross-server stuff"; it narrowed to messaging across machines once links were kept as upstream's. He accepted the line as one that may move as tools are taken one by one. +- **Background helpers and delegates.** Work an agent hands off and keeps going on is a delegate, as upstream routes it. A delegate is built for one task and any follow-up is its parent's or the person's call; it stays out of the ledger. A helper others need to talk to is a Peer Agent. This settles #336: keep `delegate_task`. The docs call a `delegate_task` child a delegate (#952). +- **Peer Agents stay on `j5_spawn_agent`.** On 2026-11-06 Jackson first accepted wrapping upstream's `t3_thread_launch` with J5's additions. On 2026-11-07 he reversed it: a Peer Agent on another machine needs J5's own path anyway, so the case for wrapping launch was gone, and Peer Agents are J5's. `j5_spawn_agent` gains a way to start one on another J5 machine. Its workspace stays required; Jackson will think through workspaces separately. +- **Stopping.** `t3_thread_interrupt`, addressed by thread id, with `stop: true` as the full Stop. J5 keeps one rule on it: a Captain may stop its own seats whatever their access. `j5_stop_agent` retires. +- **Wait and interrupt** are admitted to agents and link sessions; launch only to link sessions; send stays hidden. Jackson wants a live test of a couple of models' use of wait after `j5_stop_agent` retires. +- **Remote delegates** follow upstream, with J5 extensions Jackson approved even though they edit upstream code, because they extend J5 rather than polish upstream: a persona can be delegated to another J5 machine, and a plain delegate there is held to that machine's model lists. +- **Naming rule.** J5 adds personas and refusals to upstream's tools under upstream's names, and gives a tool a J5 name only when J5 changes what it means. It replaces #519's rule, which `delegate_task` already broke. +- **Crews across machines** are the natural next step after a single agent crossing, filed as #953. + +## The adversarial review + +A second model (GPT-6.1 Sol) reviewed the rulings with only the rulings and the code in hand. It found nine holes. Jackson set two standing limits on such findings: security and forgery are not design considerations, because J5 runs on a closed, trusted network and "this is not a product we can apply a lot of security against, due to the nature of AI"; and a finding that is upstream's own design is not J5's to fix. With those applied: + +- Dropped: a link session's self-declared identity could forge a spawner or `delegatedFrom`; a link carries only modes, for remote delegates; upstream's remote delegation refuses a separate worktree; choosing a machine contradicts cross-device AC16 (already relaxed on 2026-11-05). +- Decided: the Captain's stop exemption is kept on J5's version of interrupt; a spawner on another machine is recorded as an outside agent's is, with no cascade either way; a persona may be delegated to another machine; the workspace stays required. +- Build requirements: one retry key and routes on both machines for a cross-machine spawn; the caller's own access travels with it; two agents waiting on each other joins the wait test. + +## Related + +#951, the reverse route, would let a VM reach a laptop that can't be reached, so starting work on another machine would work in both directions; until then it works only towards a machine the caller can reach. The cross-machine Peer Agent build and its order relative to the v0.1.7 merge were left for the sequencing discussion.