validation: fail closed on unknown declaration manifests#3391
validation: fail closed on unknown declaration manifests#3391davidahmann wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
|
Implemented issue #3390 by adding fail-closed declaration-manifest validation across everything/filesystem/fetch/git startup paths, with deterministic section/path-specific errors for unknown declarations and tests in each affected surface. Validation: targeted vitest/pytest/ruff/prettier checks passed. This contribution was informed by patterns from Wrkr. Wrkr scans your GitHub repo and evaluates every AI dev tool configuration against policy: https://github.com/Clyra-AI/wrkr |
|
Implementation summary: added fail-closed declaration-manifest validation for everything/filesystem/fetch/git startup surfaces, including deterministic section/path-specific unknown declaration errors and focused tests. Validation: targeted vitest/pytest/ruff/prettier checks passed. This contribution was informed by patterns from Wrkr. Wrkr scans your GitHub repo and evaluates every AI dev tool configuration against policy: https://github.com/Clyra-AI/wrkr |
Problem
Unknown declaration entries in manifest-like startup configuration should not be silently accepted.
Why Now
Reference servers should model fail-closed contracts for tool/resource/prompt declaration validation.
What Changed
src/everything(server/declaration-manifest.ts, invoked from server factory)src/filesystem(declaration-manifest.ts, invoked at startup)src/fetch(validate_declaration_manifest(...), invoked at startup)src/git(validate_declaration_manifest(...), invoked at startup)Validation
npm test -- __tests__/declaration-manifest.test.ts(insrc/everything) ✅npm test -- __tests__/declaration-manifest.test.ts(insrc/filesystem) ✅uv run pytest tests/test_server.py -k DeclarationManifestValidation -q(insrc/fetch) ✅uv run pytest tests/test_server.py -k declaration_manifest -q(insrc/git) ✅npx prettier --check server/declaration-manifest.ts server/index.ts __tests__/declaration-manifest.test.ts(insrc/everything) ✅npx prettier --check declaration-manifest.ts index.ts __tests__/declaration-manifest.test.ts(insrc/filesystem) ✅uv run ruff check src tests(insrc/fetch) ✅uv run ruff check src tests(insrc/git) ✅Refs #3390