Repository navigation
feat(docs-ci): validate docs config examples against the schema - #121336
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 10, 2026 01:47
steipete
force-pushed
the
claude/vigilant-goodall-3cbb1a
branch
4 times, most recently
from
August 10, 2026 04:36
c336af7 to
6db4d73
Compare
steipete
force-pushed
the
claude/vigilant-goodall-3cbb1a
branch
3 times, most recently
from
August 10, 2026 05:34
2d30962 to
760faa2
Compare
steipete
force-pushed
the
claude/vigilant-goodall-3cbb1a
branch
2 times, most recently
from
August 10, 2026 06:33
6283a26 to
e199a66
Compare
Contributor
Author
|
Merged via squash.
|
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.
What Problem This Solves
A docs audit found the dominant docs-drift class is JSON5 config examples in
docs/**teaching keys the strict config schema rejects — it recurs every time a config key is retired, because nothing validated docs config fences against the schema. This PR adds a permanent CI gate and fixes all current drift (~130 findings across ~80 docs pages) so the gate starts green.Why This Change Was Made
Docs are product surface: a competent operator copying a documented example must end with a config the gateway accepts. The gate keeps
docs/**andsrc/config/dead-config-keys.test.tsin lockstep permanently instead of relying on periodic audits.Design:
src/config/docs-config-examples.ts(precedent:src/config/doc-baseline.ts): scansdocs/**/*.md(x)fences with languagejson5/json/jsonc, JSON5-parses them, and validates whole-document candidates viavalidateConfigObjectRawWithPlugins({ validateBundledChannels: true })against one source-checkout plugin metadata snapshot per audit. Findings are restricted to unrecognized-key issues — placeholder values never false-positive.policy.jsonc, and fragments out of scope (~2550 of ~3460 fences skipped).$includekeys are dropped recursively before validation, mirroringsrc/config/includes.tsresolution order, so include-demo fences stay validated for their other keys.validate=falsein the fence info string for deliberately partial/legacy/non-openclaw.json fences; 5 annotations total, each a genuinely non-config document (ACPX config,policy.jsonc, two gateway protocol payloads, one intentionally rejected legacy shape). Documented indocs/AGENTS.md.run_check_docsonly fires on docs changes:pnpm docs:check-config-examples(new, appended tocheck:docs) covers docs-only PRs, and the colocated lockstep test insrc/config/docs-config-examples.test.tsis selected by change classification whensrc/configchanges — so retiring a config key fails PR CI even with no docs edit. Together there is no classification gap.Docs fixes by cluster: retired
agents.list→ canonicalagents.entriesroster (~27 pages);env.<KEY>→env.vars.<KEY>(~15 provider pages, rootenvis strict);agents.defaults.*GenerationModelandtools.media.*.models→agents.defaults.mediaModels.*(~14 pages);agents.defaults.promptOverlays.gpt5.personality→ plugin-ownedplugins.entries.openai.config.personalitywith corrected behavior prose; plus the long tail (browser.*.color, channelretryblocks,messages.queue.debounceMs→messages.inbound.debounceMs,slack.identity→postAs,hostnameAllowlist→allowedHostnames,pdfMaxBytesMb→pdfMaxMb,tools.exec.timeoutSec→timeoutSeconds, retiredcommands.ownerDisplay*/useAccessGroups,discovery.wideArea.enabled,messages.tts, twitch/whatsapp/zalouser shapes,bootstrapPromptTruncationWarningnow built-in). Surrounding prose updated with the fences.Production LOC: +377/−6 (net +371); tests +150/−2; docs net −28. The plugin schema baseline remains below current
main(4053 → 4040) while exposing runtime-owned config and preserving Voice Call's shipped aliases; no new runtime option or default is introduced.Overlap note: open contributor PRs #114593 (cacheTrace docs) and #114610 (hostnameAllowlist docs) address subsets of this drift; their target lines are fixed here as part of the sweep. Maintainer will resolve/credit those separately.
User Impact
Operators copying any whole-config example from the docs now get config the strict schema accepts. Docs authors get a clear contract: config fences are validated in CI; deliberately partial snippets annotate
validate=false.Evidence
node scripts/check-docs-config-examples.mjsreported ~130 unrecognized-key findings across ~80 pages (full inventory in the check output;docs_config_fences_validated=912).docs_config_files_scanned=763,docs_config_fences_seen=4556,docs_config_fences_validated=1165, 5 opt-outs.agentId; OllamawebSearch.baseUrl).docs/providers/anthropic.md's retiredagents.listexample plus 38 other nested examples.voiceandvoiceIdare restored beside canonicalspeakerVoice/speakerVoiceIdin every Voice Call TTS provider schema, matching shipped runtime compatibility; the duplicate top-levelagentIdmetadata/schema entry is removed. Retiring the aliases remains a future Voice Call doctor-migration task, not part of this PR.src/config/docs-config-examples.test.ts, so schema-only manifest PRs exercise the docs audit even without a docs edit. The changed-target routing suite passes 85/85 on the final landing base.72c4f26a4eaa78, which independently removed the unusedapplySessionHintsimport while preserving the mock-factory key. Targeted oxlint passes on the rebased file.personalityyfails withdocs/gateway/config-agents.md:501 :: plugins.entries.openai.config :: invalid config: must not have additional properties: "personalityy"; reverting restores green.node scripts/run-vitest.mjs src/config/docs-config-examples.test.ts: 14/14 passed, including the pre-fix failing indented Accordion fence, a longer closing fence, unsupported/supported OpenAI plugin config, and bundled-channel forwarding.node scripts/run-vitest.mjs src/config/config.plugin-validation.test.ts: 82/82 passed after aligning the Voice Call manifest fixture with canonicalspeakerVoice.pnpm config:docs:checkpassed with the plugin baseline ratcheted from4053 → 4040after current-main regeneration; targeted oxfmt/oxlint andgit diff --checkpassed.pnpm plugin-sdk:api:checkpassed on Linux Node 24 Testbox (run 31353580043); the generated API baseline is folded into the same feat commit.pnpm lint:docs(755 files, 0 issues),node scripts/check-docs-mdx.mjs docs README.mdpassed (770 files), oxlint/oxfmt clean on touched files,git diff --checkclean.origin/main: clean, "patch is correct" (0.99).