Uh oh!
There was an error while loading. Please reload this page.
docs(fields): narrow two snippets to ObjectUI's own contract instead of an ambient db handle and an undeclared ajv - #6137
Conversation
The Sequence Management block on auto-number.mdx called db.transaction on a db declared nowhere in the workspace, and the Backend Validation block on object.mdx imported ajv, which no package.json in this repository declares. Both are narrowed to what ObjectUI actually exposes rather than satisfied with an ambient declaration or a new dependency, and both pages join the doc-snippet gate's compile population. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
yinlianghui-tw
commented
Aug 24, 2026
PM: ACCEPTThe narrowing made both sections more informative, not lessMy order set a constraint — "the narrowed block must still teach something true and useful; if narrowing guts it, stop and report" — and I expected that to be a floor. You cleared it in the other direction: each section gained the ObjectUI-owned fact it was missing.
Those are exactly the facts a reader needed and the old blocks obscured by demonstrating a backend the product does not own. The transactional sketch and Ajv survive in prose, where an illustration belongs; no ambient You checked the route before implementing, and checked the right thingI told you to verify whether #6120's route covers That distinction is the whole reason the two cards were kept apart, and confirming it by mechanism rather than by merge status is the stronger check.
|
Uh oh!
There was an error while loading. Please reload this page.
`check:doc-fences` went red on its FIRST CI run, reporting nine of its own entries as STALE — `block-schema.mdx` baselined at 10 now carries 0, and the same for `fields/auto-number`, `fields/object` and six `plugins/` pages. Nothing was wrong with the tree: #6136 (#5867 batch 4) and #6137 merged while this branch was open and re-fenced 23 blocks across those 9 files. That is the shrink-only baseline doing exactly what it is for, unstaged, on its first run, with the remedy printed. The remedy is followed literally: the nine zero lines are deleted and nothing else moves. The population is RE-DERIVED on the merged base rather than subtracted by hand — 105 blocks / 83 files, and the diff against the old map is nine deletions with no line added and no number raised. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
Fixes#6126
Route taken: narrowing, not the #6120 environment fix — and why
The card's hedge said to follow #6120's route if it turned out to cover
object.mdx. Checked before implementing: PR #6129 is still open andunmerged, and by its own description it derives paths for the specifiers each
imported package declares in its own
dependencies.ajvis declared by nopackage.jsonin this repository, so there is nothing for that route to resolveto even once it lands. Narrowing it is, exactly as ruled.
Re-measured on
origin/mainfirstThe card's readings come from batch 3's probe, so they were re-taken here before
anything was edited:
origin/main133e2ea1e, the four classifier-matchingplaintextfences on the two pages re-fenced totsin a throwaway probe underan
EXITtrap (restore verified:plaintextcounts back to 7 and 8). All threediagnostics reproduce verbatim:
auto-number.mdx— the ambientdbhandleThe Sequence Management block called
db.transactionon a handle declarednowhere in the workspace. No ambient
db, nodeclareshim, no backend client:the block is now the part ObjectUI genuinely owns — a literal annotated with the
exported
AutoNumberFieldMetadata, carrying the two keys that type actuallydeclares,
formatandstarting_number.The transactional sketch moves to prose, which the ruling names as its home: one
counter per object-and-field pair, incremented inside the same transaction that
inserts the record, partitioned only when the format resets.
What the section gains rather than loses: it now states the fact the page never
stated, which is that ObjectUI never allocates a value at all.
AutoNumberFieldrenders whatever the saved record carries and shows aplaceholder until it comes back — so a create form shows the field empty. The
old block implied the opposite by presenting an allocation routine as
copy-pasteable code.
object.mdx— the unresolvableajvNo dependency was added anywhere. The block keeps the ObjectUI half — an
ObjectFieldMetadataliteral whoseschemaholds the same JSON Schema documentthe page's JSON Schema Format section teaches — and the Ajv call sequence is
gone, because on inspection it was Ajv's documentation (construct, compile,
call, read
errors) rather than ObjectUI's. Ajv survives as a prose example of"whichever JSON Schema validator the server already has".
Again the section gains the ObjectUI-specific fact it was missing, measured from
packages/fields/src/widgets/ObjectField.tsx: the widget checks JSON syntaxonly — it declines to propagate a draft
JSON.parserejects and does nothingelse — so nothing on the client enforces
schema, and structural validationis the server's. A reader who copied the old block learned an Ajv idiom; a reader
of the new one learns where the boundary is.
The blocks are genuinely checked, not merely collected
Both imported types are sealed (
BaseFieldMetadatacarries no index signature),so the annotations really excess-check. Ablated on the committed fix to prove the
gate can fail on them — one unknown key injected into each narrowed literal,
restore under an
EXITtrap, and the mutation confirmed on disk by grepping forthe injected text (a first attempt was rejected by that check: the anchor
label: 'API Configuration',matched twice inobject.mdx, so the reading wasdeclared void and the anchor retargeted before re-running):
No rebuild leg applies: the mutation is in the documents the gate reads, not in a
package's sources, and the resolution control below shows the same built
.d.tsthe green run used.
Population moved by exactly the batch, fragments unmoved
Baseline measured in this worktree with the two files reverted to
133e2ea1eunder a trap, restore verified:
Four blocks, exactly the four classifier-matching fences on these two pages.
No
FRAGMENT_MARKERanywhere — these are genuinely TypeScript — and thedeclared-fragment, covered and ungated sets are all unmoved.
auto-numberis thepage joining the ts/tsx population;
objectalready held onetsblock.Verification
Union re-run at final HEAD
f2145987awith a clean tree, each gate quoting itsown verdict line:
node scripts/check-doc-snippet-types.mjsEvery covered documentation snippet compiles against the built types.·Semantic phase: 210 of 210 block(s) judged, 0 failed.node scripts/check-doc-component-types.mjsEvery documented component type is registered.node scripts/check-doc-links.mjsLinks are valid across 15 scan roots.node scripts/check-control-bytes.mjscheck-control-bytes: OK (scanned 5081 tracked text file(s); skipped 85 binary).node scripts/check-changeset-presence.mjsNo source of a released package changed in this range, so no changeset is owed.node scripts/check-changeset-fixed.mjsAll workspace packages are in the changeset fixed group.node scripts/check-changeset-no-major.mjsNo changeset declares a major bump.node scripts/check-skills-paths.mjscheck-skills-paths: OK (93/94 stated path(s) resolve across 18 guide file(s); 1 baselined).pnpm lint:root28 problems (0 errors, 28 warnings)— all pre-existing; this diff contains no.ts/.tsxfilepnpm vitest run(repo ROOT) on the three doc-tooling suitesTest Files 3 passed (3)·Tests 72 passed (72)pnpm site:buildSITE-EXIT=0, 180-plus doc paths prerenderedThe gate reads the BUILT dist, quoted from its own resolution control on the
final run:
Both pages render coherently, checked in the prerendered HTML rather than
assumed:
.next/server/app/docs/fields/auto-number.htmlandobject.htmlbothcarry the new prose and the highlighted
tsblocks, and the stringsdb.transaction,SequenceCounter,ajv.compileand theajvimport appearzero times in either. The first
pnpm site:buildin this worktree failed onModule not foundfor@object-ui/plugin-ganttand@object-ui/plugin-map—environmental, those two sit outside the doc-snippet gate's build filter and were
simply unbuilt here; building them made it green with no edit to the diff.
Declaring the docs-only status: this repository has no
skip-changesetlabel, so the declaration is an empty-frontmatter changeset, the same shape
objectui#5867's batches use.
Out of scope, deliberately
The other
plaintextfences on both pages are left alone: they do not matchtriage's classifier (their first lines are
format: ...,const name = ...andbare object literals), which is the same line batch 3 drew.
content/docs/fields/location.mdxis the sibling blocker under #6127 and isuntouched here. #5867 is not addressed by this PR — it is the parent, and it
stays open.
One finding surfaced while measuring and is filed separately rather than fixed
here: the hand-written
interface AutoNumberFieldSchema/ObjectFieldSchemablocks on these pages declare keys (
value,className,disabled) that theexported
AutoNumberFieldMetadata/ObjectFieldMetadataand their sharedBaseFieldMetadatado not have. Because those interfaces are self-declarations,they compile vacuously — the gate reports the pages green and can never see the
divergence.
Generated by Claude Code
Generated by Claude Code