Repository navigation
mcpx(plugin): generate the README options table from the settings registry (#2516) - #2844
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Item 9 of #2516 (the remainder of #1883 item 9): the opencode plugin's options table in
pkgs/mcpx/plugin/opencode/README.mdwas a second hand-written list that nothing read. It is now generated from the settings registry and guarded by a drift test, in the same marker/-updatestyle asdocs/configuration.md.What is generated
The region between the markers renders, in registry declaration order:
plugin.*setting (all 12): option = path minusplugin., variable =EnvName()plusEnvAliases, default = the registryDefault(—when empty), effect = the registryShort;endpointandsocket, whose option names come fromdaemon.endpoint/daemon.socketand whose variables (MCPX_DAEMON_ENDPOINT,MCPX_ENDPOINT,MCPX_SOCKET) are asserted to exist insettings.ScriptEnv()rather than hardcoded.Regenerate with:
Wording that changed, because the registry is now the source of truth
discoveryRetrydefault now reads1m0s(whatdefaults.PluginDiscoveryRetryrenders, and whatdocs/configuration.mdalready said) rather than60s.true/falserather thanoff/on;headless/daemonToolsrenderautorather thandetected/when unclear.Shortlines. The longer per-row explanations they replaced are kept as hand-written paragraphs immediately below the generated region (bin: "",binArgswhitespace/JSON, the threebackendbehaviours, and the meanings ofheadless,daemonTools,env,remember), so nothing the old table said was dropped.Guards
TestThePluginReadmeListsEveryOptionregenerates the marked region and fails when the README differs;-updaterewrites it.TestThePluginOptionTableCoversTheRegistryindependently asserts everyplugin.*setting has exactly one row plus both daemon rows, so a generator that silently rendered nothing would still fail.TestThePluginOptionTableDriftBitesproves the comparison actually bites: it mutates a default, a variable, a row name and adds an invented row, and asserts each is caught. It first checks the committed file is not already stale, so it cannot pass vacuously.treefmt.tomlgains an exclude for the README, for the same reasondocs/configuration.mdhas one: prettier's table padding would break the byte-for-byte comparison.treefmt --fail-on-change plugin/opencode/README.mdis clean.Verification
gofmt -l internal/settings/pluginreadme_test.gogo vet ./internal/settings/go test ./internal/settings/ -run TestThePlugin -count=1go test ./internal/settings/ -run TestThePluginReadmeListsEveryOption -update, twicemd5sumidentical (idempotent)treefmt --fail-on-change plugin/opencode/README.mdgo test ./internal/settings/ -count=1mainatdc9b1179and497c820f(see below)The five failures —
TestEveryDocumentHasAChapter,TestNoUndeclaredEnvRead,TestEverySettingHasAnEffectProbeOrAnExemption,TestTheScriptEnvironmentIsWhatTheCodeSets,TestTheEnvironmentDocIsCurrent— reproduce unchanged onorigin/mainin a clean worktree with no changes from this branch (MCPX_ADAPTER_DECLARATION_SHA256undeclared, missing effect probes formodel.*/proto.*/script.*, staledocs/environment.md, an untrackedTESTING.mdcompendium gap). They are not caused by this change and are left alone here.Not in this PR
Item 8 — per-command flag single-sourcing in
internal/cli(~175 handfs.*declarations across 21 non-test files) — is untouched. No flag name, default or meaning changes here.Refs #2516, #1883.
Need help on this PR? Tag
@codesmith-botwith what you need.