fix(spec,docs): check-react-blocks-conformance 比的是两份声明,不是声明↔实现 (#4472) - #4491
Merged
Conversation
它的文件头原话是"confirms the objectui components ACTUALLY implement the props the spec protocol declares"。它做不到,也从来没做过。它 diff 的两边都是**声明**:左边是 spec zod schema 的 props,右边是 objectui 注册表配置声明的 inputs——由 `manifestFromConfigs` 原样抄进 sdui.manifest.json。整条链路里没有渲染器。所以一个 **两边都声明、没有任何东西读**的 prop,在这道门禁眼里是完美一致。 #4413 就是代价:四个 record:* 块发布了没人读的 objectName/recordId,在 kind:'react' 页面上渲染成 "bind a record to preview" 占位符,而 baseline 里 `{ "frontendOnly": [], "missing": false }` 稳稳绿了整个缺陷存续期。最后是人肉读 objectui 渲染器发现的。**一道报绿的假门禁比没有门禁更危险**——没有门禁时人会去核对。 Prime Directive #10(declared ≠ enforced)落在本该抓 #10 的东西自己身上,和 #1475 「spec 声明 9 种校验规则、执行器只认 3 种」同形。 - 改名到它真正做的事,名字和文件头一起改(名字本身是误信任的一部分): check-react-blocks-declaration-parity.ts、react-declaration-parity.baseline.json, baseline 键 frontendOnly → registryOnly(是"注册表声明了",不是"前端实现了")。 - 作用域说明随**每一次**输出走,包括绿的那次。对这道门禁形成判断的人读的是 CI 日志, 不是文件头。 - 它现在真的 gate。gen-sdui-manifest.sh 调用时没传 --strict,还把退出码吞进一个 ⚠, 所以连它看得见的那部分也只是被记录、从未被拦住(#4472 次要发现 1)。ratchet 只对 相对 baseline 的**新增**分歧开火,所以失败必定是一次有意的注册表改动。 - 声明由测试钉住。check-react-blocks-declaration-parity.test.ts 断言它能看见的两个 方向、caveat 确实被打印、以及那句"实现"声明不会回来——Prime Directive #10 可执行的 那一半。 它看得见的东西没变,也仍然值得留着:spec-only(palette 缺口,软信号)、registry-only (未文档化的扩展,被 ratchet)、missing(没注册/非 public)。看不见的只有一类:两边都 声明了,没人读。 渲染路径上的证据只能从渲染路径上取,那是 objectui 那侧。那里的 public-block-binding-reach.test.tsx 把每个声明了 objectName 的 public block 挂在一个 会记录调用的 dataSource 下,断言绑定确实到达了数据层;首跑就把五个绑上的和三个没绑上 的分开,并暴露两个同形真缺陷(objectui#3144)——这恰好证明这类证据在 spec 侧从来取不到。 ADR-0082 带 addendum;2026-06 那份 audit 顶上加了更正横幅,指出那句让整件事看起来安全的 假设("the component reads its full config from the spec schema at render")是预期, 从未被测量。 Closes #4472 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S3cP1eY1novcNhQEDBrSZD
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 107 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…onformance-9cjs1t
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.
Closes #4472. 配套 PR:objectstack-ai/objectui#3146(检测手段落地的那一侧,已合并)+ objectstack-ai/objectui#3147(它发现的两个真缺陷的修复)。
问题
check-react-blocks-conformance.ts的文件头原话是 "confirms the objectui components ACTUALLY implement the props the spec protocol declares"。它做不到,也从来没做过。它 diff 的两边都是声明:z.toJSONSchema)manifestFromConfigs原样抄config.inputs)整条链路里没有渲染器。所以一个两边都声明、没有任何东西读的 prop,在这道门禁眼里是完美一致。#4413 就是代价:四个
record:*块发布了没人读的objectName/recordId,在kind:'react'页面上渲染成 "bind a record to preview" 占位符,而 baseline 里{ "frontendOnly": [], "missing": false }稳稳绿了整个缺陷存续期——最后是人肉读 objectui 渲染器发现的。Prime Directive #10(declared ≠ enforced)落在本该抓 #10 的东西自己身上。
改了什么(issue 的方向 (a),全做)
check-react-blocks-declaration-parity.ts、react-declaration-parity.baseline.json、npmcheck:react-declaration-parity,baseline 键frontendOnly→registryOnly(是"注册表声明了",不是"前端实现了")。gen-sdui-manifest.sh调用时没传--strict,还把退出码吞进一个⚠——连它看得见的那部分也只是被记录、从未被拦住。ratchet 只对相对 baseline 的新增分歧开火,所以失败必定是一次有意的注册表改动。check-react-blocks-declaration-parity.test.ts断言它能看见的两个方向、caveat 确实被打印、以及那句"实现"声明不会回来。这是 Prime Directive chore: version packages #10 可执行的那一半。没有推翻它能看见的东西,那些仍是真信号:
spec-only(palette 缺口,软)、registry-only(未文档化扩展,被 ratchet)、missing(没注册/非 public)。看不见的只有一类:两边都声明了,没人读。检测手段:方向 (b) 成立,已落地在 objectui
issue 把 (b)/(c)/(d) 留给"检测手段的设计结论"。实测过了,(b) 成立且便宜(console 测试项目里 13s):把每个声明了
objectName的 public block 挂在一个记录所有调用的dataSource下,问"有没有一次调用带上了这个对象名"。八个候选里五个到达、三个没到——record:related_list合理(要先拿到父记录 id),另外两个是同形真缺陷:list-view/embeddable-form的注册没把 context 桥接到组件的dataSourceprop 上(objectui#3144,已由 objectui#3147 修复,修好后台账的双向断言强制删掉了那两条记录)。(d) 顺带否掉:注册表侧的
inputs里没有任何一处用到binding: true,kind:'binding'是 spec react overlay 的概念,收紧点不在那儿。验证
pnpm --filter @objectstack/spec test— 合入最新main后重跑:286 files / 7229 tests 全绿pnpm --filter @objectstack/spec typecheck— clean;改动文件 eslint cleancheck:generated的 ledger 双向对账接受了改名(新名字出现在 "Not run here" 里)。同一次运行里check:api-surface失败,是 AGENTS.md 记录过的 stale-dist幻影(未 build 的树),本 PR 没有碰packages/spec/src的任何文件🤖 Generated with Claude Code
https://claude.ai/code/session_01S3cP1eY1novcNhQEDBrSZD