Skip to content

mcpx: generate the public client signature reference from source - #13701

Open
dezren39 wants to merge 1 commit into
mainfrom
queue/21410-13612-public-client-surface
Open

dezren39 wants to merge 1 commit into
mainfrom
queue/21410-13612-public-client-surface

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

Replaces the hand-written signature table in pkgs/mcpx/docs/public-client.md with a region generated from the pkg/client Go source, added to the existing committed-docs golden check.

Why

The table drifted — several ctx descriptions were stale and the receiver shapes were spelled loosely. Generating it from source means a new, removed or reshaped exported callable drifts the check instead of the docs.

Fixes #13612

How

  • internal/refdoc/clientsurface.go: ClientSurface(files map[string][]byte) parses the source, renders exported types, package funcs and methods on exported receivers with the doc-comment first paragraph as the summary; unexported names, bodies, struct fields and package vars are excluded; output is deterministically sorted.
  • internal/refdoc/clientsurface_test.go: exact-render pin, drift table (parameter type/name, receiver, result, type params, removal, addition, type kind), preservation table (bodies, fields, unexported, package var), determinism.
  • internal/refdoc/regions_test.go: public-client-signatures region added to TestCommittedRegionsAreCurrent.
  • pkg/client/client.go: doc comments on (*ArgError).Error and (*HTTPError).Error so no summary is empty.

Verification

cd pkgs/mcpx && go test ./internal/refdoc ./pkg/client -count=1 (local), plus -race -shuffle=on -count=5 on refdoc. Focused Fleet dispatch result recorded in the issue thread.

{
  "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-23T20:53:28Z",
    "session_id": "ses_e5df6002d55ffe0A3TqeHqMEcI",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/fleet/code-f-21410-public-client",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/fleet/code-f-21410-public-client",
      "repo": "developing-today/code",
      "branch": "queue/21410-13612-public-client-surface",
      "sha": "b1cb58a80e93729de7a18c1263563a9fd1d34b07"
    },
    "auth_subject": "oc-code-05",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The public-client chapter carried a hand table of the pkg/client
surface that had drifted: several ctx descriptions were stale and
the receiver shapes were spelled loosely. Replace it with a generated
region built from the Go AST (types, funcs and methods on exported
receivers, doc-comment first paragraph as the summary), so a new,
removed or reshaped exported callable drifts the committed-docs
check.

The renderer is deterministic and excludes unexported names, bodies,
struct fields and package vars. Fixture tests pin an exact render and
drive the drift table (parameter type/name, receiver, result, type
params, removal, addition, type kind) and the preservation table
(bodies, fields, unexported, package var). Add the doc region to the
existing TestCommittedRegionsAreCurrent golden check.

Add doc comments to (*ArgError).Error and (*HTTPError).Error so no
generated summary is empty.

Fixes #13612
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ad7fbb0-28ee-49a8-9171-2d5f319e8215
Commits

Reviewing files that changed from the base of the PR and between 7e7af3f and b1cb58a.

Files selected for processing: 5

  • pkgs/mcpx/docs/public-client.md
  • pkgs/mcpx/internal/refdoc/clientsurface.go
  • pkgs/mcpx/internal/refdoc/clientsurface_test.go
  • pkgs/mcpx/internal/refdoc/regions_test.go
  • pkgs/mcpx/pkg/client/client.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcpx docs: keep public Go client signatures in sync with their chapter

1 participant