Repository navigation
RR-20: schema docs generator drift - #426
Merged
Merged
Conversation
The generator is deterministic; the committed docs had drifted. RR-54 hand-wrote chart and table rows in docs/schema-reference.md, RR-30 hand-added the examples/markdown/ line to docs/examples.md, and RR-41 changed audience descriptions without regenerating, leaving stale truncations. - Move the examples/markdown/ line into the generator. - Render if/then/else requirements (Table: dataset, otherwise rows) as a conditional requirement. - Regenerate docs/schema-reference.md and docs/catalog-schema-reference.md. - Add --check and pnpm check:schema-docs, which fails on drift (runs in pnpm test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 1a5e8a19-49ef-4782-99d1-2f5ced77f578) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
scripts/generate-schema-docs.mjsis deterministic: two runs give identical output, and$defsare listed in schema order. The committed docs were wrong in three ways:docs/schema-reference.mdwere rewritten by hand (short summaries,stringinstead of the enum types,inline/datasetin the Required column), andChartDataSource/NumberFormatwere moved.examples/markdown/line was added todocs/examples.mdbut not to the generator, so every run deleted it.Fix
examples/markdown/line now lives in the generator, sodocs/examples.mdkeeps it.if/then/elserequirements as a "Conditional requirement" line. ForTablethat isdataset, otherwiserows, which keeps what the RR-54 hand edit was trying to say.docs/schema-reference.mdanddocs/catalog-schema-reference.mdare regenerated. The schema descriptions are the source of truth, so the RR-54 hand-written summaries are replaced by their (truncated) schema text.node scripts/generate-schema-docs.mjs --checkandpnpm check:schema-docs. It fails and names the stale files when a committed file differs from a fresh build (CRLF is normalized for Windows checkouts). As acheck:*script it runs inpnpm testthroughscripts/run-checks.mjswith nochecks.jsonentry.changes/rr-20-schema-docs-drift.md(packages: []).Verification
check:schema-docsfails on origin/main (schema-reference.md,catalog-schema-reference.md) and passes after regenerating.check:changes,check:runnersandcheck:textpass, andrun-checks.mjs --listincludescheck:schema-docs.Coordination with RR-55 (#423)
#423 hand-edits both references. After this lands it should run
node scripts/generate-schema-docs.mjsinstead of hand-reverting:Slide.layoutrow inschema-reference.mdcomes from its schema description change, so the generator reproduces it. This PR does not touch that row.catalog-schema-reference.md(the link tofinding-schema-reference.md) is generator text. It has to go intocatalogReference(). If RR-55: short-verb API, one validate, Finding schema, stats (core 0.14.0, breaking) #423 adds afinding.schema.jsonunderspec/schemas/, the generator also needs to exclude it from the catalog list, as it already excludesopf.schema.json. Otherwisecheck:schema-docsfails on the rebased branch.🤖 Generated with Claude Code
Note
Low Risk
Documentation and doc-generation tooling only; no runtime schema or engine behavior changes.
Overview
RR-20 restores the schema docs as true generator output and blocks future hand-edit drift.
scripts/generate-schema-docs.mjsnow documents thatdocs/schema-reference.md,docs/catalog-schema-reference.md, anddocs/examples.mdmust not be edited by hand. It emits conditional requirements from JSON Schemaif/then/else(e.g. Table:datasetwhen present, otherwiserows), moves theexamples/markdown/bullet into the generator so it is not wiped on regen, and supports--checkto compare committed files to a fresh build (CRLF-normalized). Writers return in-memory content;pnpm check:schema-docswires that into CI viapackage.json.The two reference markdown files are regenerated from schemas, replacing prior manual chart/table rows and stale truncation from missed regens after description changes. A changelog fragment records the fix.
Reviewed by Cursor Bugbot for commit b907b5c. Configure here.