Repository navigation
同步上游 pstack 0.15.36:Orchestrate 去掉 orch、skill 更新、statechart 编译器 - #31
Conversation
上游把 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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| 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; |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
确认问题成立,但本 PR 不改:region-check.ts 与上游 c742dd61 逐字节一致,fork 按文件跟随上游,在这里打补丁会增加以后每次同步的分叉。要触发它需要一个有几十个区域、初始状态彼此相关的 view,常见的 2 到 4 个区域碰不到。这个问题更适合回报给上游 cursor/plugins,由上游修复后随同步带进来。
🤖 Addressed by Claude Code
- 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>
目的
把 fork 从上游 pstack 0.15.32(
e73df471)同步到 0.15.36(c742dd61),只跳过 Cursor 专属内容。这一段上游共有 7 个 pstack 提交:#977、#978、#981、#982、#983、#986、#1043(#978、#983 只是版本号)。改动(按提交)
0f90a49Orchestrate(#1043):协调者直接用宿主的协作工具调度 worker,删除scripts/orch/和bin/orch.mjs,build-runtime.py只打包 watch-pr。fork 原有的 Shipping、worktree-audit、github-remote.ts决策保留,并入 ADAPTATION 新的「Shipping and stack tooling」一节。883edcfskill 更新(#986,interrogate 除外):50eaf10statechart(#977/#981/#982):上游的 TypeScript 编译器替换旧.mjs脚本,一条命令完成三件事:跑 TLC、画 Mermaid 图、为每条被违反的规则给出最短路径。旧的--against、--fixed、骨架生成随上游删除。保留的本地决策:STATECHART_INSTALL=1时才mise install,否则以退出码 2 结束,并给出安装命令。JAVA和TLA2TOOLS先解析成绝对路径。原因:Java 在临时目录里运行,相对路径会解析错。references/render.md要求先问用户再安装。test/fork.test.ts覆盖以上行为,并在上游run.ts上做了反向验证。check.sh改跑*.test.ts。bdb1f4ccheck-upstream:GitHub compare 对整个 monorepo 最多只列 300 个文件。这次的 compare 占满了上限,却一个 pstack 文件都不含,旧脚本因此报告 0 个变更文件。现在改为沿pstack/路径的提交回溯到 pin,逐个提交分页读取文件(包括改名前的路径),并输出提交列表。3da9d91、bf0d9ab同步记录:UPSTREAM.json、README 和 ADAPTATION 首行改到c742dd61,加一行同步日志,插件版本升到0.15.36-shared.1。2344d77按审查修正(thermos 两路审查和 Codex 审查的意见):render.test.ts每次运行都会从 npm 安装 Pele、Mermaid 和 jsdom。check.sh改为只在设置STATECHART_INSTALL=1时运行它,CI 设置了这个变量。TLA2TOOLS时,差分测试整组跳过,装了 fast-check 也不跑断言。相应文档已更正。watch-pr/tsconfig.json去掉已删除的../orch。statechart-fork-test和orchestrate-merge-authorization;同时收紧两条正则。13a118afast-check 检测位置:改在 statechart 的测试目录里检测 fast-check,和测试文件自己的模块解析一致;docs/ci.md 写明安装命令,以及 CI 额外设置了STATECHART_INSTALL=1。没有跟进的部分
Cursor 专属内容,已记入 ADAPTATION 的 Not taken:
run_in_background说明。environment: "cloud")、Project tracker/store、control-ui/control-cli。interrogate 改写(#986),单独跟进:上游让对抗者在各自的 worktree 里跑命令来证明问题。fork 有两处冲突:
ro,而 Claude 和 Gemini 的ro是 plan 模式,不能跑命令。scripts/pstack-host-e2e.py)也按roreviewer 验收。本 PR 里 interrogate 保持 0.15.32 的文本,ADAPTATION 写明了原因,以及以后应从上游
ab1f702c移植哪些路径。移植连同 harness 的修改另开 PR。验证
node scripts/check-fork.mjscheck-fork.test.mjs11/11(每条决策都有一次植入丢失)bash scripts/check.sh runtime(macOS,coreutils gnubin,TMPDIR=$(getconf DARWIN_USER_TEMP_DIR),HEAD13a118a)STATECHART_INSTALL跑完门禁,~/.cache/statechart的修改时间不变STATECHART_INSTALL=1不会触发mise installmise,用STATECHART_INSTALL=1跑除 render 以外的全部 statechart 测试:255 项 0 失败,假 mise 一次都没被调用bf0d9ab、2344d77)2344d77上 render 测试实际运行并通过test/fork.test.ts:在上游run.ts上 3 项中 2 项失败,fork 的run.ts3/3 通过comparisonMayBeTruncated: true);新脚本 7 个提交、464 个文件,与git diff --name-only e73df471 c742dd61 -- pstack逐行一致;pin 等于最新时报 up-to-datecheck.sh build(Bun 1.4.2 构建与类型检查)tla2tools.jar,本机和 CI 都没有风险与影响
--against、--fixed和骨架生成没有了,旧调用要改成新命令。用户能直接看到这个变化。bin/orch.mjs会消失。render.test.ts往~/.cache/statechart装了 Pele(3.6 MB)和 Mermaid + jsdom(168 MB)。现在门禁默认跳过这个测试。passes/region-check.ts在有几十个区域、初始状态彼此相关时会内存爆掉。这是上游代码,原样保留,建议回报上游。建议查看顺序
ADAPTATION.md:每项本地决策和 Not taken 的变化都在这里,先看它能知道哪些保留、哪些放弃。skills/statechart/SKILL.md、scripts/run.ts的findTlc、test/fork.test.ts:不下载、绝对路径这两项本地决策及其测试。scripts/check-fork.mjs与check-fork.test.mjs:statechart 的守卫换成新的 4 条。skills/poteto-mode/playbooks/orchestrate.md与autopilot-*.md:行为变化最大的 playbook。scripts/check-upstream.mjs:修复截断。🤖 Generated with Claude Code