Repository navigation
tooling: publish computes each @objectstack/* floor from .objectstack-sha (objectui#12958) - #13024
Conversation
…tstack-sha (objectui#12958) `scripts/objectstack-floor.mjs` runs first in `pnpm changeset:publish`. It finds the earliest @objectstack/spec version npm carries whose objectstack release tag contains the pinned commit, raises every published manifest's @objectstack/* range below it to `^<floor>` (a range at or above it stays), records each move under the package's CHANGELOG.md version section, and exits 2 -- so `changeset publish` does not run -- when no published release contains the pin. Tags and history come from an anonymous treeless fetch of objectstack's public repository: no new secret. check-spec-range-floors stays after it: a release that contains the pin can still have removed a symbol the artifact uses. The nightly Spec Range Floors workflow runs the floor step before its scan and skips the scan on exit 2. Claude-Session: https://claude.ai/code/session_01FM29ZqLTrnPNXxijioZwMp Co-authored-by: Claude <noreply@anthropic.com>
…ry checks (objectui#12958) One `merge-base --is-ancestor` per spec release tag walked the whole objectstack history each time without it. Tighten the step's header and its test. Claude-Session: https://claude.ai/code/session_01FM29ZqLTrnPNXxijioZwMp Co-authored-by: Claude <noreply@anthropic.com>
… ledger (objectui#12958) Its CHANGELOG.md is a fixture written into a temp directory. Claude-Session: https://claude.ai/code/session_01FM29ZqLTrnPNXxijioZwMp Co-authored-by: Claude <noreply@anthropic.com>
维护者速读改了什么:objectui 发版( 为什么改:执行 12955 的裁决 B(「下限也可以在那时按「哪个已发布版本包含这个提交」机械地算出来」)。下限不再手写,不会再出现 12943、12946 那样漏提的情况;pin 指向尚未发布的 objectstack 提交时,也不会发出依赖着不存在版本的包。 风险与代价(含回滚):每次发版多读一次 objectstack 公开仓库和 npm,实测约 7 秒,不需要新密钥。pin 领先于所有已发布版本时发版会停下——这是裁决要的行为,要等 objectstack 发出包含该提交的版本。提升记录只写进 npm 包里的 CHANGELOG 和 GitHub Release,不提交回 席位意见:建议批准。席位逐段读过脚本:版本比较按 semver 先后(正式版排在其预发布之后),下限取"npm 上有、tag 包含 pin"的最早版本,只往上提不往下改,读不懂的范围直接拒绝且不写任何文件。用真实数据试跑:下限 你要做的:给本 PR 一次批准(APPROVED review)。 席位核对ACCEPT · objectui
Generated by Claude Code |
Fixes #12958
Executes ruling B on objectui#12955 (comment
6248859734): 「下限也可以在那时按「哪个已发布版本包含这个提交」机械地算出来」.pnpm changeset:publishnow starts withscripts/objectstack-floor.mjs, which computes the@objectstack/*floor from.objectstack-sha, writes it into every published manifest, and stops the publish when no published release contains the pin.⛔ Stays draft: the diff touches
.github/workflows/spec-range-floors.yml, a governed path (node scripts/check-governed-queue-guard.mjs --testanswers GOVERNED, exit 3). It also came from a dispatch. It needs an APPROVED review fromos-zhuangorhotlongbefore the claiming seat lands it.The six "Done when" items
objectstack-pin.mjs'sreadPin. It readsnpm view @objectstack/spec versions --jsononce, then fetches objectstack's@objectstack/spec@*tags together with their history. For each npm version that has a tag, in ascending semver precedence, it runsgit merge-base --is-ancestor PIN refs/tags/@objectstack/spec@VERSION. The first version that contains the pin is the floor.c5pin covers this.18.xexists on npm only as18.0.0-next.N. Versions are ordered by semver precedence: numeric identifiers compare as numbers, and a release outranks its own prereleases. So a pin insidenext.3floors atnext.3, even after18.0.0ships..changeset/config.jsonthere lists all seven that objectui reaches). The spec's version is therefore the floor for every@objectstack/*range. Before writing anything, the step checks that npm carries each moved name at that version.@objectstack/*range in all four dependency fields of every published manifest, the same populationdiscoverPublishedPackagesgives the other publish gates.^FLOOR.movedorkept.^,~,>=,=or a bare version) is refused with exit 1, and nothing is written.&&,changeset publishdoes not run. This is the floor computation having no answer, not a new gate, and no CI job is added.check-spec-range-floors.mjs: kept, and it now runs after the floor step.Spec Range Floorsfollows the same decision. It runs the floor step between the build and the scan, so the scan judges the floors a publish would ship. Without the step, the nightly would judgemain's hand-written floors, which nothing maintains any more.changeset versionhas already rendered the CHANGELOG in the version PR, the lane deletes pending changesets before publishing, andchangeset publishreads none.### Dependency floorsentry under that package's## VERSIONsection ofCHANGELOG.md. The entry lists each moved range and names the pin.filesincludesCHANGELOG.md, so the entry ships in the tarball.scripts/release-github-releases.mjscuts the GitHub Release body from the same file, so the entry appears there too.scripts/__tests__/objectstack-floor.test.tsruns real git over a throwaway objectstack-shaped history with annotated tags (c1 - c2 [next.0] - c3 - c4 [next.1] - c5 [next.2, tagged, not on npm] - c6) and a recorded npm list.c3→next.1); pin exactly a release commit (c4→next.1, notnext.0); pin newer than every published release (c5andc6→ no floor).--dry-runwrites nothing.changeset:publish, and the nightly runs it between the build and the scan.Where the tags come from at publish (dispatch hypothesis 3)
The release job's objectui checkout has no objectstack history, so the step brings its own.
git fetch --filter=tree:0 --no-tags) of+refs/tags/@objectstack/spec@*from objectstack's public repository into a temporary bare repository, then writes a commit-graph.Build @objectstack at the pinstep fetches the pin withobjectstack-pin.mjs. It already reaches npm as well. So the route needs no new secret and no new step inchangeset-release.yml.OBJECTSTACK_REPO_URLoverrides the URL, as it does forobjectstack-pin.mjs.--is-ancestorexit 1 is a real non-ancestor.Measured (dispatch hypotheses 1 and 2)
4016370af3:changeset:publishhad the two-gate form shown in the card,.objectstack-sha=2c9bf9430a1198bfaa5c0de9ff4a811838c6869c, andspec-range-floors.ymlexists.@objectstack/spec@VERSION, annotated.git ls-remote --tagslists a peeled^{}entry for each tag; 171 spec tags. The peeled commit of@objectstack/spec@18.0.0-next.3is exactly the current pin.nextdist-tag is18.0.0-next.3.--is-shallow-repositoryfalse. Control leg:merge-base --is-ancestor @objectstack/spec@17.0.0 @objectstack/spec@18.0.0-next.2exits 0.--is-ancestorper tag walked the whole history: the real dry run took 89 s. With the graph it took 7.4 s.18.0.0-next.3; 35 ranges moved, 2 kept (the@objectstack/specranges ofapp-shellandplugin-detail, already atnext.3); exit 0.## 17.7.0. This was not a publish.Gates (local; final run cited with its HEAD below)
pnpm exec vitest run scripts/__tests__(repo root, HEAD27b5fc4, clean tree):Test Files 189 passed | 2 skipped (191),Tests 5661 passed | 2 skipped (5663), exit 0. Onbd57569the same run had 1 failure:markdown-test-inputs.test.tsflagged the new test's fixtureCHANGELOG.mdas unadjudicated.27b5fc4adds the ledger entry.pnpm type-check:scripts(tsc -p tsconfig.scripts.json, the project that compilesscripts/__tests__): exit 0, same run.pnpm type-check(turbo over the workspace packages) was not run locally. It does not reachscripts/(see the header oftsconfig.scripts.json), and this diff changes no workspace package. CI runs it.pnpm exec eslint --no-inline-configon the two new files: exit 0.pnpm check:new-line-citations(0 new),pnpm check:control-bytes,pnpm check:test-path-roots,pnpm check:pre-install-import-graph, andnode scripts/check-changeset-presence.mjs(no changeset owed: no released package's source or published contract changed).ci-cd-pipeline-doc.test.tsgained one declaration: the new publish leg, reached through the action'spublish:input the same way as the other legs.Acceptance notes
mainkeep the hand-written ranges. The publish lane commits nothing, somain'sCHANGELOG.mdand the tagged tree never carry the moved ranges or theDependency floorsentry. The tarball and the GitHub Release do carry them.main's, so its tarball's copy will not include the earlier release's entry.main's manifest ranges will keep drifting below the computed floor, by design under ruling B (today 35 of 37). Nothing reads them as a claim any more except the next publish, which rewrites them.Line count
git diff --numstatagainst4016370af3: 353 added, 9 deleted.scripts/objectstack-floor.mjs181 and its test 119 come to 300, over the dispatch's ~250 for the step and its test. The rest: the nightly step 18, the doc section 12+3, its parity declarations 11+5, the gate-header note 5, the ledger entry 6, andchangeset:publish1+1.维护者速读(草稿)
pnpm changeset:publish)的第一步现在会做三件事。第一,按.objectstack-sha找出第一个包含这个提交、并且已经发布到 npm 的 objectstack 版本。第二,把所有发布包里低于这个版本的@objectstack/*版本下限提到它,并在该包这一版的 CHANGELOG 里写明提升了什么。第三,如果还没有这样的版本,就停止发版。夜检 Spec Range Floors 也会先跑这一步再检查;遇到「还没有版本包含这个提交」时跳过检查,不变红。main上的 CHANGELOG 和 tag 指向的提交不记录。changeset:publish的第一段,并撤回 workflow 里新增的那一步。.github/workflows/spec-range-floors.yml,属于受管面。需要os-zhuang或hotlong批准,之后由认领席落地。The implementing session is
https://claude.ai/code/session_01FM29ZqLTrnPNXxijioZwMp.Generated by Claude Code