Skip to content

mcpx book build: generated spec tables carry unescaped placeholders; docs workflow header claims PR builds #13422

Closed

Description

@dezren39

What this is

Two book-build infrastructure disagreements found by the bookwright coverage audit of the mcpx book (PR #13413, tracking #1888). The audit fixed the book-side symptoms; both items are about the generators/config that will reintroduce them.

1. Generated spec tables carry unescaped placeholder tokens

The baseline .#mcpx-docs build emitted 19 "unclosed HTML tag" warnings. Thirteen of them sit in text generated from the MCP spec corpus or quoted from upstream sources:

  • spec/conformance-matrix.md — mcpx elicit result <id> (5 occurrences of <id>)
  • spec/requirements.md — <server>
  • spec/revision-conflicts.md — <server>, <id>
  • protocol.md — a quoted "Invalid or missing client id: <uri>: <reason>" string
  • compare/register/plugin-apis.md — quoted TypeScript (Array<Hooks>, Promise<void>, Array<SystemPart>)

Bare <token> prose is eaten as an HTML tag by the renderer: the placeholder vanishes from the published page, not just from the log. PR #13413 escaped the committed occurrences, and the settings table's instance was fixed at its source (the script.devshell Short string in internal/settings/registry.go). But the spec chapters are regenerated from the corpus, so the next regeneration reintroduces the spec-side ones unless the generator escapes angle-bracket placeholders in quoted spec text (backticks or &lt;).

Ask: the spec-corpus generator escapes placeholder tokens at generation time, so regenerated chapters are warning-free without hand edits.

2. mcpx-docs.yml's header describes PR builds its triggers never fire

.github/workflows/mcpx-docs.yml opens with "Builds run on pull requests, pushes to main, and manual dispatch" and has an "Upload built site (PR builds only)" step guarded by if: github.event_name == 'pull_request' — but its on: triggers are push (main) and workflow_dispatch only. There is no pull_request trigger, so the step is unreachable and the comment is wrong. (The sibling build-only workflows — fleet-docs.yml, atlas-docs.yml, id-docs.yml — likewise build on push-to-main + dispatch, not on PRs.)

Ask: either add the pull_request trigger (with the artifact upload the comment promises) or correct the header comment and remove the dead step, so the workflow file and its own documentation agree. The book's new deploying chapter (pkgs/mcpx/docs/deploying.md, PR #13413) describes the triggers as they actually are.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T15:39:33Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane ZZ claim — taking both halves of this issue:

    1. Generator escaping: find the spec-corpus generator that emits the mcpx spec chapters (per the brief, internal/refdoc is the suspect), make it escape <...> placeholder tokens in generated tables/quoted spec text, regenerate the affected chapters, and confirm the .#mcpx-docs build warning count drops to the known remaining search-index size notice.
    2. Workflow header: correct .github/workflows/mcpx-docs.yml's header to describe its real triggers (push to main + workflow_dispatch, matching the sibling docs workflows) and remove the dead PR-only artifact-upload step.

    Plan: reproduce the docs build first-hand and count warnings before touching anything; verify with the generator's Go tests (internal/refdoc, internal/settings) and a before/after docs build; land via PR from a laptop worktree off fresh main.

  3. added a commit that references this issue on Nov 23, 2026
  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane ZZ — done, both halves landed in PR #13449 (merged, merge commit ae889033d512).

    Premise: TRUE, reproduced first-hand. On main as found, go test ./internal/conformance -run TestMatrix FAILED: regeneration flipped the five committed &lt;id&gt; matrix rows back to bare <id> (source: the Gap Why at internal/conformance/coverage_clientfeatures.go:158), the matrix input digest was stale from the same hand edits, and requirements.json was stale against its source. The book build itself showed 1 warning (the search-index notice) only because PR #13413's escapes were hand-applied to the generated files — an unsustainable state the golden test was already rejecting.

    What landed:

    • internal/refdoc gains EscapeAngles — </> become &lt;/&gt; in prose; backtick code spans pass through untouched (so the audit's own source fix, `flake:<ref>`, keeps its exact text) and existing entities are never double-escaped. refdoc.Table cells route through it.
    • internal/conformance's mdEscape uses it. The regenerated matrix reproduces the escaped rows byte for byte — the only matrix diff is the input-digest line — and requirements.json was regenerated to match its source.
    • internal/settings' ConfigurationTable escapes its governs cell the same way. All committed generated regions (configuration.md, parity.md, protocol.md) regenerate byte-identically, so this removes the regression path without book churn. (The hand-maintained chapters — requirements.md, revision-conflicts.md, protocol.md prose, plugin-apis.md — keep the audit's escapes; nothing regenerates them.)
    • .github/workflows/mcpx-docs.yml: header now describes the real triggers (push to main + manual dispatch, verified against the three sibling docs workflows), the dead PR-only artifact-upload step is removed, and the deploy job's "PR build" reference now says "build job". Triggers and job behavior otherwise unchanged.

    Verification (laptop route):

    • go test ./internal/refdoc ./internal/settings ./internal/conformance ./internal/cli ./internal/api — all green, TestMatrix passing again; new unit tests pin the escaping in refdoc (TestEscapeAngles, TestTableEscapesAnglePlaceholdersInProse) and in mdEscape (TestMdEscapeAngles).
    • Darwin gate: GOOS=darwin GOARCH=arm64 go test -c ./internal/conformance — ok.
    • nix build .#mcpx-docs: 1 warning before, 1 warning after — the known search-index size notice (12,776,815 → 12,776,769 bytes) — and zero unclosed-tag warnings in both. The change is that the warning-free state is now produced by the generators and enforced by the golden tests, not by hand edits to generated files.

    Closing as completed.

  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Closed as implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions