Repository navigation
feat(skills): Skills tab on the server page of the Web UI (spec 125, PR-4a) - #1950
Conversation
…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
Deploying mcpproxy-docs with
|
| 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 |
- 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
|
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. |
|
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 >.
- 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
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 44845151840 --repo smart-mcp-proxy/mcpproxy-go
|
Regenerate ROADMAP.md (scripts/gen-roadmap.py) after #1947.
|
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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… 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.
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.
skills.changed.Review binding
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 liveskills.changedturns Approve off until a reload for the server applies (unchanged hash → back on; moved hash → stale). The approve/block routes sendserver_replacedin the message only (noerror_code), so the UI reads the code from the message prefix. A 409 is never retried.v-htmlin the skills components.QA handoff
Fixture.
cmd/skillsfixture— a loopback-only skills upstream (refuses a non-loopback-addrand a foreignHost;POST /_fixture/mutate?skill=&file=needsX-Skills-Fixture: mutateand refuses anyOrigin). Three skills:plain,with-files(notes.txt+ binarylogo.bin),big(data/large.txt, 150 KiB, read in parts).Exact commands (from the repo root, on the checked commit):
By default the script builds the frontend and the core from the checkout itself (
npm ciif needed,npm run build, copies the build intoweb/frontend/dist,go build ./cmd/mcpproxyinto its scratch dir) and buildscmd/skillsfixture. To test a given binary instead (the release gate does this), setMCPPROXY_BINARY_PATH=<path to mcpproxy>and optionallySKILLS_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: noMCPPROXY_*of yours reaches it; a data dir under~/.mcpproxyis refused), approves the server, runse2e/web-ui-sweep/skills-tab.spec.ts, reads the skill records back after each action, writesskills-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: setPW_CHROMIUMto a local Chrome.--self-testalone checks isolation, cleanup and redaction without a browser.Checked commit.
459a4d274(clean tree; evidence committed in the commit after it). Evidence committed inspecs/125-skills-over-mcp/verification/(skills-sweep-results.json,report.htmlwithout screenshots). All 8 scenarios passed on the first attempt:?tab=skills, no page errorApproved / blocked results (read back from
GET /api/v1/servers/skillsfx/skills, incarnation 1 throughout):b23404c903097acd03097acd03097acdwith-filesandbigchange 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-sweepin theweb-ui-sweepjob (throughrelease-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
error_code(errorCode, additive; other callers unchanged).refresh_superseded,skills_not_supported,skills_disabled,server_replaced); the REST contract line that namedrefresh_in_progress(never sent) is corrected.Known limitation
A hot-reloaded
enable_skillstoggle publishes noskills.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'sMCPPROXY_DATA_DIR/ audit-log path, printed the key underDEBUG=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 vetclean; golangci-lint v2 (--new-from-rev=origin/main) 0 issues.bash -n/shellcheck scripts/run-skills-tab-sweep.shclean;./scripts/run-skills-tab-sweep.sh --self-testexit 0.--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).