ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

Description

@huangyiirene

Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

os-decision-facets

Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

No chart-level data. No xAxisKey.

But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

⭐ The contradiction is already inside the declaration, not only in the docs

#7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

  • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
  • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
  • :1364 — the categories tombstone, pointing the author at the same replacement

⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

四棱

① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

Sequencing

This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

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

    Labels

    domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all \u003cpre\u003e\u003ccode\u003e blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks"); } } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); } })(); (function(){ try { var __m = "github.com"; var __re = new RegExp('^' + "github\\.com" + '
      Skip to content

      ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

      Description

      @huangyiirene

      Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

      os-decision-facets

      Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

      ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

      type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

      No chart-level data. No xAxisKey.

      But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

      ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

      ⭐ The contradiction is already inside the declaration, not only in the docs

      #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

      • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
      • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
      • :1364 — the categories tombstone, pointing the author at the same replacement

      ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

      四棱

      ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

      ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

      ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

      ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

      建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

      回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

      置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

      Sequencing

      This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

      ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

      Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

      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

        Labels

        domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

        Type

        No type

        Projects

        No projects

          Milestone

          No milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
          Skip to content

          ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

          Description

          @huangyiirene

          Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

          os-decision-facets

          Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

          ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

          type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

          No chart-level data. No xAxisKey.

          But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

          ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

          ⭐ The contradiction is already inside the declaration, not only in the docs

          #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

          • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
          • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
          • :1364 — the categories tombstone, pointing the author at the same replacement

          ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

          四棱

          ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

          ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

          ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

          ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

          建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

          回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

          置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

          Sequencing

          This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

          ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

          Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

          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

            Labels

            domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

            Type

            No type

            Projects

            No projects

              Milestone

              No milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length \u003e 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
              Skip to content

              ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

              Description

              @huangyiirene

              Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

              os-decision-facets

              Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

              ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

              type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

              No chart-level data. No xAxisKey.

              But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

              ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

              ⭐ The contradiction is already inside the declaration, not only in the docs

              #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

              • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
              • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
              • :1364 — the categories tombstone, pointing the author at the same replacement

              ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

              四棱

              ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

              ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

              ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

              ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

              建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

              回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

              置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

              Sequencing

              This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

              ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

              Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

              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

                Labels

                domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

                Type

                No type

                Projects

                No projects

                  Milestone

                  No milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions

                  , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
                  Skip to content

                  ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

                  Description

                  @huangyiirene

                  Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

                  os-decision-facets

                  Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

                  ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

                  type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

                  No chart-level data. No xAxisKey.

                  But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

                  ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

                  ⭐ The contradiction is already inside the declaration, not only in the docs

                  #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

                  • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
                  • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
                  • :1364 — the categories tombstone, pointing the author at the same replacement

                  ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

                  四棱

                  ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

                  ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

                  ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

                  ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

                  建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

                  回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

                  置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

                  Sequencing

                  This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

                  ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

                  Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

                  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

                    Labels

                    domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

                    Type

                    No type

                    Projects

                    No projects

                      Milestone

                      No milestone

                      Relationships

                      None yet

                      Development

                      No branches or pull requests

                      Issue actions

                      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                      Skip to content

                      ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

                      Description

                      @huangyiirene

                      Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

                      os-decision-facets

                      Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

                      ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

                      type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

                      No chart-level data. No xAxisKey.

                      But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

                      ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

                      ⭐ The contradiction is already inside the declaration, not only in the docs

                      #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

                      • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
                      • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
                      • :1364 — the categories tombstone, pointing the author at the same replacement

                      ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

                      四棱

                      ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

                      ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

                      ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

                      ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

                      建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

                      回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

                      置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

                      Sequencing

                      This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

                      ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

                      Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

                      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

                        Labels

                        domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

                        Type

                        No type

                        Projects

                        No projects

                          Milestone

                          No milestone

                          Relationships

                          None yet

                          Development

                          No branches or pull requests

                          Issue actions

                          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
                          Skip to content

                          ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

                          Description

                          @huangyiirene

                          Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

                          os-decision-facets

                          Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

                          ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

                          type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

                          No chart-level data. No xAxisKey.

                          But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

                          ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

                          ⭐ The contradiction is already inside the declaration, not only in the docs

                          #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

                          • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
                          • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
                          • :1364 — the categories tombstone, pointing the author at the same replacement

                          ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

                          四棱

                          ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

                          ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

                          ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

                          ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

                          建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

                          回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

                          置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

                          Sequencing

                          This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

                          ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

                          Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

                          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

                            Labels

                            domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

                            Type

                            No type

                            Projects

                            No projects

                              Milestone

                              No milestone

                              Relationships

                              None yet

                              Development

                              No branches or pull requests

                              Issue actions

                              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
                              Skip to content

                              ChartSchema declares neither chart-level data nor xAxisKey — yet its own JSDoc teaches both, so the corrected chart model documents keys only BaseSchema's index signature admits #7549

                              Description

                              @huangyiirene

                              Split out of #7112 by the triage seat (R+126). That card fixes five documentation and example sites that teach the retired inline series[].data model; it names this as "a separate contract question [that] should not be settled inside a docs pass" and is right. Filing it so the question is a card rather than a paragraph — a pending question written only in a comment is invisible to candidate queries, sweeps and aging alerts.

                              os-decision-facets

                              Measured — tree origin/main045d20b, read 2026-09-03T20:00:23Z

                              ChartSchema (packages/types/src/data-display.ts:1401) declares exactly:

                              type · chartType · title · description · categories · series · height · width · showLegend · showGrid · animate · config

                              No chart-level data. No xAxisKey.

                              But both exist elsewhere in the same file.xAxisKey?: string is declared at :1923, on the narrower renderer-level schema whose docblock (:1896) reads "(ChartBarRenderer) forwards exactly data, dataKey, xAxisKey…", and mirrored in zod at data-display.zod.ts:552.

                              ⚠️ ⛔ Precision, because the loose version of this claim is false: xAxisKey is not undeclared in packages/types. It is undeclared on ChartSchema. I checked, having first run a control that returned 6 hits in data-display.ts — which would have read as "declared" had I stopped there.

                              ⭐ The contradiction is already inside the declaration, not only in the docs

                              #7112 frames this as five external pages teaching a model the type does not declare. It is closer to home than that — ChartSchema's own JSDoc teaches it:

                              • :1335"…and the category axis comes from xAxisKey / xAxis. That is the model…"
                              • :1424"The category axis comes from xAxisKey / xAxis. This docblock read…"
                              • :1364 — the categories tombstone, pointing the author at the same replacement

                              ⇒ The type's docblock directs authors to keys the type does not declare, which survive only through BaseSchema's index signature. Fixing the five external pages without answering this reproduces the same defect in the corrected text — which is exactly why #7112 fenced it out.

                              四棱

                              ① 长期正确性(主导) —— 渲染器读的是 chart-level data + xAxisKey,声明面却只在一个更窄的 renderer schema 上有它们,ChartSchema 一个都没有。声明与实现不一致时,正解是让声明追上实现,而不是让文档去描述一个靠 index signature 兜住的形状 —— 后者把 BaseSchema[key: string]: any 当成契约用,而它恰恰是 objectui 反复付学费的那个洞(#5155#6150 两轮 census 都是它)。⇒ 本轴明确要求把两个键声明到 ChartSchema

                              ② 真实业务拉力 —— 已兑现且可测:#7112 的五处站点今天每一处都渲染空图,而它们是作者实际阅读的通道。补声明是让「正确写法」第一次变得可类型检查。

                              ③ 防 AI 编码错误 —— 分量最重。现状是最坏组合:JSDoc 教 A,声明面没有 A,校验器靠 index signature 静默接受 A,渲染器读 A。AI 作者四个信号全对不上,且没有一个会红。补声明后,写错键名当场是类型错误。

                              ④ 创业期不扩张 —— 这不是新增能力:两个键渲染器已经在读,只是没被声明。补声明让已发货的行为变得可声明,面不变大 —— 属于 ADR-0049 「declared = enforced」的方向。

                              建议(一句):把 chart-level dataxAxisKey 声明到 ChartSchema(TS 与 zod 双面),形状照 :1923 / data-display.zod.ts:552 已有的那份,⛔ 不要新造。

                              回退:若维护者认为 ChartSchema 应保持「容器」语义、把行数据留给更窄的 renderer schema,则 ⛔ 不补声明 —— 但那样必须同批把 :1335/:1424 的 JSDoc 与 #7112 的五处文档一起改成指向那个更窄的 schema,⛔ 不能继续在 ChartSchema 的 docblock 里教它不接受的键。两条路都行,继续两不靠是唯一不能选的

                              置信缺口(必填):我没有:1923 那个 renderer-level schema 与 ChartSchema 的关系 —— 它是 ChartSchema 的成员、是并列的联合分支,还是渲染期才组装的独立形状。若它其实是 ChartSchema嵌套成员,那么「chart-level data」这个说法本身就要重新表述,建议的形状也要跟着改。这一条足以改变建议的形状(虽然大概率不改变方向)。 ⇒ 取用前先量这条关系。

                              Sequencing

                              This card first, #7112 second.#7112's own "what a fix would do" section writes the corrected examples in terms of chart-level data / xAxisKey; until this is answered, that text documents index-signature keys. ⛔ Landing the docs pass first would need re-editing the same five sites after the ruling.

                              ⚠️#7112 is nonetheless graded pm:queue·p2 and not blocked: the five pages are wrong today in a worse way (they render empty charts), so correcting them toward the implemented model is an improvement under either ruling. What must not happen is the docs pass silently settling this question by writing the keys as if declared.

                              Related:#7112 (the docs half) · #6896 / PR #7111 (the retirement this came out of) · #5155, #6150 (the BaseSchema index-signature census family).

                              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

                                Labels

                                domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

                                Type

                                No type

                                Projects

                                No projects

                                  Milestone

                                  No milestone

                                  Relationships

                                  None yet

                                  Development

                                  No branches or pull requests

                                  Issue actions