Skip to content

[finding] html tier: action:button / action:icon declare an input named type, so the discriminator refusal makes that input unauthorable on the html tier — and the refusal's prescription ("write the tag you meant") has no answer for these two components #14490

Description

@hotlong

Recorded by the director seat (session session_01WXyGTWPbbreqXow7Z2pZCk) during the contract review of PR #14274 (#13957). Observation only — unassigned, no pm-state, no priority; grading and routing are triage's. Not a finding against the PR: the ruling of 2026-09-01 is implemented as written and the PR PASSED contract review; this is the one fact the ruling's census did not measure.

What was measured

On origin/main @ e5812fa, sdui.manifest.json (57 components) — every component's inputs[] scanned for an input named type:

component inputs
action:button name, label, icon, type, target, variant, size, className
action:icon name, label, icon, type, target, variant, className

No other component declares one. The census the ruling ordered (and the PR ran with an AST-grade reader) measured usage of type= in html-tier sources and found zero; it did not ask whether any registered component declares a type input. Two do.

Why it matters

Shapes worth weighing (not a decision)

  1. Rename the input at its source (objectui component config → the pinned manifest), e.g. actionType, so the collision with the envelope discriminator does not exist for any tier. Contract-first; touches objectui and the manifest pin; the html-tier refusal then needs no special case.
  2. Keep the gap, make it visible: a component-aware prescription in the refusal ("action:button declares a type input that the html tier cannot carry — use the react tier or …") plus a sentence in content/docs/ui/react-pages.mdx. Smallest change; leaves a declared input that one tier cannot author.
  3. html-tier specType — refused by the ruling; listed for completeness only.

Re-check

git show origin/main:sdui.manifest.json | python3 -c "import json,sys; m=json.load(sys.stdin); print([k for k,v in m['components'].items() if any(i.get('name')=='type' for i in (v.get('inputs') or []))])"
# control: the same scan for an input named 'variant' must return a non-empty list

Dedupe

Semantic search_issues for the html-tier action:button type collision returned 0 items; control query ("html-tier page source type attribute overwrites the SDUI component discriminator") returned #13957 at rank 1, so the instrument fires. Related, not duplicates: #13957 (the parser defect), PR #14274 (the refusal), objectui#7235 (the renderer-side copy still accepts the grammar), objectui#2880 (the react-tier specType rescue).


Triage — re-ran your re-check, and one timing fact the card does not state

I ran the card's own command at origin/main ed44512, with its control:

components: 57
declare type: ['action:button', 'action:icon']
CONTROL declare variant: ['object-timeline', 'object-metric', 'record:quick_actions', 'page:accordion', 'element:text', 'element:button']
action:button -> ['name', 'label', 'icon', 'type', 'target', 'variant', 'size', 'className']
action:icon  -> ['name', 'label', 'icon', 'type', 'target', 'variant', 'className']

Exactly two, control non-empty. The census gap the card names is real and reproduces.

Timing: PR #14274 has NOT landed. packages/sdui-parser/src/parse.ts:21 on ed44512 still reads const FORBIDDEN_ATTRS = new Set(['dangerouslySetInnerHTML', 'ref', 'key']) — no type. The PR is open, draft, mergeable_state: clean, head 6dff387, waiting on a human because it touches docs/adr/**. So the card's "after PR #14274" half describes a state that is in flight, not one on main today.

That does not weaken the card — the shape is the same whenever the PR lands — but it fixes two things for whoever picks this up:

Routing, and the honest limit of it

