docs: default tables of contents to one level - #1324
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The TOC generator currently drops an explicit max-depth=2 marker during regeneration, making --check non-idempotent for that valid configuration.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the documentation TOC generator to default to listing only top-level (H2) sections, while allowing individual documents to opt into deeper TOCs via a max-depth marker attribute, and refreshes existing docs to match the new default.
Changes:
- Default TOC generation to include only H2 headings unless
max-depthis specified (2–6), and preserve that setting through regeneration/checks. - Add Python regression tests covering default behavior, opt-in depth, idempotency, duplicate-anchor numbering, and invalid values.
- Regenerate TOCs across docs to remove subsection entries under the new default.
File summaries
| File | Description |
|---|---|
| scripts/test_gen_doc_toc.py | Adds regression tests for per-document TOC depth behavior. |
| scripts/gen-doc-toc.py | Implements max-depth parsing and default depth behavior in TOC generation/checking. |
| docs/strata-engine.md | Refreshes TOC to top-level sections only. |
| docs/spirit_progress.md | Refreshes TOC to top-level sections only. |
| docs/schema-intelligence.md | Refreshes TOC to top-level sections only. |
| docs/postgresql.md | Refreshes TOC to top-level sections only. |
| docs/pending-drops.md | Refreshes TOC to top-level sections only. |
| docs/namespaces.md | Refreshes TOC to top-level sections only. |
| docs/invariants.md | Refreshes TOC to top-level sections only. |
| docs/grpc-control-edge-cases.md | Refreshes TOC to top-level sections only. |
| docs/github-app-setup.md | Refreshes TOC to top-level sections only. |
| docs/engines.md | Refreshes TOC to top-level sections only. |
| docs/configuration.md | Refreshes TOC to top-level sections only. |
| docs/check-runs.md | Refreshes TOC to top-level sections only. |
| docs/architecture.md | Refreshes TOC to top-level sections only. |
| docs/apply-lifecycle.md | Refreshes TOC to top-level sections only. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
e2da919 to
1840cbb
Compare
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1324, 1840cbb. Verdict: 8 findings — 0 blocking, 6 non-blocking, 2 suggestions. Re-reviewed the delta Non-blocking1. An explicit 2. A case typo bypasses the typo-rejection path the PR just added. 3. The feature ships with no automated coverage. The six new tests in 4. 5. An invalid depth aborts the write sweep mid-flight, before the manifest is written. 6. The broken-TOC message got less useful. General suggestions7. 8. Docstring and ergonomics. The rewrap left a 137-char line at The one thing that could have broken, verifiedBoth marker regexes use Verified correct
This review was generated by Claude Code (claude-opus-5). |
|
🤖 Addressed in b407e49:
Nine tests pass, including an end-to-end Keeping |
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1324, b407e49. Verdict: 7 findings — 0 blocking, 5 non-blocking, 2 suggestions. Re-reviewed the delta Non-blocking1. One 2. The broken-TOC report is the one path the new tests never reach, and all three of its defects survive. Hardcoding 3. The duplicate-key guard is untested. Dropping 4. The test file documents an invocation that permanently dirties the repo. 5. Still no document opts in, and General suggestions6. The 7. Style debt that survived two reworks. The one thing that could have broken, verifiedMarker discovery is not fence-aware: both Verified correct
This review was generated by Claude Code (claude-opus-5). |
Generated tables of contents list every subsection, taking up too much space before readers reach the guide. Default to main sections (
##headings) and regenerate existing TOCs with the shorter layout.Documents can opt into more detail with
max-depth=3in the opening TOC marker. The setting survives regeneration and CI checks, supports heading levels 2–6, and preserves duplicate-heading anchors. Only TOC entries change; the document sections stay intact.Validation: six regression tests covering depth settings, regeneration, invalid values, and duplicate anchors; Go build and documentation checks passed.
Generated with Codex