Repository navigation
fix(pm): dispatch-gates derives the CLI command-id, ADR anchor and error-code provenance gates from the diffs that break them - #31254
Merged
Conversation
…ror-code provenance gates from the diff that can break them Three lint steps judge populations no path trigger reached, so --commands never handed them to a card and each cost a CI round trip: - check:cli-command-ids reads a quoted binary-name literal in any package source and every CLI command module. A content predicate reaches the literal (a net held against the gate's own reader in the self-test) and a path predicate reaches the command surface and manifest. - check:adr-symbol-anchors reds when an anchored declaration is removed or an anchored file moves, from a diff touching no ADR. The predicate reads the anchored files from the gate's own corpus registration. - check:error-code-provenance reads the same stamp sites as the vocabulary gate and was filed under the artifact rosters; it rides that entry now. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mUdL1EUGghY7nGHww
This was referenced Nov 7, 2026
Contributor
Author
|
domain:devx#3 · os-project-manager · session_01FEkQ5njkh3xbcDN6EtSfw7 席位核对Verdict: ACCEPT · head
Generated by Claude Code |
This was referenced Nov 7, 2026
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.
Requested by Leehom · project thread
Fixes #30763
Clause-②: no
Metadata-protocol: none
维护者速读
dispatch-gates --commands新增两种「按改动内容判定」的门禁派生,并给已有的错误码派生补上一道门禁:改到含 CLI 命令字面量的源码或 CLI 命令文件时派生check:cli-command-ids;改到被 ADR 按符号锚定的文件(或移走/删掉任何被锚定的文件)时派生check:adr-symbol-anchors;改到含错误码字面量的文件时,除原有的词表门禁外再派生check:error-code-provenance。scripts/pm/下的派生工具与其自测,不改任何门禁检查什么,也不动 workflow;最坏情况是多派生一道门禁(多跑几秒)或漏派生(即现状)。回滚即还原本 PR。scripts/pm/dispatch-gates.mjs的carriesACliCommandLiteral与breaksAnAdrAnchor;scripts/pm/dispatch-gates.data.mjs新增的三条CHANGE_KIND_ROWS门禁行。node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack packages/cli/src/commands/migrate/apply.ts packages/services/service-push/src/push-plugin.ts,预期输出里有pnpm check:cli-command-ids与pnpm check:adr-symbol-anchors(main 上两者都没有)。What changes
Three lint steps run on every PR (
lint.yml, nopaths:filter) over a population no path trigger indispatch-gatesreached, so--commandsnever handed them to a card. Each now reaches a card through a change-kind row (CHANGE_KIND_ROWS), the same channel the vocabulary, status and durability gates already use:check:cli-command-idssrcpath segment in any package (no subtree spelling covers it); its only declared root isscripts/**. Its command-module duty spells the commands dir package-relative.check:adr-symbol-anchorsdocs/adr/**only; an anchor also reds from the anchored file's end.path#Symbol, or moves/deletes a file any ADR anchors. The anchored files are read with the gate's own corpus registration and the shared extractor (scripts/symbol-anchors.mjs), cross-repo anchors left out.check:error-code-provenance--commands.check:dispatcher-error-vocabularyon the existingerror-code-literalrow (same stamp sites, population-disjoint verdicts).check:cli-command-ids: content, not every diff. The step is unconditional in CI, but at about 22 s locally it is not cheap (ADR anchors ~7 s, provenance ~6 s), so a for-every-diff family was rejected per the order's precision rule. The literal limb is a net around the gate's reader, not a copy of it: the gate's module loadstypescriptat import time anddispatch-gatesruns in checkouts with no install, so it is not imported. The self-test holds the net to the gate's ownbinNamesOfandliteralsOnin a child process.Tests
New self-test cases in
scripts/pm/dispatch-gates.self-test.mjs:osx, test files,__tests__, non-JS, CLI source outside its commands dir, no declared CLI. Live: CLI discovered from its manifest, a command module reached, discrimination (424 of 7002). Gate-reader parity in a child process: same binary names, and every file the gate's reader finds a literal in is inside the net (missed: none). Rendering, whole table, runnable union, STALE.error-code-literalrow; the fix(scenarios): run grading reads the card's today, app validation codes, overstep probes, scope figures and served keys #31214 shape (a scenarios-package constant bound toVALIDATION_FAILED) derives it through the whole table; the section now carries both code gates.Ablation (one fast-tier run, both guards removed through
scripts/ablation-replace.mjs, the first held and the second in run mode, restore proven: blob == HEAD098f38af9ac9,git diff HEADempty):Acceptance notes
813399e1:--commandson that PR's 17 paths printed 54 commands and notcheck:error-code-provenance; the human rendering listed it under "Artifact rosters" (outside the runnable total). Theerror-code-literalkind already fired on 5 of the paths (scenario-operation-grade.tsboundVALIDATION_FAILED_CODE: ErrorCode = 'VALIDATION_FAILED'). Same defect class, so fixed here. With this branch's tool on that tree: 56 commands,+ check:error-code-provenance,+ check:cli-command-ids. Recall of the predicate against the gate's own--reportat fe97d85: 162 of 162 site files; the gate's any-name constant limb adds 0 files the predicate does not reach.lint.ymlsteps over a whole-root population that--commandsdoes not derive for a diff outside their home package (probe:packages/qa/scenarios/src/score/scenario-run-grade.ts):--commands:check:init-service-contract,check:live-db-isolation,check:meta-type-normalized,check:optional-error-sink,check:resume-authority-declared,check:route-envelope,check:runner-env-posture,check:settings-bind-window,check:startup-registry-verdict,check:verify-stand-in,check:wildcard-fallthrough.check:stack-collection-maps,check:authz-resolver,check:error-code-casing,check:filter-alias-parity,check:tenant-chokepoint,check:object-def-param-keys,check:published-readme-exports. Read from a walk/ls-filessignature in each gate's source; population width not measured per family.check:engine-double-contract,check:i18n-stale-fill,check:error-status-conformance, and nowcheck:error-code-provenance.--commandsemit the roster or wide blocks. That is a choice for the seat, put in the report as an open question..github/**edit, and no change to what any gate checks.Verification
Gate union derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon this diff (30 families), run on head2653b6b1(after mergingorigin/main), reconciled with--ran: "30 derived famil(ies) accounted for — 30 run, 0 NOT-MEASURED (a DERIVED zero …)".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(19 s),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): 2021 cases pass; 7 slow section(s) deferred."node scripts/pm/dispatch-gates.mjs --self-test, the slow tier CI runs onmainonly): on head2653b6b1, "✓ dispatch-gates self-test: 2310 cases pass." (fast 2021 cases in 428 s, slow 289 cases in 1363 s).pnpm exec 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.Generated by Claude Code