Repository navigation
Lint prompts (MCPP017-MCPP024) - #32
Merged
Merged
Conversation
A nullable prompts argument next to Lint(surface, LintOptions?) made Lint(surface, null) ambiguous. The prompts parameter is now required, so existing callers that pass null still mean options. The root help text now mentions prompts.
Lint JSON keeps the existing report format and adds an optional finding-level kind (prompt, resource or resourceTemplate), omitted for tools. Lint SARIF fingerprints are ruleId|kind|tool|path. Diff fingerprints are unchanged.
JsonKind for a tool is "tool", and lint SARIF always passed it into the fingerprint, so tool findings hashed as ruleId|tool|name|path instead of format 1's ruleId|name|path on main. Pass a kind only for non-tool findings. Diff fingerprints were already unchanged.
Keep the prompt-lint CHANGELOG bullet and the icons bullet from #31, and keep both the prompt/fingerprint tests and DiffJson_IconChange_IsIconsChanged.
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.
Lint prompts (MCPP017-MCPP024)
lintandLintToolsAsyncnow also check prompts when the server declares the prompts capability. If it doesn't,prompts/listis not sent, so tool-only servers behave as before.--from-filestill lints tools only, since snapshots don't carry prompts.New rules, all on by default:
LintFinding.Kind(LintTargetKind: Tool, Prompt, Resource, ResourceTemplate) is new and init-only. Reports printpromptbefore the name.ignoreentries take an optionalkind. If it's missing, the entry matches any kind. Writing a baseline addskindfor non-tool findings.ToolLinter.Lint(surface, prompts, options).Lint(surface, null)still picks the old options overload.Heads up: servers with prompts that have no descriptions or undescribed arguments can start failing default lint. Turn the rules off with
--rule MCPP017=nonethrough--rule MCPP024=none, or use ignore or a baseline.JSON lint findings include an optional
kind(prompt,resourceorresourceTemplate); it is omitted for tools, so the top-level reportkindstayslint. Lint SARIF fingerprints areruleId|kind|tool|path. Diff fingerprints are unchanged.Tests: full suite 1482 passed on net8.0 and net10.0, Release, 0 warnings. Rebased onto main after PR #30 (F14).
This branch was rebased onto main (c4485b3). Conflicts were resolved by keeping both sides: CHANGELOG (prompt-lint bullet first, then F14/F15/F16); CliApp (F14
--format/--sarifandWriteOutputAsync, plus prompt-aware lint); ServerOptions (FromFilePathplusCaptureForLintAsync).Likely remaining conflicts:
CliTests.csandLintConfigTests.cs. Keep MCPP999.ToolLinterTests.Rules_HaveUniqueIdslists all ids: merge both lists (add MCPP008 and MCPP017-024).