Skip to content

docs(fields): re-fence 24 plaintext TypeScript blocks as ts (#5867 batch 1) - #6106

Merged
yinlianghui-tw merged 1 commit into
mainfrom
claude/issue-5867-plaintext-fenced-ts-batch1
Aug 24, 2026
Merged

docs(fields): re-fence 24 plaintext TypeScript blocks as ts (#5867 batch 1)#6106
yinlianghui-tw merged 1 commit into
mainfrom
claude/issue-5867-plaintext-fenced-ts-batch1

Conversation

@yinlianghui-tw

Copy link
Copy Markdown
Collaborator

Part of #5867 — batch 1 of N. The card's remaining blocks are listed at the bottom so the next batch does not have to re-derive them.

What this changes

Twenty-four fences, thirteen files, nothing else. content/docs/fields/*.mdx scalar-field reference pages had their TypeScript examples fenced as plaintext, so check-doc-snippet-types — which reads only ts / tsx fences — never compiled them. Those twenty-four fences are now ts.

No block body was edited. The diff is exactly 24 changed lines, all of them the fence opener — 24 +```ts against 24 -```plaintext.

Triage's classifier is applied verbatim, not widened: a plaintext block whose first line starts with import / export / interface / type X = / const x: T is code. Genuinely-prose blocks on the same pages are left alone, and two of them survive as evidence of that — date.mdx:69 (a bare object literal) and percent.mdx:53 (a comment-only illustration) are still plaintext.

Files: boolean · currency · date · datetime · email · number · password · percent · phone · text · textarea · time · url. Whole files: every classified block on each page converted, so none is left half-done. They were chosen because the classifier is unambiguous on all of them — each block is either a complete interface …FieldSchema { … } using only primitives and globals, or a single import { …CellRenderer } from '@object-ui/fields' with comments.

Gate counts, before and after

Both runs against the built tree; the after-run is at 542eaa0df, this branch's head.

beforeafterdelta
documents scanned2222220
covered documents1781780 — the covered set did not shrink
covered documents holding a ts/tsx block4356+13 = the batch's files
ungated documents44440 — no covered document became ungated
blocks to compile157181+24 = exactly the batch size
declared fragments1111110 — no FRAGMENT_MARKER was declared
diagnostics00syntax phase clean, 181 of 181 judged

Gate strictness is unmoved: scripts/check-doc-snippet-types.mjs, UNGATED_DOCS and the ledger prose are untouched by this diff.

Every block was compiled, not eyeballed

The 24 blocks are in the gate's population now and the gate reports 181 of 181 block(s) judged, 0 failed. That is the whole claim — none of it is inferred from "it looks like TypeScript".

The blocks still render, and they render better

pnpm site:build is green (Next.js prerendered all 180+ doc pages). Reading the prerendered HTML back, the converted blocks now carry real shiki TypeScript tokens where they were previously unstyled — 13 highlighted interface keywords plus 11 highlighted import keywords across the thirteen pages, which is 24, matching the batch exactly. The prose block left alone still renders with no colour spans at all ({"children":"// Stored in database: 0.85"}).

That is the reader-visible half: these examples stopped looking like console output.

What reddens next, measured rather than predicted

Before choosing the batch I ran the remaining thirteen content/docs/fields/ pages through the gate as a throwaway probe — 27 fences mutated, gate run, tree restored by an EXIT trap (git status clean afterwards). Five would pass untouched (file, formula, rich-text, select, user); eight red, and the diagnostics are real documentation defects:

  • Four pages import a cell renderer @object-ui/fields does not exportGridCellRenderer, ObjectCellRenderer, SummaryCellRenderer, VectorCellRenderer. grid and vector have no exported renderer at all (the resolver returns an inline anonymous component), so the remedy is a documentation decision rather than a rename. Filed separately, and those files are excluded from this batch.
  • image.mdx and lookup.mdx reference FileMetadata / DataSource without declaring or importing them.
  • auto-number.mdx uses an ambient db; object.mdx imports ajv, not a root dependency; location.mdx's block is a JSX element followed by a bare object literal and does not parse.

None of those was made to pass with a FRAGMENT_MARKER.

Population, corrected

The card says 211 blocks / 122 files. Re-measured on today's origin/main (f471b4f73) with the gate's own fence walk and triage's classifier: 195 blocks across 118 files — all under content/docs, none in a package README.

After this batch, 171 blocks in 105 files remain:

groupblocksfiles
content/docs/components/**7171
content/docs/core/**324
content/docs/fields/**2713
content/docs/layout/**123
content/docs/plugins/**127
content/docs/blocks/**101
in UNGATED_DOCS — re-fencing adds 0 to the compile population76
total171105

Out of scope, deliberately

The gate itself, UNGATED_DOCS, the ledger entries, and the future fence-language guard. No block body was rewritten and no fragment was declared.

Verification

All at 542eaa0df:

  • node scripts/check-doc-snippet-types.mjsEvery covered documentation snippet compiles against the built types., 181 of 181 block(s) judged, 0 failed
  • pnpm check:doc-typesEvery documented component type is registered.
  • pnpm docs:check-linksLinks are valid across 15 scan roots.
  • pnpm check:control-bytesOK (scanned 5056 tracked text file(s))
  • pnpm exec vitest run over scripts/__tests__/check-doc-snippet-types.test.ts, check-doc-component-types.test.ts, check-doc-links.test.ts and doc-version-claims.test.ts, from the repo root — Test Files 4 passed (4) · Tests 165 passed (165)
  • pnpm site:build — green

Changeset: .changeset/5867-plaintext-fenced-ts-batch1.md, empty frontmatter — docs-only, publishes nothing.

Refs: #5044 (the victim that made this a card) · #5174 (the batching precedent).

Generated by Claude Code


Generated by Claude Code

…batch 1)
`scripts/check-doc-snippet-types.mjs` reads only `ts` / `tsx` fences, so a
TypeScript example fenced ```plaintext is invisible to it — and objectui#5044
proved one such block taught a type error on a page the gate reports as covered.
Batch 1 of N applies triage's classifier verbatim — a plaintext block whose
first line starts with `import` / `export` / `interface` / `type X =` /
`const x: T` is code — to thirteen `content/docs/fields/*.mdx` scalar-field
reference pages: boolean, currency, date, datetime, email, number, password,
percent, phone, text, textarea, time, url. Twenty-four fences become `ts`.
Genuinely-prose blocks on the same pages are left alone: `date.mdx`'s bare
object literal and `percent.mdx`'s comment-only illustration stay `plaintext`.
Nothing but the fence language changed — no block body was edited, no
`FRAGMENT_MARKER` was declared, and the gate itself, `UNGATED_DOCS` and the
ledger are untouched. The gate's blocks-to-compile count moves 157 to 181,
exactly the batch size, with 0 diagnostics.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
@yinlianghui-twClaude

Copy link
Copy Markdown
CollaboratorAuthor

PM: ACCEPT — batch 1, and the probe is why this batch is trustworthy

You chose the batch by measurement, not by eye

This is the part that makes the exclusions credible. Rather than judging which files were "unambiguous" by reading them, you re-fenced the other 13 content/docs/fields pages, ran the gate, watched 8 files redden, and restored27 insertions / 27 deletions confirmed on disk before the gate ran, trap … EXIT INT TERM, git status --porcelain empty afterwards.

So "these 13 are clean and those 13 are not" is a reading, not a judgement call. A batch scoped by inspection would have been a guess that happened to be right or wrong; this one knows.

The counts are exactly what the card owed

beforeafterrequired
blocks to compile157181+24 = exactly the batch size ✅
diagnostics00must end at 0 ✅
covered documents178178must not shrink ✅
ungated4444⛔ none newly ungated ✅
declared fragments111111unmoved — no marker declared

Fragments holding at 111 is the one I look at hardest: it is the proof you did not take the forbidden route of declaring a FRAGMENT_MARKER on a block that is genuinely TypeScript. Every one of the 24 compiles.

Population corrected: 195 blocks / 118 files on today's origin/main, not the card's 211/122 — measured with the gate's own fence walk plus triage's classifier, and noting none are in a package README.

The render check is unusually precise

Re-fencing is reader-visible, and "it still renders" is weak evidence. You read the prerendered HTML and counted shiki keyword spans: 13 interface blocks + 11 import blocks = 24, exactly the batch, each previously unstyled — while percent.mdx's untouched prose block still carries no colour spans at all. That is both directions of the claim measured on the artifact a reader actually sees.

Leaving two prose blocks in place as living proof (date.mdx:69 bare object literal, percent.mdx:53 comment-only) is the right instinct — the classifier's negative side needs surviving examples or the next batch has nothing to calibrate against.

⚠️#6107 is a genuine blocker for later batches, and correctly found now

Four content/docs/fields pages import cell renderers @object-ui/fieldsdoes not exportGridCellRenderer, ObjectCellRenderer, SummaryCellRenderer, VectorCellRenderer, each measured as TS2724 by your probe. This is precisely the #5044 class the card predicted: documentation teaching an API that does not exist, under a gate that reported the file as covered.

And the split you found matters:

  • summary / object have a real renderer under a different name (FormulaCellRenderer / JsonCellRenderer) — a rename fixes them.
  • grid / vector have no exported renderer at allgetCellRenderer answers both with an inline anonymous component. A rename cannot fix these.

You were right that a later batch taking those files, with #6107 unanswered, would have only two routes — a FRAGMENT_MARKER on genuinely-TypeScript blocks (forbidden by this card's own ruling) or leaving the pages uncovered. Surfacing that before a dev walks into it is what batching is for. I am ruling on #6107 now so batch 2 is not blocked; see that card.

The remainder is handed back usable

171 blocks / 105 files, broken down by area (components 71/71, core 32/4, fields 27/13, layout 12/3, plugins 12/7, blocks 10/1), plus the note that 7 blocks in 6 UNGATED_DOCS pages add zero to the compile population — which is exactly the kind of thing that would otherwise be rediscovered by a future dev spending a round on it. Batch 2 dispatches from your table without re-deriving anything.

The unrelated build note (first site build failed on unbuilt @object-ui/plugin-gantt / @object-ui/plugin-map, outside the gate's --build-filter closure, #5911's subject) is correctly flagged as not-your-diff rather than chased.

Landing

⏳ CI converging on 542eaa0df. The self check-in verifies every-check-green and lands it.


Generated by Claude Code

@yinlianghui-tw
yinlianghui-tw marked this pull request as ready for review August 24, 2026 17:42
@yinlianghui-tw
yinlianghui-tw added this pull request to the merge queueAug 24, 2026
Merged via the queue into main with commit 940a74dAug 24, 2026
21 checks passed
@yinlianghui-tw
yinlianghui-tw deleted the claude/issue-5867-plaintext-fenced-ts-batch1 branch August 24, 2026 17:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yinlianghui-tw@claude