Skip to content

feat(skills): Skills tab on the server page of the Web UI (spec 125, PR-4a) - #1950

Merged
Dumbris merged 19 commits into
mainfrom
125-skills-pr4-web-ui
Nov 21, 2026
Merged

Dumbris merged 19 commits into
mainfrom
125-skills-pr4-web-ui

Conversation

@Dumbris

@Dumbris Dumbris commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related #1895 (spec 125, PR-4a of 5). Builds on #1921, #1923, #1928.

What this adds

A Skills tab on the server page of the Web UI, for administrators. It is shown when the server's skills listing says the feature is on and the server supports skills (or has skill records); never for a server-edition tenant user and never for an agent-token listing.

  • List with state chips (Awaiting review, Changed, Approved, Blocked, Unusable) and whether agents are offered the skill.
  • File list, and a viewer for text files of the current or the approved copy, read in parts (Load more). Binary files are listed, never shown.
  • Changes since the approved copy: added / removed / changed files by digest, and a line diff of one changed text file (unchanged runs collapsed, output capped). A removed file, or an approved text file now replaced by a binary one, can still be opened from the approved copy.
  • Scan verdict, completeness and findings.
  • Approve, Block, Unblock, Refresh. Live reload on skills.changed.

Review binding

  • Approve sends the hash and server incarnation of the version the reviewer opened. If the skill changes while it is open (a reload with a new hash, a 409 review_out_of_date / server_replaced, or a viewer part with another digest), the review is marked stale at once, Approve is disabled, and only re-opening the new version enables it again, even if the follow-up reload fails. A live skills.changed turns Approve off until a reload for the server applies (unchanged hash → back on; moved hash → stale). The approve/block routes send server_replaced in the message only (no error_code), so the UI reads the code from the message prefix. A 409 is never retried.
  • Every part the viewer and the diff read must carry the digest and offset listed for that file and copy; parts of two versions are never joined.
  • Upstream-written text (names, descriptions, file names, file text, finding evidence) is rendered as text only; a test fails on any v-html in the skills components.
  • Late or out-of-order answers (server switch, skill switch, file or copy switch, a refresh overtaken by a newer load, an unmounted view) never replace newer state or write another view's URL.
  • The success notice says whether agents are offered the skill, from the listing after the approve.

QA handoff

Fixture. cmd/skillsfixture — a loopback-only skills upstream (refuses a non-loopback -addr and a foreign Host; POST /_fixture/mutate?skill=&file= needs X-Skills-Fixture: mutate and refuses any Origin). Three skills: plain, with-files (notes.txt + binary logo.bin), big (data/large.txt, 150 KiB, read in parts).

Exact commands (from the repo root, on the checked commit):

./scripts/run-skills-tab-sweep.sh --self-test-first --out tmp/skills-sweep --report-html tmp/skills-sweep/report.html

By default the script builds the frontend and the core from the checkout itself (npm ci if needed, npm run build, copies the build into web/frontend/dist, go build ./cmd/mcpproxy into its scratch dir) and builds cmd/skillsfixture. To test a given binary instead (the release gate does this), set MCPPROXY_BINARY_PATH=<path to mcpproxy> and optionally SKILLS_FIXTURE_BINARY. It then starts the fixture and a throwaway core on free loopback ports with a scratch data dir and a clean environment (env -i: no MCPPROXY_* of yours reaches it; a data dir under ~/.mcpproxy is refused), approves the server, runs e2e/web-ui-sweep/skills-tab.spec.ts, reads the skill records back after each action, writes skills-sweep-results.json, redacts the throwaway key and local paths from everything it writes or prints (including npm, go, Playwright output), stops exactly the processes it started, and exits non-zero on any failure. Offline: set PW_CHROMIUM to a local Chrome. --self-test alone checks isolation, cleanup and redaction without a browser.

Checked commit. 459a4d274 (clean tree; evidence committed in the commit after it). Evidence committed in specs/125-skills-over-mcp/verification/ (skills-sweep-results.json, report.html without screenshots). All 8 scenarios passed on the first attempt:

  1. the Skills tab lists the fixture skills as awaiting review
  2. views SKILL.md, pages a large file (every part checked for the listed digest and contiguous offsets), does not offer a binary file
  3. approve turns the chip to Approved
  4. an upstream change plus Refresh shows Changed with a file diff and a line diff
  5. a pending skill changed while open is stale, with Approve disabled until re-opened
  6. a refresh through the REST API marks the open review stale by the live event alone
  7. block and unblock
  8. the tab survives a reload through ?tab=skills, no page error

