Skip to content

同步上游 pstack 0.15.36:Orchestrate 去掉 orch、skill 更新、statechart 编译器 - #31

Merged
mtmtian merged 8 commits into
mainfrom
claude/sync-upstream-0.15.36
Oct 30, 2026
Merged

mtmtian merged 8 commits into
mainfrom
claude/sync-upstream-0.15.36

Conversation

@mtmtian

@mtmtian mtmtian commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

目的

把 fork 从上游 pstack 0.15.32(e73df471)同步到 0.15.36(c742dd61),只跳过 Cursor 专属内容。这一段上游共有 7 个 pstack 提交:#977、#978、#981、#982、#983、#986、#1043(#978、#983 只是版本号)。

改动(按提交)

  1. 0f90a49 Orchestrate(#1043):协调者直接用宿主的协作工具调度 worker,删除 scripts/orch/ 和 bin/orch.mjs,build-runtime.py 只打包 watch-pr。fork 原有的 Shipping、worktree-audit、github-remote.ts 决策保留,并入 ADAPTATION 新的「Shipping and stack tooling」一节。
  2. 883edcf skill 更新(#986,interrogate 除外):
    • poteto-mode:首条消息复述目标;Explain the Number 的触发时机;Autopilot-stack 改为“不合并的 Autopilot-full”,每个 PR 只叠在它依赖的 PR 上。
    • playbook:autopilot-full、autopilot-stack、babysit、opening-a-pr、multi-phase-plan 按上游跟进。multi-phase-plan 的 rebase 项写明两种 base(trunk 或父 PR 分支)。
    • 其他 skill:arena 的 judge 不从父模型同族选,按池子顺序,xagent judge 走 xagent 的重试规则;ketchup-video 加字幕;explain-the-number 一并跟进。
  3. 50eaf10 statechart(#977/#981/#982):上游的 TypeScript 编译器替换旧 .mjs 脚本,一条命令完成三件事:跑 TLC、画 Mermaid 图、为每条被违反的规则给出最短路径。旧的 --against、--fixed、骨架生成随上游删除。保留的本地决策:
    • 只有 STATECHART_INSTALL=1 时才 mise install,否则以退出码 2 结束,并给出安装命令。
    • 相对路径的 JAVA 和 TLA2TOOLS 先解析成绝对路径。原因:Java 在临时目录里运行,相对路径会解析错。
    • SKILL 和 references/render.md 要求先问用户再安装。
    • 新增 test/fork.test.ts 覆盖以上行为,并在上游 run.ts 上做了反向验证。
    • 修正 macOS 上 launcher 符号链接测试的临时目录路径。
    • check.sh 改跑 *.test.ts。
  4. bdb1f4c check-upstream:GitHub compare 对整个 monorepo 最多只列 300 个文件。这次的 compare 占满了上限,却一个 pstack 文件都不含,旧脚本因此报告 0 个变更文件。现在改为沿 pstack/ 路径的提交回溯到 pin,逐个提交分页读取文件(包括改名前的路径),并输出提交列表。
  5. 3da9d91、bf0d9ab 同步记录:UPSTREAM.json、README 和 ADAPTATION 首行改到 c742dd61,加一行同步日志,插件版本升到 0.15.36-shared.1。
  6. 2344d77 按审查修正(thermos 两路审查和 Codex 审查的意见):
    • 门禁默认不联网。 上游的 render.test.ts 每次运行都会从 npm 安装 Pele、Mermaid 和 jsdom。check.sh 改为只在设置 STATECHART_INSTALL=1 时运行它,CI 设置了这个变量。
    • 去掉 CI 安装 fast-check 的步骤。 没有 TLA2TOOLS 时,差分测试整组跳过,装了 fast-check 也不跑断言。相应文档已更正。
    • multi-phase-plan 合并清单写明两种 base。 之前这一项只写了 trunk,按它做会把 stacked PR 拍平。
    • watch-pr/tsconfig.json 去掉已删除的 ../orch。
    • check-upstream 处理文件数上限。 单个提交达到 GitHub 的 3000 文件上限时直接报错,不再静默漏文件。
    • 新增两条守卫。 statechart-fork-test 和 orchestrate-merge-authorization;同时收紧两条正则。
    • ADAPTATION 补记三项。 interrogate 改写暂缓及原因;Orchestrate 的合并授权;fork 默认配置下 arena 没有评委。
  7. 13a118a fast-check 检测位置:改在 statechart 的测试目录里检测 fast-check,和测试文件自己的模块解析一致;docs/ci.md 写明安装命令,以及 CI 额外设置了 STATECHART_INSTALL=1。

没有跟进的部分

  • Cursor 专属内容,已记入 ADAPTATION 的 Not taken:

    • #986:Task 工具的 slug 回退链,以及 run_in_background 说明。
    • #1043:云 VM worker(environment: "cloud")、Project tracker/store、control-ui/control-cli。
    • 删除了已随旧 statechart 脚本失效的 #791 条目。
  • interrogate 改写(#986),单独跟进:上游让对抗者在各自的 worktree 里跑命令来证明问题。fork 有两处冲突:

    • xagent 规则让 reviewer 走 ro,而 Claude 和 Gemini 的 ro 是 plan 模式,不能跑命令。
    • 真实宿主 E2E harness(scripts/pstack-host-e2e.py)也按 ro reviewer 验收。

    本 PR 里 interrogate 保持 0.15.32 的文本,ADAPTATION 写明了原因,以及以后应从上游 ab1f702c 移植哪些路径。移植连同 harness 的修改另开 PR。

验证

检查 结果 证据
fork guards:node scripts/check-fork.mjs PASS 10 条 denylist、29 条必需本地决策;check-fork.test.mjs 11/11(每条决策都有一次植入丢失)
bash scripts/check.sh runtime(macOS,coreutils gnubin,TMPDIR=$(getconf DARWIN_USER_TEMP_DIR),HEAD 13a118a) PASS Node 运行时测试 90/90;statechart 255 项:196 过、0 失败、59 跳过;render 与差分测试按设计跳过并打印原因;Python 与 E2E harness 单测全过
门禁不联网 PASS 不设 STATECHART_INSTALL 跑完门禁,~/.cache/statechart 的修改时间不变
CI 设 STATECHART_INSTALL=1 不会触发 mise install PASS 在 PATH 里放一个只记录调用的假 mise,用 STATECHART_INSTALL=1 跑除 render 以外的全部 statechart 测试:255 项 0 失败,假 mise 一次都没被调用
CI(bf0d9ab、2344d77) PASS 两次提交上,runtime(ubuntu、macOS)和 build 三个 job 都通过;2344d77 上 render 测试实际运行并通过
fast-check 检测位置的反向验证 PASS 用一个临时的假 fast-check 包装在 statechart 目录下:旧检测找不到,新检测能找到
statechart 本地决策反向验证 PASS test/fork.test.ts:在上游 run.ts 上 3 项中 2 项失败,fork 的 run.ts 3/3 通过
statechart 与上游基线对比 PASS 同一环境下上游原版 266 过、2 失败(符号链接测试、缺 fast-check),fork 0 失败
check-upstream 修复前后对比 PASS 同一 pin:旧脚本 0 个文件(comparisonMayBeTruncated: true);新脚本 7 个提交、464 个文件,与 git diff --name-only e73df471 c742dd61 -- pstack 逐行一致;pin 等于最新时报 up-to-date
check-upstream 文件数上限的反向验证 PASS 把阈值临时降到 300,脚本在文件超过 300 个的 #977 上报错
check.sh build(Bun 1.4.2 构建与类型检查) 本机 NOT RUN,CI PASS 本机只有 Bun 1.4.4,由 CI 的 Build and types job 验证
statechart render 测试 本机 PASS,此后跳过 早先一次本机运行通过(那次自动从 npm 装了渲染器,见下方风险);此后由 CI 覆盖
statechart 需要 TLC 的测试,含差分测试 NOT RUN 需要 tla2tools.jar,本机和 CI 都没有
真实宿主 E2E N/A 本 PR 没有改 swarm、interrogate、xagent

风险与影响

  • statechart 的用法变了:--against、--fixed 和骨架生成没有了,旧调用要改成新命令。用户能直接看到这个变化。
  • Orchestrate 不再有 orch CLI。刷新安装后,已安装副本里的 bin/orch.mjs 会消失。
  • 合并后需要按 ADAPTATION「Refresh installations」刷新 Codex、Claude Code、Antigravity 三处安装。
  • 修复前,有一次本机门禁运行让上游的 render.test.ts 往 ~/.cache/statechart 装了 Pele(3.6 MB)和 Mermaid + jsdom(168 MB)。现在门禁默认跳过这个测试。
  • 有一个问题本 PR 不修:Codex 指出 passes/region-check.ts 在有几十个区域、初始状态彼此相关时会内存爆掉。这是上游代码,原样保留,建议回报上游。

建议查看顺序

  1. ADAPTATION.md:每项本地决策和 Not taken 的变化都在这里,先看它能知道哪些保留、哪些放弃。
  2. skills/statechart/SKILL.md、scripts/run.ts 的 findTlc、test/fork.test.ts:不下载、绝对路径这两项本地决策及其测试。
  3. scripts/check-fork.mjs 与 check-fork.test.mjs:statechart 的守卫换成新的 4 条。
  4. skills/poteto-mode/playbooks/orchestrate.md 与 autopilot-*.md:行为变化最大的 playbook。
  5. scripts/check-upstream.mjs:修复截断。

🤖 Generated with Claude Code

mtmtian and others added 6 commits October 30, 2026 17:00
上游把 Orchestrate 改成由协调者直接用宿主的 agent 工具运行,删除了 orch
CLI 与 store。本 fork 跟进:orchestrate.md 按 host-neutral 措辞重写
(宿主协作工具、选定的状态目录、verification workers 角色、合并须授权),
删除 orch 源码、bin/orch.mjs 及其构建与测试,ADAPTATION 中 orch 的两节
合并为 Shipping and stack tooling。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- poteto-mode:首条消息复述目标;Explain the Number 前移到测量之前;
  Autopilot-stack 改为「不合并的 Autopilot-full」,只在依赖时叠 PR
- autopilot-full/stack、babysit、multi-phase-plan、opening-a-pr 同步:
  可复现问题才阻断、纯文案改动不再验证、栈内 PR rebase 到父分支
- arena:评委必须来自其他模型家族,inherit-parent/auto 不做评委,
  没有可用的异族评委时跳过;setup-pstack 说明 pool 按偏好排序
- ketchup-video 加字幕;explain-the-number 新增「先写下决策阈值」
- 不跟:Task 拒绝 slug 后的回退链与 run_in_background(Cursor 专有)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
用上游的 statechart 编译器替换旧的 .mjs 脚本:一条命令跑 TLC、画 Mermaid
图并给出每条被违反规则的最短路径。旧的 chart→TLA+、--against、--fixed
随之删除,对应的本地修复一并移除;输出目录与字符串转义已由上游另行解决。

保留的本地决策:
- 只有 STATECHART_INSTALL=1 才 mise install,默认 exit 2 并给出命令
- 相对路径的 JAVA/TLA2TOOLS 先解析为绝对路径(Java 在临时目录运行)
- SKILL 与 render.md 安装前先问用户;新增 test/fork.test.ts 覆盖并经
  上游 run.ts 反向验证会失败
- 修正 macOS 上 launcher 符号链接测试的临时目录路径
- check.sh 跑 *.test.ts,未装 fast-check 时跳过差分测试;CI 安装它

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub compare 对整个 monorepo 最多列 300 个文件。0.15.32→0.15.36 这次
compare 占满上限却一个 pstack 文件都没有,旧脚本报告 0 个变更文件。
改为沿 pstack/ 路径的提交回溯到 pin,逐个提交分页读取文件(含改名前路径),
同时输出提交列表。同一 pin 下新脚本得到 7 个提交、464 个文件,与本地
git diff --name-only 完全一致。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UPSTREAM.json、README 与 ADAPTATION 首行移到 c742dd61;同步日志加一行;
Not taken 增加 #986 的 Task slug 回退链与 run_in_background 说明、#1043
Orchestrate 的 Cursor 运行时,删除已随旧 statechart 脚本失效的 #791 条目。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

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 ✅ Completed 2026-10-30T10:07:18.543953Z 13a118a New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3da9d91135

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +39
for (const r of regions) {
const next: string[][] = [];
for (const c of product)
for (const s of r.states) if (s.start) next.push([...c, tupleKey(s.path)]);
product = next;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check initial combinations without materializing their full product

When a multi-region view has correlated initial states, this loop constructs the entire Cartesian product before checking whether any combination is invalid. A model with just two initial states—every part Off or every part On—and 24 binary regions allocates 2^24 arrays, despite containing only two model states and needing to fall back to parent states as soon as the first mixed combination is found. I reproduced a heap exhaustion in project() with that graph under a 64 MiB heap; increasing the number of regions also exceeds ordinary heap limits. Generate and validate combinations lazily, or bound the product against the number of actual initial combinations before allocating it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确认问题成立,但本 PR 不改:region-check.ts 与上游 c742dd61 逐字节一致,fork 按文件跟随上游,在这里打补丁会增加以后每次同步的分叉。要触发它需要一个有几十个区域、初始状态彼此相关的 view,常见的 2 到 4 个区域碰不到。这个问题更适合回报给上游 cursor/plugins,由上游修复后随同步带进来。

🤖 Addressed by Claude Code

mtmtian and others added 2 commits October 30, 2026 17:49
- check.sh 默认跳过 statechart 的 render 测试:它会从 npm 安装 Pele、
  Mermaid、jsdom,只在 STATECHART_INSTALL=1 时运行;CI 设该变量。
  去掉 CI 的 fast-check 安装:没有 TLA2TOOLS 时差分测试全部跳过,
  装了也不跑断言;docs/ci.md 与 ADAPTATION 的说法随之更正
- multi-phase-plan 合并清单的 rebase 项写明两种 base,与前面的
  rebase 项和 autopilot-stack 一致
- watch-pr/tsconfig.json 去掉已删除的 ../orch,恢复与上游一致,
  source-hashes 同步
- check-upstream 复用第一页提交;单个提交达到 GitHub 的 3000 文件
  上限时报错,不再静默漏文件
- 守卫:新增 statechart-fork-test 与 orchestrate-merge-authorization,
  收紧两条 statechart 正则;各有植入丢失测试
- ADAPTATION:记录 interrogate 改写暂缓及其原因、Orchestrate 的合并
  授权、fork 默认配置下 arena 无评委;删去只讲历史的段落

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check.sh 从仓库根探测 fast-check,按 skills/statechart/scripts/package.json
装在该目录下的 fast-check 会被误判为未安装。改为在 test 目录探测,与测试
文件自身的模块解析一致。docs/ci.md 写明安装命令、缓存路径随 XDG_CACHE_HOME,
以及 CI 额外设置 STATECHART_INSTALL=1;CI 注释改清楚。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mtmtian
mtmtian merged commit b605a32 into main Oct 30, 2026
3 checks passed
@mtmtian
mtmtian deleted the claude/sync-upstream-0.15.36 branch October 30, 2026 10:46
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