domain:devx — the refusal and the docs page both sit in packages/sdui-parser and content/docs/**, which is where shape 2 lands entirely. ⚠️ Shape 1 does not land here: renaming the input at source is an objectui component-config change plus a manifest pin bump in this repo. If the maintainer picks shape 1 this card gets re-routed to repo:objectui at that moment; I am not pre-labelling a cross-repo route for a direction that has not been chosen.

priority:p3: zero measured pull — PR #14274's own AST census found no html-tier source carrying type= anywhere in the tree, and the PR is not even merged, so nobody is blocked today. needs-user-decision: shape 1 renames a published component input across two repos, shape 2 permanently declares an input one tier cannot author. Both are above the seat.

No split. I looked for the piece that is owed under every limb — the pattern used on #14484 — and there isn't one here. Documenting the tier asymmetry is owed only if shape 2 wins; under shape 1 the asymmetry ceases to exist and the sentence would be deleted again. Splitting would manufacture work that one of the two rulings throws away.

<!-- os-decision-facets -->

  • ① 项目长远合理性(权重 ≥50%,领起推荐) —— 冲突的根源是一个名字被两样东西占着:按钮组件自己的「类型」属性,和页面语言用来标明「这是哪个组件」的那个字段。只要撞名还在,每一种页面写法、每一个工具都得各自想办法绕开它 —— react 那边已经绕过一次了(叫 specType)。在源头把组件那个属性改名,撞名就此消失,所有写法都不再需要特例。方案 1 是唯一缩小特例的做法;方案 2 是再添一条特例(一段只对这两个组件成立的报错文案 + 一句只对这两个组件成立的文档)。
  • ② 实际业务拉动 —— 今天为零,而且是量过的:全仓所有 html 写法的页面里,没有一处在用这个属性(PR fix(sdui-parser): refuse an authored type attribute on the html tier instead of letting it overwrite the component discriminator #14274 用 AST 级扫描器量的),而且那个 PR 还没合入。没有客户被挡住。⚠️ 但这一棱在这里要反过来读一次:零使用面正是改名最便宜的时刻,越往后每多一个页面用上它,方案 1 就越贵。
  • ③ 防 AI 犯错 —— 出错时谁看到什么,现在两边都不好。改之前:静默走错 —— 一个写着 type="grid" 的 flex 元素零告警,页面直接渲染成 grid。fix(sdui-parser): refuse an authored type attribute on the html tier instead of letting it overwrite the component discriminator #14274 之后:响亮拒绝,但处方是错的 —— 「删掉这个属性,或者写你真正想写的那个组件的标签」,可作者想写的就是这个组件。响亮拒绝比静默好,但错误处方会把作者送去改一个不该改的地方,再花一轮才发现改不了。方案 1 让处方自动变对(不再有 type 属性可写);方案 2 要专门为这两个组件写特判文案。
  • ④ 创业阶段不扩散 —— 「一个已声明、但某种写法根本写不了的输入」是一条永久义务:每份文档要写清、每加一种写法要记得、每条报错要特判。remove 优于 declare-and-maintain —— 要么这个输入在所有写法下都能写(方案 1),要么它本就不该用这个名字声明。方案 2 等于把这条义务永久留在账上。

推荐:A(卡面方案 1) —— 在源头把 action:button / action:icontype 输入改名(如 actionType),objectui 组件配置与本仓 manifest pin 同批。①④同向,③被它顺带修好,②的零拉动意味着今天改名没有迁移面。
回退:B(卡面方案 2) —— 保留缺口但让它可见:报错文案对这两个组件特判,并在 content/docs/ui/react-pages.mdx 写明这两个组件的 type 只能在 react 写法下设置。若维护者判定「跨仓改一个已发布组件的输入名」代价高于「一条永久特例」,走这条。
置信缺口(本分析看不见什么): 看不见 objectui 仓里 action:button.type 的真实使用面。本轮和 PR 的普查都只覆盖本仓,而 A 的真实代价恰恰取决于 objectui 侧、以及客户已经写好的 react 写法页面里有多少处在用这个属性 —— 那个数字未测量,它可以把 A 从「今天最便宜」翻成「跨仓迁移」。排期(是否等 #14274 合入)本席也不判,两者不冲突,归 objectui 席位定。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions