[2.0] Generate docs/schema-reference.md from the config dataclasses - #388
Closed
ishandhanani wants to merge 2 commits into
Closed
ishandhanani wants to merge 2 commits into
ishandhanani wants to merge 2 commits into
Conversation
This was referenced Sep 6, 2026
Closed
ishandhanani
marked this pull request as ready for review
September 7, 2026 19:16
ishandhanani
requested review from
alec-flowers,
csahithi and
nlevin-ui
as code owners
September 7, 2026 19:16
docs/config-reference.md is hand-written prose and drifts from the schema (the power docs merged last week already reference a field that #317 removed). This adds a generated, CI-checked field-level reference so the truth lives in the code. - src/srtctl/core/schema_docs.py walks the dataclass tree rooted at SrtConfig plus the four backend types and ClusterConfig, and renders one Markdown table per dataclass: YAML key (honoring marshmallow data_key), type (nested dataclasses linked, Literals expanded), default, and a description taken from the class docstring `Attributes:` block or the comment on the field. - `srtctl schema-docs` writes docs/schema-reference.md; `--check` exits 1 when the checked-in file is stale. `make schema-docs-check` and a CI lint step run the check; tests/test_schema_docs.py enforces it in the test suite too and covers the renderer and the CLI. - docs/config-reference.md points at the generated file as authoritative for keys, types, and defaults; SUMMARY.md links it; CLAUDE.md tells contributors to regenerate after any schema change. Part of the 2.0 plan: #385
ishandhanani
force-pushed
the
idhanani/srt2-03-schema-docs
branch
from
September 8, 2026 03:54
5a9bc82 to
4d3e76e
Compare
Collaborator
Author
|
Consolidated into #407, which carries these same commits as one PR against main (this description is reproduced there as one of its parts). Closing to keep review in one place; the branch stays for per-step reference via stack #398. |
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.
Summary
Third PR of the 2.0 stack (plan: #385, Track 1 item 2). Stacked on #387; the diff against that branch is what to review.
docs/config-reference.mdis hand-written prose and drifts from the schema (the power docs merged last week already reference atelemetry.providerfield that #317 removed). This adds a generated, CI-checked field-level reference so keys, types, and defaults live in the code.src/srtctl/core/schema_docs.pywalks the dataclass tree rooted atSrtConfig, the four backend types, andClusterConfig, and renders one Markdown table per dataclass: YAML key (honoring marshmallowdata_key, sogpus_per_prefillrather than_explicit_gpus_per_prefill), type (nested dataclasses linked,Literals expanded), default, and a description taken from the class docstringAttributes:block or the#comment on the field.srtctl schema-docswritesdocs/schema-reference.md(562 lines, 38 sections).srtctl schema-docs --checkexits 1 when the checked-in file is stale.make schema-docs-check(part ofmake check), andtests/test_schema_docs.py::test_checked_in_schema_reference_is_current.docs/config-reference.mdnow points at the generated file as authoritative for keys, types, and defaults;SUMMARY.mdlinks it;CLAUDE.mdtells contributors to regenerate after any schema change and where to put field descriptions so they land in the table.Validation
ruff,ruff format --check, andtyclean on the new moduletests/test_schema_docs.py(9 tests: drift check, determinism, data_key handling, docstring and comment descriptions, backend and cluster sections, CLI write/check/stale)srtctl schema-docs --checkpasses on the committed fileStack
--bash