From 5c49c442e60f29fca1177993b6ec821de01ca819 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 14:46:33 +0000 Subject: [PATCH] docs(agents): drop the retired "gen:schema wipes gen:openapi" trap from three agent-facing surfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `build-schemas.ts` stopped removing the output directory itself: its clean now routes through `clearOwnedOutputs()`, which skips every entry declared in `FOREIGN_JSON_SCHEMA_ARTIFACTS` — and `openapi.json` is the one entry there. So `gen:schema` has not deleted `gen:openapi`'s artifact for some time, and the run prints `↳ kept openapi.json — owned by gen:openapi (...)` when it spares it. Three agent-facing surfaces still taught the pre-fix trap and prescribed a `gen:openapi` rerun that is now a no-op: - .claude/agents/os-dev.md — the dispatch prompt itself - .claude/skills/pm-dispatch/references/landing-operations.md - scripts/pm/os-regen-merge.sh — both the header comment and the step-4 text the script PRINTS to the operator at run time The last of these is not named in the card; a repo-wide grep for the claim is what turned it up, and it is the copy an agent reads live. A doc naming a fixed trap does not fail loudly — it converts every reader into a false-positive reporter. The measured cost so far is one full card, filed and closed premise-false on the strength of this claim. The clauses are deleted rather than restated: the guarantee and its reasoning already live at the source, in packages/spec/scripts/lib/json-schema-out-dir.ts, pinned by scripts/json-schema-out-dir.test.ts and scripts/build-schemas-check-mode.test.ts. The MERGE-state anchor trap sitting beside each deleted clause is untouched and still true — in landing-operations.md the surrounding "顺序防两个陷阱" became "顺序防的陷阱", since only one of the two was ever an ordering trap. Co-authored-by: Claude --- .claude/agents/os-dev.md | 4 +--- .../skills/pm-dispatch/references/landing-operations.md | 4 +--- scripts/pm/os-regen-merge.sh | 8 ++------ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 9ebc826f0e1..ae364bdbd68 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -187,9 +187,7 @@ dispatch prompt 只携带每单增量(裁决引文、裁决 / PM-机制假设分 它。作数的断言是 `check:authorable-surface` 绿;`baseRev` 允许滞后(一行信息,不是错 误)。⛔ 永不在 MERGE 态跑 `gen:schema`:HEAD 还是 merge 前的 tip,锚点会静默回滚到旧 分叉点 —— 依然真实、门禁全绿、一次已落地的推进被吞掉。先 commit merge 再重生成(已机 - 械化:`bash scripts/pm/os-regen-merge.sh`)。姊妹陷阱:`gen:schema` 的清理会抹掉 - `gen:openapi` 的产物(rest 里冒出假 5xx 失败);用 - `pnpm --filter @objectstack/spec gen:openapi` 恢复。 + 械化:`bash scripts/pm/os-regen-merge.sh`)。 - **家族规则:`git worktree` 只隔离工作树与 HEAD;`.git/` 下其余一切 —— refs(含 `refs/remotes/*`)、stash 栈、config、hooks —— 全 worktree 共享;配方只有不点名共享态 才 worktree-safe。家族同签名:操作看着本地、报成功,唯一症状是 `git status` 里出现他 diff --git a/.claude/skills/pm-dispatch/references/landing-operations.md b/.claude/skills/pm-dispatch/references/landing-operations.md index 3dbf74e52c6..2ddcaf5532c 100644 --- a/.claude/skills/pm-dispatch/references/landing-operations.md +++ b/.claude/skills/pm-dispatch/references/landing-operations.md @@ -12,13 +12,11 @@ 四步序已机械化:`bash scripts/pm/os-regen-merge.sh` —— ① `git merge origin/main` (⛔ 禁 rebase / force-push);② 生成物 `git checkout origin/main -- <路径>`;③ -**先 commit 掉 merge**;④ 整链重生成 + 生成物门禁全绿。顺序防两个陷阱: +**先 commit 掉 merge**;④ 整链重生成 + 生成物门禁全绿。顺序防的陷阱: - **MERGE 状态下跑 `gen:schema` 会把 authorable-surface 锚点静默倒退回旧分叉点** (HEAD 仍是合并前分支 tip),倒退后的锚点**依然 authentic**、全部门放行 ——「先 commit 再重生成」的由来。 -- **`gen:schema` 的清场会抹掉 `gen:openapi` 的产物**(rest 包成串 `expected 503 - to be 200` 假红);补跑 `pnpm --filter @objectstack/spec gen:openapi` 即复原。 重生成后**断言所有兄弟单的条目都还在**;更硬的旁证是查**上一单的实现体**完好(带 引号精确名 `git grep … origin/main -- <实现文件>`)—— 条目是索引,实现体才是被吞 diff --git a/scripts/pm/os-regen-merge.sh b/scripts/pm/os-regen-merge.sh index 1ae5e78b90e..109cddc4ffa 100644 --- a/scripts/pm/os-regen-merge.sh +++ b/scripts/pm/os-regen-merge.sh @@ -24,10 +24,7 @@ # BODY — still exist (quoted-exact-name git grep against origin/main). # # This script performs steps 1–3 and prints step 4 (the regen chain varies by -# what the branch touches; running it blind would hide a red). Sister trap for -# step 4: `gen:schema`'s cleanup wipes `gen:openapi`'s output, which shows up as -# bogus 5xx assertions in the rest package — rerun -# `pnpm --filter @objectstack/spec gen:openapi` to restore. +# what the branch touches; running it blind would hide a red). # # ## Step 3 and the pre-commit hook agree (#8047) # @@ -102,8 +99,7 @@ cat <<'EOF' → step 4 (yours, in this order — the script stops here on purpose): 1. build the spec build closure, then regenerate the WHOLE chain (e.g. pnpm --filter @objectstack/spec build && the gen:* scripts your - surface touches; gen:schema's cleanup wipes gen:openapi's output — rerun - pnpm --filter @objectstack/spec gen:openapi after it); + surface touches); 2. run the generated-artifact gates until fully green; 3. assert every sibling PR's entries AND the previous PR's implementation body still exist: quoted-exact-name `git grep "" origin/main -- `