Repository navigation
docs(agents): drop the retired "gen:schema wipes gen:openapi" trap from three agent-facing surfaces - #11744
Merged
Conversation
…om three agent-facing surfaces `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 <noreply@anthropic.com>
This was referenced Aug 24, 2026
hotlong
marked this pull request as ready for review
August 24, 2026 15:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11597
Three agent-facing surfaces still taught the pre-#5371 trap "
gen:schema's cleanup wipesgen:openapi's output" and prescribed agen:openapirerun to recover from it. The trap is gone; the docs are not. This deletes the stale clauses.Current behavior, from the source
build-schemas.tsno longer removes the output directory itself. Its clean routes throughclearOwnedOutputs(), which skips every entry declared inFOREIGN_JSON_SCHEMA_ARTIFACTS— andopenapi.jsonis the one entry there.packages/spec/scripts/lib/json-schema-out-dir.ts:70-72—FOREIGN_JSON_SCHEMA_ARTIFACTSmapsopenapi.jsonto'gen:openapi (packages/spec/scripts/build-openapi.ts)'.packages/spec/scripts/lib/json-schema-out-dir.ts:121-125— the clean loop: an entry present in that map goes topreservedand is skipped, never removed.packages/spec/scripts/build-schemas.ts:297-323— the clean callsclearOwnedOutputs(OUT_DIR, …)instead of the oldfs.rmSync(OUT_DIR, { recursive: true }), and line 318 prints↳ kept openapi.json — owned by gen:openapi (…) (#5371)for each spared entry.83f86077cd— "fix(spec): gen:schema clears only its own outputs, sparing gen:openapi's openapi.json". (The card cites this asgen:schemarmSync 整个json-schema/会顺手抹掉gen:openapi的产物,rest 的 openapi 路由测试随后 503 假红——check:generated原地跑 build-schemas 也触发 #5371; the commit subject carries(#6200). Both refer to the same landed change;83f86077cdis an ancestor of this branch's basedd4113ec.)Pinned in two layers, both already in the tree:
packages/spec/scripts/json-schema-out-dir.test.ts:78— "leaves gen:openapi's openapi.json byte-identical" (unit).packages/spec/scripts/build-schemas-check-mode.test.ts:2113— "build-schemas.ts — the output clean spares a sibling generator (gen:schemarmSync 整个json-schema/会顺手抹掉gen:openapi的产物,rest 的 openapi 路由测试随后 503 假红——check:generated原地跑 build-schemas 也触发 #5371)" (integration), carrying a--check-specific case becausecheck:authorable-surfacewas the reported trigger.No destructive generation command was run to establish this — the evidence above is read from the current source, per the dispatch constraint.
The file list is the grep's, not the card's
The card names two files. A repo-wide grep for the claim (
wipes/抹掉/清场/expected 503 to be 200, intersected withopenapi/gen:schema) returns three surfaces, four occurrences:.claude/agents/os-dev.md.claude/skills/pm-dispatch/references/landing-operations.mdscripts/pm/os-regen-merge.shThe third is not named in the card, and its second occurrence is the worst of the four: it is inside the step-4 heredoc the script prints to the operator at run time, so an agent reads the retired trap as live instruction on every merge of a generated-artifact branch.
Two remaining hits in
packages/spec/CHANGELOG.mdare deliberately left alone: they state a different and still-true fact (gen:docsdropping a reference page when a schema stops being emitted), and a changelog is a historical record rather than an agent-facing instruction.Deleted rather than restated
The guarantee and its full reasoning already live at the source, in the
json-schema-out-dir.tsdocblock, pinned by the two tests above. Restating it in three agent prompts would spend budget on a non-trap; the prompts' job is to warn about live ones.AGENTS.mdwas already corrected and is untouched here.The MERGE-state anchor trap sitting beside each deleted clause is unaffected and still true — it is kept verbatim in all three files. One knock-on:
landing-operations.mdintroduced the pair as顺序防两个陷阱("the order prevents two traps"), which becomes顺序防的陷阱. Only one of the two was ever an ordering trap; leaving the count would have been a second false statement.Line deltas (all reductions, nothing rewritten):
.claude/agents/os-dev.md.claude/skills/pm-dispatch/references/landing-operations.mdscripts/pm/os-regen-merge.sh.claude/skills/package total: 2595 → 2593 (−2). This is internal agent tooling under.claude/, not the customer-publishedskills/directory, so the published-skills budget ruling does not apply; the numbers are reported anyway because the surface is skill-adjacent.Governed surface — draft, human merge
Two of the three files are under
.claude/**(one of them the dispatch prompt itself), so Prime Directive #14 applies: this PR stays draft, is never queued, never auto-merged, and is not flipped out of draft by an agent. The PM decides the landing path.Verification
Gate families derived mechanically with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(no path arguments — the script reads its own change set). 14 families matched; all run green, plus the 3 artifact-roster families the residue flags as "not evidence in EITHER direction" for paths underscripts/andscripts/pm/, which were run rather than reasoned about.Union re-run at final commit
5c49c442, exit codes captured before any pipe. Each gate's own verdict line:check:doc-formula-expressionsfirst came back exit=1 on a missing@objectstack/formula/distand then onpackages/lint/dist— the unbuilt-closure trap in a fresh worktree, not a finding. It is green above only afterpnpm --filter '@objectstack/lint^...' buildandpnpm --filter @objectstack/lint build.bash -n scripts/pm/os-regen-merge.shexits 0 (the edit touches a heredoc, so the parse is load-bearing). A control-byte self-scan over the three edited files (grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]') returns no match.Changeset: none, deliberately. Nothing published moves —
.claude/**andscripts/pm/**are repo-level agent tooling, in no package's publishedfiles.skip-changesetapplied.Generated by Claude Code