Repository navigation
docs: say pnpm run setup for the first-time install and spec build - #24370
Conversation
Under pnpm 10 a bare `pnpm setup` resolves to pnpm's own built-in command: it writes PNPM_HOME into the shell rc and exits 0, and the root `setup` script (install + spec build) never runs. `pnpm run setup` runs the script. AGENTS.md's Build & Test block and examples/README.md's Getting started block now say `pnpm run setup`; the AGENTS.md comment names the built-in so the `run` is not tidied away again. Claude-Session: https://claude.ai/code/session_01FM29ZqLTrnPNXxijioZwMp Co-authored-by: Claude <noreply@anthropic.com>
维护者速读改了什么: 为什么改:在 pnpm 10 下,裸 风险与代价(含回滚):只改两行文档,不碰代码,没有对外发布面,也不加门禁。回滚就是 revert 这个 PR。 席位意见:建议批准。改动与 main 上的 你要做的:同意就给这个 PR 一次批准(APPROVED review),之后由 devx 席位落地。 席位核对ACCEPT ·
Generated by Claude Code |
Fixes #24357
Clause-②: no
What changed
One line in each of two files, net ±0 lines per file:
AGENTS.md, Build & Test block:pnpm setupbecomespnpm run setup, and the comment now ends(bare `pnpm setup` is pnpm's own built-in), so the next edit does not tidy therunaway. The comment column stays aligned with the lines around it.examples/README.md, Getting started block:pnpm setupbecomespnpm run setup. The comment column stays aligned.Nothing else is touched. The root
package.jsonsetupscript is unchanged.Why: measured on pnpm 10.31.0
10.31.0 is both the root
packageManagerpin and the container'spnpm --version. Every probe of the bare form ran withHOME,SHELL=/bin/bashandXDG_DATA_HOME/XDG_CONFIG_HOME/XDG_CACHE_HOME/XDG_STATE_HOMEpointed at a throwaway directory in the session scratchpad, withPNPM_HOMEunset. I read the sha256 of the container's real~/.bashrc,~/.zshrcand~/.profilebefore and after every probe, and none of them changed.pnpm setupsetup, which writes a marker file.bashrcwith the# pnpm...export PNPM_HOME=......# pnpm endblock and printed "To start using pnpm, run: source ...". No marker file.pnpm run setupSETUP_SCRIPT_RANand wrote the marker file.pnpm setupa2a3777bf5packages/spec/distwas absent before and after.pnpm run setupHOMEso it uses the real storepnpm install && pnpm --filter @objectstack/spec build. It printedAlready up to date, ran the spec build tocheck-dts-emitted: 38/38and stampedpackages/spec/dist/.build-input-hash.os-verify-lockVERDICT command-exit 0)So the failure is silent. Bare
pnpm setupexits 0, prints text that looks like success, and edits the contributor's shell rc. It leaves no install and no spec build behind.pnpm help setupagrees: "Usage: pnpm setup. Sets up pnpm".Every
pnpm setuphit and its dispositionOn the base,
git grep -nE 'pnpm setup\b' a2a3777bf5 -- . ':!**/CHANGELOG.md'found 3 hits. The excludedCHANGELOG.mdfiles have 0 hits, and they are release-owned anyway.AGENTS.md:40examples/README.md:42.github/workflows/lint.yml:157After the change, the same grep finds 2 hits:
lint.yml:157, and the newAGENTS.mdcomment, which names the bare form on purpose. On the base,git grep -nE 'pnpm run setup'found 0 hits.I also intersected the 206 root
package.jsonscript names with pnpm 10's command names. The only other collisions aretest, where pnpm's built-in runs the script so nothing breaks, andversion, which every tracked caller already spellspnpm run version.The open choice I settled: the comment clause
Should the
AGENTS.mdline say why it isrun? I judged it on the four axes. Business need: the readers are first-time contributors and every new agent session, and barepnpm setupis exactly what they ran. Long-term soundness: the clause states the trap once, where the command lives, with no gate and no new file. Making AI mistakes structurally harder: an agent that knowspnpm SCRIPTnormally runs a script will shortenpnpm run setupback topnpm setup. The clause names why this one must keeprun, and that shortening is how the defect got in. No scope spread: one line, no number, no incident narrative (check:pm-skill-id-lintis green).examples/README.mdgets only therun, because its readers follow it rather than edit it.Changeset
None. The PR carries the
skip-changesetlabel: both files are repo-root docs, and no package'sfiles[]ships either of them. The devx lane rule says rootscripts/, docs and test-only changes getskip-changeset.Gates (local subset, at
2601bcc81)node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 42 commands for the two paths, the same list as the dispatch-time reading. I ran each one in the worktree and captured its exit code before any pipe:check:pm-governed-prose,check:pm-governed-merges,check:pm-skill-id-lint(87 files clean),check:pm-skill-ratchet,check:nul-bytes,check:cross-package-test-inputs,check:published-files,check:test-source-aliasandcheck:examples-live-imports, plus everynode scripts/check-*.mjsrow and its--self-test.PREREQUISITE NOT MET, which reads as NOT MEASURED, not as a failure:pnpm check:dual-build-cjs-loadsandpnpm check:lean-entry-closure. Both load built output of packages this diff does not touch, and onlypackages/specis built in this worktree. CI's Build Core and Lint jobs run them over a full build.check:dts-closureandcheck:sourcemap-no-sources-contentexited 0 but swept 1 built package (@objectstack/spec) for the same reason.dispatch-gates --ranwithCOMMAND :: exit CODElines printed: "42 derived famil(ies) accounted for — 40 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".No package is touched, so no package build closure,
pnpm testorpnpm typecheckis owed. No tested behaviour changed, so there is no ablation. Every family CI runs on the PR is read from the PR's check-runs, not re-run here.Acceptance notes
examples/README.mdrunspnpm installon the line abovepnpm run setup, and the script runspnpm installagain. That is redundant but harmless, since the second install is a no-op. It is polish, not a defect, so I left it as written. Carrier: none.package.jsonoutside this card's file surface, objectui kept thesetupname and moved its docs topnpm run setup, and nothing in this repo calls the script by any other spelling. Carrier: none.维护者速读(草稿)
改了什么:
AGENTS.md「Build & Test」段和examples/README.md「Getting started」段里首次安装的那一行,pnpm setup改成pnpm run setup。AGENTS.md那一行的注释补了半句,说明裸pnpm setup是 pnpm 自带的命令。每个文件只改一行,行数不变。为什么改:pnpm 10 下,裸
pnpm setup跑的是 pnpm 自带的 setup 命令,它往 shell 配置文件里写PNPM_HOME。仓库根package.json里的 setup 脚本(装依赖 + 构建 spec)根本不会跑。这个命令以 0 退出,打印的提示看起来像成功了,所以照AGENTS.md做首次安装的新同事或新 agent 会以为已经装好,实际上依赖没装、spec 没构建,shell 配置还被改了。两种写法都在本仓根目录和一个隔离夹具里实测过,全程没碰真实的 rc 文件。风险与代价(含回滚):只改两行文档,不碰代码,没有发布面,不加门禁。代价是首次安装命令多了 4 个字符。回滚就是 revert 这个 PR。
AGENTS.md是 Tier H 治理面,所以整个 PR 要等你批准才能落地。席位意见:
你要做的:看一下这两行 diff,同意就给一次批准(APPROVED review),之后由席位落地。如果不想要注释里那半句,告诉席位只保留
pnpm run setup即可。Generated by Claude Code