diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ff50ce3..d37f313 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ "name": "pstack", "source": "./plugins/pstack", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", - "version": "0.17.3", + "version": "0.17.4", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" }, diff --git a/package.json b/package.json index 1031010..bb66dae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "t3-pstack", - "version": "0.17.3", + "version": "0.17.4", "private": true, "type": "module", "scripts": { diff --git a/plugins/pstack/.claude-plugin/plugin.json b/plugins/pstack/.claude-plugin/plugin.json index 42b4cdd..0156a20 100644 --- a/plugins/pstack/.claude-plugin/plugin.json +++ b/plugins/pstack/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "pstack", "displayName": "pstack", - "version": "0.17.3", + "version": "0.17.4", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" diff --git a/plugins/pstack/.codex-plugin/plugin.json b/plugins/pstack/.codex-plugin/plugin.json index b619214..b47b4e8 100644 --- a/plugins/pstack/.codex-plugin/plugin.json +++ b/plugins/pstack/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "pstack", - "version": "0.17.3", + "version": "0.17.4", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" diff --git a/plugins/pstack/skills/poteto-mode/references/t3-adapter.md b/plugins/pstack/skills/poteto-mode/references/t3-adapter.md index acbb488..7aca67d 100644 --- a/plugins/pstack/skills/poteto-mode/references/t3-adapter.md +++ b/plugins/pstack/skills/poteto-mode/references/t3-adapter.md @@ -40,7 +40,7 @@ poteto-mode's kickoff line `Read /worker.md before anything else.` is the | A Cursor Project, its coordinator, a Project worker | The coordinator is the root thread. A Project worker is a `delegate_task` lane like any `Task` subagent. | | `readonly: true` | The brief says read-only, and the lane reads a frozen SHA (Worktrees section). | | `run_in_background: true`, waiting on the result | Async is the default. A running task's result carries `next`: its completion wakes you. Continue other work, and end the turn when none is left. Do not poll, and never call `task_status` on a running task before that wake. "The Task response body" is the task `summary`. | -| Resume, message, or queue a follow-up | A new round is a new `delegate_task` with the full consolidated brief and a new `clientRequestId`. Never `t3_thread_send` a new round to `childThreadId`. Send to the child only for upstream's narrow case: state that lives in that child. A live child takes `mode: "queue"` or `"steer"`. A child whose task finished can still take a send, for example when its worktree holds uncommitted changes. When the send returns a `taskId`, record it, and its completion wakes you. A queued or restarted follow-up gets its own task. A steer returns the task of the turn it joins, which you may already track, and none when that turn has no task. | +| Resume, message, or queue a follow-up | A new round is a new `delegate_task` with the full consolidated brief and a new `clientRequestId`. Never `t3_thread_send` a new round to `childThreadId`. Send to the child only for upstream's narrow case: state that lives in that child. A live child takes `mode: "queue"` or `"steer"`. A child whose task finished can still take a send, for example when its worktree holds uncommitted changes. When the send returns a `taskId`, record it, and its completion wakes you. A queued or restarted follow-up gets its own task. A steer returns the task of the turn it joins, which you may already track, and none when that turn has no task. To get the child's answer as data, pass a JSON Schema as `outputSchema`. T3 queues that send instead of steering it and has the child return the result with `t3_submit_output`. When the completion wakes you, read `output` with `t3_thread_wait` and the send's `runId`. A run that ended without submitting has no `output`. | | Stop, hold, cancel nested subagents | `task_cancel` (it stops nested tasks and their PR watches). A hold is a `t3_thread_send` with `mode: "steer"` and the zero-writes order. | | Liveness, the Cursor dashboard, recorded subagent IDs | Record `taskId` and `childThreadId` where upstream records subagent IDs, including each `taskId` a follow-up send returns. Probe a running child, such as on an audit tick, with `t3_thread_read` on its `childThreadId`: `status`, `updatedAt`, its latest activity, and `pendingRequestCount`. `pendingBackgroundTasks` lists work a child still waits on after its run ended, such as a subagent or a command marked `awaited: true`, and `blockedOnThreadWait` is true while its run only waits on another thread. A task whose `status` is `starting` has a child whose provider has not begun its turn, so no work has started. None of these means the child is stuck. A pending request is a question (Questions section) or an approval, and neither wakes you. You cannot grant an approval. Ask the user to approve or deny it in the child's thread, named by the `link` the task returned. | | Eval blinding | Also blind the `title` and the worktree path, which the child can see. | @@ -82,7 +82,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **A linked environment stands in for a cloud VM.** `t3_environment_links` lists the user's other machines, when T3's Labs beta for them is on. Run a lane that upstream sends to the cloud on a link whose `status` is `reachable` and whose `access` is `auto` or `full-access`, because a narrower link makes the user approve the child's tool calls by hand. Never call `t3_environment_link` unless the user names a machine to link, because it asks the user to approve the link. Delegate with `target.environmentId`, and resolve the role's model with `orchestrator_capabilities` given that `environmentId`. The task runs in that machine's checkout of the repository and takes no `isolation` or attachments, so only pushed commits reach it. When `delegate_task` finds no project for the repository there, run the lane here. Push the base first. The brief tells the child to fetch it, run `git worktree add ${TMPDIR:-/tmp}/pstack/// ` there, and work only in that worktree. The child pushes its branch, returns its evidence in its report, and then removes the worktree. A lane that needs this machine, such as a control skill run, a simulator, local transcripts, auth that exists only here, or the work dir, stays local. Name each remote lane's machine in the reply. - **A lane that drives a simulator or emulator gets its own device.** Pick one per lane from your `device_list`, and put its `hostId` and `id` in the brief, as T3's device instructions say, plus its `booted` value. Do this for every lane that may drive a device, such as an interrogate adversary or a Shipping verifier. A lane never creates a simulator for itself, because `device_open` refuses an id that `device_list` does not show, and a new simulator can stay off that list for a minute or more. When a lane needs a new simulator, create it yourself and put it in the brief once `device_list` shows it. Two lanes never share a device, so device lanes beyond the free devices run in sequence. Call `device_close` on a device you opened yourself before you give it to a lane, because your open session locks the lane out. Before it returns, the lane calls `device_close` on its device, with `shutdown: true` when it was not booted, so the next lane can open it and no idle simulator holds CPU. A lane that ends without that call, such as a lane you cancel, can leave its device locked. When a lane reports `DEVICE_IN_USE`, do not wait for the other session. Give the lane a different device, and prefer one that `device_list` shows as not booted. - **Upstream's capacity numbers assume cloud VMs.** Cap in-flight writing lanes at what this machine and each linked machine you use can run. Give each live lane its own ports and data directories per the project's verification skill. If the app cannot run side by side, run those lanes in sequence. A push that runs a pre-push gate waits while a lane drives the shared VM, simulator, or app. -- **Separate top-level threads** come only from an explicit user request for them. Then use `t3_thread_launch` with a `workspaceStrategy`. A launched thread is not a task: follow it with `t3_thread_read` or `t3_thread_wait`, never `task_status`, and it does not wake you when it ends. `t3_thread_wait` with `untilDelegatedWorkSettled: true` also waits for the tasks that thread delegated, and its `resultRun` names the run that holds the final answer. +- **Separate top-level threads** come only from an explicit user request for them. Then use `t3_thread_launch` with a `workspaceStrategy`. A launched thread is not a task: follow it with `t3_thread_read` or `t3_thread_wait`, never `task_status`, and it does not wake you when it ends. `t3_thread_wait` with `untilDelegatedWorkSettled: true` also waits for the tasks that thread delegated, and its `resultRun` names the run that holds the final answer. To get the thread's answer as data, launch it with `message` and an `outputSchema`, then read `output` from `t3_thread_wait` with `untilOutput: true`. `generateTitle: true` has T3 name the thread from `message` the way the app does. `title` is still required. - **Listing worktrees.** `t3_worktree_status` reports only your own thread. To audit every worktree, use `t3_worktree_list`, `t3_thread_list`, and `t3_thread_read` per thread for its `worktreePath`. `t3_thread_list` with `allProjects: true` lists every project's threads in one call, and each item names its `projectId`. It also returns up to 5 of each thread's open linked PRs in `pullRequests`, watched ones first, the number of its open linked PRs in `openPullRequestCount`, and the number of all its linked PRs in `pullRequestCount`. A thread with `openPullRequestCount` 0 and `pullRequestCount` above 0 has only merged or closed PRs, so its worktree is a cleanup candidate. To name those PRs, call `list_thread_pull_requests` with `threadId` and `states: ["merged", "closed"]`. Add `git worktree list` for detached worktrees, which `t3_worktree_list` omits. ## Pull requests, watching, and loops @@ -96,6 +96,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **Opening a PR.** `pull_request_create` is the run's PR tool. Call it with `draft: false`, and with `base` for a stacked layer. It pushes the calling thread's branch when the remote lacks commits, opens the PR, and links it to that thread. Without it, create the PR with the resolved forge (`gh` or `origin`), ready for review, never draft. The root links every PR, each stack layer included, with `link_pull_request` for one PR or `link_pull_requests` for several in one call. A child that opens a PR returns its URL and head SHA, and the root links it. - **Linking issues.** The root links every issue the run works on or files, such as the tracker issue in benny's reproduce automation, with `link_issue`, so T3 shows it beside the thread. A child that works on or files an issue returns its URL, and the root links it. - **A merged dependency PR can end the run.** T3 settles a thread at a turn end once every PR linked to it has merged. Settling ends the session and kills its background commands, such as a push through a pre-push gate. A run that merges a dependency PR in another repo before it opens its own PR is exposed. Open and link the run's own PR before the dependency PR merges. If the dependency merged first, unlink it before you end a turn that still waits on work. Call `unlink_pull_requests` with `states: ["merged"]`, then `unlink_pull_request` on any merged dependency missing from its `unlinked` list, because the call trusts T3's last known state. Link them again after the run's own PR is linked. +- **Several repositories in one project.** When your prompt carries a `` block, the project covers every repository it lists, so a run can change a dependency in another repository from its own thread. Run Git inside the repository you change, and commit in each one separately. `pull_request_create` opens a PR only from the thread's root folder. Open a PR in another listed repository with the resolved forge, run inside that repository, and the root links it with `link_pull_request`. - **Review guides.** When the root hands PRs to the user for review or merge, it reads each with `read_pull_request_guide`. Then it calls `write_pull_request_guides` once for every PR whose guide is missing or `stale`. A run takes minutes, so do not wait for it. The user reads the guide in the PR's Guide tab. Pass each PR as `repository` and `number`, because the `url` form can fail to find the project's checkout. A PR whose outcome is `failed`, for example because guides are off in T3's Source Control settings, gets no guide. Give its `detail` in the reply and go on. - **A PR owner (autopilot, multi-phase plans)** is a role, not a long-lived agent. Each owner round (build, fix, merge) is a fresh `delegate_task` in that PR's worktree. The round does its work, reports the PR URL, head SHA, and state, and returns. The root decides and delegates the next round. - **Babysit inside a child.** A child told to babysit does one `check` pass, fixes what it can, and returns the PR state. It never arms a watch. @@ -131,7 +132,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **A delegated child never asks the user.** It returns `BLOCKED` with the question, and the root asks. A child that asks anyway waits, and `t3_thread_read` on its `childThreadId` shows a nonzero `pendingRequestCount`. Find the question with `t3_pending_request` and `action: "list"`, read it with `action: "read"`, and answer it with `action: "respond"`, each with `threadId` set to the child's `childThreadId`. Answer it yourself when the brief or the run settles it. Otherwise ask the user and pass on the answer. On Claude, keep each option's `preview` in `AskUserQuestion`. - **Visuals** (charts, tables, mockups, Cursor's `/visualize`). Build a self-contained page as an `.html` file in the work dir (Worktrees section), check it with `html_preview`, then publish it with `html_render` from the root. Pass the file's absolute path as `path` to both, so the page is not retyped. The file is a whole document that starts with ``. T3 refuses a fragment, such as a file that starts with `