Skip to content

pstack W7: adapter and end-to-end checks #13

Open

Description

@ibetitsmike

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.

  1. M0, before feature code: write docs/fork/pstack-adapter.md in this fork (Mike, 2026-11-08: no cursor/plugins fork), with the PRD 7 table. It is a fork-only page: do not add it to docs/manifest.json. Run pstack single-agent skills on the dev instance with skills copied to ~/.coder/skills/.
  2. After each merge, remove the adapter rows that the feature replaces.
  3. Run the gate checks in "Waves and gates" and record evidence.
  4. 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.
  5. 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

  1. added
    pstack-parity
    on Nov 8, 2026
  2. ibetitsmike commented on Nov 8, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this on behalf of @ibetitsmike.

    W7 M0 status (2026-11-08 23:45 UTC): adapter page docs/fork/pstack-adapter.md drafted and verified against main b3a57df; implement-flow run started, dev-instance evidence run (UAT) follows on the pushed SHA.

  3. ibetitsmike commented on Nov 9, 2026

    @ibetitsmike
    OwnerAuthor

    Opened #29 (docs/fork/pstack-adapter.md, head d6e014a409). 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.

    Xum posted this on behalf of @ibetitsmike.

  4. ibetitsmike commented on Nov 9, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted for Mike on this comment.

    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).

  5. ibetitsmike commented on Nov 9, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted for Mike on this comment.

    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.

    Check Result Evidence
    W0a merged Pass #25 b1f5f23ffe, #26 d4e1dfc991, #27 cac7ca575c, #28 72525d25d3, #30 2d28793f49 (gh pr view <n> --json state,mergeCommit)
    fork-ci green on a main push, with the new jobs Pass run 42573574117 (push, 7a2cba5071): graph, schema, chat-tests, build, forkdb, agent-sdk, site all succeeded
    Daily server runs the head Pass GET /api/v2/buildinfo gives v2.39.0-devel+7a2cba5071
    No fork experiment enabled Pass GET /api/v2/experiments and the experiments deployment option both give ["chat-virtual-desktop","mcp-server-http"]: 0 fork- entries. codersdk.ForkExperiments is empty on main
    Fork route hidden Pass GET /api/v2/chats/fork/x: 401 anonymous, 404 as an owner, 404 as a member
    Existing chat unchanged Pass GET /api/v2/chats/15eeeae6-.../messages?limit=200 (chat created at 03:27 UTC on 8c183ed4f8, before #27) is byte-identical to its 03:40 export: sha256 96b03a66e9ca7d79.... Chat 1891e839 (created on 72525d25d3) is also byte-identical to its export, 017013d972e4c3f5...
    /agents and the chat page Pass Headless Chromium as a member user: /agents and /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 (ForkComposerSlot returns null, forkToolRenderers is {})
    One chat turn Pass Chat 31a235e8 (member user, oMLX Qwen3.8 Flash Next, no workspace): "Reply with exactly: G0 OK" got G0 OK, no tool calls, last_error null, status waiting

    Note: the main push run for #30 (2d28793f49, run 42571989957) failed one site test, AgentsPageLayout.test.tsx "handles the saved draft on New chat after a prompt link" (expected the saved draft, got null). #30's PR run and the 7a2cba5071 push run, which contains #30, both passed it, so I treat it as a flake. If it recurs, it becomes a followup.

    The temporary admin session and member API token used for these checks are revoked.

  6. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted for Mike on this comment.

    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/buildinfo gives v2.39.0-devel+d559632512 (#89, the leaves-first archive lock).
    main is now 741fc8a969, and the two commits after d559632512 (#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 execute of sleep 600.
    When all three chats report running, the run waits 15 seconds and then sends PATCH /api/v2/chats/<root> with {"archived":true}.

    Run Root / coordinator / worker Before PATCH PATCH After PATCH
    run2 9c3d8c69 / cd509452 / bfd398c2 3 of 3 running, worker execute started 02:10:15Z 02:10:35Z, 204 in under 1 second 3 of 3 archived=true, status=waiting. Worker execute result: tool call was canceled while running
    run3 a7ddfae1 / aacfcdb1 / ba56a70a 3 of 3 running, worker execute started 02:14:57Z 02:15:25Z, 204 in under 1 second 3 of 3 archived=true, status=waiting. Worker execute canceled
    run4 4ffe1cdf / 05024c1e / 5c6b1ffe 3 of 3 running, worker execute started 02:16:57Z 02:17:16Z, 204 in under 1 second 3 of 3 archived=true, status=waiting. Worker execute canceled

    Server log since the d559632512 restart: 0 deadlock lines, 0 lock chat lines, and 0 logged PATCH failures.
    Before #89, the same step returned 500 with lock chat and bump snapshot: pq: deadlock detected (chat d0de9b51, 2026-11-09 23:01:38Z).

    An earlier attempt, run1 (d6084992), is excluded.
    Its worker ran sleep 600 in the background and went idle, so the family was not working when the PATCH arrived.

    The result matches docs/fork/pstack-adapter.md lines 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-w7gate is stopped and deleted.

  7. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted for Mike on this comment.

    W7: opened #276 (docs: Cursor rules and wait_for_events background processes in the pstack adapter, from the drift report on main 525bb3d68b).

  8. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted for Mike on this comment.

    Status: docs PR #276 (Cursor rules rows and wait_for_events process wake-ups) is ready for review at 423f788ff0: fork-ci green, Codex clean, 0 unresolved threads.

  9. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted for Mike on this comment.

    Status: docs PR #277 (the sticky /poteto-mode row and a new Pinned skills section, for #237 and #240) is ready for review at 8f4c505bad: fork-ci green, Codex clean, 0 unresolved threads.

  10. added
    needs-mike
    on Nov 13, 2026
  11. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Coder Agents acted on behalf of @ibetitsmike.

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-mikepstack-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions