Skip to content

chore(pstack): sync upstream pstack (cursor/plugins#538..#617) - #18

Merged
lucasheriques merged 7 commits into
mainfrom
sync/upstream-2026-10-14
Oct 14, 2026
Merged

lucasheriques merged 7 commits into
mainfrom
sync/upstream-2026-10-14

Conversation

@lucasheriques

@lucasheriques lucasheriques commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Why

Upstream pstack shipped 26 commits since the last sync. They add three skills, cut the autopilot and shipping playbooks down to principles, distill prompts across every skill, and change how subagent models are picked. This merges them into the Claude Code port and translates the Cursor-only parts.

The last two syncs were squash-merged, which dropped upstream from main's history, so git re-conflicted on everything since the first import. The first commit (-s ours b384b33) restores that history without changing any file, so this merge only conflicts on the new commits.

What changed

  • New skills: ketchup, in-your-own-words, sharpen, added to the README and poteto-help.
  • Autopilot-full, Autopilot-stack, and Shipping take upstream's principle-first text, with stacks still on gh stack and merges still through merge-gate.
  • orch frontier set walks the PR base chain with gh, replacing the port's gh stack view reader. Upstream's Origin forge is removed.

Scope

  • Covers every upstream pstack/ commit through chore(pstack): bump to 0.15.24 cursor/plugins#617.
  • Deleted as Cursor-only: the root plugin.json (a fixed version would block claude plugin update), the built-in PR tool paragraph, and Origin support in worktree-audit.sh.
  • Leaves out the repo merge setting. See Blast Radius.

Tradeoffs

  • The orch frontier now resolves the PR base chain instead of reading gh stack view --json. It reads the same chain a native stack creates, needs no extension, and removes about 700 lines of port-only code that conflicted on every sync.
  • The reasoning-level and speed dial has no Claude Code equivalent, because the Agent tool takes only model. "Match the model to the job" keeps what the model choice can express.

Blast Radius

This changes skill prose and a few helper scripts, so every pstack user gets the new playbook text on the next claude plugin update. merge-gate changed only to call watch-pr's new paging helper.

Merge with a merge commit, never squash. The repo allows only squash merges today, which is what broke the last two syncs. Merge commits need to be enabled in the repo settings first.

Verification

  • bun scripts/check-port.ts reports 0 findings, and its 82 parameterized cases pass. The new rules cover the effort dial, principle-as-skill references, unprefixed agent ids, /visualize, index titles that don't resolve, and playbook step references past a playbook's last step.
  • The ancestry warning in scripts/sync-upstream.sh was checked against this repo's real history. It names a squash, an unlanded sync, and a repaired branch correctly.
  • bun test orch watch-pr merge-gate check-plan.test.ts passes all 189 tests, 8 runs clean after the orch fixture stopped signing commits. Both typechecks are clean.
  • claude plugin validate . passes, with the expected no-version and root CLAUDE.md warnings. The claude -p probes pass: poteto-mode and pstack:poteto-agent print the same absolute path, and pstack:read-only did not create probe.txt.

#9 and #13 were squash-merged, which dropped the upstream branch from
main's ancestry. main's content already carries b384b33 (the #13 squash),
so this -s ours merge restores the ancestry without changing any file.
Merges 26 upstream pstack commits since df58112, mirrored as upstream
b5fd060. The parent merge (-s ours b384b33) restored the ancestry that the
squash-merged #9 and #13 dropped, so this merge's base is the last mirror.

New skills ported: ketchup (#539, #570, #595, #609, #616),
in-your-own-words (#602, #606), sharpen (#615). ketchup's `/visualize`
becomes the session's visual tool.

Taken with translation:
- #613: Autopilot-full, Autopilot-stack, and Shipping cut to principles.
  Stack mechanics stay on gh stack (link/sync/rebase; GitHub restacks
  server-side, so the post-merge retarget goes away). Merges stay on
  merge-gate, never --squash or --auto. "Match the model to the job" keeps
  only what the model dial can express; the reasoning-level/speed sentence
  is deleted everywhere. One full swarm per PR.
- #613 orch frontier: takes upstream's PR-base-chain resolver over the
  port's gh stack view reader, with the Origin forge removed, so the
  command takes no --forge.
- #538, #571: distilled prompts taken across skills; port departures kept
  (interrogate PR scope, blind spots, source check, someone-else's-PR flow;
  models.md roles; pstack:read-only; ${CLAUDE_SKILL_DIR} paths).
- #575, #597, #577: poteto-agent is a delegate, never the runner. Its
  plugin-path search is dropped: the agent preloads poteto-mode.
- Principles and playbooks now resolve by title; the leaf-skill links in
  principle files are rewritten to the port's layout.
- #484 watch-pr paging: merge-gate now calls resolveReviewThreads.

Deleted as Cursor-only: root plugin.json (#576, a fixed version would
block updates), the built-in PR tool paragraph, Origin in worktree-audit.

Port tooling: check-port gains effort-dial, principle-as-skill,
unprefixed-agent, /visualize, and title-index rules (TDD, 71 cases);
sync-upstream.sh warns when main lost the previous mirror; the orch test
fixture disables commit signing, which flaked via the 1Password agent.

Tested:
- bun scripts/check-port.ts: 0 findings
- bun test ./scripts/check-port.test.ts: 71 pass
- bun test orch watch-pr merge-gate check-plan.test.ts: 189 pass, 8 runs
  clean after the signing fix; bun run typecheck clean
- claude plugin validate .: passes (expected no-version and root
  CLAUDE.md warnings)
- claude -p probes: poteto-mode and poteto-agent quote the same absolute
  sibling path; pstack:read-only did not create probe.txt

Merge with a merge commit, never squash: the repo currently allows only
squash merges, which is what dropped upstream from main's ancestry.
- babysit pointed at Autopilot-stack step 7, gone since #613 cut it to four
  steps. A new check-port rule (unresolved-step) flags any "<playbook>
  step N" past that playbook's last numbered step.
- Autopilot-stack: an owner pushes only until the root links its branch;
  after that it hands fix commits to the root, since gh stack sync
  force-pushes every linked branch.
- Shipping: moving a PR out of a gh stack is the user's (gh stack modify is
  interactive); step 5 names step 4's rebase, push, and sync.
- Orchestrate: the stacker's merges go through scripts/merge-gate.
- poteto-mode index: "Nothing merges before a verdict"; Autopilot-stack is a
  gh stack.
- sync-upstream.sh: the ancestry warning no longer assumes a squash. It
  says to land or close an unlanded sync first, and stays quiet once HEAD
  carries the mirror.
- check-port: allow Explore and Plan agent types, catch "reasoning-level",
  and accept only a (**principle-x**) right after the title as an index
  entry's own file.
- worktree-audit.sh: back to gh's own PR fields; the dead draft arm and the
  two-forge reshaping are gone.

Tested: bun scripts/check-port.ts (0 findings); check-port tests 78 pass;
bun test orch watch-pr merge-gate check-plan.test.ts 189 pass x3;
typecheck clean; worktree-audit.sh run on this repo shows #18/OPEN.
- Autopilot-stack: drop the "linked owners never push" rule. Owners never
  rebase there, so after a link they only add commits, never force-push,
  and take the root's push as their new base and lease (upstream's line).
  That keeps babysit's push waves valid and needs no handoff channel.
- Orchestrate: PR closes go through the stacker; moving a PR out of a
  stack is the user's (gh stack modify is interactive).
- sync-upstream.sh tells a squash from an unlanded sync by grepping main
  for the mirror's pstack@<sha>. It prints -s ours only for a squash not
  yet repaired on HEAD, and says "land it first" otherwise.
- check-port's step tripwire covers "steps N and M", ranges, and "step N of
  the <playbook> playbook", escapes titles by hand instead of
  RegExp.escape, and the principle index accepts a (**principle-x**) only
  right after the title. The speculative Explore/Plan exemption is gone.

Tested: bun scripts/check-port.ts (0 findings); check-port tests 82 pass;
bun test orch watch-pr merge-gate check-plan.test.ts 189 pass; typecheck
clean; the ancestry warning checked against b384b33 (squashed: warns from
main, quiet from this branch), b5fd060 (not landed), 8a26243 (in main).
@lucasheriques
lucasheriques marked this pull request as ready for review October 14, 2026 15:17
@lucasheriques
lucasheriques merged commit 8882c71 into main Oct 14, 2026
1 check passed
lucasheriques added a commit that referenced this pull request Oct 16, 2026
Merges upstream@f713f14 (cursor/plugins pstack@f713f14203cd). Also records
upstream@b5fd060 as a parent via `git merge -s ours`, because #18 was
squash-merged and dropped it from main's ancestry.

Upstream commits merged:
- #628 /ketchup explains changes with embedded screenshots, videos, diagrams
- #633 restate attack-the-premise, fix-root-causes, make-operations-idempotent,
  test-behavior-not-implementation as reasoning; sync summaries and /correct
- #634 cut marginal sections from interrogate lead-judgment, swarm,
  type-system-discipline, migrate-callers-then-delete-legacy-apis

Conflicts:
- README.md: kept the port's README (upstream's principles table, "not
  shipped here", automations sections are Cursor-only).
- docs/guide/08-principles.md: stays deleted; its edits mirror the principle
  summaries already merged into poteto-mode/SKILL.md.
- ketchup: took upstream; "`/visualize` chart" stays "a chart from the visual tool".
- attack-the-premise: took upstream; links rewritten to ./principle-x.md.
- type-system-discipline: took upstream's cut; kept the port's
  **principle-x** naming.

Inherited from upstream, left as-is to stay in parity (worth raising upstream):
migrate-callers body is now one orphan bullet; type-system description still
promises "illegal states" and "exhaust variants" whose bullets were cut; swarm
still says "N workers" and "the table" after their antecedents were cut.
- swarm: took upstream's cut of the intro line and step 3; kept the port's
  step 4 unchanged (upstream did not edit it). Step numbering follows
  upstream (2, 4, 5) so the next sync merges cleanly.

Tested:
- bun scripts/check-port.ts: 0 findings
- bun test ./scripts/check-port.test.ts: 82 pass
- bun test orch watch-pr: 61 pass on 14 of 15 runs; first run reported 53
  tests and 1 error, not reproduced since. No script changes in this diff.
- claude plugin validate .: passed (expected root CLAUDE.md warning)
- claude -p smoke checks: NOT run, nested CLI hit its usage limit.

Merge with `gh pr merge --merge`, never squash or rebase: a squash drops
`upstream` from main's ancestry and the next sync re-conflicts.
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