Skip to content

feat(macos): profiles, client bindings, token profile, scoped views and explainer (Spec 108-k) - #1442

Merged
github-actions[bot] merged 9 commits into
mainfrom
108-k-macos-profiles-clients
Oct 1, 2026
Merged

github-actions[bot] merged 9 commits into
mainfrom
108-k-macos-profiles-clients

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 30, 2026

Copy link
Copy Markdown
Member

Summary

Spec 108-k (specs/108-profiles-v3, tasks T110a to T120 and T042m): the macOS app and tray learn profiles, per-client bindings, token profiles, scoped views and the access explainer. It consumes the REST surface merged in 108-f (#1439); it changes no Go, frontend, oas or contract file.

What a user sees

  • Profiles page. A new sidebar item in Connect (Clients, Profiles, Servers, Tools) and a "Profile" entry in the toolbar "+" menu. An "All servers" card first, then one card per profile with its tier, tool counts, what uses it, calls and blocked calls in 24 h, and Tools, Activity, Clients and Tokens links that open filtered by that profile. The editor covers every profile field, a per-tool table with Allow, Deny and Classify (unannotated tools only), the stale-classification marker, "Try it" on the unsaved draft, "Assigned to", and rename and delete sheets that list what they move and require a target.
  • Clients. A binding label and credential badge on each row; in the detail a profile Picker, a Locked toggle, credential state and expiry, blocked calls, Rotate, Finalize rotation, Forget and Explain access. A client without an active client credential gets no working picker, only "Upgrade to client credential…" or "Reconnect…". A warnings banner, "Move Clients…", "Upgrade Admin-Key Clients…" and "Other Client…" (the credential is shown once, never stored). A binding-guard refusal shows both fixes; the fix buttons only open Settings.
  • Connect sheet. Profile Picker and Locked toggle, the masked mcp_cli_•••• credential line in place of the API-key notice, the notice that a client credential cannot reach management tools unless the profile allows them, keyless under Advanced only while authentication is off, and the CLI-format result line. Nothing about the binding is sent until the controls are touched, so a reconnect keeps its binding.
  • Tray. The "Profile:" switcher is gone. A "Clients" submenu lists each credentialed or connected client as name — profile 🔒 with the profile list, a checkmark and Lock or Unlock; a client without a credential offers "Upgrade to client credential…". Glance client rows open that client's activity once the core attributes calls.
  • Agent Tokens. Create Token asks for a Profile and an Expiry; the legacy servers and permissions sit under "Legacy scope (advanced)". The list shows kind, profile chip and mode, read-only legacy scope with a "Migrate to a profile" hint, no Revoke on client credentials, and Profile and token-name filters.
  • Settings. Security gains "Anonymous callers" (PATCH anonymous_profile, guard refusal shown, fix buttons preselect without saving) and scroll-to-and-highlight for require_mcp_auth.
  • Scoped views. Activity gets a Caller column and Profile, Client and Token pickers; Tools gets "View as" with greyed rows, reasons and a "Why?" button; Home filters usage and sessions and shows Profile and Source columns; Servers filters by profile.
  • Live refresh. SSE profiles.changed and client.binding_changed refresh the lists (debounced).

The command-number shortcuts shift: Profiles is third, so Servers is now ⌘4, Tools ⌘5, Review Queue ⌘6, Secrets ⌘7, Activity ⌘8 (documented in docs/development/macos-tray.md).

Audit findings addressed

The macOS column of the parity matrix for profiles, client bindings, credential state, token profile and expiry, anonymous callers, view-as, attribution columns, bulk move, admin-key upgrade, rotate, forget, custom client, explainer and the tray Clients submenu (FR-005 editor marker, FR-047 to FR-050, T042m).

Spec

specs/108-profiles-v3 (tasks.md Phase 12 ticked, FR-047 to FR-049 wording, quickstart row, research D36).

Tests

New suites: ProfilesV3ContractTests, ClientsTrayMenuTests, ProfileEditorModelTests, ClientBindingModelTests, AccessExplainerModelTests, TokensCreateModelTests, AnonymousProfileSectionTests, APIClientProfilesTests. Extended in place: NavigationStructureTests, ScopeFilterTests, ConnectClientModelTests, ProfileModelsTests, TrayAuditMenuTests (inverted), TrayPresentationTests. The full suite passes (1575 tests). The new tests do not compile on the merge base, which lacks the models they use.

Deviations from the plan

  • Activity shows one "Caller" column (client, profile with source, token, block reason) instead of three columns, to keep the list usable next to the detail panel at 800 pt; the detail panel carries each field separately.
  • Delete requires a "Move them to" target whenever anything is listed (identical to the Web plan).
  • Accessibility id is toolbar-add-Profile, capitalised like the other 109-i ids.
  • The token list model now decodes the real response shape (name, allowed_servers); the old model required an id and read servers, and the old Create Token sheet sent servers, which the core ignores.
  • There is no separate F24 access-explanation fixture on main; explain_blocked.json already carries subject.kind and is decoded.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

F6.2: Reconnect/Upgrade now presets the client's previous profile in the
Connect sheet (ConnectClientModel.preselect).
F2.2: the Anonymous callers section resolves the API client at save time
instead of capturing it once, so Save works after the core connects.
F2.3: a closed Settings window drops its SwiftUI tree so the stale view
cannot consume the route meant for the next Settings window.
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 108-k-macos-profiles-clients

Available Artifacts

  • archive-darwin-amd64 (31 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (26 MB)
  • installer-dmg-darwin-arm64 (24 MB)
  • smart-mcp-proxymcpproxy-go8FV5XT.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 36818461819 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Found by driving the dev app against a scratch core:
- profiles/try hits are {score, tool:{name,server_name,description}} on the
  wire; TryHit now reads the nested tool, so Try it lists real tools
- fetch the server list once on connect/attach/reconnect (it was SSE-only), so
  the editor's server checklist and Home counts are not empty on attach
- keep the Connect sheet model in a StateObject host (it reset to
  "Loading clients..." on every profiles.changed) and wire its Close button
- show a Revoked badge on revoked tokens and offer no second Revoke
- title "New credential issued" after a rotation
- scroll the editor's tool table horizontally so a 900 pt window is not clipped
- contract test fails, not skips, when explain_blocked.json lacks subject.kind

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (Model B): Paperclip review verdicts = ACCEPT and qa-gate green at this head SHA. Arming auto-merge; GitHub merges when all required checks pass.

@github-actions
github-actions Bot merged commit 1628eeb into main Oct 1, 2026
56 checks passed
Dumbris added a commit that referenced this pull request Oct 1, 2026
QA.0: already merged. origin/main (including #1442) is an ancestor of the head,
no conflict markers remain in specs/ or ROADMAP.md, and GitHub reports
mergeable.

QA.1: the sweep no longer depends on spec order. profiles-seed.ts now opens the
seed MCP session through openMcpSession() and closes it (HTTP DELETE) once the
calls are made, so no live "Connected" client lingers on Home. New tests: a
profiles-scope check that the seeded session is closed (fails when the close is
removed), and visual-a11y-sweep "contrast AA: / with a live MCP client" in both
themes, which opens a live session on purpose (fails at 3.32:1 with the old
opacity-50 timestamp, verified by rebuilding with it). Home's timestamp on this
head is already text-base-content/60 and measures above AA in both themes, so
no Home.vue change was needed.

QA.2: the Scope column already folds below xl, but the inline "Why?" button in
the Status cell still overflowed the card by 23px at 1024px (sidebar open). It
now shows from xl only; the drawer carries Why? at every width. The layout
sweep covers 1440, 1280, 1100, 1024, 900, 768 and 390 and asserts the inline
button's visibility per width.

QA.3 and QA.4: already fixed on this head (banner says a disabled server's tools
"may not be listed", FR-032 says the same; the view-as banner is hidden under
the Profile/Client not found alert). Both are covered by tools-view-as.spec.ts.

QA.5: not reproducible on this head (one /activity and one /activity/summary
request per profile pick, verified in a browser); covered by the existing
"picking a profile in the filter panel" vitest.

F2.3: ScopeFilterSelects loads the token and client lists when a picker first
becomes visible (watch on the shown list), not only in onMounted. New vitest
scope-filter-selects-late-features.spec.ts fails without the fix.
github-actions Bot pushed a commit that referenced this pull request Oct 1, 2026
…de, settings edits, upgrade preview, toolbar add (Spec 108-retro-mac) (#1452)

Fixes the verified post-merge review findings of the macOS profiles work
(#1442, Spec 108-k) and of the toolbar hand-off (#1427, Spec 109-i).
Code changes are under `native/macos/` only; the REST, CLI, MCP and Web
surfaces and the wire contract are unchanged.

Spec: `specs/108-profiles-v3/` (tasks T120a-T120f, FR-047 note,
quickstart unit-gate filter) and `specs/109-ux-navigation-consistency/`
(task T141a). Findings R1-R6 are Spec 108 work; F4.1 (with F6.1) belongs
to Spec 109-i and is fixed in `ServersView.swift`, which both specs
touch.

## User-visible changes (macOS app)

- R1, Forget: the sheet now runs the forget itself and always shows the
outcome, with the Web UI's wording. A credential that was revoked while
its config entry could not be removed shows a warning ("Credential
revoked; the config entry could not be removed: ...") instead of closing
silently. A Close button dismisses it, the list reloads either way, and
the result is announced to VoiceOver. New accessibility ids:
`forget-result`, `forget-close`.
- R2, Try it: a new, never-saved profile now offers Try it (the draft is
sent to `POST /profiles/try` without a name). A new profile has no tool
table because there is no saved profile to compute effective tools for.
The editor layout is driven by `ProfileEditorModel.sections`.
- R3, Reload: "Changed elsewhere - Reload" now discards the draft and
adopts the saved profile. Before, it raised the banner again. Edits
typed while the reload is in flight are kept and re-raise the marker, so
a draft is never overwritten without a click.
- R4, Assign: the sheet sends the profile and the wanted lock in one
`PUT /clients/{id}/binding`, so it can change only the lock of a client
already on the profile. When the binding already matches, nothing is
sent and the sheet says "already on ...".
- R5, Anonymous callers: saving adopts only the `anonymous_profile` key
in the Settings store (`ConfigStore.adoptSaved`) instead of reloading
everything, so other unsaved edits on the same tab survive. The Raw tab
still shows the saved value.
- R6, Admin-key upgrade: changing the profile after a preview drops the
preview (a generation counter also drops a late response), disables
Apply, and loads a fresh preview. Apply sends exactly the previewed
request.
- F4.1 and F6.1, toolbar "+ -> Server": the hand-off and pending routes
are consumed by `ServersView.body`, which stays mounted, so the Add
Server sheet opens over an open server detail and is no longer replayed
when the detail closes. A route that arrives while a detail is open is
consumed immediately.

## Decisions

- F6.1 is folded in because it has the same root cause and fix as F4.1.
- The duplicate `.onReceive(.showAddServer/.showServerDetail)` handlers
inside `serverListView` are left as they are; they are harmless and will
be tracked as a low follow-up.
- The checklist lines for `docs/development/macos-tray.md` stay with the
docs PR (108-l, T124).

## Tests

All new tests were written first. Red was a compile failure for the
model, section and settings tests (missing `ForgetResult`, `assign`,
`AssignOutcome`, `sections`, `adoptSaved`, `commitSaved`); the two
source-guard tests for the toolbar hand-off failed at runtime before the
`ServersView` change.

- `ClientBindingModelTests`: Forget result texts and announcement,
Assign (one request, lock-only change, unchanged sends nothing, refused
without a client credential, guard refusal kept, note wording), upgrade
preview invalidation, previewed profile is what Apply sends, a late
preview is dropped.
- `ProfileEditorModelTests`: Reload adopts the server version, edits
during a reload are kept, sections for new and existing profiles, Try on
a new profile sends the unsaved draft, the view renders
`model.sections`.
- `AnonymousProfileSectionTests`: unrelated unsaved edits survive a
save, `adoptSaved` before load is a no-op, the section never calls
`store.load()`.
- `ServersViewRoutingTests`: the add hand-off and route consumers live
on `body`, not `serverListView`.

`swift build` and the full `swift test` suite pass (1611 tests).
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.

2 participants