Skip to content

feat(mcpx): generator emitting tool-view and virtual-namespace declarations (#1933 slice 4) - #8671

Merged
dezren39 merged 1 commit into
mainfrom
queue/14968-1933-slice4-generators
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14968-1933-slice4-generators

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements #1933 slice 4 — the final slice: a deterministic generator in pkgs/mcpx/internal/config that emits tool-view / virtual-namespace declarations for a composed tool set, in exactly the config shape a hand-written declaration uses (Approach C of #1933: generation is an author-time convenience; the daemon at runtime reads only declarations).

  • ViewSpec / ViewToolSpec describe a composed tool set: alias views (aliasOf + bare from), virtual namespaces (qualified server.tool mounts), and script-backed views (command / file), with pin/hide/description per tool.
  • GenerateViewServers renders the composition into the same Server/Extras/ToolView structs parsing produces, refusing compositions the loader would refuse (no source or two sources for a tool, hide without pin, bare from on a virtual namespace, duplicate names, a command-backed view without a description).
  • GenerateViewsJSON emits the {"mcpServers": {...}} fragment, deterministic byte-for-byte.

Tests (named oracles)

  • TestGeneratedViewsMatchHandWrittenShape — the emitted declarations equal the hand-written oracle's parsed shape; generation is deterministic.
  • TestGeneratedViewsRoundTripThroughResolve — a generated declaration merged with its targets loads through the ordinary path (parse + Resolve) and yields the same resolved catalogue as the equivalent hand-written declaration, including mount splitting.
  • TestGenerateViewsRefusesUndeclarableCompositions — nine refusal cases.
  • TestGeneratedScriptViewRoundTrips — a generated command-backed view resolves.

Results: the four new tests pass; go test ./internal/config/ ./internal/daemon/ — daemon ok; config fails only on TestServerKeysAnotherHostWritesAreRecordedNotRefused, which this PR proves pre-existing by running it on a pristine origin/main worktree (same failure, no changes applied). Per the slice packet, after this slice #1933 has no remaining slices.

Fleet task 14968 (lane any-a). The mcpx view generate CLI verb from #1933's Approach C can wrap this generator unchanged; it is deliberately not included here — the slice acceptance is the generator plus its round-trip.


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

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 12:31
@coderabbitai

coderabbitai Bot commented Nov 11, 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 32 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: 01fb6914-b361-4584-9411-e768be8003e8
Commits

Reviewing files that changed from the base of the PR and between 761fdc7 and 7333eb6.

Files selected for processing: 2

  • pkgs/mcpx/internal/config/generate.go
  • pkgs/mcpx/internal/config/generate_test.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

@dezren39
dezren39 merged commit 538d98b into main Nov 11, 2026
4 of 23 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T12:32:48.976792Z 7333eb6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant