Repository navigation
Description
Xum created this issue on behalf of @ibetitsmike.
Part of #4.
Workspace brief from the pstack parity plan (local plan page "Running pstack on the Coder Agents Fork"; the PRD is local to Mike's Mac and not reproduced here). Claim numbers such as 1.3 or shared.2 refer to the plan page.
W7 · Lead: adapter and end-to-end · mike/pstack-adapter, mike/pstack-e2e
Task. Own the adapter doc (PRD 7), run every milestone exit check, and measure the PRD 9 metrics.
Background. pstack lives at ~/.xum/plugins/pstack (v0.15.36). Its Claude Code adapter is docs/harness/claude-code.md (67 lines).
Scope.
- M0, before feature code: write
docs/fork/pstack-adapter.mdin this fork (Mike, 2026-11-08: nocursor/pluginsfork), with the PRD 7 table. It is a fork-only page: do not add it todocs/manifest.json. Run pstack single-agent skills on the dev instance with skills copied to~/.coder/skills/. - After each merge, remove the adapter rows that the feature replaces.
- Run the gate checks in "Waves and gates" and record evidence.
- Keep the two stack merges current (plan shared.5). When upstream pushes to a stack, merge its top branch again in a new fork PR. When upstream merges a stack PR, resolve the fork-sync conflict to upstream's version.
- Metrics: Orchestrate reference task, 20 runs, 90% success after M2; 95% of wake-ups within one minute of due time; adapter no longer than the Claude Code one after M4; share of skills with no adapter row 80% after M3, 95% after M4.
Acceptance. Each gate has a dated evidence note (commands, chat IDs, results) before the next wave starts.
Constraints. No cursor/plugins fork and no upstreaming of the adapter (Mike, 2026-11-08). The adapter tracks pstack v0.15.36 at ~/.xum/plugins/pstack.
Rules for every workspace
| Topic | Rule |
|---|---|
| Runner | One Xum workspace per brief (W0 runs as W0a and W0b), started from fork main at its wave start. Every implementation runs implement-flow with the workstream issue as its input and the brief as the plan. |
| Branches | mike/<topic> for the workspace; stacked PR branches mike/<topic>-<n>-<slug>. Local name equals remote name. Never push to main. |
| PR size | 500 changed lines at most per PR, generated code excepted (reviewer-friendly-pr). Stack with gh stack; the extension is not installed on the Mac today (gh extension install github/gh-stack), else use explicit-base PRs. |
| Schema | Fork tables are chatd graph nodes: go run ./coderd/database/migrations/chatdmig/cmd/chatdmig new <name> -requires <node or upstream:name>. Never edit a node that ran. No edits to dump.sql, queries.sql.go, querier.go, dbmock or numbered migrations. |
| Queries | coderd/database/forkdb only (created by W0). Every method goes through the forkdb authz wrapper. A forkdb write that belongs with an upstream write runs in the same transaction, through the W0 accessor (database.Store exposes only InTx, coderd/database/db.go:22-31). |
| Authorization | Chat-owned rows authorize through the owning chat (dbauthz.go:6513-6522 pattern). Agent and plugin rows reuse the skill RBAC objects. No new RBAC resources, no new API key scopes. Tools run as the chatd subject, which can read and update every chat (dbauthz.go:807-817): a tool that touches a chat other than its own runs as the owner (asOwner, chattool/listtemplates.go:437-443). |
| Upstream files | One hook line per hot file (plan shared.2). Logic lives in new fork files. Hot files: turn_environment.go, chatd.go, subagent*.go, codersdk/chats.go, deployment.go, dbauthz.go, chat_routes.go, AgentChatInput, AgentChatPageView. |
| Open upstream PRs | If a workspace needs an open coder/coder PR, W0 or W7 merges its branch into the fork with a merge commit. Its migrations go through chatdmig route into the chatd schema. Sync conflicts are solved later (Mike, 2026-11-08). |
| Flags | Each feature is behind its fork-* experiment in codersdk/fork_experiments.go. With the flag off, tool lists, routes and UI match upstream. |
| API | Swagger annotations on new public endpoints. Audited types update enterprise/audit/table.go. |
| chatd docs | coderd/x/chatd/ARCHITECTURE.md gets TODO lines only. Mike writes the text. |
| Validation | Go suites run in Colima: a postgres:17 container, plus golang:<go.mod version>-bookworm --network container:<pg> with volumes coder-gen-gomod and coder-gen-gocache and postgresql-client-17 from PGDG. chatdmig tests use CHATDMIG_TEST_DATABASE_URL='postgres://[email protected]:5432/postgres?sslmode=disable'. Never create a postgres role on the live Postgres. Frontend: site/AGENTS.md commands plus frontend-deep-review for any site/ diff. |
| Review | implement-flow ends with codex-review-loop; Codex is installed (2026-11-08). If @codex review gets no reply within 30 minutes, tell the lead and run code-quality-review with Opus until Codex answers. Mike (2026-11-09): fix real defects in the PR's own change; drop scope creep and defensive bikeshedding with a one-line reply and a resolved thread, no follow-up issue. Upstream is only a sync source: never report or file anything upstream. |
| UAT | coder-agents-uat through Coder MCP on the local deployment (http://127.0.0.1:3000, templates devcontainer or docker, RUNBOOK "Running a branch in a dev container workspace"). The remote agent runs scripts/develop.sh for the branch inside its workspace (plan decision uat). Never coder-local use a branch build: that replaces Mike's daily server. |
| Ready | When a PR meets the merge bar, send the lead (task_send_message to 8ac7791132) READY #<pr> <head sha> with the CI, Codex, UAT and open-thread evidence, then wait. Never merge yourself. |
| Merge | The lead merges (Mike, 2026-11-08). Merge bar: green fork-ci on the exact head, a clean Codex verdict, or Codex findings that were all fixed or dropped under the scope rule (the lead confirms each drop), no unresolved threads, UAT PASS on the head or on a SHA whose later commits only answer review, and a lead review of the diff against the brief. Squash, except sync and upstream stack PRs, which take a merge commit. A merge to fork main deploys Mike's daily server through autodeploy within about 5 minutes plus a drain of up to 30 minutes, so the lead merges one PR at a time and waits until Fork ops reports the deploy healthy. Experiments stay off on that server until Mike enables them. |
| Follow-ups | A defect in merged code or on the daily server becomes an issue in ibetitsmike/coder with label followup. Fork ops triages it; an accepted one gets its own workspace running implement-flow. |
Activity
ibetitsmike commentedon Nov 8, 2026
W7 M0 status (2026-11-08 23:45 UTC): adapter page
docs/fork/pstack-adapter.mddrafted and verified againstmainb3a57df; implement-flow run started, dev-instance evidence run (UAT) follows on the pushed SHA.docs: correct pstack adapter rows from the dev-instance UAT
ibetitsmike commentedon Nov 9, 2026
Opened #29 (
docs/fork/pstack-adapter.md, headd6e014a409). UAT: R1 to R4 passed in round 2, R5 and R6 passed in a rerun on the daily deployment with the oMLX model. Codex review requested.ibetitsmike commentedon Nov 9, 2026
W7 status: #29 is ready to merge at
afc6929da6. fork-ci is green, the Codex review is clean with 0 open threads, and a focused re-UAT on that head passed (R6 block quote,~path skill run).docs: add the pstack adapter for Coder Agents (#29)
ibetitsmike commentedon Nov 9, 2026
G0 exit check: PASS at
7a2cba5071(2026-11-09, 06:35 to 06:50 UTC)Run by W7 after the lead reported
7a2cba5071(#29 and #30) deployed healthy on the daily server at 06:46:53Z.b1f5f23ffe, #26d4e1dfc991, #27cac7ca575c, #2872525d25d3, #302d28793f49(gh pr view <n> --json state,mergeCommit)mainpush, with the new jobs7a2cba5071):graph,schema,chat-tests,build,forkdb,agent-sdk,siteall succeededGET /api/v2/buildinfogivesv2.39.0-devel+7a2cba5071GET /api/v2/experimentsand theexperimentsdeployment option both give["chat-virtual-desktop","mcp-server-http"]: 0fork-entries.codersdk.ForkExperimentsis empty onmainGET /api/v2/chats/fork/x: 401 anonymous, 404 as an owner, 404 as a memberGET /api/v2/chats/15eeeae6-.../messages?limit=200(chat created at 03:27 UTC on8c183ed4f8, before #27) is byte-identical to its 03:40 export: sha25696b03a66e9ca7d79.... Chat1891e839(created on72525d25d3) is also byte-identical to its export,017013d972e4c3f5.../agentsand the chat page/agentsand/agents/15eeeae6-...render the composer with upstream controls only and no fork text. Screenshots from before (72525d25d3) and after (7a2cba5071) the deploy match, except one read marker. The only failed requests are 410s for that chat's workspace, which was deleted after M0 UAT. Both fork UI hooks from #30 are empty (ForkComposerSlotreturnsnull,forkToolRenderersis{})31a235e8(member user, oMLX Qwen3.8 Flash Next, no workspace): "Reply with exactly: G0 OK" gotG0 OK, no tool calls,last_errornull, statuswaitingNote: the
mainpush run for #30 (2d28793f49, run 42571989957) failed onesitetest,AgentsPageLayout.test.tsx"handles the saved draft on New chat after a prompt link" (expected the saved draft, gotnull). #30's PR run and the7a2cba5071push run, which contains #30, both passed it, so I treat it as a flake. If it recurs, it becomes afollowup.The temporary admin session and member API token used for these checks are revoked.
ibetitsmike commentedon Nov 10, 2026
Final gate, archive of a working family: PASS at
d559632512(2026-11-10, 02:05 to 02:18 UTC)Run by W7 on the isolated UAT server (
127.0.0.1:3100), not the daily server.GET /api/v2/buildinfogivesv2.39.0-devel+d559632512(#89, the leaves-first archive lock).mainis now741fc8a969, and the two commits afterd559632512(#84 and #92) do not touch archive code.Each run creates root, coordinator, and worker chats as a member user in workspace
uat3100-w7gate.The worker blocks in a foreground
executeofsleep 600.When all three chats report
running, the run waits 15 seconds and then sendsPATCH /api/v2/chats/<root>with{"archived":true}.9c3d8c69/cd509452/bfd398c2running, workerexecutestarted 02:10:15Z204in under 1 secondarchived=true,status=waiting. Workerexecuteresult:tool call was canceled while runninga7ddfae1/aacfcdb1/ba56a70arunning, workerexecutestarted 02:14:57Z204in under 1 secondarchived=true,status=waiting. Workerexecutecanceled4ffe1cdf/05024c1e/5c6b1fferunning, workerexecutestarted 02:16:57Z204in under 1 secondarchived=true,status=waiting. WorkerexecutecanceledServer log since the
d559632512restart: 0deadlocklines, 0lock chatlines, and 0 loggedPATCHfailures.Before #89, the same step returned
500withlock chat and bump snapshot: pq: deadlock detected(chatd0de9b51, 2026-11-09 23:01:38Z).An earlier attempt, run1 (
d6084992), is excluded.Its worker ran
sleep 600in the background and went idle, so the family was not working when the PATCH arrived.The result matches
docs/fork/pstack-adapter.mdlines 186 to 187: archiving a working root interrupts the family and archives every member.These runs do not exercise the 30-second failure branch, because every family stopped in under 1 second.
Cleanup:
uat3100-w7gateis stopped and deleted.ibetitsmike commentedon Nov 13, 2026
W7: opened #276 (docs: Cursor rules and
wait_for_eventsbackground processes in the pstack adapter, from the drift report on main525bb3d68b).ibetitsmike commentedon Nov 13, 2026
Status: docs PR #276 (Cursor rules rows and
wait_for_eventsprocess wake-ups) is ready for review at423f788ff0: fork-ci green, Codex clean, 0 unresolved threads.ibetitsmike commentedon Nov 13, 2026
Status: docs PR #277 (the sticky
/poteto-moderow and a new Pinned skills section, for #237 and #240) is ready for review at8f4c505bad: fork-ci green, Codex clean, 0 unresolved threads.ibetitsmike commentedon Nov 13, 2026
Triage by the new maintainer chat (Coder Agents, 2026-11-13). Labeled
needs-mike.Open decision handed over by the Xum lead: re-pin the adapter doc evidence from W7 (624 cites, 110 moved, 32 changed, 26 unresolved). No GitHub comment records it yet, so it is recorded here. No work starts on it until Mike decides.