Skip to content

[finding] 21 of 24 form-section examples in YAML fences under content/docs/protocol/objectui/** have no name — outside check-docs-section-name's declared scope #11887

Description

@os-steve

Found while implementing #10830 (the TS-fence name gate). Filing separately: the
gate that lands there reads object literals, and a YAML block is a different parser,
not a bigger regex. Widening it is a separate change with its own verification surface.

The observation

scripts/check-docs-section-name.mjs (landing in #10830) judges form-section literals in
TS-family fences under content/docs/** and requires a name — the i18n anchor that
resolves objects.<object>._sections.<name>.label. A section without one renders its
authored label in every locale.

That gate declares and counts its out-of-scope population rather than silently
skipping it: its verdict line prints 16 YAML fence(s) declared out of scope, and
--list names each. This issue is the measurement of what is inside that declared gap.

The census

Measured on 4019e16cd, parsing each YAML fence with the yaml package (the same parser
the docs build resolves) and walking every sections: sequence for mapping items that
lack a name key:

yaml fences carrying `sections:` : 16 (14 parse; 2 are elided fragments that do not)
section mappings named : 3
section mappings NAMELESS : 21
pagenameless
content/docs/protocol/objectui/layout-dsl.mdx17
content/docs/protocol/objectui/concept.mdx2
content/docs/protocol/objectui/index.mdx2

⚠️Two numbers, and the smaller one is the trustworthy one. A first pass with a
hand-rolled indentation walker returned 51. A real YAML parse returns 21. The
hand-rolled walker double-counted nested sequences. Recording both, because #10830's whole
subject is instrument error in exactly this shape — a hand-derived count that reads
plausible and is wrong. Anyone acting on this card should re-derive with a parser, not
trust either number here.

Why it is not folded into #10830

Not proposing a schema change

name stays .optional() in packages/spec — settled in #10709 and reaffirmed in
#10830. A nameless section is legal metadata. This is about examples.

Possible shapes (not a recommendation — needs triage)

  • Extend check-docs-section-name.mjs with a YAML limb that parses each fence with yaml
    and walks sections: sequences, treating an unparseable fence as a declared skip with a
    printed count (the pattern that file already uses for its out-of-scope population).
  • Or sweep the 21 sites and leave the surface unguarded, which is the state that let the
    TS-fence population drift for three counting passes.

Back-links: #10830, #10709, #10827, #10579

Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions