Repository navigation
docs(skills): objectstack-upgrade names os migrate meta --write beside the default run - #22122
Conversation
…ide the default run The published upgrade skill said the command "writes nothing but --out" at the Quickstart comment and the failure-mode row, and that it "does not rewrite your source files". Since `--write` landed, that is true only of the default run. Every sentence stating what the command writes now holds for both routes: the default run lists the mechanical edits and writes only the `--out` snapshot; `--write` rewrites in place each edit it can trace to one literal in one project file, lists every other with the reason it was not written, never writes a semantic change, and on a disagreeing re-run restores every file and exits 1. Token ratchet paid in content, not wrapping: the duplicated `--out` recheck block (its first line was byte-identical to Quickstart step 1), the "in memory" clause the mechanism paragraph already states, and the stored/authored exclusivity sentence the stored-only-flag row already carries. 24772 -> 24748 bytes, 6193 -> 6187 tokens, 488 -> 484 lines. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0181E4ZeZmWyknawnauxD2CE
Contract reviewServed-tier: Inputs: card #22120 (body and thread), the diff of ① Derived judgments
② Semver levelNo package touched; ③ Boundary flags
Implemented-by: VERDICT: PASS |
维护者速读(终稿)改了什么:只改一份对外发布的技能 为什么改:客户项目的 agent 整包加载这份技能;读到「只写 风险与代价(含回滚):纯文本,无代码、无 changeset、无生成物(frontmatter 未动, 席位意见:ACCEPT;席内契约复核 PASS(记录 6046687007,head 你要做的(一个动作):以授权账号 APPROVE 本 PR(或亲手合入)。PR 保持 draft;获批后本席翻 ready、挂 auto-merge 入队并跟到 MERGED。 |
Fixes #22120
Clause-②: no
The published upgrade skill said that
os migrate meta"writes nothing but--out" (Quickstart comment, failure-mode row) and that it "does not rewrite your source files" (§1). Sinceos migrate meta --writelanded (a959493cdf), that is true only of the default run. This PR makes every sentence inskills/objectstack-upgrade/SKILL.mdthat states what the command writes true of both routes, within the skill's token ceiling.What changed (one file:
skills/objectstack-upgrade/SKILL.md)os migrate meta --from 16 --write # rewrite the proven sites in place.os migrate metarewrites no source file. It lists the mechanical edits and writes only the--outJSON snapshot." followed by one sentence for--write: it rewrites in place each edit it can trace to one literal in one project file, lists every other with the reason it was not written, never writes a semantic change, and if re-running the chain over the written files disagrees, restores every file and exits 1. The porting sentence now reads "Porting the edits left unwritten is yours" — true on both routes.migrate metareports changes, but the files are unchanged": cause "Working as designed — the default run only lists."; fix "Pass--write, or port the printed edits by hand; then replay from the target major to confirm 0 changes."--applyrefused / stored-only flag rejected": the tail "the authored-source chain has nothing to write to" (false under--write) now mirrors the CLI's own refusal text: "writes only--outand, with--write, the sources".Every claim is read from
packages/cli/src/commands/migrate/meta.tsatdb4c45b8c3(flag description andexclusive: ['stored'];WriteOutcome.status=written | restored | unwritten;printWriteOutcomelists each unwritten site as "not written [kind]: reason";this.exit(1)wheneverwrite.status !== 'written') and from thepackages/cli/src/utils/authored-source-codemod.tsmodule docblock (one object or array literal in one project file, statically matching the loaded value, no second reference to any binding the walk crossed; semantic TODOs never read). The default run and--writeare both described; the text does not say what--outdoes on a run with nothing to migrate and does not describe the semantic-notice list (both are in flight onmeta.tsin #22121 and #22115).Token ratchet — paid in content, not wrapping
node scripts/check-skills-token-ratchet.mjs(tokens = ceil(utf8 bytes / 4); ceiling for this file 6193):db4c45b8c3)9bb10014)Diff: +13 / −17 lines. Gate line at
9bb10014:✓ check-skills-token-ratchet: skills/objectstack-upgrade/SKILL.md is 6187 tokens (ceiling 6193; headroom 6).The growth (+179 bytes gross) was paid by deleting three pieces of duplicated content, no rule, failure-mode row or needed command among them:
--outrecheck code block in §1 — its first line was byte-identical to Quickstart step 1 (os migrate meta --from 16 --out .upgrade/migrated.stack.json), and the "replay from the target major, 0 changes" recheck is already carried by Quickstart step 3, the §3.3 callout and the failure-mode row;--storedsubsection — the failure-mode row "--applyrefused / stored-only flag rejected" carries the same fact with its fix, and the preceding "--storedtakes no--from" keeps the other direction.Scope held
packages/spec/**(the retirement sentence inretired-key.tsis feat(cli):os migrate meta --write— the AST codemod that rewrites authored sources for the mechanicalappliedset (v18) #9591's spec-lane remainder; this text uses its vocabulary — "lists the mechanical edits" — so the two read consistently once that lands). Nocontent/docs/**(devx lane under feat(cli): os migrate meta --write — write the chain's mechanical edits into the authored sources #22108). No generated listing: frontmatter unchanged,check:skill-docsgreen ("Skill docs in sync").references/examples-upgrade.md:57("Ported into sources fromos migrate meta --out") andevals/protocol-major-upgrade.json(must_containincludes--out; the eval's expected answer describes the default route, which still rewrites no source).Gates
Derived with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackfrom the changeset at9bb10014(24 families; identical to the path-derived list). All 24 run, exit codes recorded beside the printed command and reconciled with--ran(see the report comment on #22120 for the table).check:doc-formula-expressionsfirst exited 3 (prerequisite:@objectstack/lintnot built) and was re-run after the prescribed build.Acceptance notes
SKILL.md:103says "os migrate meta --from 10replays every step in order", butMIGRATION_SUPPORT_FLOOR = 16(packages/spec/src/migrations/registry.ts:79), so that command refuses withMigrationFloorError/unsupported_from_major— the skill's own failure-mode row says so. Not fixed here: the sentence's point ("several majors late is the designed-for case") cannot be re-exampled truthfully on a 16 → 17 chain, so the fix is a rewording, not a mechanical edit.evals/protocol-major-upgrade.jsoneval 1expected_outputsays "the command rewrites nothing on disk" — true of the default route it describes; a--write-aware eval is a product decision, not a drift fix.维护者速读(草稿)
改了什么:只改一份对外发布的技能文件
skills/objectstack-upgrade/SKILL.md。原文在三处断言os migrate meta"只写--out、不改源文件";自--write落地后这只对默认运行成立。现在每一句关于"命令写什么"的话都同时对默认运行和--write成立:默认只列出机械修改、只写--out快照;--write只就地改写它能证明来源的站点(一个项目文件里的一个字面量),其余逐条列出未写原因,语义修改永不写,复跑不一致时恢复全部文件并以 1 退出。为什么改:客户项目的 AI agent 整包加载这份技能;它读到"命令只写
--out"就永远不会发现--write,而读到无条件的"自动改写"又会被误导。文字必须与 CLI 源码一致(meta.ts的 flag 描述、written | restored | unwritten三态、exit 1),并与 spec 侧退休句的措辞("列出机械修改")保持一致。风险与代价(含回滚):纯文本改动,无代码、无 changeset、无生成物。token 棘轮:6193 → 6187(上限 6193),净减 24 字节,靠删除三处重复内容支付,未删任何规则、故障行或命令。回滚即 revert 本 PR 的一个提交。注意
#22121(--out在无变更运行时的行为)与#22115(语义通知列表)在meta.ts上并行,本文未对那两点做任何断言。席位意见:(留空,席位定稿)
你要做的:
skills/**为 Tier H 受管面:请以授权账号 APPROVE 一次,或亲手合入;本 PR 保持 draft,不由 agent 翻 ready。Generated by Claude Code