fix(skills): report a "dynamic" skill as unverifiable, not verified - #2474
Merged
Merged
Conversation
…2405) `--verify` gave a `resources: "dynamic"` skill the same verdict as one whose every file hashed clean: `outcome: "verified"`, `ok: true`, exit 0 — though nothing was hashed. - core: a fourth `outcome`, `unverifiable` (SEP-2640's own word for it), below `failed` and `incomplete` in precedence; `ok` stays true since "dynamic" is a conforming wire form. New `anySkillUnverifiable` helper. - cli: the headline no longer says "Verified" for such a skill and names how many advertised no digests; new opt-in `--require-digests` exits 9 (`skills_unverifiable`) for a CI job standing in for a host that declines unverifiable skills. Exit-code selection moved into one helper shared by skills/list and skills/get. Default exit stays 0. - tui: the Skills pane says UNVERIFIABLE instead of Verified. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation and coverage satisfy #2405, with only a minor JSDoc clarification remaining.
Review effort: Balanced
Findings: 1
What changed in this PR
Fixes #2405 by distinguishing dynamic skills from fully verified skills.
Changes:
- Adds the
unverifiableoutcome with defined precedence. - Adds CLI
--require-digests, exit code9, summaries, and documentation. - Updates TUI status rendering and comprehensive tests.
| File | Description |
|---|---|
core/mcp/skillsVerification.ts |
Adds the outcome and helper. |
clients/web/src/test/integration/mcp/inspectorClient-skills.test.ts |
Verifies real-transport behavior. |
clients/web/src/test/core/mcp/skillsVerification.test.ts |
Covers precedence and helpers. |
clients/tui/src/components/SkillsTab.tsx |
Displays unverifiable status. |
clients/tui/__tests__/SkillsTab.test.tsx |
Tests the TUI label. |
clients/cli/src/handlers/skills-verify.ts |
Selects exit codes and summaries. |
clients/cli/src/handlers/run-method.ts |
Applies digest policy to skill methods. |
clients/cli/src/handlers/method-types.ts |
Adds the digest-policy argument. |
clients/cli/src/handlers/consume-outcome.ts |
Adds the error-envelope code. |
clients/cli/src/error-handler.ts |
Defines exit code 9. |
clients/cli/src/cli.ts |
Parses and validates the new option. |
clients/cli/README.md |
Documents outcomes and exit behavior. |
clients/cli/__tests__/skills-verify-cli.test.ts |
Tests validation and envelopes. |
clients/cli/__tests__/run-method-skills.test.ts |
Tests dispatch, summaries, and precedence. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
…e manifest (#2474 review) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
Member
Author
|
Copilot round 1: 1 finding (low), fixed.
No suppressed comments. Requesting round 2. |
Member
Author
|
Copilot review closed. Round 2 was clean: no findings, no inline comments, no suppressed comments, approval recommended, and the round-1 finding is listed as resolved. The loop stops on the first clean round. |
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.

Closes #2405
Problem
--verifygave aresources: "dynamic"skilloutcome: "verified",ok: trueand exit0, which is the same verdict as a skill whose every file hashed clean. For the dynamic skill nothing was hashed. To a CI job the two cases looked identical.Change
The issue listed three possible changes and said they were not mutually exclusive. This PR does all three.
outcome:unverifiable(core/mcp/skillsVerification.ts). This is SEP-2640's own word for a"dynamic"skill'sSKILL.md. Precedence isfailed>incomplete>unverifiable>verified:failed.incomplete, because nothing about it was read.okstaystrue, since"dynamic"is a conforming wire form.allSkillsVerifiedis now false for such a skill, and a newanySkillUnverifiablehelper was added.Checked 1 skill and 0 files: no conformance errors. 1 of 1 skill advertised no digests (resources: "dynamic"), so its integrity was not checked.It never says "Verified" for such a skill.--require-digests(with--verify). A dynamic skill then exits9with the envelope codeskills_unverifiable. The default exit stays0, per the issue ("not exit 7, not ok: false"). With mixed outcomes the loudest code wins:7>8>9. Exit-code selection is now one helper,skillVerificationExitCode, instead of the same ternary copied intoskills/listandskills/get.--require-digestswithout--verifyis rejected, the same way--verifyrejects a non-skills method.The TUI Skills pane shows
[UNVERIFIABLE — Enter to re-verify]. ItsRecordover the outcome union flagged the missing label as a type error, as #2293 intended. The CLI README's outcome table, option table and exit-code table are updated.Verification
The issue's own repro server (
srv.mjs), run against the built CLI:outcomedynamicunverifiableChecked 1 skill and 0 files: no conformance errors. 1 of 1 skill advertised no digests (resources: "dynamic"), so its integrity was not checked.0dynamic--require-digestsunverifiable{"code":"skills_unverifiable"}9goodverifiedVerified 1 skill and 1 file: no conformance errors.0good--require-digestsverified0TUI Skills pane after pressing Enter on a dynamic skill. This is the rendered Ink frame, captured as text through the TUI's test renderer. Before this change the last line read
[Verified — Enter to re-verify].Tests added:
unverifiableoutcome, frontmatter mismatch stillfailed, over-budget dynamic skill stillincomplete,anySkillUnverifiable. The fixture integration test now assertsdynamic-reportisunverifiable.0, exit9under the flag on bothskills/listandskills/get, a precedence table forskillVerificationExitCode, the headline wording, flag validation, and the envelope code.npm run local:gatepasses.🤖 Generated with Claude Code