GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — mcpx docs: generated reference pages -- settings, env vars, flags, CLI, /v1, MCP tools, protocol and parity matrices · Issue #1843 · developing-today/code Closed Labels app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/docsDocumentation improvement or additionpriority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item DescriptionRelocated from dezren39/darwin-nix#144 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering). Parent: #96 SummaryDecide how the reference part of the mcpx docs is produced so it cannot drift from the binary: settings, environment variables and flags, global CLI arguments, CLI commands, the This issue was added by the architect. The user's notes have no "generated reference" bullet. They do ask for pages on "env vars", "cli arguments", "cli commands", "mcp compatibility" and "/v1", and for a compendium where "basically everything that is built can be described". Those pages are the ones that go stale fastest, and mcpx already has single sources for most of them (the settings registry, The reading below found that some reference docs have already drifted, and that several "single sources" have gaps. Those gaps would be published as-is. They are listed as bug candidates under "Found while reading", separate from the docs work. Original notes
These lines are the parents plus the reference-shaped children of the level-2 list. The other children of line 52 belong to #146 and #147. The compendium lines are quoted because its reference sections, such as per-area setting tables, should include the same generated fragments rather than copy them. Current statePaths are relative to What each reference surface is generated from today
The last row is not a docs source. The settings table: how it is made, and what the test checks
Commands:
|
| Setting | Flag | Variable | Where |
|---|---|---|---|
daemon.leaseTTL |
--daemon-lease-t-t-l |
MCPX_DAEMON_LEASE_T_T_L |
configuration.md:216 |
proto.askTTL |
--proto-ask-t-t-l |
:403 |
|
proto.serveMCP |
--proto-serve-m-c-p |
MCPX_PROTO_SERVE_M_C_P |
:407, and this one is not plumbing |
proto.stateTTL |
--proto-state-t-t-l |
:409 |
A generated page publishes these as-is, and once published, renaming them is a breaking change. Decide before the site goes live: acronym-aware dashed(), or explicit Flag/Env plus the old spellings as FlagAliases/EnvAliases.
The man page date is not reproducible (manual.go:335). Use SOURCE_DATE_EPOCH when it is set.
docs/parity.md is missing 27 ops, as listed above.
mcpx config --schema omits scope and hot, although configuration.md:152 says it prints "the same thing".
| Page | Source | Shape | Notes |
|---|---|---|---|
| Settings, env vars, flags | registry, plus the declared table of non-setting MCPX_* variables that #172 owns |
One full table with one section per top-level key, plus the same sections includable one at a time (per-area pages, compendium entries) | Columns as today: setting, kind, default, scope, hot, flag(s), variable(s), governs. Plus Long and enum values. Plumbing marked, not hidden. |
| Global CLI arguments | a new GlobalFlags() table that main.go parses from |
One page | Needs bug candidate 1's refactor, or it is hand-written with a presence test |
| CLI commands | Commands() + registry ForCommand + the hand-declared flags |
An index grouped by Group (the man page's titles, manual.go:354-360), and one page per command: usage, summary, aliases, detail, examples, flags with scope |
One page per command suits search and linking from #147. Subcommands (settings get/set, servers add/remove, log sql/record, elicit answer, recipes run) are not data today. |
/v1 API |
api.Ops() |
Markdown, one section per op: method and path, summary, description, parameters, admin/mutating/destructive/streams, the MCP tool that reaches it (ToolName() / CoveredBy) |
Also publish the raw openapi.json next to it. An HTML "try it" renderer is optional (below). |
| MCP tools mcpx serves | the tool list from mcpserver.New(...).WithExtras(OpTools(nil)) |
name, description, annotations (readOnlyHint, destructiveHint), input parameters |
Covers both the hand-written tools and the mcpx_<op> proxies |
| Protocol matrix | Supported, Features, FeatureMatrix(), capabilities(v) |
The §1 and §2.2 tables | §2.1 methods stay hand-written, with a presence test, until methods are data |
| Parity matrix | ops, tools, plus CLI and plugin columns | The /v1 table generated. The CLI column needs a source: an Op field naming its commands, which #76 would want anyway. The plugin column comes from plugin/opencode/mcpx/daemon.ts method names, or stays hand-written. |
Its "Known gaps" prose stays hand-written |
| Man page as HTML | the same data as the per-command and settings pages | The per-command and settings pages are the HTML manual. Also link the raw mcpx.1. |
Converting roff to HTML (mandoc/pandoc) would render a lossy copy of data we already have |
Every generated page must work as-is as its own agent twin (#120): plain markdown, no generator-specific syntax inside the fragment.
This is today's model, extended. Keep writing the tables by hand, add presence tests for parity.md and a command page, and fix the empty-default rendering.
Why not:
/v1 op.parity.md shows the failure under this model: a claim of test coverage sat next to 26 missing rows.The docs build starts from the binary's JSON and renders it with templates or a preprocessor in the docs toolchain (#117). With mdBook, that is a preprocessor reading [context, book] on stdin.
Inputs:
mcpx config --schema --plumbing --jsonmcpx openapi (the serve surface)GET /v1/openapi.json from a started daemonmcpx man converted with pandocThe OpenAPI goes through Redoc (the redocly build-docs single HTML file), Scalar or Stoplight Elements for the /v1 page.
What you get: no change to the Go code, and the HTML renderers give a polished "try it" UI.
What it costs:
GET /v1/openapi.json depends on the builder's configuration (daemon/ops.go:498-535). The build must start a daemon with an empty config, an isolated state directory and a clean shutdown. chore(deps): bump build/buck/preludes/buck2-prelude from d956689 to e7457f6 #52 showed how easily that lifecycle leaks. Phase 5: tag event bodies must travel with the event #182 fixed the e2e leak (stop --all through the info files, plus MCPX_AUTOSTART_IDLE_EXIT=60s, internal/e2e/e2e_test.go:60-83), but a docs build would have to repeat that discipline. api.OpenAPI in-process avoids it, but that is a Go-side emitter, which is C.CoveredBy, admin, destructive) survive only as x-mcpx-* extensions that a generic converter ignores.Setting or Op then means editing Go and the templates, and nothing fails when only one is edited.--format on existing commandsA new package, e.g. internal/refdoc, holds pure functions from the existing data to markdown:
settings.SchemaCommands() plus the registry/v1 from api.Ops()mcpserverFeatureMatrix() / capabilitiesExisting commands expose it:
| Invocation | Output |
|---|---|
mcpx man --format roff|markdown [-o DIR] |
Roff stays the default. Markdown writes the whole reference tree into DIR: CLI index, global flags, one page per command, settings, /v1, MCP tools, protocol and parity tables. "The manual" is the whole reference, and roff is the terminal subset of it. man already has --install DIR (CmdMan, root.go:255-276). |
mcpx config --schema --format text|json|markdown |
The settings fragment alone, the same bytes as the settings page. --json stays as a synonym for --format json, and JSON gains scope and hot. |
mcpx openapi |
Unchanged. It is published as a file next to the /v1 page. A daemon-surface variant (--surface daemon) is only needed if someone wants the static daemon spec without a daemon. Open question. |
No new command and no new endpoint.
Why the binary rather than a separate go run generator:
mcpx can print a reference that matches itself, offline: mcpx man --format markdown | less, or an agent reading it. That is the same argument that put the roff page in the binary.package.nix can write the tree to $out/share/doc/mcpx/, so the docs derivation (fix(deps): update github.com/charmbracelet/ssh digest to ebfa259 - autoclosed #118) copies it from ${mcpx} instead of building mcpx a second time.Why the data rather than OpenAPI for /v1: the ops table carries the facts a reader of mcpx needs (MCP tool name, CoveredBy, admin, destructive), and it is available without a daemon.
Committed goldens or build-only? Both have a place. The split is whether the file already has to render on GitHub.
| Committed and regenerated in place (golden) | Generated at build, never committed | |
|---|---|---|
| Pages | Tables inside docs/configuration.md, docs/parity.md and docs/protocol.md, between markers like <!-- mcpx:generated settings --> … <!-- /mcpx:generated --> |
CLI per-command pages, global flags, /v1, MCP tools, the site's settings page |
| Why | These files are read on GitHub and linked from story.md. GitHub does not process mdBook's {{#include}}, so an include directive there would show as literal text. |
They exist only on the site. Committing them adds churn and review noise and buys nothing. |
| Check | A Go test renders each marked region and compares it with the committed bytes, with -update to rewrite (the standard Go golden idiom). CI fails on drift. |
None needed: they cannot differ from the binary that built them. CI checks that the docs build succeeds. |
| Risk | A contributor must run the update step. The failure message says exactly which command to run. | A reader browsing the repo sees no per-command pages, only mcpx help <cmd>. |
On the site, the prose pages include fragments from the generated directory rather than from the marker regions, so the site never depends on a committed copy being current. mdBook's {{#include file.md:anchor}} with ANCHOR: / ANCHOR_END: lines, which it strips, lets one generated settings file serve both the full table and per-area includes. That covers the compendium entries and the #146 config pages with no extra flags.
Prerequisites before any page is published:
#74 bears on this directly. A generated per-command page states, from Setting.Commands, which flags a command accepts, so the page is only as honest as those lists. For example, pool.max/pool.min/pool.idleTimeout list status and restart (settings/registry.go:30-80) and are daemon-scoped, and #77 notes that pool.callTimeout is listed for run/exec/call but is not call-scoped. The page must show scope next to every flag, with a line saying what a daemon-scoped flag does on a command that talks to an already-running daemon. #74's proposed flag-walk test is what earns the page the right to say "accepted". #75 (which closed #74) built that walk for exec's flags. #129 owns extending it to every setting (#181 collision 15).
/v1 HTML renderer: is a Redoc/Scalar/Elements "try it" page wanted in addition to the markdown page? It has to point at a daemon the reader runs, over loopback CORS. Deferred unless asked.newFlagSet then parseFlags (root.go:34-67) before doing any work, so parseFlags can record fs.VisitAll and return a sentinel. Declaring moves each command's flags into Command. Capture is cheap but depends on every command parsing before side effects. Data is more work but also serves Update Rust crate petgraph to 0.6.4 - autoclosed #74.settings set, servers add, log sql, ...): should Command gain Sub []Command?Op name the CLI commands that reach it, checked against Commands()? Update Rust crate clap to 4.5.4 - autoclosed #76 would then generate from the same field.Commands() groups or the hand-written usage groups? Fixing bug candidate 1 forces a choice./v1 page need response schemas (today all {"type":"object"})? That is an ops-table change, separate from docs.Ease M. The decision itself is small, but it forces the choices about command-table completeness and flag capture. · Impact high. Every reference page and the agent twin depend on it, and it stops the drift already visible in parity.md. · Depends on / related: #117 (mdBook {{#include}} and anchors, preprocessor), #120 (fragments double as the twin), #146, #147 (the prose that includes the fragments), #145 (implementation; owns #181 collision 18: the parity drift check fails on an absent row), #118 (the docs derivation), #74 (closed, fixed in #75; a generated page must not advertise ignored flags), #129 (the guard that a flag changes an outcome, #181 collision 15), #76 (CLI for /v1-only ops, same source as the parity CLI column), #77 (protocol follow-ups; pool.callTimeout scope), #49 (CI), #52 (closed, fixed in #182; why B's started daemon is a liability), #159 (the bug candidates below, filed), #172 (the outbound MCPX_* table the env-var page needs).
Security/auth deferred; see tracker.
History carried over from dezren39/darwin-nix#144 (verbatim, oldest first):
@dezren39 · 2026-09-30T07:20:33Z
Integration pass. Placed in the DAG rooted at #181.
@dezren39 · 2026-09-30T11:06:16Z
Collision ownership (issues pass, 2026-09-30, at 05c78b2). #181 listed these cross-theme collisions with no owner. Each now has one:
| #181 row | Collision | Owner | What the owner decides |
|---|---|---|---|
| 18 | docs/parity.md cannot distinguish an absent row from a known gap |
#145 | #145's drift check fails on an absent row, not only a wrong one. The page's content belongs to whoever regenerates it (#76/#144). |
Where this issue is the owner, the decision is made here; where it is not, it adopts the owner's decision rather than making its own.
@dezren39 · 2026-09-30T11:52:29Z
Issues pass (2026-09-30, at 05c78b2). I re-checked the body against 05c78b2 and edited it in place. Nothing in "Original notes", the approaches or the recommendation changed.
exec had been left off the list; see Phase 3: sync data phase batches are bounded by count, not bytes #180. The body now records that the file's ## Known gaps cannot be told apart from missing rows, and that ⚡ Bolt: Optimize cursor color generation and position grouping #145 owns that fix (Phase 3: sync, blob gate, and relays #181 collision 18). This issue owns the shape of the page, and Update Rust crate clap to 4.5.4 - autoclosed #76 owns the CLI column.mcpx daemon no longer reads MCPX_FORMAT/MCPX_LOG_LEVEL by hand. It falls back to the resolved logging.format/logging.level (root.go:131-146), which answers the "not verified" sentence, so I struck that sentence. The flag shadowing itself remains. capabilities is now per connection and no longer declares logging, so the committed §2.2 table in docs/protocol.md is already wrong (Root flake check fails on nixosConfigurations due to missing clan-core.clanModules #159 item 18).d956689 to e7457f6 #52 is closed (fixed in Phase 5: tag event bodies must travel with the event #182). Approach B's daemon-lifecycle risk now cites the fix (stop --all, a 60 s idle exit). The risk still applies to a docs build that starts its own daemon.omasnap upstream repository to flake inputs #129 owns extending it to every setting (Phase 3: sync, blob gate, and relays #181 collision 15).05c78b2 (118 x := fs.* plus 12 fs.Var). The "118" elsewhere leaves out fs.Var.05c78b2: dispatch main.go:119-162, usage root.go:549-611, helpFor :473, handleOpenAPI daemon/ops.go:498-535, Supported server.go:778, capabilities :1389, method switch :504-765, dashed schema.go:227-243, CI mcpx.yml:65, checkPhase package.nix:73-81, and others.omasnap upstream repository to flake inputs #129, Root flake check fails on nixosConfigurations due to missing clan-core.clanModules #159 and Phase 2: membership, delegation, groups, and server config #172. The settings/env-var page names Phase 2: membership, delegation, groups, and server config #172's declared non-setting table as its second source.🤖 Agent note · picked up
🤖 Agent note · done — triage verdict: decision CONFIRMED (Approach C); dedupe mapped — implementation already tracked as #1846, prerequisites as #1883, tracker #1903; scope PARTIALLY LANDED on current main; no new packet enqueued (would duplicate #1846's pipeline)
queue/queued with its own triage in the pipeline — so none was enqueued.82b019a0 (2026-10-29, via GitHub API) — the landscape has moved since the body was written at 05c78b2:
internal/settings/docs_test.go now regenerates the docs/configuration.md inventory between BEGIN GENERATED markers and fails on any byte difference (TestTheDocumentationListsEverySetting, -update idiom) — the test's own comment records the drift it caught (missing --output / --n aliases under the old presence-only check). docs/environment.md is generated the same way (scriptenv_test.go). This is Approach C's committed-golden half, implemented as test renderers rather than an internal/refdoc package (code search: no refdoc, no mcpx:generated markers, no --format markdown anywhere in pkgs/mcpx).docs/parity.md is now generated by ParityDoc in internal/cli/parity.go, guarded by TestParityDocumentIsCurrent; the file's header lists the direction tests, including TestEveryDispatchedCommandIsDeclared — so bug candidate 1 (dispatched commands missing from the declared table) is also closed on main, and the 27-missing-ops drift this issue cites is gone by construction.docs/protocol.md carry no generated markers), per-command pages, the global-flags page, the /v1 and MCP-tools site pages, and man-as-HTML; the open questions on this issue (flag capture vs declaration, subcommand data, parity CLI column source) remain mcpx docs: markdown emitters in the binary and a drift check for every generated page #1846's to settle in its triage.-update, committed generated regions) is the shape mcpx docs: markdown emitters in the binary and a drift check for every generated page #1846 should extend, rather than introducing a second generation mechanism beside it.🤖 Agent note · picked up
🤖 Agent note · done — triage verdict: decision implemented; closing this decision record
Verdict: already done. This issue is the Approach C decision record (generate the mcpx reference from the binary's own single sources). The decision was confirmed by triage task 2732 on 2026-10-29, and the implementation has now fully landed:
internal/refdoc helpers, settings page generated from Schema.Markdown (golden-guarded), parity table via ParityDoc, Commands() dispatch guard, man-page date determinism.72efce0bda94a4e37c96f8610979037536871268). Verified fresh this shift from the PR file list (13 files): per-command + global-flag pages (internal/cli/manual_md.go), /v1 page (internal/api/openapi_md.go), MCP-tools page (internal/mcpserver/refdoc.go), protocol tables (docs/protocol.md), the consolidated golden (internal/refdoc/regions_test.go), and the Nix wiring (pkgs/mcpx/package.nix) — every item the 2026-11-03 triage delta on this issue listed as missing is in that PR.Routing followed: the 2026-11-03 delta note on this issue recorded "this issue can close once #4909 lands" — #4909 has landed and is CLOSED, so task 8102 closes this decision record with the evidence above. No new packet is enqueued (any would duplicate #4909's completed pipeline).
Still open, deliberately untouched: #1883 (source-completeness prerequisite — the accuracy of individual generated rows, proceeding in parallel per #4909) and tracker #1903 (the family tracker). Closing this decision record does not close either.