Skip to content

fix(spec): check:react-declaration-parity 无 MANIFEST 时报错退出,门禁台账改记「此处跑不了」(#4690) - #5959

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-4690-parity-gate-wiring
Aug 6, 2026
Merged

fix(spec): check:react-declaration-parity 无 MANIFEST 时报错退出,门禁台账改记「此处跑不了」(#4690)#5959
baozhoutao merged 1 commit into
mainfrom
claude/issue-4690-parity-gate-wiring

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes #4690

前提复核(先证伪,再动手)

三条现象在 origin/main(72bd873)上全部成立:

断言 复核方式 结果
不在任何 workflow 里 git grep -l check:react-declaration-parity origin/main -- .github/workflows/ 无输出,exit 1
无 MANIFEST 时静默 skip 退出 0 pnpm --filter @objectstack/spec check:react-declaration-parity ⚠ … manifest unavailable … — skipping. / exit=0
check:generated 把它与另外 7 个并列为「deliberately not run」 check-generated.tsNO_GENERATOR 成立

PM 裁决的分叉判据:MANIFEST 在本仓 CI 里拿不到(实测,非推断)

脚本要的是 objectui 的 sdui.manifest.json唯一生产者是 objectui 的 scripts/dump-public-manifest.mjs:用 Playwright chromium 打开构建后 console 的 dev/manifest-dump.html,读 window.__MANIFEST —— registry 是浏览器应用(plugin-map / charts 拉浏览器专属依赖),Node 侧枚举不出来。逐个核对本仓候选来源:

  • packages/console/ 只跟踪 4 个文件,dist/.gitignore 里 —— 没有任何签入副本(git ls-files | grep sdui.manifest 为空);
  • scripts/build-console.sh(ci.yml 真正会跑的那个)故意不产出 manifest,自己的收尾注释就写着不能把浏览器拖进 console 构建;
  • 已发布的 @objectstack/console tarball 里也没有:16.1.0 共 513 个文件,sdui 命中 0;里面的 dist/manifest.json 是 PWA manifest。也就是说连 CLI 的 @objectstack/console/dist/sdui.manifest.json 兜底都解析不到东西;
  • 没有任何 workflow 跑 pnpm sdui:manifest 或装 Playwright(showcase-smoke 装的那份与此无关)。

结论走 PM 裁决的第二支:不把一个必然 skip 的步骤接进 lint.yml —— 那只是给同一个缺陷套上 CI 外衣。因此本 PR 没有改 .github/workflows/lint.yml(#5827 的同文件冲突面归零)。

改了什么

  1. 「跑不了」变成失败,不再是 skip。MANIFEST、路径不存在、JSON 读不动、dump 里零个 component —— 四条路径统统 exit 1,并打印可执行的处方(pnpm sdui:manifestOBJECTUI_ROOT=../objectui pnpm objectui:build、以及它需要的浏览器)。刻意不受 --strict 支配:那个 flag 决定「有分歧」值多少钱,而这里是另一件事 —— 根本没发生比较。把它挂到 flag 上等于把 check:react-declaration-parity 是唯一没接进任何 workflow 的源码审计门禁,且无 MANIFEST 时静默 skip 退出 0 —— 它现在永远不可能红 #4690 的洞往下挪一层。空 dump 是同族的新增覆盖:objectui 的 dumper 本就拒绝空 manifest,这里对应地拒绝,而不是把每个 block 都报成 missing。
  2. 台账不再暗示「有人在跑」。 check:generated 把它从 NO_GENERATOR(可跑、只是本聚合器不跑)移进新的 EXTERNAL_INPUT_REQUIRED,记录缺的输入与它的生产者,并打印 cannot run here: check:react-declaration-parity — needs MANIFEST=…; runs in scripts/gen-sdui-manifest.sh。沿用 EXPLICIT_GENERATORS(check:authorable-surface--check 模式下也会重写 authorable-surface.base.json —— 一次纯核验会改工作区,且任何无关 PR 都能因此静默推进删除门的锚点 #5358/fix(spec): 重锚 authorable-surface.base.json 改为显式动作 —— 构建不再顺手推进删除门的锚点 #5807)的先例:分类带一条被强制的断言,而不只是一个标签 —— 若 scripts/gen-sdui-manifest.sh 不再于非注释行调用该门禁,reconciliation 直接红。被记成「在别处跑」却哪里都不跑,正是这个分类要暴露的洞。
  3. AGENTS.md 同步:它不再属于「pure checks with no generator」那串枚举;新增一段说明它是唯一 check:generated 跑不了的门禁、manifest 从哪来、以及「不要靠重新加回 skip 来消红」。

「这个门禁能红」本身是可验证的(#4804/#4777 的验收杠)

原有测试全部只读报文文本,而 run() 按设计吞掉退出码 —— 也就是说它们对一个「永远 exit 0」的脚本同样会绿,那恰好就是这个门禁当时的状态。新增的 describe 断言退出码:

× 伪造 registry-only 输入 → exit 1,报文点名 zzzFabricatedRegistryOnlyInput
× baseline 里存在的 block 从 manifest 消失 → exit 1,报文点名 block vanished from the manifest
✓ 与 baseline 一致 → exit 0(对照组:证明上面两条不是因为别的原因红)
× 四条「跑不了」路径 → 各自 exit 1

反向验证(方向事先预判为红,实测即红):

  • 把删掉的 skip 分支塞回脚本 → a missing MANIFEST is a failure, not a skipa MANIFEST path that does not exist fails loudly 两条转红,AssertionError 里就是旧的 manifest unavailable — skipping.。另外两条「跑不了」用例保持绿是如实的:旧分支从来只覆盖「未设/不存在」,畸形 JSON 当年是未捕获抛栈、空 dump 当年直接 exit 0,它们不可能靠还原这条分支变红。
  • gen-sdui-manifest.sh 里的调用注释掉 → check:generated --reconcile-only exit 1:EXTERNAL_INPUT_REQUIRED says … runs via scripts/gen-sdui-manifest.sh, which no longer invokes it.(注释行不算数,这正是「非注释行」判定要挡的伪证据。)

验证

pnpm --filter @objectstack/spec typecheck   → tsc --noEmit 通过;check:test-typecheck OK(79 files / 691 errors 仍锁在 debt 台账)
packages/spec 全量 vitest                    → 323 files / 8275 tests 全绿(260s)
node scripts/check-nul-bytes.mjs            → OK(5726 个文件,无裸控制字节);改动文件另做控制字节自扫,零命中

authorable-surface.base.json 未出现在改动清单里(逐文件核对过 git status)。

Changeset

@objectstack/spec: patch —— 依 #4472 先例(同一个脚本的上一次改动就是 patch changeset),因为对任何手工跑它的人来说行为是可见变化:以前静默退 0,现在带处方红。

遗留

manifest 在 CI 里究竟该从哪来(在本仓 workflow 里 clone objectui 并加浏览器 / 让 objectui 发布 manifest 制品 / 在 objectui 侧做 Node 端 dump),是一个带成本的架构决定,已按 PM 裁决 (c) 另行开单记录测量数据,不在本 PR 内猜。


Generated by Claude Code

…不了」(#4690)

The gate had no path on which it could go red: it is in no workflow, and a
manual run without MANIFEST printed a warning and exited 0.

Measured first, before wiring anything: the manifest cannot be produced in this
repo. Its only producer drives a real browser at objectui's built console
(`window.__MANIFEST`); packages/console/dist/ is gitignored, build-console.sh
deliberately does not dump one, and the published @objectstack/console tarball
carries no sdui.manifest.json (16.1.0: 513 files, 0 `sdui` matches). Wiring a
lint.yml step would have wired a permanently-skipping step.

- missing / nonexistent / malformed / empty MANIFEST now exit 1 with a
  prescription naming the producer, independent of --strict (that flag prices a
  divergence; this is "no comparison happened").
- check:generated moves it from NO_GENERATOR into a new EXTERNAL_INPUT_REQUIRED
  bucket recording the missing input and its runner, whose honesty is enforced:
  reconciliation fails if gen-sdui-manifest.sh stops invoking the gate.
- Tests assert EXIT CODES: a fabricated registry-only input and a vanished block
  each exit non-zero naming themselves; an accepted state still exits 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01559M8FVm6W6vDLABL3jvdW
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 6, 2026 1:00pm

Request Review

@github-actions github-actions Bot added the size/m label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Aug 6, 2026
@baozhoutao
baozhoutao marked this pull request as ready for review August 6, 2026 13:11
@baozhoutao
baozhoutao enabled auto-merge August 6, 2026 13:11
@baozhoutao
baozhoutao added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit a34fd2e Aug 6, 2026
25 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-4690-parity-gate-wiring branch August 6, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

2 participants