Repository navigation
fix(mcp): close Skills conformance gaps with directory reads and resource metadata - #905
Conversation
Expose accepted skill directories and SKILL.md metadata so MCP hosts can browse served packages without guessing manifest filenames. Reuse catalog selection and refresh boundaries, including empty directories and stable pagination, and normalize strict frontmatter for YAML 1.2 Core readback. Add regressions and a pinned official conformance runner, and update the runbook and MCP references to describe the browsing contract. Refs runkids#895
Record UTF-8 classification from the same bounded bytes used for package digests so directory metadata agrees with resource reads for extensionless and unknown-extension text. Reuse the existing bounded reader without adding listing-time payload reads or changing package limits. Share pagination with skills/list, trust the SDK's typed request boundary, and repair the pagination regression to detect stale catalog snapshots. Refs runkids#895
Buffering supporting files during catalog refresh allocated with asset size. Restore one bounded stream for digest, size and UTF-8 classification, retaining at most three incomplete rune bytes and consuming invalid text through EOF. Preserve the existing same-file checks, package caps and SKILL.md byte reader. Keep real package-load benchmarks and strengthen the existing MIME fixtures for split runes and bytes after invalid sequences. Use one first-match sed command for the conformance URL without a truncated pipeline under pipefail. Scoped packages, focused race tests, vet, shell syntax/shellcheck and all 45 pinned official checks pass. Allocation stays near 48 KB for 64 KiB and 8 MiB assets; multibyte UTF-8 validation still costs CPU versus digest-only loading.
Check every directory continuation URI so a duplicated middle entry cannot hide a missing resource. Keep the existing before/after-cursor refresh cases. Merge nested-skill acceptance fixtures in the catalog owner, preserving all skill-count, skip-warning and directory assertions across configured and targetless cases. Move directory capability coverage to initialization and merge scalar, alias and rejection cases under the existing parser test. Give cached-page benchmark skills names that match their URI directories. Narrow tests, benchmark smoke and vet pass; duplicate-result and stale-catalog mutations both fail, then restored source passes. Production is unchanged.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
(#911) Follow-up to #905. The conformance script builds and serves skillshare and runs npm ci, which the repository only allows inside a container, but nothing stopped it from running on the host. It now refuses outside a container, with the same check scripts/hooks/git-e2e.sh uses. Nothing referred to the script either, so the testing topic now says when and how to run it. The translated mcp reference pages left out the example URI the English page gives for a skill root. All four now carry it. The streaming UTF-8 check in the package loader was only exercised with a rune split one byte before the read boundary. Two fixtures in the existing directory test add the 2+2 and 3+1 splits, so a mistake in the carried-over bytes shows up as a wrong MIME type.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel) — mcp serve: directory reads and the remaining SEP-2640 conformance gaps #895 has noapprovedlabel.Linked Issue
#895: directory reads and the remaining SEP-2640 conformance gaps.
What changed
mcp serveadvertisesdirectoryRead: trueand implementsresources/directory/readfor served skill roots and subdirectories. It returns direct children with file MIME types andinode/directoryfor directories. Empty directories returnresources: []; files and unknown directories return-32602.resources/listlists servedSKILL.mdfiles with their frontmatternameanddescription. Supporting files remain available through directory browsing and the existing resource template. Cached listings use catalog metadata without rereading payloads; catalog refresh still performs the existing file reads. Listings follow the same selection and refresh rules as skills and return at most 100 resources per page in URI order.SKILL.md: dates stay strings and leading-zero decimal integers stay decimal. Source bytes remain unchanged.Why
The server already served skill manifests and files, but clients could not browse directories. Without
directoryRead, the official suite skips directory checks; withoutSKILL.mdinresources/list, its name and description checks warn as untestable. YAML scalar differences could also make manifest frontmatter disagree with the file clients received. This closes those gaps while keeping listings within the served catalog.fix-mcp-close-Skills-conformance-gaps-with-directory-reads-and-resource-metadata.mp4
Usage
Start the server as before:
An MCP client can now call
resources/listfor skill metadata, orresources/directory/readwith{"uri":"skill://example/templates"}to browse a served skill's directory. Use directory URIs without a trailing slash. Pass a returnednextCursorascursorto continue either listing.Verification
Local measured results from isolated Linux devcontainer runs with synthetic sources:
internal/utilsandinternal/skillserve;internal/skillpkgcompiled and its supporting-file benchmark matrix was exercised. MIME boundary cases are covered by skillserve tests. IntegrationTestMCPServepassed. Scoped utils/skillserve race checks and package vet were clean.Upstream CI at
df41a292: all 7 active checks passed across the Test and Nix workflows: unit tests, Windows tests, Ubuntu and macOS integration tests, redteam, offline Docker sandbox, and Nix check.docker-sandbox-onlineandredteam-signalwere skipped per policy.Not run locally:
make check, the full Go or integration suites, the all-locale website build, Windows guest checks, or dashboard tests. The upstream suites above passed separately. There are no rendered UI changes.The final GLM-5.3-flash source review at high effort passed with no issues. GitHub Codex's automatic review after the draft was marked ready completed at
df41a292with no findings; the two earlier manually requested reviews failed because of a service limitation.Checklist
make check) — for code changes. Scoped local checks and upstream CI passed as listed above; full localmake checkwas not run.Closes #895