Skip to content

chore(pstack): sync upstream pstack (cursor/plugins#637..#1043) - #21

Merged
lucasheriques merged 3 commits into
mainfrom
sync/upstream-2026-10-31
Oct 31, 2026
Merged

lucasheriques merged 3 commits into
mainfrom
sync/upstream-2026-10-31

Conversation

@lucasheriques

@lucasheriques lucasheriques commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Why

Upstream pstack shipped 33 commits since the last sync, including four new skills and redesigns of interrogate, orchestrate, and autopilot-stack. This merges them and keeps the port's Claude Code translation and house rules.

What changed

  • New skills ported: statechart (agent-invocable here), create-formal-verification-skill, maintain-formal-verification-skill, ketchup-video.
  • interrogate now uses upstream's design: adversaries prove each finding with a run, and only findings a rerun confirms survive. It stays model-invocable and remains the pre-PR gate. Opening a PR step 2 applies every verified finding or blocks on it.
  • orchestrate is agentic and scripts/orch is deleted. autopilot-stack is Autopilot-full without the merge, and a PR stacks with gh stack only on a PR it builds on.

Scope

  • Covers cursor/plugins pstack through upstream@4dd1d05818d1.
  • Leaves out upstream's guide pages, setup-pstack, and its runtime Claude Code adapter (docs/harness/claude-code.md). The port translates once, at build time.

Tradeoffs

  • interrogate's gate drops the Act on / Consider / Dismissed buckets and the code-quality lens. Upstream cut them on purpose: a finding has to be proven by a run. Style and structure cleanup stays with /simplify.
  • Arena's cross-judge picks a different model, not a different family. The port's pool is all Claude, so upstream's family rule would always skip the judge. This is recorded as a deliberate departure.

Blast Radius

Every session that loads pstack gets the new playbooks after claude plugin update. The pre-PR gate now costs more per run, because each adversary works in a worktree and runs code.

Verification

  • bun scripts/check-port.ts: 0 findings. bun test ./scripts/check-port.test.ts: 82 pass. skills/poteto-mode/scripts: 221 tests pass, typecheck clean. claude plugin validate . passed with the expected warnings.
  • claude -p probes: poteto-mode and poteto-agent print the absolute sibling path, and pstack:read-only refused to write a file.
  • Pre-PR gate: interrogate with opus and sonnet adversaries. It found four run-proven defects, all fixed in the second commit: statechart could not be invoked by agents, orchestrate had two gh stack writers, a messaging rule contradicted itself, and the verifier model rule clashed with poteto-mode. statechart's own suite has one upstream test that fails on macOS (symlinked launcher, 266 pass, 1 fail) and TLC tests skip without tla2tools.jar. That code is unchanged from upstream.

Merge with a merge commit, never squash. A squashed sync drops upstream from main's ancestry, and the next sync re-conflicts on every line resolved here. merge-gate's policy already merges sync/* that way.

Merges upstream@4dd1d05818d1 (cursor/plugins#637 through #1043) into the port.

New skills, ported: statechart (TLA+ models drawn as Mermaid charts),
create-formal-verification-skill, maintain-formal-verification-skill,
ketchup-video. Updated: sharpen restored to its original prompt, ketchup,
arena, swarm, reflect, typescript-best-practices, explain-the-number,
watch-pr and worktree-audit fixes, check-plan.

Conflicts and resolutions:
- interrogate: took upstream's redesign (adversaries prove each finding
  with a run, the lead keeps only rerun-confirmed ones, reviewer and rubric
  references dropped). Kept the port's PR-number scope, blind-spot lenses,
  model invocation, pre-PR gate hand-back, and someone-else's-PR flow.
  Opening a PR step 2 now applies every verified finding or blocks on it.
- orchestrate: took upstream's agentic rewrite and deleted scripts/orch.
  Cursor's Project tracker becomes a notes.md store under
  ~/.claude/projects; workers stay remote by default; owners stack with
  gh stack and merge through merge-gate.
- autopilot-stack: took upstream's "Autopilot-full without the merge,
  stack only on a PR you build on", keeping gh stack link/sync with the
  root as the single topology writer.
- arena cross-judge: upstream picks by model family; the port's pool is
  all Claude, so the judge is the first pool entry whose model differs
  from the parent's (new deliberate departure in translation.md).
- poteto-mode, autopilot-full, autonomous-run, babysit, multi-phase-plan,
  swarm, package.json, worktree-audit.sh: upstream substance, port
  translation (Agent tool, models.md roles, /simplify, claude-in-chrome).
- poteto-help and README: kept the port's own, added the new skills.
- Deleted as Cursor-only: docs/guide edits, docs/harness/claude-code.md
  (the port translates at build time), setup-pstack edits.

Tests:
- bun scripts/check-port.ts: 0 findings
- bun test ./scripts/check-port.test.ts: 82 pass (fixture moved to
  autopilot-stack step 2, which now has two steps)
- skills/poteto-mode/scripts: bun run test 221 pass; typecheck clean
- claude plugin validate .: passed with the expected warnings
- claude -p probes: poteto-mode and poteto-agent print the absolute
  sibling path; pstack:read-only refused to write probe.txt

Not run: statechart's own node test suite (upstream code, unchanged).
Merge with a merge commit, never squash, or the next sync re-conflicts.
The pre-PR gate (opus and sonnet adversaries) found four defects in the
merge, each shown by a run, and one documentation gap.

- statechart drops disable-model-invocation. The generated formal
  verification skill tells agents to run it, and the Skill tool refused
  (claude -p probe). Its references now say /pstack:statechart.
- Orchestrate: one owner per gh stack is the single writer, because
  gh stack sync and rebase push every branch in the stack.
- Orchestrate: a follow-up goes to the worker holding the built state,
  and other new work gets a fresh worker. Before, the bullet both sent
  new work by message and forbade it.
- Orchestrate: the verifier runs on the other of opus and sonnet from
  the owner, which overrides poteto-mode's swarm-workers default.
- statechart documents the TLA2TOOLS and JAVA fallback when mise is
  missing.
- translation.md records the new departures.

Tests: bun scripts/check-port.ts 0 findings; check-port.test.ts 82 pass.
@lucasheriques
lucasheriques marked this pull request as ready for review October 31, 2026 18:32
@lucasheriques
lucasheriques merged commit ff5b519 into main Oct 31, 2026
1 check passed
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