Repository navigation
fix(pm): dispatch-gates derives the published-README export gate from the claims a diff takes away - #31314
Conversation
… the claims a diff takes away check:published-readme-exports reads the built types of 68 packages through the imports of 129 published documents, so a path net would hand it to nearly every card and --commands never derived it. A new change-kind row reaches it through what the documents claim: a new fenced import or member call in a published document, a manifest field or workspace glob that moves the population or a type entry, or a claimed name a reached package's source declares fewer times than the merge base did. The row names the build the gate needs, so an unbuilt run reads NOT MEASURED. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nVzx9yUpEnQaYZcEg
|
domain:devx#3 · os-project-manager · session_01FEkQ5njkh3xbcDN6EtSfw7 席位核对Verdict: ACCEPT · head
|
Requested by Leehom · project thread
Fixes #31292
Clause-②: no
Metadata-protocol: none
维护者速读
dispatch-gates --commands新增一条派生行,把check:published-readme-exports(已发布 README 里写的 import 必须在包的已构建类型里存在)派给「真的可能让它变红」的改动:README 新写了 import 或成员调用、package.json的发布字段(exports/types/files等)变了、或某个被 README 引用的名字在源码里被删除或改名。scripts/pm/下的派生工具与自测,不改任何门禁检查什么,不动 workflow。最坏情况是多派一次(需要先构建)或漏派(即现状)。回滚即还原本 PR。scripts/pm/dispatch-gates.mjs的takesAReadmeClaim与publishedReadmeReach;scripts/pm/dispatch-gates.data.mjs新增的那一行(含构建前置命令)。packages/core/src里ObjectKernel类改名后跑node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack,预期清单出现pnpm check:published-readme-exports;还原后不再出现。What changes
check:published-readme-exportsruns on every PR (lint.yml, after the workspace build) and--commandsnever handed it to a card: it sat in the artifact-roster block, and the seat ruling on #30763 keeps that block out of--commandswholesale. It is the one family #31257 left (PR #31291 closed the other seventeen), because its reach is the BUILT type entries of 68 packages that 129 published documents import from, so a path net would name it for nearly every card.This PR adds one change-kind row,
published-readme-claim, bound to a claim net: it reads what the published documents claim and asks whether the diff takes one of those claims away. Three limbs, each judged against the blob at the change set's merge base (the working tree is the head):receiver.path.member(sitepackage.jsonwhosename,private,files,exports,typesortypingschanged; the workspace file'spackages:globsoverridesexport * fromlinedistfileThe names are the gate's own, read by copies of its extraction (
readFences,extractImports,memberCallSites, the one-hopconst x = [await] [new] Name(receivers). Where a copy must choose, it is WIDER: every candidate receiver is kept where the gate drops a shadowed one. The gate's module loadstypescript, so it is held to the copy through a spawned child in the self-test rather than imported (the no-install rule). The workspace parse is imported fromscripts/workspace-enumerator.mjs, the module the gate itself uses (dependency-free, no path population).The row's lead names the build prerequisite runnably, as
lint.ymlspells it (pnpm exec turbo run build --filter=./packages/* --filter=./packages/*/*), and says that the gate's exit 3 on an unbuilt tree is NOT MEASURED, never green, so a--ranrecord carrying:: exit 3reconciles it as NOT-MEASURED.Recall, against the gate's own reader (at
7c523aa1)outsideUiTree(publishedDocs())), none differing.Precision, replayed over the last 500 first-parent commits on
main303 of them touched a reached package's TypeScript; 17 would derive the gate (10 by a removed claimed name, 7 by a manifest field, 3 by a new document claim). For comparison, a path net over the reached packages would have derived it for every one of the 303.
Tests
New cases in
scripts/pm/dispatch-gates.self-test.mjs:export * fromline are hits; adding a method, a new file, removing an unclaimed name, a claimed name dropped from a comment only, a test file, adistfile and a path in no reached package are misses. A new scoped import and a new member call on a built receiver in a live published document are hits; a prose-only edit, a foreign-scope import and a deleted document are not. A changedexportsand changed workspace globs are hits; a version bump and changedoverridesare not. Each declaration shape the reader counts is pinned.uitree) and its fence languages are exactly the net's. A tree with no published document throws rather than reaching nothing.Ablation (one fast-tier run, four mutations through nested
scripts/ablation-replace.mjs; restore proven four times: blob == HEADe7178e75c1fe,git diff HEADempty), 6 of 2205 cases red, each named:<widened to<=⇒ "MEMBER: adding a method is not a hit", "MEMBER: a claimed name dropped from a comment only is not a hit";Acceptance notes
.github/**edit; no change to what any gate checks.Verification
Gate union from
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon this diff (3 paths vs merge base7c523aa10): 30 families, all run on headaa386612, each exit 0, reconciled with--ran: "30 derived famil(ies) accounted for — 30 run, 0 NOT-MEASURED (a DERIVED zero — all 30 recorded an exit code and none of them is 3)". The derivation does not namecheck:published-readme-exportsfor this diff, as intended: it touches no reached package, document or manifest.30 gates, exit codes captured before any pipe
node scripts/check-closing-keyword-parity.mjs(and--self-test),check-comment-mask-corpus.mjs,check-declaration-mirrors.mjs(and--self-test),check-self-test-wired.mjs(and--self-test),check-self-test-workflow-commands.mjs(and--self-test),check-whole-set-label-write.mjs(and--self-test),ci/plan-test-core-shards.mjs --self-test: exit 0 eachpnpm check:agent-test-spelling,check:bash32-floor,check:ci-filter-parity,check:cli-command-ids,check:cross-package-test-inputs,check:declared-population-live,check:driver-memory-census,check:entry-guard,check:gitlink-declared,check:nul-bytes,check:parse-guard,check:pnpm-filter-targets,check:pnpm-flag-spellings,check:ratchet-remedy-authority,check:refd-timer-probe,check:scripts-symbol-anchors,check:watch-hint-literal: exit 0 eachpnpm check:pm-dispatch-gates: exit 0, "✓ dispatch-gates self-test (fast tier): 2205 cases pass; 9 slow section(s) deferred." (394 s)export class ObjectKernelrenamed inpackages/core/src/kernel.ts(uncommitted),--commandslistspnpm check:published-readme-exports; aftergit checkout HEAD -- packages/core/src/kernel.tsit does not.node scripts/pm/dispatch-gates.mjs --self-test, slow tier included) was running onaa386612when this PR opened; its verdict is in the os-dev report on dispatch-gates: check:published-readme-exports is never derived by --commands for a package-source diff (the one family #31257 left) #31292. The slow section's check (every gate claim declared in its closure) was measured standalone at 377 of 377 net claims, none undeclared.npx eslint --no-inline-configon the three files: exit 0. No package touched, so no packagelint/test/typecheckis owed.skip-changeset:scripts/pm/**ships in no package.Human Minimum
packages/specholds no runtime logic. (not touched)main, one pull request.scripts/pm/**), soskip-changeset; both declaration lines are filled in.packages/specnot touched.Generated by Claude Code