Skip to content

test(types): the objectui#7340 pin cannot see example object literals — its DOC_MEMBER_RE requires a declaration row, so a retired handler key in a const x: Schema = {} example stays green #7840

Description

@claude

Measured on main 52cac3886 while landing objectui#7488, which is one instance of this class.

objectui#7340 landed packages/types/src/__tests__/component-docs-retired-handler-keys-7340.test.ts
as the pin for exactly this class: a doc page that still teaches a handler key the contract
has retired to a never tombstone. It stayed green on objectui#7488's page for the whole
interval, and the reason is structural rather than incidental.

The mechanism

The pin's doc reader recognises two shapes, both declaration-shaped:

/** An interface member row: `  onFoo?: (x: T) =` ... */
const DOC_MEMBER_RE = /^\s{0,8}(on[A-Z][A-Za-z0-9]*)\?:\s*(\S.*)$/;
/** A markdown prop-table row: `| onFoo | function | ... |` */
const DOC_TABLE_RE = /^\|\s*`(on[A-Z][A-Za-z0-9]*)`\s*\|\s*([^|]*)\|/;

DOC_MEMBER_RE requires the ? — it matches a member DECLARATION (onSave?: string;),
not an assignment. So an example object literal, which is how most pages actually teach
a schema:

const builder: ReportBuilderSchema = {
  showPreview: true,
  onSave: 'handleSaveReport',
  onCancel: 'handleCancel'
};

matches neither shape, and the pin has nothing to say about it. It is not that the pin
"measures table rows and this happened to be prose" — the population it walks is every
.mdx / .md under content/docs, this page included; the two regexes simply cannot
express an assignment.

Why the other instruments do not cover the gap

  • check:doc-snippets compiles ts / tsx fences only. A retired key inside a
    ```plaintext (or text / `plain` / `txt` / no info string) fence is invisible to it.
    That is objectui#5867's population, and `check:doc-fences` carries it as a declared
    SHRINK-ONLY ledger — so the block being hidden from the compiler is a KNOWN, BASELINED
    state, not an unknown one.
  • check:doc-types reads type string literals, nothing else.

⇒ the intersection that nothing covers today: a retired handler key authored as an
example object literal inside a fence that is not ts/tsx
. Every page still holding a
check:doc-fences ledger entry is a place where this can sit green.

The measurement this card owes

The PR for objectui#7488 dealt with its own instance by re-fencing that one block ts, which puts
the literal under check:doc-snippets (it then reports TS2322: Type 'string' is not assignable to type 'undefined' per line). That works instance by instance. Widening the
pin instead closes the class, and it is its own measurement, for the reason objectui#7488's
triage gave: the parse surface of example literals is much larger than that of declaration
rows, and the false-positive cost is unknown. Specifically it has to answer:

  1. Which shapes count as an authored literal? A bare onSave: 'x', line matches inside any
    object anywhere on the page — including one that is deliberately showing the retired
    dialect as a counter-example, or prose about the retirement itself. The pin already has
    a PROSE rule (rule 5: it flags rows, never mentions) that would need an analogue.
  2. What owns the literal? The declaration-row reader resolves an owner from the enclosing
    heading or interface declaration; an object literal resolves its owner from its type
    annotation (const builder: ReportBuilderSchema = {), which the current reader does not
    parse. Without an owner there is no (owner, key) pair, and the pin's PAIR RULE — the
    thing that keeps a live runtime slot such as ActionSchema.onClick from being swept —
    cannot run. A name-level sweep is the shape objectui#7340 explicitly rejected.
  3. What is the population on main today, before any change? Both counts: literals that
    would be flagged, and of those, how many are real (a retired pair) vs. counter-examples.

An alternative worth pricing in the same measurement: drive the class to zero through
check:doc-fences instead — every block that leaves that shrink-only ledger becomes a
compiled block, and a retired key in a compiled block is a tsc error by construction, no
new pin needed. That trades a new instrument for finishing objectui#5867's lane
(80 files / 89 blocks at 52cac3886).

Provenance

Filed by the execution seat that landed objectui#7488, at the explicit request of that
card's triage comment, so the class does not reappear on a fourth page once that card lands. Cross-reference: objectui#7488 (the instance), objectui#7340 (the pin),
objectui#5867 / check:doc-fences (the hidden-fence population), objectui#7344 (the
retirement these keys belong to). Generated by Claude Code, session
session_01KbJQ1y1J12nZxYzFWhP8Q3.


Generated by Claude Code

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:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repofinding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions