Skip to content

Commit e478375

Browse files
committed
docs(spec): 注释里的语料数字改用本次实测值,并写明与 issue 正文 11 格的差因 (#6569)
去重注释沿用了 issue 正文的「11 格 / 6 个页面」,而同一个 PR 的实测把它否掉了: 带相同 `object` 重复的是 **9 格 / 5 个页面**。11 是子串统计带进来的 —— `object \| object` 也会命中 `object \| object[]` 那两格(`ui/page.mdx` 的 `slots`、`automation/state-machine.mdx` 的 `states`),那是两种不同拼写,规则 有意不折叠。 注释是长期物,PR 正文不是;下一个读这个函数的人会把注释里的数字当实测事实。 差因一并写进注释,免得后来者 grep 出 11 之后误判「去重漏了两格」。 仅注释文本,逻辑、夹具、生成物均未改动。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZgRyPVwi1jLb1mNNuUQ9o
1 parent 939d798 commit e478375

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

packages/spec/scripts/lib/format-type.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,23 @@ function renderType(prop: any, ctx: TypeContext | undefined, depth: number): str
566566
// Identical spellings are not new here, but #6374 made them common: with
567567
// `SHAPE_DEPTH_LIMIT` in force every all-object union below a summary
568568
// prints `object` per variant, so `object | object | object | object`
569-
// appeared on 11 cells across 6 shipped reference pages, and
569+
// appeared on 9 cells across 5 shipped reference pages, and
570570
// `kernel/manifest.mdx`'s `Manifest.navigationContributions` spelled four
571571
// of them and then counted `… +5 more` identical ones behind them. Those
572572
// pages are the authoritative input for AI authors (ADR-0033), where a
573573
// cell that reads as a rendering bug costs more than a wide one.
574574
//
575+
// 9 and not the 11 #6569 was filed with, because a SUBSTRING count of
576+
// `object | object` also matches the two cells that spell
577+
// `object | object[]` (`ui/page.mdx`'s `slots`,
578+
// `automation/state-machine.mdx`'s `states`) — two spellings, which the
579+
// rule below deliberately never collapses. Worth knowing before grepping:
580+
// re-deriving 11 that way and concluding the dedupe missed two cells is
581+
// the wrong conclusion from a correct observation. Counting all duplicate
582+
// spellings rather than only `object` ones, the rule moves 14 cells on 7
583+
// pages; the extra 5 repeat a SHAPE spelling (`ui/app.mdx`,
584+
// `data/validation.mdx`).
585+
//
575586
// WHY THE COUNT STAYS. Collapsing to a bare `object` would drop the union's
576587
// ARITY, which after the depth budget is the only fact that cell still
577588
// carries — "choose one of N shapes" degraded to "some object". #6226 ruled

0 commit comments

Comments
 (0)