Repository navigation
feat(web): profile scope on Tools, Activity, Sessions and Usage (Spec 108-j) - #1448
Merged
Merged
Conversation
…on (Spec 108-j) A scoped SSE subscriber's own activity.internal_tool_call.completed event carried no ownership proof, so its attribution was withheld. The session now records the credential's display prefix and the ctx-less internal-tool funnel reads it back, only for the token name the session itself recorded.
… 108-j) Tools sends client/profile to GET /tools and renders the subject's verdict per row (administrator) or a hidden count (tenant), with a Why? that opens the access explainer. Activity, the Sessions table and Usage send profile, client and token, show them as removable chips and pickers, and Activity rows carry attribution chips plus Allow in profile and Why? on a blocked call. A page whose URL names a scope waits for /status so the first request is filtered.
…rows readable (Spec 108-j) A call a profile refuses is stored as a policy_decision, so the Tool calls view hid exactly the rows a blocked filter asks for; the blocked filter now includes them. Tools view-as marks a tool the subject cannot call with a tinted row instead of opacity, which dropped its text under AA contrast, and the Sessions table folds its capabilities column away below 2xl and wraps its actions.
Adds e2e/web-ui-sweep/profiles-scope.spec.ts (seeded through profiles-seed.ts), registers it in the web smoke script, extends the contrast sweep to the scoped Tools and Activity pages, ticks T104-T108a, records D37 and amends FR-032, FR-045, FR-046 and the quickstart recipe.
…gate (Spec 108-j) Ticks T109 and T109a (the sweep ran green against a built binary), adds the both-subjects scenario to profiles-scope.spec.ts, pins that Tools it sees needs the client filter itself and documents why waitForScopeFeatures times out.
Deploying mcpproxy-docs with
|
| Latest commit: |
373c5b3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b95fb09c.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://108-j-webui-profile-scope-ui.mcpproxy-docs.pages.dev |
- F3.2: runIdentity() now keys on client_id, client_name, profile, profile_source and token_name, so repeat folding never shows one caller's attribution chips for another caller's calls (FR-029). - F5.1: "Tools it sees" clears the sticky profile param (linkTo treats an empty patch value as "drop this param"), so it no longer opens the two-subject conflict state. - F5.2: after the startup /status wait, any scope param named in the URL and still unavailable gets the disabled "Filter unavailable on this server" chip, including when /status failed or does not advertise scope_filters. The three rule-7 tests now assert the disabled chip instead of no chip. - F3.1/F4.1/F2.1: Activity, Usage and Tools loaders (loadActivities, reload, loadTools) wait on a ready promise released by firstLoad(), so SSE events, window/status/sort controls and Refresh cannot send an unfiltered request during the startup wait; the action runs once the wait ends. - F2.2: Tools resets to page 1 on Show and view-as subject changes and clamps the page when the result shrinks.
CodeQL alert 640 (js/insecure-randomness): the element ids were built from Math.random. useId() gives the same per-instance uniqueness deterministically (SSR-safe). A vitest assertion mounts two instances and checks the ids differ and each label targets its own select.
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36858585017 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…der the explainer (Spec 108-j) The drawer panel was a fixed 500px, so at 390px its left 110px sat off-screen and clipped the new Attribution section and the Allow in profile / Why? actions. It is now full width capped at 500px. Escape pressed in the access explainer opened from the drawer also closed the drawer, dropping focus to body; the explainer now owns Escape while open and focus returns to the Why? button. Adds unit tests and drawer bounding-box and focus assertions to the live sweep.
- Home: live-client age text uses text-base-content/60 (AA contrast) - Activity: Scope column from xl, narrower; below xl the drawer carries the chips - Activity: no duplicate /activity and /activity/summary requests on a scope change - Tools: no view-as banner over a profile/client not found alert - Tools/spec: disabled-server banner and FR-032 describe the real listing behaviour - sweep: assert the Activity table fits its card at 768+
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.
…andled on unroute
…f clipping both ends (Spec 108-j) The chips were inline-flex badges with truncate on the badge itself, which cannot ellipsise: a long profile label was cut at both ends in the Activity Scope column at 1280/1440px. The label now truncates in an inner span, and the layout sweep asserts no chip has scrollWidth > clientWidth or leaves its cell.
The attribution chip fix (inner truncating span, ellipsis, full text in title) and its layout assertion were already on the branch; the assertion was verified to bite: against the previous AttributionChips.vue the 1440px sweep fails with 'attribution-profile content 202 > box 180', against the fixed one all 98 sweep tests pass. Merging origin/main changed emitActivityInternalToolCall to take a context first, which broke the build of internal/server tests; the 108-j attribution test now passes context.Background(). ROADMAP.md and the 108 task count were reconciled after the merge. Deferred: shortening the 'locked by credential' source label (the full text stays in the title; no clipping remains).
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 2, 2026
…on Servers and row links (Spec 109-l) (#1457) ## Summary Spec 109-l (specs/109-ux-navigation-consistency, Phase 14, T151 to T159) integrates Spec 108 into the needs-attention list and renders the three link-map rows that 109-k registered but never showed. It also fixes two items of #1437. Spec 108 warnings now appear as needs-attention items, ranked 4 to 9 so they sit above every server item. They come from the same function that fills the Clients page banner, so the two cannot disagree, and they never read a client config file. Closes #1437 (items 2, 3 and 4 landed with 108-j in #1448; this PR owns items 1 and 5). ## User-visible changes **Core, REST, SSE** - Six new attention kinds with exact wire names equal to the Spec 108 warning codes: `anonymous_denied_by_binding_guard` (4), `client_holds_admin_key` (5), `client_token_name_conflict` (6), `profile_missing` (7), `client_rotation_pending` (8), `client_credential_expiring` (9). The binding guard is a single item with the new subject type `setting`; every other item is one per client. Each carries a fix verb equal to the Spec 108 warning action and a target the Web UI already serves. - Scoped callers (agent tokens, non-admin server-edition sessions) are now filtered by an allow-list on REST and SSE: only server items they can enumerate. The new kinds are administrator-only and an unknown future subject type fails closed. - The attention subscriber also recomputes on `client.binding_changed`, `profiles.changed`, `config.reloaded` and `config.saved`, re-reads the client warnings every 30 seconds (rotations, forgets and token creation emit no event), and wakes when an active credential enters its 14-day window. `since` for the expiring kind is the start of that window. - `client_holds_admin_key` appears once a client's credential state has been observed (an on-demand read persists it). There is deliberately no background config read, which would trigger the macOS privacy prompt. Recorded in FR-093. - #1437 item 1: `GET /servers?profile=<viewed>` from a caller pinned to a narrower profile now counts only tools both profiles admit and drops servers outside the caller's own pin, so it agrees with `GET /tools`. Administrator output is unchanged. - #1437 item 5: a revoked token's name stays reserved because activity history references it. `POST /tokens` (and `mcpproxy token create`) now say so: `A revoked token named "x" still holds this name for activity history; choose another name`. - OpenAPI regenerated (subject type enum and the attention scoping description). **Web UI** - Servers page: a Profile select and a removable chip, backed by `GET /servers?profile=`. The list is page-local, so the shared servers store (sidebar, header, Dashboard) is untouched. It shows the spinner instead of the unfiltered list while `/status` features are pending, "Profile not found" with Clear on a 404, a disabled chip for `-`, and "No servers in this profile" with Clear. - Clients expanded row: Activity, Sessions, Tools it sees, Usage, each carrying `client=<id>`. - Tokens tab: Activity and Usage links on agent token rows (client credentials are filtered as clients, from the Clients page). - All of these stay hidden until `features.scope_filters` lists the parameter, and the URL keeps the parameter untouched meanwhile. `useScopeQuery.ts`, `navModel.ts` and `SidebarNav.vue` are not touched. - Generated `contracts.ts` gains the six kinds and the `setting` subject. **macOS** - Home attention rows and the tray "Needs Attention" rows for the new items are actionable: a pure `AttentionWarningAction` mapper feeds 108-k's warning dispatcher, so each opens Settings (scrolled to `require_mcp_auth`), the Clients page, the upgrade sheet, the connect sheet or the Agent Tokens tab filtered by the token. The tray never mutates config or a credential. - `ScopeFilterTests` additions for the un-hide, the URL round trip and the profile links. **CLI** - No format change. `mcpproxy attention`, `status` and `doctor` render the new items generically; a golden pins the table with a setting subject and an admin-key client. ## Audit findings No audit finding carries a dedicated id for this PR. It implements FR-093, FR-002 (kinds), FR-007 (scoped filtering), FR-082 (the deep links 109-k registered) and parity row 30 of Spec 109. ## Spec documents specs/109 tasks (T151 to T156 plus T152a, T154a, T157, T158, T159; 185 tasks), spec FR-002, FR-007, FR-082, FR-093, contracts/rest-api.md#attention (the kind table), data-model section 4, quickstart recipe 109-l, research D33 (P1 to P15). Spec 108 FR-043 and the Tokens contract gain the revoked-name sentence. docs/features/needs-attention.md lists the new kinds and docs/development/web-ui-verification.md the new sweep spec. ROADMAP regenerated. ## Tests added - Go: `internal/runtime` `attention_108_kinds_test.go` (table, ordering, truncation, no secrets, name equality with the Spec 108 codes), `attention_108_source_test.go` (the set equals `ClientsService.Warnings`, zero config reads, no clients service), `attention_108_subscriber_test.go` (events, periodic tick, expiry threshold, `firstSeen`), `attention_108_contract_test.go` (exact TypeScript lines), `attention_108_bench_test.go` (cost at the 100-token deployment cap, about 1 ms); `internal/httpapi` `attention_108_scope_test.go` (REST and SSE allow-list), `servers_profile_caller_pin_test.go` (both list branches), `tokens_revoked_name_test.go`; `cmd/mcpproxy` `attention_108_cmd_test.go` with a golden. - Frontend: `profiles-unhide.spec.ts` (features x `/profiles` route table), `servers-profile-scope.spec.ts`, `attention-108-targets.spec.ts` (each target resolves in the real router). - Playwright: `e2e/web-ui-sweep/profiles-unhide.spec.ts` (sidebar and Add menu, Viewing chip, Clients and Token links, Servers scope, an expiring credential becoming the first attention item within seconds, 1440/900/390 layout, keyboard order). The 108-i sweep step that clicked a link named "Tools" now clicks the renamed "Tools it sees" link by its test id. - Swift: `Attention108KindsTests`, three `ScopeFilterTests` cases. ## Deviations from the plan, recorded - The plan's helper path `helpers/profile-seed.ts` is `e2e/web-ui-sweep/profiles-seed.ts` on main. - `AttentionClientWarning` also carries `BindingNames` (display names for the guard detail) next to `BindingCount`, and `Since`. - The plan's 500-token cost case cannot exist: the store caps tokens at 100, so the cost test runs at the cap. - `AttentionList.vue` gets no `aria-describedby`: item ids can contain spaces (custom client ids), which are invalid id references; the summary sits directly above the fix button. - Token-row links render only when the Activity and Usage routes are registered, so routers without them (the 108-i unit specs) keep passing unmodified. ## Follow-ups - Agent-token expiry as an attention kind (not a Spec 108 warning). - Background admin-key detection without config reads.
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.
What changes for the user
Spec 108-j (
specs/108-profiles-v3, tasks T104 to T109a) puts the profile, client and token filters on the pages that did not send them yet. Spec 109-k registered the parameters and 108-e advertises them, but only the Sessions view sent them to the backend.Tools
/ui/tools?client=and?profile=now callGET /toolswith that subject. Before, the page loaded the unfiltered list.client=-,profile=-and a tenantclient=are disabled chips that are never sent. A 404 is an inline "Client not found" or "Profile not found" with "Clear filter". Selection and batch actions are disabled while viewing as a subject.Activity
profile,clientandtoken. Removable chips and Profile, Client and Token pickers (with "Unattributed") write the URL.client-<id>is not repeated as a token chip. Below themdbreakpoint the same chips are in the detail drawer's new Attribution section.policy_decisionrecords. A call a profile refuses is stored as one, so the view used to hide exactly the rows the filter asks for.Sessions
Usage
All pages: a URL that names a profile, client or token waits for
GET /statusbefore its first fetch, so no unfiltered request precedes the filtered one (rule 1). When the feature list never arrives in 2 seconds the filter stays hidden and the page shows a disabled "Filter unavailable on this server" chip.Backend (#1437 item 3): a scoped SSE subscriber's own
activity.internal_tool_call.completedframe now carries its attribution. The session records the credential's display prefix and the internal-tool funnel reads it back, only for the token name the session recorded.Findings fixed
Audit UX findings on scope consistency (the "profile filter ignored on Tools, Usage and Activity" family) and #1437 items 2, 3 and 4. Refs #1437 (items 1 and 5 stay with 109-l).
Specs
specs/108-profiles-v3: tasks T104 to T108a ticked, T109 and T109a added (they close with the live run), D37 records J1 to J20, FR-032, FR-045, FR-046 and the US3 reason words are amended, the quickstart 108-j recipe is extended,ROADMAP.mdis regenerated.Deviations from the plan
e2e/web-ui-sweep/profiles-seed.ts;profiles-scope.spec.tsextends it additively instead of addinghelpers/profile-seed.ts.AccessExplaineralready accepted every subject kind (J17), so it only gainstitleandnoteprops and a stale-response ticket (Follow-ups from Spec 108-i Web UI profiles review (#1444) #1446 F5.2).utils/profiles.tsreasonTextis extended with the remaining access reasons;accessReasonLabeladds the row-dependent "Disabled". The word forunannotated_hiddenstays "Unannotated — hidden" (the existing editor word).SetSessionTokenPrefix), not the request context: the internal-tool funnel has about 60 call sites and no context./toolsrequest ordering is asserted by holding the scoped answer back and checking that no rows render, because the sidebar issues its own unscoped tool-count request.Tests added
tools-view-as,activity-attribution,activity-scope-params,sessions-attribution,usage-scope-params,scope-chips,scope-features-wait,scope-params-api,access-reason-label. The existingactivity-sessions-scope-paramscase "does not send scope params outside the Sessions view" is inverted on purpose: the calls view now narrows/activity, and the general/sessionsfetch that feeds name resolution stays unscoped.TestInternalToolCall_AttributionCarriesTokenPrefix,TestInternalToolCall_NoCredentialCarriesNoTokenPrefix,TestSSEInternalAttribution.e2e/web-ui-sweep/profiles-scope.spec.ts(registered inscripts/run-web-smoke.sh), plus the scoped Tools and Activity pages in the contrast sweep.Review
Cross-model review with codex gpt-6-luna, read-only, in six chunks over three rounds. The last round of every chunk has no critical or high finding. Verified false positives that were not changed: "Tools it sees" for a build that advertises only profile and token (the link needs the client filter itself, now pinned by a test) and a
profile_missingblock reason (it is not a block reason in the backend). The 2 second fallback ofwaitForScopeFeaturesis plan decision J3 and is documented instores/system.ts. Low leftovers: the scope sweep seed overwrites and then clears an instance's existinganonymous_profile, the same pattern as the 108-i seed.