Approved / blocked results (read back from GET /api/v1/servers/skillsfx/skills, incarnation 1 throughout):

After plain with-files big
approve approved, offered to agents, current = approved b23404c9 pending, not offered pending, not offered
approve-changed approved, offered to agents, current = approved 03097acd pending, not offered pending, not offered
block approved, offered to agents, current = approved 03097acd pending, blocked, not offered pending, not offered
unblock approved, offered to agents, current = approved 03097acd pending, not offered pending, not offered

with-files and big change upstream during scenarios 5 and 6, so their current hashes move; neither is ever offered to agents.

Release gate. The sweep runs on every tag as the advisory entry advisory/skills-tab-sweep in the web-ui-sweep job (through release-gate run-suite --advisory, with --self-test-first), so a failure shows in the verdict's advisory failures and never blocks a tag. The job timeout goes from 20 to 35 minutes for the two sweeps. Blocking entries and the verdict rules are unchanged.

Decisions taken without asking

  1. PR-4 is split: this tab now, review queue + Home attention rows + macOS labels in PR-4b (separate PR), so each merges on its own.
  2. The API client keeps a failure's error_code (errorCode, additive; other callers unchanged).
  3. Approve is offered for pending and changed skills that are not blocked; the scan result is shown above it and does not gate it (the server's trust mode decides, as for tools).
  4. The line diff only runs when both copies are text and at most 256 KiB; unchanged runs collapse to 3 lines of context; more than 5,000 output lines reports "too large".
  5. Refresh errors follow what the backend sends (refresh_superseded, skills_not_supported, skills_disabled, server_replaced); the REST contract line that named refresh_in_progress (never sent) is corrected.

Known limitation

A hot-reloaded enable_skills toggle publishes no skills.changed, so the tab appears or disappears on the next page load or navigation. The backend enforces the switch either way.

Review

Nine rounds, each with a fresh-context Opus 5.5 reviewer and opencode gpt-6.1-sol (four chunks), every finding verified against the code and fixed test-first. The main ones: Approve could follow a silent reload to a hash the reviewer never read; parts of two versions could be joined; live events never reached the tab (SSE frame shape); a vitest file exited 1 on an unhandled rejection; the sweep core could inherit the operator's MCPPROXY_DATA_DIR / audit-log path, printed the key under DEBUG=1, orphaned its processes, and printed local paths; the fixture's mutate endpoint accepted cross-site writes.

Tests

  • cd frontend && npm run type-check && npx vitest run — exit 0, 330 files, 2958 tests.
  • go test ./internal/skills/... ./cmd/skillsfixture/... ./cmd/release-gate/... ./internal/gatereport/... — exit 0; go vet clean; golangci-lint v2 (--new-from-rev=origin/main) 0 issues.
  • bash -n / shellcheck scripts/run-skills-tab-sweep.sh clean; ./scripts/run-skills-tab-sweep.sh --self-test exit 0.
  • The browser sweep above (8/8, exit 0) and --self-test (exit 0).

Not checked: the advisory gate step on a GitHub runner (it runs on tags), and the tab against a real skills server (PR-2 checked ingestion against https://huggingface.co/mcp).

…PR-4a)

An administrator can now review skills in the Web UI: the list with state
chips, the file list, a paged viewer of the current or approved copy, the
changes since the approved copy (file set by digest and a line diff), scan
findings, approve, block, unblock and refresh. skills.changed reloads the tab.

Review binding: Approve sends the hash and incarnation of the version the
reviewer opened. A reload that changes them marks the review stale and
disables Approve until the new version is opened. Every part the viewer and
the line diff read must carry the digest listed for that file and copy, so
parts of two versions are never joined. A 409 reloads and is never retried.

Also: the API client keeps error_code on failures (additive); the tab falls
back to Tools when it is not offered and is never requested for a tenant;
cmd/skillsfixture is a loopback-only skills upstream for the sweep (Host
check, mutate needs a custom header and refuses an Origin);
scripts/run-skills-tab-sweep.sh runs the browser sweep in one command and
writes a results file, and runs in the advisory release-gate web-ui-sweep job.

Review queue and Home attention rows for skills and the macOS labels are the
next PR (PR-4b).

Related #1895
- Sweep script: the core never inherits MCPPROXY_DATA_DIR / MCPPROXY_DATA
  (env -u, --data-dir, scratch HOME) and refuses a data dir under
  ~/.mcpproxy; --self-test proves an ambient data dir does not reach it.
- Sweep script: the API key is never in a URL and is redacted, with local
  paths, from everything it writes; the results file names the checked
  commit and whether the tree was dirty; --no-screenshots report variant.
- The stateful skills spec does not retry; the first failure is recorded.
- The sweep is the advisory gate entry advisory/skills-tab-sweep, run
  through release-gate run-suite, so a failure shows in the verdict.
- A failed background re-check no longer closes an open review.
- Refresh errors follow the backend (refresh_superseded, not the never-sent
  refresh_in_progress; contract doc corrected) and reload the listing.
- A write notice is cleared when another skill is opened.
- View approved for an approved text file now binary or removed.
- The agent-token listing shape offers no tab and never breaks rendering.
- e2e: a pending skill changed while open shows the stale banner with
  Approve disabled.

Related #1895
- skills.changed reaches the tab: consumers read the SSE frame's payload
  (tests use the real frame through the store); a new e2e step shows an
  open review going stale from a REST-triggered refresh alone.
- SkillsPanel load, refresh and write never reject unhandled and never
  leave a spinner on.
- Overlapping visibility checks are ordered by request sequence.
- An unchanged reload keeps the open viewer; the copy toggle offers only
  text copies; the line diff collapses unchanged runs and caps its output.
- Sweep script: the core and fixture start with a clean environment, so no
  inherited MCPPROXY_* (audit log, data dir, certs, bundle path) reaches
  them; the self-test proves it with decoys. DEBUG=1 no longer uses xtrace
  and never prints the key.
- web-ui-sweep job timeout 20 -> 35 minutes for both sweeps.

Related #1895
- run-skills-tab-sweep.sh: the core and the fixture were started through a
  backgrounded shell function, so $! was a subshell's PID and cleanup killed
  that shell, orphaning the server (seen in practice: cores and fixtures of
  earlier runs left running). They now start through a CLEAN_ENV array, so
  the recorded PID is the server itself; stop_started (the EXIT trap and the
  self-test restart) reads the process tree before signalling, sends SIGTERM
  to the tree, SIGKILLs what is left after 15 s, and touches nothing else.
  --self-test gains a step proving the recorded PIDs are the core and the
  fixture (by name and by the listening port), that after cleanup no PID of
  the run nor either port is alive, and that an unrelated process survives.
- ServerDetail.vue: a late visibility answer arriving after the view was
  unmounted wrote ?tab=tools into the next page's URL. Every ?tab= write now
  requires the view to be mounted and the URL to be this server's
  (urlIsThisView). Tests cover a deferred check that answers after unmount
  and after a server switch (the switch was already guarded by the name
  check; the unmount case failed before the fix).
- SkillsPanel.vue: the approve notice is worded from the reloaded listing's
  `available` for that skill (skillApprovedNotice): "Agents can use this
  skill now" only when available, "Not offered to agents yet: <reason>"
  (feature off, expose_skills: false, blocked, no longer listed, state moved)
  or without a reason (server disabled or quarantined), and a neutral
  "Approved." when the reload failed.
- skills-tab.spec.ts: the paging scenario now asserts that every part is of
  the current copy, carries the digest and size the core lists for the file
  (and the file row shows on screen), starts where the previous part ended
  and its next_offset is where it ends, and that the last part ends at the
  listed size. The report text for the scenario says exactly that.

Related #1895
- SkillsPanel: refresh() takes its place in the request order when it
  starts (seq = ++requestSeq, alongside its own refreshSeq for the
  button). Its listing is applied only while it is still the newest
  request; a superseded refresh reloads instead, so a late refresh answer
  never overwrites a newer listing applied by a load that started later.
- SkillsPanel: stale latch. An approve 409 review_out_of_date /
  server_replaced for the open review, and SkillDetail's content-changed
  (viewer digest/offset mismatch, line-diff part of another version),
  mark the open review stale synchronously, before the reload. Only an
  explicit re-open clears it, so a pending or failed reload never
  re-enables Approve (disabled while stale, banner shown).
- run-skills-tab-sweep.sh: printed paths go through say_path (relative
  to the repo root, else <out>/<scratch>/<repo>/~), the fixture and core
  log dumps on a startup failure, server responses and st_fail messages
  go through redact_stream (the same redactor as redact_file). The
  self-test checks the stdout and stderr of a passing DEBUG=1 run and of
  a forced fixture and core startup failure for the API key (plain and
  URL-encoded) and for absolute paths under the scratch dirs and home.
- Tests: deferred refresh/load ordering; each stale signal followed by a
  pending and by a failed reload; a late 409 for a review the reviewer
  left does not mark the new one.

Related #1895
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 493ae6a
Status: ✅  Deploy successful!
Preview URL: https://11cf013f.mcpproxy-docs.pages.dev
Branch Preview URL: https://125-skills-pr4-web-ui.mcpproxy-docs.pages.dev

View logs

- Approve, block and unblock answer 409 server_replaced through the shared
  approval error writer, whose body has no error_code. skillErrorCode reads
  the code from the message prefix (server_replaced, review_out_of_date) when
  error_code is absent, so a real refusal latches the review stale and shows
  the worded notice instead of the raw text. The panel tests now use the
  core's real bodies for approve, block and unblock.
- A live skills.changed for the server turns Approve off (for the open review
  and one opened from the listing on screen) until a reload for the server
  applies: an unchanged hash turns it back on, a moved hash marks the review
  stale as before. A banner says so and offers Reload. Tests for a pending and
  a failed reload.
- Every write takes an operation number; only the newest write publishes a
  notice, so a slow reload after an approve no longer replaces "Blocked.".
- skillErrorNotice is worded per action: skills_disabled and server_replaced
  say nothing was approved / blocked / unblocked / refreshed.
- run-skills-tab-sweep.sh: npm ci, npm run build, go build, playwright install
  and the Playwright run are captured into scratch files (run_logged) and
  printed only redacted, with their exit statuses kept. The redactor reduces
  any other absolute path under a filesystem root to <path>/basename, and
  say_path does so for any path outside the known prefixes. --self-test adds
  say_path/redact_stream checks, a forced Playwright failure with a stand-in
  PW_CHROMIUM under /tmp that dumps its environment, and a failing go build.
- docs/development/release-gate.md: the web-ui-sweep job has 35 minutes.

Related #1895
- SkillsPanel: refresh and every write take a number from one shared notice
  order when they start; a notice is published only while its action is still
  the newest, so a late refresh failure no longer replaces "Blocked." (and a
  late block no longer replaces a newer refresh notice). Spinner and button
  resets and the reconcile reloads do not depend on it. Deferred tests both
  ways.
- run-skills-tab-sweep.sh: the redactor reduces any absolute filesystem path
  to <path>/basename whatever its root (no root allowlist), also after an ANSI
  colour code or a JSON escape, and keeps URL paths, bare core routes and the
  placeholders. The configured paths (PW_CHROMIUM, the binaries, the browser
  dir) are replaced as a whole, so a path with a space is covered too.
  --self-test adds /data and /work roots, JSON-escaped and coloured messages, a
  configured path with a space, and checks the forced Playwright failure's
  JSON report and results file for the stand-in path and the key.
- The --out and --report-html directories are made through run_logged and
  checked writable up front: an unwritable one fails at once with redacted
  diagnostics. --self-test covers an unwritable --out and report parent (a
  missing subdir of a read-only dir, and the read-only dir itself).

Related #1895
@Dumbris

Dumbris commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Integrated checkout at c829f8f9 with #1949 e34d39b and #1951 fc23935: the sweep self-test exits 1 at “a run whose Playwright fails printed a local path (1 lines)” when the checkout is under /private/tmp and the output directory is outside the checkout. The preceding containment, process cleanup and API-key checks pass. Please cover this checkout layout and correct the failure before merge. The failing browser stand-in also prints its full environment; please limit it to synthetic canary variables so unrelated credentials cannot appear in test artifacts.

@Dumbris

Dumbris commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Coordinator update for Claude and reviewers: I pushed 3e59c6e after reproducing the failing path assertion with the checkout under /private/tmp. Playwright reported a relative path containing the alternate macOS temporary-directory spelling. The updated harness self-test and all eight browser scenarios passed together on integrated commit a117c920. The fix also limits the simulated browser diagnostic to the synthetic test key.

SkillsPanel:
- A refresh refused with server_replaced (error_code or the message prefix,
  through skillErrorCode) latches the open review stale before its reload, so
  a pending or failed reload never leaves Approve on.
- Unmounting ends the visit: a write or refresh answered after unmount shows
  nothing and starts no reconcile request.
- A notice is shown when no later action has already shown one
  (lastPublishedOp), so a successful refresh, which shows nothing, no longer
  hides an earlier approve's failure.

run-skills-tab-sweep.sh:
- The HTML report writer (write_report) no longer redacts the escaped HTML a
  second time, which put a raw <path> after entities such as &gt;.
- The catch-all reduces an absolute path only when its first segment exists
  on this machine, so regex literals (/approved/i, /tab-active/) and route
  fragments (/skills/refresh, /servers/{id}/skills) are kept; configured paths
  are still replaced whole. A root this machine does not have is kept (said in
  the comment and in docs/development/web-ui-verification.md).
- An existing read-only report file fails up front; the browsers dir goes
  through make_writable_dir; the report writer's output is captured, printed
  redacted, and its status kept.
- Self-test 6's stand-in browser dumps its whole environment again.
- --self-test covers all of these: the kept strings, a temp-dir path, a
  missing root, the report strings after escaping, a failing report write, a
  read-only report file and an unwritable PLAYWRIGHT_BROWSERS_PATH.

Related #1895
- write_results runs its node writer through run_logged: a failed write of
  skills-sweep-results.json (an unwritable file, a directory at the path, a
  full disk) prints node's diagnostics redacted, and the status stays
  non-zero.
- redact_file, the other direct node writer, captures a failed in-place
  rewrite's error and prints it redacted, keeping the status.
- --self-test calls the results writer with a directory and with a read-only
  file at the results path: non-zero exit, the path printed as <scratch>/...,
  no absolute path and no key.

Related #1895
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 125-skills-pr4-web-ui

Available Artifacts

  • archive-darwin-amd64 (33 MB)
  • archive-darwin-arm64 (30 MB)
  • archive-linux-amd64 (20 MB)
  • archive-linux-arm64 (18 MB)
  • archive-windows-amd64 (33 MB)
  • archive-windows-arm64 (29 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (29 MB)
  • installer-dmg-darwin-arm64 (26 MB)
  • smart-mcp-proxymcpproxy-goO6BFF0.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 44845151840 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

Regenerate ROADMAP.md (scripts/gen-roadmap.py) after #1947.
@Dumbris

Dumbris commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Merged origin/main (48681c0, #1947) into this branch as 493ae6a. The only conflict was the generated ROADMAP.md, regenerated with scripts/gen-roadmap.py (--check clean). No PR code changed versus efa8c0c, so the earlier review stands; merging once required checks are green on 493ae6a. #1949 will be updated after this lands.

@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

❌ Patch coverage is 69.38776% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/skillsfixture/main.go 73.97% 17 Missing and 2 partials ⚠️
internal/skills/skillstest/fixture.go 54.16% 10 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit 5f37ac9 into main Nov 21, 2026
70 checks passed
Dumbris added a commit that referenced this pull request Nov 21, 2026
Regenerate ROADMAP.md (scripts/gen-roadmap.py) after #1947 and #1950.
Dumbris added a commit that referenced this pull request Nov 21, 2026
… PR-4b) (#1951)

Completes the operator review queue portion of #1895 (Spec 125 PR-4b).
Administrators can see pending or changed skills in Home and the review
queue and open the server's Skills tab to review the exact version.
Includes Web/native labels, runtime visibility and event handling, and
regression coverage.

The implementation owner is finishing the independent review and full
test evidence. This draft starts CI in parallel. The release coordinator
will validate it together with #1950 and #1949.
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