Repository navigation
docs(specs): Spec 108 Profiles v3 and Spec 109 UX navigation and consistency - #1379
Merged
Merged
Conversation
…nd cross-surface consistency) Spec 108 makes profiles the unit of scope: tool-tier caps, fail-closed handling of unannotated tools, per-client credentials pinned to a profile, enforcement on every MCP surface, profile/client attribution on activity, and management from the Web UI, macOS app, CLI and an admin MCP tool. Spec 109 reorganises navigation (Clients, Review queue, Catalog, Home with Needs attention), adds a shared URL filter contract with deep links, one health vocabulary, informed review and cross-surface terminology parity. Both come from a first-run UX audit of the Web UI and were reviewed with zcode and Codex.
Deploying mcpproxy-docs with
|
| Latest commit: |
f4c2196
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://aa1e8078.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://docs-specs-108-109.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- 108: GET /profiles omits used_by for non-admin callers (FR-034, FR-032 rule) - 108: unset code_execution resolves off under a read/write cap (FR-003a) - 108: FR-009a also gates anonymous_profile until 108-d - 108: FR-008a pre-apply check on PATCH /config and POST /config/apply lands in 108-c; later routes tested in the PR that adds them - 109: contradictory server/tool URL filters issue no request (contract rule 8)
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36197231924 --repo smart-mcp-proxy/mcpproxy-go
|
- FR-008a: API refusal is one BindingGuardDelta over whole candidate states; covers DELETE /profiles?reassign_to, upgrade-admin-key-holders, POST /profiles, rename, MCP profiles mutations, and narrowing members of a switchable binding's switchable_to; T070a route-coverage test. - FR-009a: fix the test-only override mechanism (const + EnablePolicyForTest gated by testing.Testing(), no env/config/flag/build tag); T004a AST, go-build probe and built-binary checks; T055a deletes the override.
This was referenced Sep 26, 2026
… Usage view macOS has no usage charts or unresolved-tool group, and a native macOS Usage view is already a listed follow-up (parity row 22a, navigation-map.md). T026 and FR-074 are now Web only; the follow-up carries the ticks and label to macOS.
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 26, 2026
…1380) ## Summary Spec 108 (Profiles v3) foundation PR — `108-a` of the `a → (b ∥ c) → d → e → f → (g ∥ h ∥ i ∥ k) → j → l` merge order (spec: `specs/108-profiles-v3/`, tasks Phase 2 `T001-T015`, FR-001–FR-009, FR-009a, FR-052; spec docs are in the not-yet-merged #1379). This PR parses and validates the new v3 profile-policy fields and adds one pure decision predicate. **Nothing is enforced yet** — the FR-009a rollout gate keeps every v3 field (and `anonymous_profile`) rejected at config load outside test binaries, so no release can ship an unenforced policy while the profile is mid-rollout across 108-a…108-l. `108-b`/`108-c` wire the predicate into discovery/dispatch and credentials. ## User-visible changes per surface - **Config file**: `ProfileConfig` gains `title`, `description`, `max_tier`, `unannotated`, `tools` (`allow`/`deny`/`classify`), `code_execution`, `management_tools`, `switchable_to`; `Config` gains `anonymous_profile`. A legacy profile (`{name, servers}` only) round-trips byte-identically — `IsLegacy()` stays true until any one of the six policy fields is set. - **Startup / `mcpproxy serve` / `PATCH /config` / `POST /config/apply`**: until 108-d ships enforcement, setting any of the six v3 policy fields, or a non-empty `anonymous_profile`, is a **fatal validation error** (exit code 4) with the exact message from `data-model.md` §1 — this is intentional (FR-009a), not a regression; it prevents an operator from configuring a policy that nothing enforces yet. - **REST API / swagger**: `oas/swagger.yaml` and `oas/docs.go` now document the new `ProfileConfig`/`Config` fields (`config.ProfileToolRules` schema added). No endpoint behavior changes in this PR. - **Web UI / macOS / CLI**: no visible change in this PR — `frontend/src/types/contracts.ts` gains the Spec 108 enums (tiers, decision reasons, resolution sources, block reasons, explain steps, fix actions, credential states, surfaces, warning codes) via `cmd/generate-types`, so 108-d onward's UI work references the same wire spellings the backend defines; nothing consumes them yet. - **MCP / internal**: a new `internal/profile` package (`policy.go`, `glob.go`, `contract.go`) compiles a profile's v3 fields into a `CompiledPolicy` and evaluates it via `Decide`, but it is only reachable through the test-only override (`profile.EnablePolicyForTest`) until later PRs wire it into request paths. `profileIndex` (in `internal/server/profile_tool.go`) compiles policies alongside the existing profile snapshot and exposes an `EffectiveAnnotations` seam (`internal/server/mcp_visibility.go`) as the single source of tool-tier annotations for all future enforcement, discovery and the explainer. ## Findings fixed (zcode review, rounds 1–2) - **Missing `anonymous_profile` gate**: `ValidateProfiles`' FR-009a check didn't reject a non-empty `Config.AnonymousProfile` while the gate is closed, contradicting `data-model.md` §1. Fixed — now fatal regardless of whether the name is known/unknown/profiles are empty. - **Unprotected test-only override**: `PolicyEnforcementReady` was an exported, independently-assignable var. Replaced with an unexported const base + `atomic.Bool` override behind `EnablePolicyForTest(tb testing.TB)`, which panics outside a test binary; added a `go build`-based probe (`internal/config/testdata/overrideprobe`) proving the override is unreachable from production code, plus a binary-level check that runs the real `mcpproxy serve` against a scratch instance and asserts exit code 4 + exact refusal text for both a v3 field and a bare `anonymous_profile`. - **`EffectiveCodeExecution` fail-open default**: `CompiledPolicy.CodeExecution` carried the raw `*bool` through unchanged instead of the FR-003a default matrix (off under `read`/`write` max_tier, global-gate-decides under `destructive`/legacy). Added `ProfileConfig.EffectiveCodeExecution()` implementing the matrix; `CompiledPolicy.CodeExecution` is now the effective `bool`, not the raw pointer. - **`tools.classify` glob-in-key**: `classify` is an exact `server:tool` identity map, but nothing rejected a `*` in a key, which would silently never match. `ValidateProfiles` and `Compile` now both guard it (defense in depth); an invalid, unrecognised classify value is dropped rather than trusted. - **Fingerprint blind to `tools: {}` vs absent**: both compile to the same enforcement but `IsLegacy()` treats a present-but-empty `tools` object as non-legacy (flips `hidden_by_profile` presence, FR-011). `CompiledPolicy.Fingerprint` now carries an explicit `ToolsSet` flag so FR-027's snapshot-diff edit detection can't miss the flip. - **Duplicated tier-adapter logic**: `IntrinsicTier`'s `contracts.Tier` mapping was hand-copied instead of calling one named helper, so a test could exercise a mirror that drifts from the real mapping. Extracted `tierFromContractsTier`. - **Double-running `ValidateProfiles` / re-wrapped boot error**: the v3 hook landed in `validateDetailedCore`, which the boot path (`Validate()`) also calls internally before invoking `ValidateProfiles` again — running the validator twice per boot/reload and wrapping the boot path's raw error text as `"profiles: profiles[0]: ..."`, changing behavior for every pre-existing Spec 057 profile error. Moved the hook into `ValidateDetailed` itself, which `validateDetailedCore` doesn't participate in on the boot path. - One reviewer claim was checked against spec.md/data-model.md/tasks.md and rejected as not applicable (no "FR-003a EffectiveCodeExecution deliverable" requirement exists beyond what's already implemented above). - **This PR (post-push)**: `make swagger-verify` (the pre-push hook) failed because the new `ProfileConfig`/`Config` fields above were never reflected in the committed `oas/swagger.yaml`/`oas/docs.go`. Regenerated and committed both. ## Tests added - `internal/config/profiles_v3_test.go` — legacy round-trip byte-identity, per-field parsing/validation messages, `IsLegacy()` semantics, FR-009 reflection guard (JSON tag set is exactly the FR-001 fields, default + `-tags server`), `switchable_to` nil-vs-empty-list round trip through the real config save path. - `internal/config/profiles_rollout_gate_test.go` — FR-009a fatal-gate matrix (six policy fields + `anonymous_profile`) through config load, `PATCH /config`, `POST /config/apply`; includes `TestEnablePolicyForTest_PanicsOutsideATestBinary` (builds `internal/config/testdata/overrideprobe` as a plain binary) and `TestServeRejectsV3PolicyFieldsAtStartup` (builds and runs the real `mcpproxy` binary against a scratch instance, asserts exit code 4). - `internal/profile/policy_test.go` — enforcement-matrix table (allow/deny/classify precedence, deny-beats-allow, unknown-server warning, stale classification ignored, `IntrinsicTier`/`EffectiveUnannotated`/`EffectiveCodeExecution` defaults). - `internal/profile/intrinsic_tier_contract_test.go` — one tier mapping shared with Spec 109-a's `contracts.AnnotationTier` verified across every annotation-hint combination, including out-of-range fail-closed behavior; grep guard against a second, drifting annotation-reading path. - `internal/profile/glob_test.go`, `internal/profile/contract_test.go` — glob matcher (anchored, case-sensitive, `server:tool` identity incl. `/` and `__`) and enum encode/decode + fingerprint stability. - `internal/server/profile_index_policy_test.go` — `profileIndex.PolicyFor`/`PolicyAt` resolve correctly (by name, by position, legacy fast path, unknown profile), including over the live fixture with real upstreams, and a compiled-policy/snapshot pair taken together is immune to a later edit on a second index. - `internal/server/profiles_v3_fixture_test.go` — shared three-upstream/three-profile fixture + `anonCtx()` helper for downstream PRs. ## How this was verified live Ran the full config/profile/contracts unit suites and the profile-tagged subset of `internal/server` (`go test -race`) on this branch against `origin/main` HEAD; all passed except one pre-existing, unrelated flake (`TestProfile_UpstreamServersListFiltered`, a legacy-SSE-transport timing test untouched by this diff — confirmed to pass reliably in isolation, and confirmed via `git diff` that this PR does not touch that test file). Built both editions (`go build ./...` and `go build -tags server`) clean. Ran `golangci-lint` (`.github/.golangci.yml`) bare and with `--build-tags server` over every changed package — zero issues in any file this PR touches (all flagged issues are pre-existing, in files this PR does not modify). Regenerated `frontend/src/types/contracts.ts` via `cmd/generate-types` and diffed it byte-for-byte against the committed file (identical) to confirm the generator output matches what's checked in. Ran `make swagger-verify`; it failed on the pre-existing state (new config fields undocumented), so `make swagger` was run and the regenerated `oas/swagger.yaml`/`oas/docs.go` committed, after which `swagger-verify` passed. No live macOS/CLI/Web-UI walkthrough was needed for this PR — it adds no enforcement and no reachable surface change (the FR-009a gate keeps the new fields rejected outside test binaries), so there is nothing yet for those surfaces to exercise; that verification lands with 108-b/108-c/108-d. --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 26, 2026
…-j) (#1383) Stacked on **#1378** (`109-a-quick-wins`, still open) — this PR targets that branch, not `main`, and should merge after it. Spec text lives on `docs/specs-108-109` (PR #1379, also open): `specs/109-ux-navigation-consistency/spec.md`, FR-060–FR-067. ## Summary Catalog-first "Add Server" (Spec 109-j): one aggregated catalog search replaces the old per-registry Repositories/Discover flow across Web UI, macOS, CLI and MCP, plus a Paste-source importer and a Value/Secret toggle for env vars and headers that stores secret values in the OS keyring instead of `mcp_config.json`. ## User-visible changes per surface **Web UI** - `/add-server` gets four tabs — Catalog (default) · Paste · Import · Manual — selected by `?tab=`. `/repositories` redirects to `/add-server?tab=catalog`. - Catalog tab (`CatalogSearch.vue`): searches every enabled catalog source in parallel, sections into Official/Popular when the query is empty, shows title/publisher/verified/official badges, "Add to MCPProxy" → "Added ✓ · Open". - Paste tab (`PasteServer.vue`): paste a JSON/TOML config, an `http(s)://` URL, or a shell command line; previews via `/servers/import/json?preview=true` and fills in detected fields before anything is added. - Every env var / header field in Paste, Manual and Catalog-with-inputs gets a Value/Secret toggle (`SecretToggle.vue`), defaulting to Secret for secret-shaped names; Secret writes to the OS keyring and stores `${keyring:<ref>}` in config, never the raw value. - Settings → **Catalog Sources** (`CatalogSourcesSettings.vue`) replaces the old Repositories "manage registries" half; the Repositories page (1149 lines) is deleted. **macOS tray** - Add Server sheet gains the same four tabs (Catalog · Paste · Import · Manual), via new `CatalogView.swift` and `PasteServerView.swift`. The generic "Add Server" entry points (toolbar +, empty-state button, dashboard shortcut) open on Catalog by default. - The "Registries" sidebar item is removed; the old `ServerBrowseView.swift` ("Discover servers" per-registry browse) is deleted outright, fully superseded by the aggregated catalog search. Registry *source* management moves to Settings → Catalog Sources (`RegistriesView.swift`), mirroring the Web UI. - New `SecretFieldResolver.swift` / `SecretFieldToggleView.swift` port the same Value/Secret toggle and ref-name convention to native env/header fields. **CLI** - New `mcpproxy catalog search|show|add` (FR-066), fanning out to every enabled source; `registry search|add` remain as deprecated aliases that print the `catalog` equivalent. - `mcpproxy upstream add` gains `--secret-env NAME=VALUE` / `--secret-header 'Name: value'` (FR-065), storing the value in the OS keyring and writing `${keyring:<ref>}` into config. Fails fast with an actionable message when the OS keyring write-gate isn't opted into (`MCPPROXY_KEYRING_WRITE=1` outside the tray), before any partial write. **MCP** - `search_servers`' `registry` argument is now optional (FR-067): omitted, it fans out across all sources through the same catalog backend and returns the FR-061 fields (`title`, `publisher`, `verified`, `official`, `popularity`, `source`) in the FR-060 ranking order, matching what REST/CLI callers already see. ## Secret ref-name convention (FR-065) One shared rule for turning a field name into a keyring reference — `<server>-env-<NAME>` / `<server>-header-<Name>`, lowercased, non-`[a-z0-9-]` runs collapsed to `-`, ≤64 chars, `-2`/`-3`… appended on collision — implemented three times (Go `internal/secret/refname.go`, TypeScript `frontend/src/utils/secretRef.ts`, Swift `SecretRefName.swift`) and pinned to one shared fixture, `internal/secret/testdata/ref_names.json`, decoded by all three test suites so the three implementations can't drift. ## Review rounds applied on this branch Reviewed with zcode (GLM), the mandated external reviewer: - **Round 1** (`ce0be59d8`): keyring write-gate ordering (probe now checks the gate before, not after); `CatalogSearch.vue` no longer treats a failed add as success; secret rollback wired into all three add surfaces on a later failure; CLI `upstream add` validates `--trust-mode` before writing any secret, and rolls back partial `--secret-env`/`--secret-header` writes; `search_servers` MCP surface now carries the catalog fields; `GET /catalog/search` empties `results` when `sections` is populated; `source=` filtering moved before ranking/truncation so a narrow source's matches can't be truncated away by a broader one. - **Round 3** (`b1ddae539`, T109/T103): macOS `AddServerView` had the catalog backend but no UI for it — added `CatalogView.swift`/`PasteServerView.swift` as Catalog/Paste tabs, ordered to match the Web UI; removed the macOS "Registries" sidebar item (superseded by Catalog), moved registry-source management to a new Settings → Catalog Sources tab, and deleted the old per-registry `ServerBrowseView.swift` "Discover servers" flow outright; updated `docs/registries.md` to match. - Plus a T099 fixture-pin commit (`ab75d4716`): `secret_like` name-rule respects an explicit `isSecret:false` override, and FR-007 added/not-added scoping applies to any non-admin `AuthTypeUser` session, not just agent tokens. ## Tests added - Go: `internal/registries/catalog_test.go`, `catalog_bench_test.go`, `rank_test.go`; `internal/secret/refname_test.go`, `keyring_available_test.go`; `internal/secretlike/secretlike_test.go`; `internal/httpapi/catalog_test.go`, `catalog_dto_test.go`, `import_preview_fields_test.go`, `secrets_keyring_available_test.go`; `internal/configimport/detect_url_command_test.go`; `internal/cliclient/catalog_test.go`; `cmd/mcpproxy/catalog_cmd_test.go`, `upstream_add_secret_test.go`; `internal/server/mcp_menu_surface_test.go`, `search_servers_all_sources_test.go`. - Frontend (vitest): `add-server-catalog.spec.ts`, `add-server-manual.spec.ts`, `add-server-paste.spec.ts`, `add-server-tab-url.spec.ts`, `secret-ref.spec.ts`, `secret-toggle.spec.ts`, `settings-catalog-sources.spec.ts`, `repositories-redirect.spec.ts`. - macOS: `CatalogTests.swift`, `PasteServerFieldsTests.swift`, plus the pre-existing `ServerBrowseModelsTests.swift`/`APIClientAddServerFromRegistryTests.swift` (their contents test shared models, not the deleted view, and still compile). - `oas/swagger.yaml` regenerated for the new `GET /catalog/search` endpoint and import-preview `env`/`headers` fields. ## How this was verified live Rebased onto the current `109-a-quick-wins` tip (which had moved two review rounds ahead) and resolved one modify/delete conflict on `ServerBrowseView.swift` in favor of the deletion this PR intends, since the base's changes to that file (an `addedKey` collision fix) landed in `RegistryModels.swift` instead and merged in cleanly. After rebasing: `go build ./...` clean; `go vet`-backed `golangci-lint` (bare and `--build-tags server`, matching CI) showed only pre-existing issues in files this PR doesn't touch. Full Go suite green — `internal/registries`, `internal/secret`, `internal/secretlike`, `internal/httpapi`, `internal/cliclient`, `internal/configimport`, `cmd/mcpproxy` (plain and `-race`), and `internal/server` (both with the CLAUDE.md `-skip` regex, plain and `-tags server -race`, matching the CI job exactly). Frontend: `vue-tsc --noEmit` clean, `vitest run` green (156 files / 1431 tests). Built the binary and ran a real local instance (scratch data-dir, non-default port, isolated from any other running mcpproxy): `GET /api/v1/catalog/search` with an empty `q` returned `official`/`popular` sections and empty `results` as specified (FR-060); a `q=github` search returned ranked, deduplicated results; `mcpproxy catalog search`/`catalog show` against the running daemon returned the same shape over the CLI; `mcpproxy upstream add --secret-env` first failed with the documented keyring-write-gate message with the gate unset, then succeeded with `MCPPROXY_KEYRING_WRITE=1`, writing `${keyring:<server>-env-<name>}` into the server's config and the server card came back quarantined by default, matching the FR-065/FR-063 contract. Cleaned up the added test server and its one keyring entry afterward. ## Known, documented gap (not fixed here — pre-existing scoping decision on this branch) `AddServerModal.vue` is only rewired for the Web UI's *global header* "+ Add Server" button (`TopHeader.vue`, now `router.push('/add-server')`); `Dashboard.vue`'s two shortcut buttons and `Servers.vue`'s empty-state button still open the old modal (Import/Manual only, no Catalog/Paste). This was called out and deliberately deferred in the commit that added the page (`466ab2e79`): retiring `AddServerModal.vue` fully cascades into ~9 other Playwright specs (protocol detection, duplicate-endpoint, trust-mode) sized for their own PR. One concrete, verified consequence: `e2e/web-ui-sweep/visual-a11y-sweep.spec.ts`'s `the Add Server modal takes focus, traps Tab and closes on Escape` test drives the header button expecting the modal and now fails, since that button navigates away instead — confirmed live (`./scripts/run-web-smoke.sh`, 28/29 passed, this one failing, 2 skipped for no fixture upstream). This spec is the release gate's **advisory** `web-ui-sweep` job, not a required check, and is unmodified by this PR. Left as-is rather than expanding this PR's surface; flagging for a follow-up (retire `AddServerModal.vue` everywhere, migrate `Dashboard.vue`/`Servers.vue` to `/add-server`, update/retire the dependent specs). ## Notes - 11 commits ahead of `109-a-quick-wins`; this PR is the full catalog/add-server slice (109-j) — 109-k (activity scope filters) is a separate, independent branch. - Not merging this PR — leaving that to the maintainer, and it depends on #1378 landing first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two speckit specs produced from a first-run UX audit of the Web UI (fresh instance, sandboxed HOME) plus a code reading of the profile, agent-token, connect and activity subsystems.
specs/108-profiles-v3/): profiles become the unit of scope. A profile holds servers, a maximum tool tier, fail-closed handling of unannotated tools, tool allow/deny rules, code-execution and management-tool switches. Clients get their own credential pinned to a profile (locked or switchable), so reassigning a client is server-side and needs no config rewrite; the admin API key stops being written into client configs. Every MCP surface enforces the profile, activity records carry the effective profile/client/token, and profiles are managed from the Web UI, macOS app, CLI and an adminprofilesMCP tool. PR split 108-a…108-l.specs/109-ux-navigation-consistency/): Clients hub, Review queue with informed review, catalog-first Add server, Home with Needs attention, one health vocabulary, single-next-action server cards, a shared URL filter contract (useScopeQuery) with deep links, responsive header, and terminology/capability parity across Web UI, macOS, CLI and MCP. PR split 109-a…109-m; 109-a/b/c are open as feat(ui): navigation, review and tool-tier quick wins (Spec 109-a) #1378, feat(ui): onboarding and Connect wizard hints across surfaces (Spec 109-b) #1377, feat(health): status vocabulary across surfaces (Spec 109 FR-010-012) #1376.Shared artifacts have one owning spec (109 owns the filter contract, deep-link map, Clients page shell and navigation; 108 owns profile policy, credentials, attribution and profile UI) and the other spec references it.
Review
Reviewed over several rounds by zcode (GLM) and Codex (gpt-6-sol / gpt-5.6), with findings verified against the code before being applied (security: lock bypass via anonymous access, rollback safety of client credentials, non-disclosure of hidden tools and profiles).
Docs only; regenerates ROADMAP.md.