GeezerVison is showing github.com — mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section · Issue #1871 · developing-today/code
mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871DescriptionRelocated from dezren39/darwin-nix#154 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: #98
Summary
The compendium's research chapter holds what was learned while building mcpx, and while doing anything else in this repository, filed so it is not lost in session transcripts. It has four parts:
- A section outline for every topic note 91 names.
- A large standalone Nix section that does not need to mention mcpx.
- A seed list of findings that already exist in the repository, with file references.
- A harvesting process and a quality bar, so findings from sessions, PRs and issues keep arriving and stay trustworthy.
Scope, recorded as the note gives it: fiction is allowed, not requested. The deliverable is "an overview intro and reference website and manual".
Original notes
- documentation
- make a book using whatever is the most common and simple modern choice
- 3 main things, not book sections jsut like levels of detail-
- the compendium
- you dont have to just put strict mcpx things here
- any research or incidental findings into ai, llm, harnesses, plugins, token providers, cloudflare, the typescript ecosystem, SSE, sockets/rpc/websockets/tcp/mcp/openapi/rest/oauth/command-line, really whatever you come across or we talk about. compendium can have an entire section on nix that is a hundred pages and doesnt mention mpcx at all. you could write a short science fiction in there and i wouldnt mind. i'm not asking you to write a short science fiction story i'm asking for an overview intro and reference website and manual.
Note 91's last sentence ("i'm asking for an overview intro and reference website and manual") describes the whole book, not just this chapter. It is recorded here because it is part of the line, and it is also relevant to #89.
Current state
Findings exist, but they are spread across feature entries, design docs, commit messages and PR descriptions. Nothing collects them by topic, and nothing marks which ones are measured, which are read from a source, and which are hearsay. docs/ideas.md already has the discipline this chapter needs ("an answer that only exists in a conversation is lost"), but only for design questions.
Section outline, with seed findings
Every seed below already exists in the repository. File references are to pkgs/mcpx on main unless another path is given.
| Section (note 91 term) |
Seed findings |
| AI and LLMs |
Cost model: ls ~171 tokens, search ~61, types 675-4,402 per namespace (docs/story.md "Zero-context discovery"). Cloudflare's argument that models write code better than they call tools, because tool-call tokens are synthetic training data (blog.cloudflare.com/code-mode). MCP client best-practices: switch to progressive discovery at 1-5% of the context window; mutating the tools array mid-conversation invalidates the provider's prompt cache (modelcontextprotocol.io client best-practices). |
| Harnesses |
Harnesses and plugins: docs/opencode-plugin.md (opencode v1 vs v2, and which parts are opencode's rather than general); story.md "The harness knows what the agent does not" and "Statistics from opencode"; AGENTS.md as the cross-harness instruction file; #48 harness-free core (codex, claude code, pi, manus). opencode code mode: v1 ships it behind OPENCODE_EXPERIMENTAL_CODE_MODE (OPENCODE-V2.md correction block). |
| Plugins |
Plugin without the binary: docs/plugin-discovery.md (the connection ladder, GET /v1/resolve) and #44 (fixed in #53). Plugin logging: the plugin logs over the socket (#36). Plugin install: plugin/opencode/README.md. |
| Token providers |
Ambiguous (see open questions). Model providers: this repository patches opencode for them (opencode-copilot-business-support.patch, opencode-copilot-compaction-fix.patch, opencode-openai-response-id-caching.patch at the repo root) and has skills to maintain those patches. Credential providers: story.md "Credentials". |
| Cloudflare |
Code Mode mechanics: Worker Loader API isolates; fetch()/connect() throw; bindings hide API keys from generated code. Shared with #153. |
| The TypeScript ecosystem |
Node type stripping: Node v24.20.0 runs TypeScript by stripping types, erasable syntax only. A file with enum fails. Constructor parameter properties failed too, which is why the generated client uses plain fields (ASSESSMENT.md bug 3; story.md "Runtime portability"). Runtime detection is deno, then bun, then node (script.runtime, --runtime, MCPX_SCRIPT_RUNTIME). --typecheck runs deno check, Deno only, ~80 ms repeat, ~400 ms for a new program (#79). ts-morph: constructing a TypeScript compiler per request was lootbox's memory problem (ASSESSMENT.md). The runtime comparison belongs in #101 (docs/runtimes.md). Versions here: Deno 2.9.6, Bun 1.3.11. |
| SSE |
SSE over WebSockets: story.md "Server-sent events, not WebSockets": SSE is plain HTTP, EventSource reconnects on its own, and WebSocket upgrades are mishandled by middleboxes. Reconnection: "Lossless reconnection". |
| Sockets, TCP |
Transport costs: story.md "What each transport costs": spawning mcpx status 23.12 ms, unix socket keep-alive 0.17 ms (135x), TCP loopback keep-alive 0.65 ms. Socket path limit: macOS sun_path is 104 bytes, and deep state dirs failed with bind: invalid argument (ASSESSMENT.md bug 4). Loopback address: localhost resolved to IPv6 only while the compiled build bound 127.0.0.1 (ASSESSMENT.md). |
| RPC, WebSockets |
JSON-RPC framing is standard library (docs/dependencies.md). Lootbox's WebSocket: lootbox used a WebSocket RPC channel (lootbox.config.json serverUrl: ws://127.0.0.1:9420/ws). |
| MCP |
Protocol eras: story.md "Two protocol eras" and "What 2026-07-28 actually asks of a client". Revision matrix: docs/protocol.md, every revision in both directions, plus "What is still missing". Sampling bug: story.md "Sampling" -> "It did not work, and nothing said so". Capabilities are declared in the handshake, but the handler was installed after it, and every test called the passthrough directly. Elicitation bug: "The bug that came first". Doctor: "mcpx doctor" -> "It found a bug immediately". Remote transport: "Remote servers without a shim" (Streamable HTTP, no mcp-remote). Registry: the official one publishes an OpenAPI spec; HAPI is not open source and returns 404 (story.md "Which registry"). |
| OpenAPI, REST |
Specs as tools: story.md "Specifications as tools" -> "Two things easy to get wrong": a relative server URL must resolve against the document's location, and only read methods are exposed by default. Wrong spec: "The specification described the wrong thing": the spec described mcpx's ten tools, not the hundreds it fronts. Ops table: one table generates the routes, MCP tools and OpenAPI (internal/api/ops*.go). |
| OAuth |
Status: story.md "Credentials"; "OAuth for remote servers" is status: proposed. |
| Command line |
CLIs as servers: story.md "Command-line programs as servers". Derived flag names: daemon.leaseTTL becomes --daemon-lease-t-t-l (docs/configuration.md:216). Ignored flags: accepted and ignored (#74, fixed by #75). Help coverage: internal/cli/manual.go Commands() lists 32 commands, but cmd/mcpx/main.go's dispatch table also routes man, completion, serve, openapi, adapter, registry and api, so help/man do not list them. |
The Nix section (need not mention mcpx)
A hundred pages is allowed. The seeds below are real, and several are not about mcpx at all.
Go on Nix.
vendorHash repair. Renovate can bump go.mod but cannot compute the vendored-tree hash, so every Go dependency bump broke the Nix build and "merged silently". .github/workflows/mcpx.yml blanks the hash, reads got: sha256-... from the failed build, commits it back to bot branches only, and fails any PR that still does not build.
- Sandbox tests.
package.nix sets subPackages = [ "cmd/mcpx" ], which confines go test to a package with no tests. So checkPhase lists the internal packages explicitly: a new package is untested in the sandbox until someone adds it there (package.nix:69).
- Pure-Go SQLite. Using
modernc.org/sqlite instead of cgo keeps the derivation free of a C toolchain and keeps cross-compilation working (docs/dependencies.md "Why this driver").
Wrapping and generated artefacts.
wrapProgram --suffix PATH with git, deno, bun-bin and nodejs, so behaviour does not depend on the calling shell. git is there because repo/worktree scopes are silently weaker without it.
- The man page and shell completions are generated by the just-built binary in
postInstall ("A man page maintained separately is wrong within two releases").
Beyond mcpx: this repository.
- The nix-darwin flake layout, homebrew brews/casks/masApps.
- Custom packages (
pkgs/: bun-bin, codedb, flake-tidy, opencode-share, opencode2, ...).
- Patching opencode from the flake, and keeping those patches alive across updates (the
update-opencode and fix-opencode-patches skills).
- The justfile workflow.
- Renovate on a flake.
Containers and CI (seeds from #182; not Nix-specific).
- Static Go builds.
os/user and net pull in libc only under cgo. CGO_ENABLED=0 produced a fully static linux binary of the same size (within ~100 bytes) that still runs exec (docs/container.md section 4). The cost is Linux-only: pure-Go os/user reads /etc/passwd instead of NSS, and the pure-Go resolver ignores nsswitch.conf. On macOS, since Go 1.20, net and os/user use the system libraries without cgo, so the flag changes nothing there.
- Where image size goes. In
debian:bookworm-slim, git with --no-install-recommends costs 105 MB, more than bun (79 MB), because Debian's git depends on perl (docs/container.md section 5).
actions/setup-go in a monorepo. Without cache-dependency-path it looks for go.sum at the repository root, logs "Restore cache failed: Dependencies file is not found" on every run, and never restores (.github/workflows/mcpx.yml:46-50, fixed in Phase 5: tag event bodies must travel with the event #182).
- Test daemons must be stopped the way they record themselves. Plain
stop recomputes the socket path from the environment, which a long state path moves elsewhere, so e2e daemons survived for hours (chore(deps): bump build/buck/preludes/buck2-prelude from d956689 to e7457f6 #52, closed). The fix stops them through the info files they write (stop --all) and sets a short idle exit as a backstop (internal/e2e/e2e_test.go:61-83, Phase 5: tag event bodies must travel with the event #182).
macOS findings.
- The temp-dir sweep. The per-user temp directory
/var/folders/.../T/ is swept by the OS. That silently destroyed ~3,000 tracked files across git worktrees, while git status reported clean from a stale fsmonitor index (instructions/worktrees.md).
- macOS-only tests. Two tests only passed on macOS (fix(deps): update rust crate axum to 0.6.20 #35).
Scope note on fiction
"you could write a short science fiction in there and i wouldnt mind. i'm not asking you to write a short science fiction story". Recorded as scope: allowed, not requested. If anything like it is ever written, it is labelled as fiction, kept out of search results mixed with facts, and left out of the agent twin (#120). Nothing in this issue produces it.
Approaches: how findings get here
-
A -- write them up when someone remembers (least recommended). This is today's process. Findings stay in session transcripts, PR bodies and commit messages. The ones in feature entries are organised by feature, not topic. Nothing marks a measurement as stale. A reader cannot tell a verified number from a guess. It costs nothing, and that is roughly what it recovers.
-
B -- issues labelled research, compiled by hand into pages. GitHub is the intake: any session, PR or person files an issue (or comments with a link) under the existing research label, and someone periodically writes pages from them. Intake is better and discussion can thread, but compilation is manual. Issues close and get forgotten, and the page format is undefined, so the quality varies.
-
C -- a findings entry format, a label for intake, and a harvest step (recommended).
-
Entry format. Reuse the runbook key block, so 🎨 Palette: Add ARIA labels and live regions to search panel #150/⚡ Bolt: Optimize ProseMirror decoration widget rendering #151 tooling (IDs, since, changed, history) works unchanged:
created: 2026-09-29T15:00:00-05:00
last-updated: 2026-09-29T15:00:00-05:00
status: verified
tags: topic:mcp, topic:sampling, area:protocol
sources: docs/story.md#sampling, 28f2cdc (#39)
checked: mcpx 0.1.0 @ d0b7e01
description: a capability handler installed after the handshake is never offered.
status gets finding-specific values: verified (reproduced here), measured (with environment), read-in-source, reported (someone else's claim, cited), hearsay, superseded (struck through, not deleted, per the runbook's "Never delete an entry"). topic: is a new tag key alongside the runbook's area, platform and cost.
-
Intake. A finding label, or the existing research label, on issues and PRs. A PR template line: "Anything learned that is not about this change? Link or label it." And a sentence in the agent instruction files telling agents to file a finding issue for a verified surprise, not bury it in a transcript.
-
Harvest. A per-release runbook step moves labelled items into topic pages as entries and closes the issues with a link. A finding stays an issue until it is written up, so nothing is lost in between.
C reuses every mechanism the compendium already needs and makes provenance explicit.
Quality bar for an encyclopedia entry
- Sources. Every claim has at least one: a file with line, a commit, an issue, or an external URL with the date it was read.
- Measurements. A measurement carries its environment (machine, OS, runtime and tool versions) and the command that produced it, following the story's rule "re-run the command, paste the result".
- Provenance. Say how it is known: reproduced, read in source, read in docs, or someone said so. Never let hearsay read like a measurement.
- Dates. Every entry is dated, and a re-check updates
checked. When an entry is wrong, strike or supersede it with a link. Never edit it silently; the history (🎨 Palette: Add ARIA labels and live regions to search panel #150) shows the change.
- Standalone. Where possible an entry is readable without mcpx context. That is the point of the Nix section.
Open questions
- "token providers": model providers (Copilot, Anthropic, OpenAI and the opencode patches for them), credential/OAuth token providers, or both? The outline assumes both.
- Does the Nix section live in this book, or in a separate book for the whole
dezren39/nix repo that this one links to? The mcpx book is a project site inside a monorepo (chore(deps): update rust crate actix-files to v0.6.10 - autoclosed #117, fix(deps): update github.com/charmbracelet/ssh digest to ebfa259 - autoclosed #118), and a hundred-page Nix section is about the monorepo, not mcpx.
- A new
finding label, or reuse research?
- One page per topic with many entries, or one page per finding?
- Should findings stated inside feature entries (the sampling bug, transport costs) move here, or be excerpted here with the feature entry as the source of truth? The latter avoids two copies.
Ease · Impact · Related
Ease L (ongoing; the first cut of the outline plus seeds is M) · Impact med · Depends on / related: #150 and #151 (entry format, history), #152 (chapter placement), #153 (Cloudflare and opencode overlap), #117 and #118 (where a Nix section is published), #120 (fiction and hearsay excluded from the agent twin), #101 (runtimes comparison), #48 (harness-free core), #79 (typecheck timing), #74 (closed, fixed in #75: flags accepted and ignored), #134 and #136 (container and platform findings).
Security/auth deferred; see tracker. Activitydeveloping-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026 History carried over from dezren39/darwin-nix#154 (verbatim, oldest first):
@dezren39 · 2026-09-30T07:20:43Z
Integration pass. Placed in the DAG rooted at #181.
@dezren39 · 2026-09-30T11:49:21Z
Issues pass (2026-09-30, at 05c78b2).
dezren39 commented on Oct 29, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), Lane D shift
- Session / ID: queue task 2764 (triage)
- Found via: queue claim
- Task: Code-side triage of relocated mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871 (was mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section dezren39/darwin-nix#154): dedupe pass, scope confirmation against current pkgs/mcpx main, follow-up packet.
- Expectation: done = verdict below + follow-up enqueued (task 3096).
- Links: follow-up queue task 3096 · re-home tracker mcpx: re-home the open mcpx backlog from dezren39/nix, with this repo as the single source #309
Triage verdict (task 2764, 2026-10-29)
Not a duplicate. Dedupe pass over open code issues on the same mcpx subject:
- mcpx docs: the book -- overview, manual and compendium (tracker) #1888 — book tracker (overview/manual/compendium) — parent tracker, not this chapter's content.
- mcpx docs: level 3 -- the compendium, release markers and section history (tracker) #1907 — level-3 compendium tracker — parent tracker for this chapter.
- mcpx docs: compendium structure, migrating the existing design docs, and a catalogue of MCP servers, resources, indexes and projects #1867 — compendium structure, migrating existing design docs, MCP catalogue — adjacent, distinct deliverable.
- mcpx docs: release-version markers and a hierarchical, collapsible section history #1863 / mcpx docs: implement the history renderer and release stamping #1865 — release-version markers + section history — a mechanism the chapter will use, not its content.
- mcpx docs: comparisons (lootbox, opencode code mode, Cloudflare Code Mode, ...) and the project's history #1869 (comparisons/history), mcpx: design a comprehensive docs and testing strategy #1892 (docs+testing strategy), mcpx docs: choose the site generator (mdBook, MkDocs Material, Docusaurus, Starlight, Hugo) #1939 (site generator) — all adjacent, none covers the research-findings chapter.
mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871 alone owns the research & incidental findings content: the section outline (AI/LLMs, harnesses, plugins, token providers, Cloudflare, TypeScript, SSE, sockets/TCP, RPC/WebSockets, MCP/OAuth/CLI/protocols, Containers/CI, plus the standalone Nix section), the seed-findings list, and the harvesting process + quality bar.
Scope confirmed against current pkgs/mcpx on main (2026-10-29): every seed source the issue names still exists — docs/story.md (118,058 B), ASSESSMENT.md (15,534 B), docs/opencode-plugin.md (21,673 B), docs/plugin-discovery.md (10,072 B), docs/dependencies.md (4,938 B), docs/ideas.md (24,254 B), docs/runtimes.md (8,329 B), AGENTS.md (5,020 B). No scope correction needed. Historical issue references in the body remain dezren39/nix numbering, as the relocation header states.
Follow-up enqueued: queue task 3096 (small_fix, dedupe repo-health:v1:fix:developing-today/code:issue:1871) — first slice only: author the chapter as generator-agnostic markdown under pkgs/mcpx/docs/ with the #1871 outline, seed findings harvested with citations + provenance tags (measured / source / hearsay), and the harvesting-process section. Named later slices (not dropped): the standalone Nix section; site-generator integration (#1939 pending). Verification for the follow-up: CI green on its PR (treefmt/nix ci); docs-only, no code tests. dezren39 commented on Nov 14, 2026
Agent note — task 16628 resumed (lane any-b)
- state: in-progress (resume from awaiting_ci park)
- task: 16628
- issue: mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871
- PR: docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 — docs(mcpx): compendium Nix section + Containers/CI harvest
- Fresh verification (2026-11-14): PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 is OPEN, no hard-stop labels on PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 or issue mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871; diff is exactly the two intended docs files (pkgs/mcpx/docs/research-and-findings.md +162/-19, pkgs/mcpx/docs/changes/research-and-findings-nix-slice.md +3) and records the placement answer in the chapter (the Nix section lives in this book; a future repository-wide book gets a link, no pre-emptive split).
- CI: no workflow runs have registered on PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 (fleet CI backlog; only CodeRabbit neutral). Per the standing merge authority, PRs do not wait for CI; the recorded targeted tests stand (go test ./tools/docs-history/ pass; docs-history check on the staged diff clean for the new fragments).
- Codex gate: the Codex review on PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 FAILED TO RUN — Codex usage limits reached (chatgpt-codex-connector[bot], 2026-11-14T13:02Z: "We couldn't complete this review" + usage-limit notice). There are no inline Codex findings to disposition.
- Next: merge PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994, then complete task 16628 as pr_opened/fixed with issue mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871 staying open for the chapter's ongoing harvest, naming what remains on the issue.
dezren39 commented on Nov 14, 2026
Agent note — task 16628 done (lane any-b)
- state: done
- task: 16628
- issue: mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871
- outcome: fixed_merged — PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 merged at 2c2adb9 (2026-11-14T14:13:58Z)
- The standalone Nix section is written in pkgs/mcpx/docs/research-and-findings.md (## Nix, from the mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871 seeds, chapter entry format with finding statuses), the Containers and CI outline seeds are harvested in the same PR, and the placement answer is recorded in the chapter text (section lives in this book; a future repository-wide book gets a link — no pre-emptive split), closing open question 2.
- Verified on merged main: no "later slice" placeholder sections remain in the chapter outline.
- Tests (recorded at pr_opened): go test ./tools/docs-history/ pass; docs-history check on the staged diff clean for the new fragments.
- CI: no workflow runs registered on PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994 (fleet CI backlog); merged under the standing merge authority (CI runs on main only). Codex review failed to run (usage limits) — no Codex findings exist on PR docs(mcpx): compendium Nix section + Containers/CI harvest (#1871) #9994.
- Remaining on mcpx docs: research and incidental findings -- AI, harnesses, protocols, TypeScript, and a Nix section #1871: nothing outstanding from this slice. The issue stays open as the compendium's standing harvest home (see "Harvesting: how findings get here" in the chapter); new findings accumulate there as they are found.
dezren39 commented on Nov 14, 2026
Agent note — next lead from the task 16869 suite run (lane any-b)
Fresh finding while running the full pkgs/mcpx suite for task 16869 (2026-11-14): internal/settings TestEveryDocumentHasAChapter fails on clean main because pkgs/mcpx/docs/changes/research-and-findings-nix-slice.md — the change fragment this issue's slice 2 added in PR #9994 — is not registered in pkgs/mcpx/docs/compendium.manifest.json. Verified pre-existing on pristine main (bc42ebf), unrelated to task 16869's change. One-line follow-on: give the fragment a chapter in the manifest (or a role + reason, per the test's message). Recorded here because #1871 is the compendium's standing harvest home; not fixed in task 16869's PR to keep that change single-purpose.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|