Skip to content

feat(z-mode): port pstack 0.15.36 native-tool Orchestrate - #72

Merged
fullerzz merged 1 commit into
mainfrom
orch-changes
Oct 29, 2026
Merged

fullerzz merged 1 commit into
mainfrom
orch-changes

Conversation

@fullerzz

@fullerzz fullerzz commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Upstream cursor/plugins#1043

Why the change

Orchestrate leaned on a bundled bookkeeping CLI and store, while upstream pstack 0.15.36 now runs a program with the coordinator's own agent tools, task tracker, and PR/CI events, so this port lets zstack follow that design and drop roughly 1,200 lines of Python it no longer needs.

Special things to note

  • Breaking change: skills/z-mode/scripts/orch/ (orch.py, store.py) and its tests are gone, so anything that called the orch CLI has to keep its own state. Manifests move to 0.22.0 for that reason.
  • Upstream's retry, follow-up messaging, and "about ten workers" rules contradicted zstack's agent lifecycle and delegation rules. An interrogation run caught this, so those rules now follow native-hosts.md: one retry with a fresh agent, reuse only for agent-held state, and a window that starts at 2-3.
  • No live Orchestrate program was run. The checks are the validator, 143 Python tests, 212 Node tests, and ty. The one mypy error in test_pr_watcher.py:746 exists on main too.

Change outline

The coordinator stops doing scripted bookkeeping and supervises owners instead.

 coordinator
-  orch init / unit add / ledger record / frontier set   # TSV + JSON store
-  drain inbox at fixed points
-  one stacker owns all rebases, retargets, merges
+  spawn workers through the selected execution method
+  keep state in the host task tracker + .agent-work/<slug>/notes.md
+  watch PRs with native PR/CI events when the host has them
+  read diffs, check `gh pr view` / `gh pr checks` before reporting
 owner (one per PR)
+  only writer of its branch: pushes, rebases, retargets
+  merges only on an other-family verifier's pass at the current head,
+    and only when the user authorized merges (else stops at merge-ready)
+  a stacked child's owner does Shipping's child rebase and retarget

The playbook gets two new sections in place of the old numbered steps.

orchestrate.md
├── intro        # goal, authority, state, no scripts or polling loops
├── Topology     # owners, fresh workers, sub-coordinators (≤3 levels),
│                #   reuse only for built state, cross-family verifier, pilot unit
└── Supervision  # evidence in every brief, read diffs, live PR checks,
                 #   one lifecycle retry, ask the user only for real decisions

The CLI removal reaches every caller.

 skills/z-mode/
 ├── playbooks/orchestrate.md        # rewritten
 ├── references/native-hosts.md      # orch --help example removed
 └── scripts/
-    └── orch/{orch.py,store.py}
 scripts/
 ├── test_z_mode_tools.py            # store/frontier tests removed; watcher launcher test kept
 ├── validate.py, test_validate.py   # orch entrypoint no longer required
 mypy.ini, README.md                 # orch search paths removed
 docs/                               # playbook reference, guides, provenance, validation
 plugin manifests                    # 0.21.2 -> 0.22.0

https://claude.ai/code/session_01AhhZLNrJaee4xyot8y1jPt


Summary by cubic

Ports upstream pstack 0.15.36's native-tool Orchestrate: the coordinator now runs a program with its own agents and tools instead of a bundled bookkeeping CLI, following upstream design and dropping about 1,200 lines of Python.

Breaking change

  • skills/z-mode/scripts/orch/ (orch.py, store.py) and its tests are deleted; anything that called the orch CLI must keep its own state, which is why manifests advance to 0.22.0.

Changed behavior

  • Each PR gets one owner, the only agent that pushes, rebases, or retargets it; a verifier from another model family must pass at the current head before merging, and without merge authority the PR stops at merge-ready.
  • State moves to the host's task tracker plus a user-owned .agent-work/<slug>/notes.md, and PRs are watched through native PR/CI event subscriptions where the host has them.
  • Retry, worker-reuse, and concurrency rules now follow the agent lifecycle contract in native-hosts.md: one retry with a fresh agent, reuse only for agent-held state, and a window starting at 2-3.
  • No live Orchestrate program was run; validation covers the structural validator, 143 Python tests, 212 Node tests, and ty. A mypy error in test_pr_watcher.py:746 also exists on main.

Written for commit 0d8f9c0. Summary will update on new commits.

Turn on auto-fix

Orchestrate now runs a program with the coordinator's own tools.
Workers spawn through the selected execution method. State lives in
the host's task tracker and a user-owned notes file. PRs are watched
through native PR and CI events where the host has them. The
coordinator writes no code and runs no bookkeeping scripts or polling
loops.

Each PR has one owner, the only agent that pushes, rebases, or
retargets it. Each PR needs a verifier from another model family at
its current head. A pilot unit runs before fan-out. Briefs name their
proof of done, and PR state is checked live before reporting.

Breaking change: the Python orch CLI, its store, and its tests are
deleted, so integrations that called it must keep their own state.
Its validator, mypy, ty, and host-contract entries are removed.

Zstack keeps merges under the user's authorized actions and Shipping.
Retries, worker reuse, and concurrency follow the agent lifecycle
rules, as interrogation found that upstream's copied rules conflicted
with them. A stacked child's own owner does Shipping's child rebase.
Manifests advance to 0.22.0.

Upstream: cursor/plugins#1043 (merge c742dd61).

Claude-Session: https://claude.ai/code/session_01AhhZLNrJaee4xyot8y1jPt
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-29T01:37:01.715205Z 0d8f9c0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fullerzz
fullerzz merged commit 8a4963d into main Oct 29, 2026
4 checks passed
@fullerzz
fullerzz deleted the orch-changes branch October 29, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant