[skip ci] wip: preserve Hermes crank development checkpoint

Owner-authorized recovery of accumulated source changes.
Includes accepted work and in-progress changes; NOT a release or acceptance.
Parent baseline 1b6db09bd1. Runtime data, build caches and local credentials excluded.
This commit is contained in:
Hermes DevOps committed 2026-10-25 08:05:37 +00:00
1 parent 1b6db09bd1
commit 301dce301a
357 files changed
+118831 -5113

No files matched your search

@@ -0,0 +1 @@
{"completions":{},"logging":{},"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}}
@@ -0,0 +1,34 @@
{
"revision": "2025-11-25",
"inventory_path": "docs/capability-inventory.json",
"inventory_sha256": "85970569edd1b658a6cea4444c796efabe166a6833787c7e98249f20a1eaf29d",
"rule": "remaining-ac-spec.md#5-server-only-projection-rules-1-4",
"projection_inputs": [
{
"role": "server",
"kind": "capability",
"surface": "logging"
},
{
"role": "server",
"kind": "capability",
"surface": "completions"
},
{
"role": "server",
"kind": "capability",
"surface": "prompts"
},
{
"role": "server",
"kind": "capability",
"surface": "resources"
},
{
"role": "server",
"kind": "capability",
"surface": "tools"
}
],
"note": "Sidecar provenance only. Never compared byte-for-byte with the endpoint; the payload oracle is the sibling .frozen.json file."
}
@@ -0,0 +1 @@
{"completions":{},"logging":{},"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}}
@@ -0,0 +1,34 @@
{
"revision": "2026-07-28",
"inventory_path": "docs/capability-inventory.json",
"inventory_sha256": "85970569edd1b658a6cea4444c796efabe166a6833787c7e98249f20a1eaf29d",
"rule": "remaining-ac-spec.md#5-server-only-projection-rules-1-4",
"projection_inputs": [
{
"role": "server",
"kind": "capability",
"surface": "logging"
},
{
"role": "server",
"kind": "capability",
"surface": "completions"
},
{
"role": "server",
"kind": "capability",
"surface": "prompts"
},
{
"role": "server",
"kind": "capability",
"surface": "resources"
},
{
"role": "server",
"kind": "capability",
"surface": "tools"
}
],
"note": "Sidecar provenance only. Never compared byte-for-byte with the endpoint; the payload oracle is the sibling .frozen.json file."
}
@@ -0,0 +1,24 @@
{
"oracle": "crank-current-scope-advertised-capabilities",
"note": "Independent expected projection of the capability descriptor the CURRENT scope is allowed to advertise: advertisement equals what is implemented. Later capabilities are deferred and must not appear until their owning story implements them. This is a scoped projection, not the official MCP capability list.",
"expected_keys": ["completions", "logging", "prompts", "resources", "tools"],
"expected_descriptor": {
"completions": {},
"logging": {},
"prompts": {
"listChanged": false
},
"resources": {
"listChanged": false,
"subscribe": false
},
"tools": {
"listChanged": false
}
},
"must_not_be_advertised": ["experimental", "extensions"],
"deferred_with_owner": {
"change_signals": "story 3.19 (FR-19)",
"io.modelcontextprotocol/tasks": "story 4.7"
}
}
@@ -0,0 +1,275 @@
{
"schema_version": 2,
"product": "crank-community",
"scope_note": "Scoped v2 candidate / readiness input, not a full-validity fixture: the required-surface oracle is an explicitly bounded reviewed subset (counts_as_exhaustive: false), so Gate A completeness stays BLOCKED until a complete reviewed list exists.",
"protocol": {
"selection_date": "2026-10-11",
"decision_note": "epic3-approved-simplification.md",
"revisions": [
{
"revision": "2026-07-28",
"role": "modern-stateless",
"lifecycle": "stateless",
"session": false,
"required_methods": [
"server/discover"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/schema/2026-07-28/schema.ts",
"sha256": "742750af0bb8c716e7030c4977c992b55d1adc4407e9e66997db5846baedc2cd"
}
},
{
"revision": "2025-11-25",
"role": "legacy-session",
"lifecycle": "initialize+session",
"session": true,
"required_methods": [
"initialize",
"notifications/initialized"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-11-25/basic/transports.mdx",
"sha256": "a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0"
}
}
],
"withdrawn": [
"2025-06-18",
"2025-03-26"
],
"capabilities": [
{
"surface": "tools/list",
"status": "supported",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "n/a",
"evidence_target": "tools/list"
},
{
"surface": "tools/call",
"status": "supported",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "n/a",
"evidence_target": "tools/call"
},
{
"surface": "resources/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/list",
"deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"
},
{
"surface": "resources/read",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/read",
"deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"
},
{
"surface": "resources/templates/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.10-3.11",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/templates/list",
"deferred_reason": "REST-backed Resource templates and their read path are owned by stories 3.10-3.11",
"requirement": "FR-15"
},
{
"surface": "prompts/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.12-3.15",
"fallback": "capability not advertised, method not served",
"evidence_target": "prompts/list",
"deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15",
"requirement": "FR-17"
},
{
"surface": "completion/complete",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.17",
"fallback": "capability not advertised, method not served",
"evidence_target": "completion/complete",
"deferred_reason": "MCP completion is owned by story 3.17",
"requirement": "FR-19"
},
{
"surface": "server/discover",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28"
],
"owner": "story 3.1",
"fallback": "modern stateless era not served until implemented",
"evidence_target": "server/discover",
"deferred_reason": "implemented by story 3.1 itself",
"requirement": "FR-13"
},
{
"surface": "logging",
"status": "deferred",
"applicability": "deprecated",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.18",
"fallback": "capability not advertised; the per-request log level replaces logging/setLevel in the modern revision",
"evidence_target": "logging",
"deferred_reason": "safe MCP server logging is owned by story 3.18 (FR-19); the capability is deprecated in the pinned 2026-07-28 revision and remains present in the legacy revision, so it is deferred with a source-backed applicability note rather than dismissed as not applicable",
"requirement": "FR-19"
},
{
"surface": "notifications/tools/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.5",
"fallback": "no change notification emitted",
"evidence_target": "notifications/tools/list_changed",
"deferred_reason": "tool change notifications belong to story 3.5",
"requirement": "FR-18"
},
{
"surface": "notifications/resources/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.19",
"fallback": "no change notification emitted",
"evidence_target": "notifications/resources/list_changed",
"deferred_reason": "Resource and Prompt change signals are owned by story 3.19",
"requirement": "FR-19"
},
{
"surface": "notifications/prompts/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.19",
"fallback": "no change notification emitted",
"evidence_target": "notifications/prompts/list_changed",
"deferred_reason": "Resource and Prompt change signals are owned by story 3.19",
"requirement": "FR-19"
},
{
"surface": "notifications/progress",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.4",
"fallback": "no progress notifications emitted",
"evidence_target": "notifications/progress",
"deferred_reason": "progress signals belong to story 3.4",
"requirement": "FR-19"
},
{
"surface": "io.modelcontextprotocol/tasks",
"status": "deferred",
"applicability": "extension",
"role": "server",
"revisions": [
"2026-07-28"
],
"owner": "story 4.7",
"fallback": "extension not advertised and not dispatched",
"evidence_target": "n/a",
"deferred_reason": "extension is owned by Epic 4 (story 4.7) until its own evidence exists",
"requirement": "FR-20"
}
]
},
"flows": [
{
"id": "mcp-revision-negotiation",
"type": "mcp",
"requirements": [
"FR-13"
],
"user_outcome": "A client negotiates one of the two approved revisions and keeps the era-correct lifecycle.",
"owner": "community-release",
"status": "planned",
"capabilities": [
"tools"
],
"evidence": {
"automated": [
"evidence/mcp-revision/mcp-revision-negotiation/automated.txt"
],
"manual": [
"evidence/mcp-revision/mcp-revision-negotiation/manual.md"
]
}
}
],
"expected": {
"gate": "validity",
"verdict": "rejected",
"must_name": "prompts/get",
"single_change": "exactly one required source-backed surface is removed"
}
}
@@ -0,0 +1,290 @@
{
"schema_version": 2,
"product": "crank-community",
"scope_note": "Scoped v2 candidate / readiness input, not a full-validity fixture: the required-surface oracle is an explicitly bounded reviewed subset (counts_as_exhaustive: false), so Gate A completeness stays BLOCKED until a complete reviewed list exists.",
"protocol": {
"selection_date": "2026-10-11",
"decision_note": "epic3-approved-simplification.md",
"revisions": [
{
"revision": "2026-07-28",
"role": "modern-stateless",
"lifecycle": "stateless",
"session": false,
"required_methods": [
"server/discover"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/schema/2026-07-28/schema.ts",
"sha256": "742750af0bb8c716e7030c4977c992b55d1adc4407e9e66997db5846baedc2cd"
}
},
{
"revision": "2025-11-25",
"role": "legacy-session",
"lifecycle": "initialize+session",
"session": true,
"required_methods": [
"initialize",
"notifications/initialized"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-11-25/basic/transports.mdx",
"sha256": "a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0"
}
}
],
"withdrawn": [
"2025-06-18",
"2025-03-26"
],
"capabilities": [
{
"surface": "tools/list",
"status": "supported",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "n/a",
"evidence_target": "tools/list"
},
{
"surface": "tools/call",
"status": "supported",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "n/a",
"evidence_target": "tools/call"
},
{
"surface": "resources/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"evidence_target": "resources/list"
},
{
"surface": "resources/read",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/read",
"deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"
},
{
"surface": "resources/templates/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.10-3.11",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/templates/list",
"deferred_reason": "REST-backed Resource templates and their read path are owned by stories 3.10-3.11",
"requirement": "FR-15"
},
{
"surface": "prompts/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.12-3.15",
"fallback": "capability not advertised, method not served",
"evidence_target": "prompts/list",
"deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15",
"requirement": "FR-17"
},
{
"surface": "prompts/get",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.12-3.15",
"fallback": "capability not advertised, method not served",
"evidence_target": "prompts/get",
"deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15",
"requirement": "FR-17"
},
{
"surface": "completion/complete",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.17",
"fallback": "capability not advertised, method not served",
"evidence_target": "completion/complete",
"deferred_reason": "MCP completion is owned by story 3.17",
"requirement": "FR-19"
},
{
"surface": "server/discover",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28"
],
"owner": "story 3.1",
"fallback": "modern stateless era not served until implemented",
"evidence_target": "server/discover",
"deferred_reason": "implemented by story 3.1 itself",
"requirement": "FR-13"
},
{
"surface": "logging",
"status": "deferred",
"applicability": "deprecated",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.18",
"fallback": "capability not advertised; the per-request log level replaces logging/setLevel in the modern revision",
"evidence_target": "logging",
"deferred_reason": "safe MCP server logging is owned by story 3.18 (FR-19); the capability is deprecated in the pinned 2026-07-28 revision and remains present in the legacy revision, so it is deferred with a source-backed applicability note rather than dismissed as not applicable",
"requirement": "FR-19"
},
{
"surface": "notifications/tools/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.5",
"fallback": "no change notification emitted",
"evidence_target": "notifications/tools/list_changed",
"deferred_reason": "tool change notifications belong to story 3.5",
"requirement": "FR-18"
},
{
"surface": "notifications/resources/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.19",
"fallback": "no change notification emitted",
"evidence_target": "notifications/resources/list_changed",
"deferred_reason": "Resource and Prompt change signals are owned by story 3.19",
"requirement": "FR-19"
},
{
"surface": "notifications/prompts/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.19",
"fallback": "no change notification emitted",
"evidence_target": "notifications/prompts/list_changed",
"deferred_reason": "Resource and Prompt change signals are owned by story 3.19",
"requirement": "FR-19"
},
{
"surface": "notifications/progress",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.4",
"fallback": "no progress notifications emitted",
"evidence_target": "notifications/progress",
"deferred_reason": "progress signals belong to story 3.4",
"requirement": "FR-19"
},
{
"surface": "io.modelcontextprotocol/tasks",
"status": "deferred",
"applicability": "extension",
"role": "server",
"revisions": [
"2026-07-28"
],
"owner": "story 4.7",
"fallback": "extension not advertised and not dispatched",
"evidence_target": "n/a",
"deferred_reason": "extension is owned by Epic 4 (story 4.7) until its own evidence exists",
"requirement": "FR-20"
}
]
},
"flows": [
{
"id": "mcp-revision-negotiation",
"type": "mcp",
"requirements": [
"FR-13"
],
"user_outcome": "A client negotiates one of the two approved revisions and keeps the era-correct lifecycle.",
"owner": "community-release",
"status": "planned",
"capabilities": [
"tools"
],
"evidence": {
"automated": [
"evidence/mcp-revision/mcp-revision-negotiation/automated.txt"
],
"manual": [
"evidence/mcp-revision/mcp-revision-negotiation/manual.md"
]
}
}
],
"expected": {
"gate": "feature-complete",
"verdict": "must be blocked",
"must_name": "resources/list",
"status": "blocked-pending-implementation",
"single_change": "one deferred cell loses its deferred reason and fallback",
"why": "the feature-complete gate (Gate B) has no CLI mode yet, so this input is recorded as a blocked Gate B candidate instead of being asserted through the validity gate"
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,303 @@
{
"schema_version": 2,
"product": "crank-community",
"scope_note": "Scoped v2 candidate / readiness input, not a full-validity fixture: the required-surface oracle is an explicitly bounded reviewed subset (counts_as_exhaustive: false), so Gate A completeness stays BLOCKED until a complete reviewed list exists.",
"protocol": {
"selection_date": "2026-10-11",
"decision_note": "epic3-approved-simplification.md",
"revisions": [
{
"revision": "2026-07-28",
"role": "modern-stateless",
"lifecycle": "stateless",
"session": false,
"required_methods": [
"server/discover"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/schema/2026-07-28/schema.ts",
"sha256": "742750af0bb8c716e7030c4977c992b55d1adc4407e9e66997db5846baedc2cd"
}
},
{
"revision": "2025-11-25",
"role": "legacy-session",
"lifecycle": "initialize+session",
"session": true,
"required_methods": [
"initialize",
"notifications/initialized"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-11-25/basic/transports.mdx",
"sha256": "a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0"
}
},
{
"revision": "2025-03-26",
"role": "legacy-session",
"lifecycle": "initialize+session",
"session": true,
"required_methods": [
"initialize"
],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-03-26/basic/transports.mdx",
"sha256": "bdc45720f0a0a3c4b2ba3bd6cbb5f9c1a2b0cd0b2a1b8b1c2d3e4f5061728394"
}
}
],
"withdrawn": [
"2025-06-18",
"2025-03-26"
],
"capabilities": [
{
"surface": "tools/list",
"status": "supported",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "n/a",
"evidence_target": "tools/list"
},
{
"surface": "tools/call",
"status": "supported",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "n/a",
"evidence_target": "tools/call"
},
{
"surface": "resources/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/list",
"deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"
},
{
"surface": "resources/read",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "community-release",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/read",
"deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"
},
{
"surface": "resources/templates/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.10-3.11",
"fallback": "capability not advertised, method not served",
"evidence_target": "resources/templates/list",
"deferred_reason": "REST-backed Resource templates and their read path are owned by stories 3.10-3.11",
"requirement": "FR-15"
},
{
"surface": "prompts/list",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.12-3.15",
"fallback": "capability not advertised, method not served",
"evidence_target": "prompts/list",
"deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15",
"requirement": "FR-17"
},
{
"surface": "prompts/get",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "stories 3.12-3.15",
"fallback": "capability not advertised, method not served",
"evidence_target": "prompts/get",
"deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15",
"requirement": "FR-17"
},
{
"surface": "completion/complete",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.17",
"fallback": "capability not advertised, method not served",
"evidence_target": "completion/complete",
"deferred_reason": "MCP completion is owned by story 3.17",
"requirement": "FR-19"
},
{
"surface": "server/discover",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28"
],
"owner": "story 3.1",
"fallback": "modern stateless era not served until implemented",
"evidence_target": "server/discover",
"deferred_reason": "implemented by story 3.1 itself",
"requirement": "FR-13"
},
{
"surface": "logging",
"status": "deferred",
"applicability": "deprecated",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.18",
"fallback": "capability not advertised; the per-request log level replaces logging/setLevel in the modern revision",
"evidence_target": "logging",
"deferred_reason": "safe MCP server logging is owned by story 3.18 (FR-19); the capability is deprecated in the pinned 2026-07-28 revision and remains present in the legacy revision, so it is deferred with a source-backed applicability note rather than dismissed as not applicable",
"requirement": "FR-19"
},
{
"surface": "notifications/tools/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.5",
"fallback": "no change notification emitted",
"evidence_target": "notifications/tools/list_changed",
"deferred_reason": "tool change notifications belong to story 3.5",
"requirement": "FR-18"
},
{
"surface": "notifications/resources/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.19",
"fallback": "no change notification emitted",
"evidence_target": "notifications/resources/list_changed",
"deferred_reason": "Resource and Prompt change signals are owned by story 3.19",
"requirement": "FR-19"
},
{
"surface": "notifications/prompts/list_changed",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.19",
"fallback": "no change notification emitted",
"evidence_target": "notifications/prompts/list_changed",
"deferred_reason": "Resource and Prompt change signals are owned by story 3.19",
"requirement": "FR-19"
},
{
"surface": "notifications/progress",
"status": "deferred",
"applicability": "stable",
"role": "server",
"revisions": [
"2026-07-28",
"2025-11-25"
],
"owner": "story 3.4",
"fallback": "no progress notifications emitted",
"evidence_target": "notifications/progress",
"deferred_reason": "progress signals belong to story 3.4",
"requirement": "FR-19"
},
{
"surface": "io.modelcontextprotocol/tasks",
"status": "deferred",
"applicability": "extension",
"role": "server",
"revisions": [
"2026-07-28"
],
"owner": "story 4.7",
"fallback": "extension not advertised and not dispatched",
"evidence_target": "n/a",
"deferred_reason": "extension is owned by Epic 4 (story 4.7) until its own evidence exists",
"requirement": "FR-20"
}
]
},
"flows": [
{
"id": "mcp-revision-negotiation",
"type": "mcp",
"requirements": [
"FR-13"
],
"user_outcome": "A client negotiates one of the two approved revisions and keeps the era-correct lifecycle.",
"owner": "community-release",
"status": "planned",
"capabilities": [
"tools"
],
"evidence": {
"automated": [
"evidence/mcp-revision/mcp-revision-negotiation/automated.txt"
],
"manual": [
"evidence/mcp-revision/mcp-revision-negotiation/manual.md"
]
}
}
],
"expected": {
"gate": "validity",
"verdict": "rejected",
"must_name": "2025-03-26",
"single_change": "one extra revision entry is added to the approved two-revision window"
}
}
@@ -0,0 +1,72 @@
{
"schema_version": 2,
"product": "crank-community",
"scope_note": "Scoped v2 candidate / readiness input, not a full-validity fixture: the required-surface oracle is an explicitly bounded reviewed subset (counts_as_exhaustive: false), so Gate A completeness stays BLOCKED until a complete reviewed list exists.",
"protocol": {
"selection_date": "2026-10-11",
"decision_note": "epic3-approved-simplification.md",
"revisions": [
{
"revision": "2026-07-28",
"role": "modern-stateless",
"lifecycle": "stateless",
"session": false,
"required_methods": ["server/discover"],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/schema/2026-07-28/schema.ts",
"sha256": "742750af0bb8c716e7030c4977c992b55d1adc4407e9e66997db5846baedc2cd"
}
},
{
"revision": "2025-11-25",
"role": "legacy-session",
"lifecycle": "initialize+session",
"session": true,
"required_methods": ["initialize", "notifications/initialized"],
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-11-25/basic/transports.mdx",
"sha256": "a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0"
}
}
],
"withdrawn": ["2025-06-18", "2025-03-26"],
"capabilities": [
{"surface": "tools/list", "status": "supported", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "community-release", "fallback": "n/a", "evidence_target": "tools/list"},
{"surface": "tools/call", "status": "supported", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "community-release", "fallback": "n/a", "evidence_target": "tools/call"},
{"surface": "resources/list", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "community-release", "fallback": "capability not advertised, method not served", "evidence_target": "resources/list", "deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"},
{"surface": "resources/read", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "community-release", "fallback": "capability not advertised, method not served", "evidence_target": "resources/read", "deferred_reason": "Resource vertical is scheduled by stories 3.6-3.8"},
{"surface": "resources/templates/list", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "stories 3.10-3.11", "fallback": "capability not advertised, method not served", "evidence_target": "resources/templates/list", "deferred_reason": "REST-backed Resource templates and their read path are owned by stories 3.10-3.11", "requirement": "FR-15"},
{"surface": "prompts/list", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "stories 3.12-3.15", "fallback": "capability not advertised, method not served", "evidence_target": "prompts/list", "deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15", "requirement": "FR-17"},
{"surface": "prompts/get", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "stories 3.12-3.15", "fallback": "capability not advertised, method not served", "evidence_target": "prompts/get", "deferred_reason": "Prompt vertical is scheduled by stories 3.12-3.15", "requirement": "FR-17"},
{"surface": "completion/complete", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "story 3.17", "fallback": "capability not advertised, method not served", "evidence_target": "completion/complete", "deferred_reason": "MCP completion is owned by story 3.17", "requirement": "FR-19"},
{"surface": "server/discover", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28"], "owner": "story 3.1", "fallback": "modern stateless era not served until implemented", "evidence_target": "server/discover", "deferred_reason": "implemented by story 3.1 itself", "requirement": "FR-13"},
{"surface": "logging", "status": "deferred", "applicability": "deprecated", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "story 3.18", "fallback": "capability not advertised; the per-request log level replaces logging/setLevel in the modern revision", "evidence_target": "logging", "deferred_reason": "safe MCP server logging is owned by story 3.18 (FR-19); the capability is deprecated in the pinned 2026-07-28 revision and remains present in the legacy revision, so it is deferred with a source-backed applicability note rather than dismissed as not applicable", "requirement": "FR-19"},
{"surface": "notifications/tools/list_changed", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "story 3.5", "fallback": "no change notification emitted", "evidence_target": "notifications/tools/list_changed", "deferred_reason": "tool change notifications belong to story 3.5", "requirement": "FR-18"},
{"surface": "notifications/resources/list_changed", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "story 3.19", "fallback": "no change notification emitted", "evidence_target": "notifications/resources/list_changed", "deferred_reason": "Resource and Prompt change signals are owned by story 3.19", "requirement": "FR-19"},
{"surface": "notifications/prompts/list_changed", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "story 3.19", "fallback": "no change notification emitted", "evidence_target": "notifications/prompts/list_changed", "deferred_reason": "Resource and Prompt change signals are owned by story 3.19", "requirement": "FR-19"},
{"surface": "notifications/progress", "status": "deferred", "applicability": "stable", "role": "server", "revisions": ["2026-07-28", "2025-11-25"], "owner": "story 3.4", "fallback": "no progress notifications emitted", "evidence_target": "notifications/progress", "deferred_reason": "progress signals belong to story 3.4", "requirement": "FR-19"},
{"surface": "io.modelcontextprotocol/tasks", "status": "deferred", "applicability": "extension", "role": "server", "revisions": ["2026-07-28"], "owner": "story 4.7", "fallback": "extension not advertised and not dispatched", "evidence_target": "n/a", "deferred_reason": "extension is owned by Epic 4 (story 4.7) until its own evidence exists", "requirement": "FR-20"}
]
},
"flows": [
{
"id": "mcp-revision-negotiation",
"type": "mcp",
"requirements": ["FR-13"],
"user_outcome": "A client negotiates one of the two approved revisions and keeps the era-correct lifecycle.",
"owner": "community-release",
"status": "planned",
"capabilities": ["tools"],
"evidence": {
"automated": ["evidence/mcp-revision/mcp-revision-negotiation/automated.txt"],
"manual": ["evidence/mcp-revision/mcp-revision-negotiation/manual.md"]
}
}
],
"expected": {
"gate": "validity-shape",
"verdict": "scoped-candidate-not-full-validity",
"completeness": "blocked-scoped-subset",
"why": "the v2 candidate must be recognised by the validity contract (its protocol block must not be reported as an unknown field or an unsupported inventory version) and its completeness state must be reported as a scoped/blocked subset, because the required-surface oracle is deliberately bounded and does not claim exhaustiveness"
}
}
@@ -0,0 +1,34 @@
{
"oracle": "mcp-official-server-surface",
"scope": "scoped server-side review list for the two approved revisions",
"scope_limit": "Bounded extract from the pinned official sources: server-side methods, capability names and extensions the reviewer can point at in the pinned bytes. It does NOT claim to enumerate every client-side, deprecated or experimental surface, and it records official availability only — never a Crank implementation status.",
"counts_as_exhaustive": false,
"pinned_commit": "1f520964b295d58494d944f2aea8a5ab51c79f77",
"sources": [
{
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/schema/2026-07-28/schema.ts",
"sha256": "742750af0bb8c716e7030c4977c992b55d1adc4407e9e66997db5846baedc2cd"
},
{
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-11-25/basic/transports.mdx",
"sha256": "a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0"
}
],
"items": [
{"surface": "tools/list", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "tools/call", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "resources/list", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "resources/read", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "resources/templates/list", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "prompts/list", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "prompts/get", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "completion/complete", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "server/discover", "kind": "method", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "absent"}},
{"surface": "logging", "kind": "capability", "role": "server", "availability": {"2026-07-28": "deprecated", "2025-11-25": "present"}, "note": "deprecated in 2026-07-28 (SEP-2577); the per-request log level replaces logging/setLevel"},
{"surface": "notifications/tools/list_changed", "kind": "notification", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "notifications/resources/list_changed", "kind": "notification", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "notifications/prompts/list_changed", "kind": "notification", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "notifications/progress", "kind": "notification", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "present"}},
{"surface": "io.modelcontextprotocol/tasks", "kind": "extension", "role": "server", "availability": {"2026-07-28": "present", "2025-11-25": "absent"}}
]
}
+30
View File
@@ -0,0 +1,30 @@
{
"oracle": "mcp-revision-window",
"decision": "owner-approved 2026-10-11",
"decision_note": "epic3-approved-simplification.md",
"selection_date": "2026-10-11",
"revisions": [
{
"revision": "2026-07-28",
"role": "modern-stateless",
"lifecycle": "stateless",
"mandatory_methods": ["server/discover"],
"session": false,
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/schema/2026-07-28/schema.ts",
"sha256": "742750af0bb8c716e7030c4977c992b55d1adc4407e9e66997db5846baedc2cd"
}
},
{
"revision": "2025-11-25",
"role": "legacy-session",
"lifecycle": "initialize+session",
"mandatory_methods": ["initialize", "notifications/initialized"],
"session": true,
"provenance": {
"locator": "https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/1f520964b295d58494d944f2aea8a5ab51c79f77/docs/specification/2025-11-25/basic/transports.mdx",
"sha256": "a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0"
}
}
]
}
+33
View File
@@ -0,0 +1,33 @@
{
"oracle": "mcp-wire-identity-cases",
"source": "protocol-era-matrix.md section 'Identity-carrier precedence (binding, decisive before adapter admission)' (21 rows) plus pinned legacy transports.mdx sha256 a247fdbb3cc25c805ef43124db18d9b60a56669b3e65bd163dffb76f4129dfc0",
"id_namespace": "wm-<nn> is this fixture's own namespace and is independent of the binding matrix row numbers; `binding_row` maps each case to its row in protocol-era-matrix.md",
"coverage": {
"binding_rows_total": 21,
"rows_covered_by_executable_cases": 13,
"rows_partially_covered": {"8": "unknown RPC method is exercised through an unknown extension method call in at_3_1_09_no_extension_surface_is_advertised_or_dispatched"},
"rows_not_yet_exercised": [5, 6, 17, 18, 20],
"rows_not_yet_exercised_reason": "narrow single-behaviour oracles (Mcp-Method/Mcp-Name header enforcement, malformed carrier values, notification-envelope rules, modern GET/DELETE) that are not needed to qualify the currently registered acceptance criteria",
"row_21_blocked_reason": "the no-residual-state repeatability row needs a barrier/counter observation seam that does not exist yet (tracked as the AC-07 blocker)",
"ac_level_blockers": {
"AT-3.1-07": "no barrier/counter observation seam for mixed-era concurrency",
"AT-3.1-08": "no public registration/eligibility seam (catalog.rs exposes only PublishedToolCatalog::new and CatalogKey)"
}
},
"cases": [
{"id": "wm-01", "binding_row": 1, "era": "modern", "shape": "meta_version_equals_header", "expected_status": 200, "expected_identity": "2026-07-28", "test": "at_3_1_04_modern_discover_is_served_without_a_session"},
{"id": "wm-02", "binding_row": 2, "era": "modern", "shape": "meta_version_differs_from_header", "expected_status": 400, "expected_error": "HeaderMismatch", "test": "at_3_1_06_header_body_version_mismatch_is_rejected"},
{"id": "wm-03", "binding_row": 3, "era": "modern", "shape": "modern_header_without_meta", "expected_status": 400, "test": "at_3_1_06_modern_header_without_required_meta_is_rejected"},
{"id": "wm-04", "binding_row": 4, "era": "modern", "shape": "meta_without_required_client_capabilities", "expected_status": 400, "test": "at_3_1_06_modern_request_without_required_metadata_is_rejected"},
{"id": "wm-05", "binding_row": 7, "era": "modern", "shape": "unknown_revision_same_in_header_and_meta", "expected_status": 400, "expected_error": "UnsupportedProtocolVersion", "test": "at_3_1_06_unsupported_version_yields_structured_error"},
{"id": "wm-06", "binding_row": 9, "era": "legacy", "shape": "initialize_2025_11_25", "expected_status": 200, "expected_identity": "2025-11-25", "test": "at_3_1_05_legacy_initialize_and_tools_list_stay_green"},
{"id": "wm-07", "binding_row": 10, "era": "legacy", "shape": "subsequent_live_session_no_version_header", "expected_status": 200, "expected_identity": "2025-11-25", "test": "at_3_1_11_subsequent_request_without_version_header_keeps_session_revision"},
{"id": "wm-08", "binding_row": 11, "era": "legacy", "shape": "subsequent_missing_session_header", "expected_status": 400, "test": "at_3_1_11_subsequent_request_without_session_header_is_rejected"},
{"id": "wm-09", "binding_row": 12, "era": "legacy", "shape": "subsequent_terminated_session", "expected_status": 404, "test": "at_3_1_11_terminated_session_is_rejected_with_not_found"},
{"id": "wm-10", "binding_row": 15, "era": "legacy", "shape": "withdrawn_revision_2025_03_26_initialize", "expected_status": 400, "test": "at_3_1_02_withdrawn_2025_03_26_initialize_is_rejected"},
{"id": "wm-11", "binding_row": 15, "era": "legacy", "shape": "withdrawn_revision_2025_06_18_initialize", "expected_status": 400, "test": "at_3_1_02_withdrawn_2025_06_18_initialize_is_rejected"},
{"id": "wm-12", "binding_row": 14, "era": "legacy", "shape": "legacy_initialize_unknown_revision", "expected": "no_session_and_no_withdrawn_identity", "status_not_pinned": true, "test": "at_3_1_06_legacy_initialize_unknown_revision_is_rejected", "note": "the pinned legacy prose does not pin an HTTP status for an unsupported body version on initialize, so this case asserts only that no session is minted, no success result is returned and the withdrawn revision is never echoed as the served identity"},
{"id": "wm-13", "binding_row": 16, "era": "legacy", "shape": "no_version_header_and_no_session_identity", "expected_status": 400, "test": "at_3_1_06_request_without_any_identity_is_rejected"},
{"id": "wm-14", "binding_row": 19, "era": "legacy", "shape": "legacy_termination_lifecycle", "expected_status": 404, "test": "at_3_1_11_terminated_session_is_rejected_with_not_found"}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"oracle": "mcp-withdrawn-revisions",
"decision": "owner-approved 2026-10-11",
"note": "Baseline code still contains these revisions; they are outside the promise and must be rejected at the endpoint. Physical removal of unreachable branches is optional (separate agreed change with a release/migration note).",
"withdrawn": [
{
"revision": "2025-06-18",
"must_be_advertised": false,
"expected_endpoint_outcome": "safe structured rejection without implicit fallback"
},
{
"revision": "2025-03-26",
"must_be_advertised": false,
"expected_endpoint_outcome": "safe structured rejection without implicit fallback",
"note": "the pinned legacy prose lets a server assume 2025-03-26 when there is no other way to identify the version; the approved window withdraws that assumption"
}
]
}
@@ -0,0 +1,345 @@
"""Story 3.1 ATDD (red phase): the per-era advertised-capabilities projection artifact (AT-13).
Oracle contract declared by this stage (the implementation stage owns the internals):
scripts/project-advertised-capabilities.py
--inventory <path> --revision <2026-07-28|2025-11-25>
--frozen <path> --provenance <path>
The script reads ONLY the canonical inventory (`protocol` block), applies the server-only projection
rules 1-4 of the accepted spec section 5, and writes
* `--frozen` the canonical capabilities payload: one JSON object, UTF-8, compact (`:`/`,`),
object keys sorted byte-lexicographically, no trailing newline;
* `--provenance` a sidecar with `inventory_sha256`, the projection `rule` id and the participating
identity triples. The sidecar is audit-only and is never byte-compared with the
endpoint.
It must never call the MCP server, must never import the registry and must never read a captured
server response: the expectation is derived from the reviewed inventory alone.
Why these tests are guarded: the executable does not exist on this revision, so a missing executable
is an honest ARTIFACT gap (`skip`), NOT a behavioural red and NOT a pass. The moment the script
lands, the same assertions run unchanged - that is the point of writing them now.
"""
from __future__ import annotations
import copy
import hashlib
import json
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
SCRIPT = ROOT / "scripts" / "project-advertised-capabilities.py"
FIXTURES = ROOT / "tests" / "fixtures" / "mcp-revisions"
CANDIDATE = FIXTURES / "inventory-reviewed-v2-candidate.json"
MODERN = "2026-07-28"
LEGACY = "2025-11-25"
# The reviewed v2 candidate is a frozen Story 3.1 input: its Prompt capability is still deferred, so
# its own projection stays `resources`+`tools`.
EXPECTED_FROZEN = (
b'{"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}}'
)
EXPECTED_SHA256 = "e38c795fc28fee74168cb045427df55d882f8f7ace206af5c9a3ca4df5892c9a"
# The canonical inventory also implements the logging surface (Story 3.18, FR-19), so the committed
# oracle and the canonical projection carry `logging` next to `completions`/`prompts`/`resources`/`tools`.
COMMITTED_FROZEN = (
b'{"completions":{},"logging":{},"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}}'
)
COMMITTED_SHA256 = "f806e750402d418b8a3784eff200338cd8fd91b69c2f99e9d564cb08217b84d2"
class AdvertisedCapabilitiesProjectionTests(unittest.TestCase):
def setUp(self) -> None:
if not SCRIPT.is_file():
self.skipTest(
"artifact gap, not a behavioural red: scripts/project-advertised-capabilities.py is "
"created by the implementation stage (BUILD); the assertions below are ready and run "
"unchanged once the executable exists"
)
self._temporary_directory = tempfile.TemporaryDirectory()
self.root = Path(self._temporary_directory.name)
self.addCleanup(self._temporary_directory.cleanup)
def load_candidate(self) -> dict:
return json.loads(CANDIDATE.read_text(encoding="utf-8"))
def project(self, inventory: dict, revision: str, stem: str) -> subprocess.CompletedProcess[str]:
inventory_path = self.root / f"{stem}.inventory.json"
inventory_path.write_text(json.dumps(inventory), encoding="utf-8")
return subprocess.run(
[
sys.executable,
str(SCRIPT),
"--inventory",
str(inventory_path),
"--revision",
revision,
"--frozen",
str(self.root / f"{stem}.frozen.json"),
"--provenance",
str(self.root / f"{stem}.provenance.json"),
],
check=False,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=str(ROOT),
)
def frozen(self, stem: str) -> Path:
return self.root / f"{stem}.frozen.json"
def test_positive_projection_equals_the_committed_frozen_oracle_for_both_eras(self) -> None:
candidate = self.load_candidate()
for revision in (MODERN, LEGACY):
with self.subTest(revision=revision):
result = self.project(candidate, revision, f"positive-{revision}")
combined = result.stdout + result.stderr
self.assertEqual(result.returncode, 0, combined)
produced = self.frozen(f"positive-{revision}").read_bytes()
self.assertEqual(produced, EXPECTED_FROZEN)
# The committed oracle is projected from the canonical inventory, which now also
# implements the Prompt vertical (Story 3.14); the reviewed v2 candidate is a frozen
# Story 3.1 input and is intentionally no longer byte-equal to it. The canonical
# inventory -> committed oracle equality is pinned by
# `test_r10_canonical_inventory_projects_to_the_committed_oracle_and_binds_its_digest`.
provenance = json.loads(
(self.root / f"positive-{revision}.provenance.json").read_text(encoding="utf-8")
)
self.assertTrue(provenance["rule"])
self.assertTrue(provenance["inventory_sha256"])
self.assertEqual(
sorted(
(item["role"], item["kind"], item["surface"])
for item in provenance["projection_inputs"]
),
[("server", "capability", "resources"), ("server", "capability", "tools")],
)
def test_client_role_capability_is_never_projected(self) -> None:
candidate = self.load_candidate()
for entry in candidate["protocol"]["capabilities"]:
if entry["surface"] == "elicitation" and entry["role"] == "client":
entry["status"] = "supported"
entry["advertised"] = {"elicitation": {"form": {}}}
for revision in (MODERN, LEGACY):
with self.subTest(revision=revision):
result = self.project(candidate, revision, f"client-role-{revision}")
combined = result.stdout + result.stderr
self.assertEqual(result.returncode, 0, combined)
self.assertEqual(self.frozen(f"client-role-{revision}").read_bytes(), EXPECTED_FROZEN)
def test_per_revision_override_changes_only_that_revision(self) -> None:
candidate = self.load_candidate()
for entry in candidate["protocol"]["capabilities"]:
if entry["surface"] == "tools" and entry["role"] == "server":
entry.setdefault("per_revision", {})[MODERN] = {"status": "deferred",
"reason": "modern projection is empty"}
modern = self.project(candidate, MODERN, "override-modern")
self.assertEqual(modern.returncode, 0, modern.stdout + modern.stderr)
self.assertEqual(
self.frozen("override-modern").read_bytes(),
b'{"resources":{"listChanged":false,"subscribe":false}}',
"deferring tools for the modern era leaves the modern resources capability in place",
)
legacy = self.project(candidate, LEGACY, "override-legacy")
self.assertEqual(legacy.returncode, 0, legacy.stdout + legacy.stderr)
self.assertEqual(self.frozen("override-legacy").read_bytes(), EXPECTED_FROZEN)
def test_conflicting_top_level_advertised_keys_are_rejected(self) -> None:
candidate = self.load_candidate()
conflicting = copy.deepcopy(candidate["protocol"]["capabilities"][0])
conflicting.update(
{
"surface": "logging",
"kind": "capability",
"role": "server",
"status": "supported",
"advertised": {"tools": {"listChanged": True}},
}
)
candidate["protocol"]["capabilities"].append(conflicting)
result = self.project(candidate, MODERN, "conflict")
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertFalse(self.frozen("conflict").exists())
def test_advertised_leaf_not_declared_by_subfeatures_is_rejected(self) -> None:
candidate = self.load_candidate()
for entry in candidate["protocol"]["capabilities"]:
if entry["surface"] == "tools" and entry["role"] == "server":
entry["advertised"] = {"tools": {"listChanged": False, "unexpected": True}}
result = self.project(candidate, MODERN, "undeclared-subfeature")
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertFalse(self.frozen("undeclared-subfeature").exists())
def test_supported_server_capability_without_advertised_is_rejected(self) -> None:
candidate = self.load_candidate()
for entry in candidate["protocol"]["capabilities"]:
if entry["surface"] == "tools" and entry["role"] == "server":
entry["advertised"] = None
result = self.project(candidate, MODERN, "missing-advertised")
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertFalse(self.frozen("missing-advertised").exists())
# --- Story 3.1 #8 remaining-foundation regressions (R3 producer side, R10 canonical chain) -----
# The validator (Gate A) and the producer must reject the same malformed advertisement shape
# independently: a scalar fragment and a top-level key that does not belong to the declaring
# surface both produce a `capabilities` object that is not the reviewed projection.
def test_r3_scalar_advertised_fragment_is_rejected_by_the_producer(self) -> None:
candidate = self.load_candidate()
for entry in candidate["protocol"]["capabilities"]:
if entry["surface"] == "tools" and entry["role"] == "server":
entry["advertised"] = {"tools": True}
result = self.project(candidate, MODERN, "r3-scalar-fragment")
self.assertNotEqual(
result.returncode,
0,
"a scalar advertisement fragment cannot be a canonical capabilities object: "
+ result.stdout
+ result.stderr,
)
self.assertFalse(self.frozen("r3-scalar-fragment").exists())
def test_r3_foreign_top_level_advertised_key_is_rejected_by_the_producer(self) -> None:
candidate = self.load_candidate()
for entry in candidate["protocol"]["capabilities"]:
if entry["surface"] == "tools" and entry["role"] == "server":
entry["advertised"] = {"prompts": {"listChanged": False}}
result = self.project(candidate, MODERN, "r3-foreign-key")
self.assertNotEqual(
result.returncode,
0,
"an advertised top-level key that does not belong to the declaring surface must be "
"rejected: " + result.stdout + result.stderr,
)
self.assertFalse(self.frozen("r3-foreign-key").exists())
def test_r10_canonical_inventory_projects_to_the_committed_oracle_and_binds_its_digest(self) -> None:
"""The reproducible chain: canonical inventory -> projection -> committed frozen bytes.
The producer is run on the real canonical artifact (`docs/capability-inventory.json`), so the
frozen bytes and the sidecar digest are derived from the canonical source rather than from a
fixture. The committed sidecar itself is pinned by
`test_story31_foundation_boundaries.py` (it must record the canonical digest).
"""
canonical = ROOT / "docs" / "capability-inventory.json"
self.assertTrue(canonical.is_file(), "the canonical inventory must exist")
canonical_digest = hashlib.sha256(canonical.read_bytes()).hexdigest()
for revision in (MODERN, LEGACY):
with self.subTest(revision=revision):
inventory_path = self.root / f"canonical-{revision}.inventory.json"
inventory_path.write_bytes(canonical.read_bytes())
result = subprocess.run(
[
sys.executable,
str(SCRIPT),
"--inventory",
str(inventory_path),
"--revision",
revision,
"--frozen",
str(self.root / f"canonical-{revision}.frozen.json"),
"--provenance",
str(self.root / f"canonical-{revision}.provenance.json"),
],
check=False,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=str(ROOT),
)
combined = result.stdout + result.stderr
self.assertEqual(result.returncode, 0, combined)
produced = (self.root / f"canonical-{revision}.frozen.json").read_bytes()
committed = (FIXTURES / f"{revision}-advertised-capabilities.frozen.json").read_bytes()
self.assertEqual(
produced,
committed,
"the canonical inventory must project to the committed frozen oracle",
)
provenance = json.loads(
(self.root / f"canonical-{revision}.provenance.json").read_text(encoding="utf-8")
)
self.assertEqual(
provenance["inventory_sha256"],
canonical_digest,
"the producer must record the digest of the inventory it actually read",
)
self.assertEqual(
sorted(
(item["role"], item["kind"], item["surface"])
for item in provenance["projection_inputs"]
),
[
("server", "capability", "completions"),
("server", "capability", "logging"),
("server", "capability", "prompts"),
("server", "capability", "resources"),
("server", "capability", "tools"),
],
)
class CommittedFrozenOracleTests(unittest.TestCase):
"""The committed per-era oracle artifacts themselves (runs without the future executable)."""
def test_committed_frozen_oracle_is_canonical_and_matches_its_sidecar(self) -> None:
for revision in (MODERN, LEGACY):
with self.subTest(revision=revision):
frozen = FIXTURES / f"{revision}-advertised-capabilities.frozen.json"
payload = frozen.read_bytes()
self.assertEqual(
payload, COMMITTED_FROZEN
)
self.assertEqual(hashlib.sha256(payload).hexdigest(), COMMITTED_SHA256)
self.assertEqual(
json.dumps(json.loads(payload), sort_keys=True, separators=(",", ":")).encode("utf-8"),
payload,
"the frozen payload must already be in canonical form",
)
sidecar = json.loads(
(FIXTURES / f"{revision}-advertised-capabilities.provenance.json").read_text(
encoding="utf-8"
)
)
self.assertTrue(sidecar["inventory_sha256"])
self.assertTrue(sidecar["rule"])
self.assertEqual(
sorted(
(item["role"], item["kind"], item["surface"])
for item in sidecar["projection_inputs"]
),
[
("server", "capability", "completions"),
("server", "capability", "logging"),
("server", "capability", "prompts"),
("server", "capability", "resources"),
("server", "capability", "tools"),
],
"the sidecar must name the exact full projection input set, in any order",
)
if __name__ == "__main__":
unittest.main()
File diff suppressed because it is too large. Load diff
@@ -8,6 +8,7 @@ import sys
import tempfile
import unittest
from pathlib import Path
from typing import Any
ROOT = Path(__file__).resolve().parents[2]
@@ -23,6 +24,7 @@ JUSTFILE = ROOT / "justfile"
CI_WORKFLOW = ROOT / ".gitea" / "workflows" / "ci.yml"
RELEASE_WORKFLOW = ROOT / ".gitea" / "workflows" / "release.yml"
REQUIRED_SURFACES = ROOT / "docs" / "capability-baseline" / "required-surfaces.json"
MCP_REVISION_FIXTURES = ROOT / "tests" / "fixtures" / "mcp-revisions"
def load_validator_module():
@@ -106,6 +108,7 @@ class CapabilityInventoryValidatorTests(unittest.TestCase):
self,
required_frs: list[str],
install_schema: bool = True,
mode: str | None = None,
) -> subprocess.CompletedProcess[str]:
if install_schema:
self.install_canonical_schema()
@@ -121,6 +124,8 @@ class CapabilityInventoryValidatorTests(unittest.TestCase):
]
for requirement in required_frs:
command.extend(["--required-fr", requirement])
if mode is not None:
command.extend(["--mode", mode])
return subprocess.run(
command,
check=False,
@@ -838,5 +843,744 @@ class CapabilityInventoryValidatorTests(unittest.TestCase):
self.assertLess(release.index("Check Community scope"), release.index("Build release binaries"))
# --- Story 3.1 ATDD (red): the approved two-revision MCP window -------------------------------
# Oracle: tests/fixtures/mcp-revisions/* (owner-approved 2026-10-11 contract, source-backed, not a
# snapshot of current output). Behaviour is observed on the real validator
# (scripts/validate-capability-inventory.py) and the real schema copy.
# The protocol vocabulary here (supported/not_applicable/experimental/deferred) is deliberately
# separate from the unchanged flow vocabulary (implemented/planned/gap/blocked).
PROTOCOL_STATUSES = {"supported", "not_applicable", "experimental", "deferred"}
def load_revision_fixture(self, name: str) -> dict[str, object]:
return json.loads((MCP_REVISION_FIXTURES / name).read_text(encoding="utf-8"))
def write_revision_inventory(self, name: str) -> tuple[dict[str, object], dict[str, object]]:
payload = self.load_revision_fixture(name)
expected = payload.pop("expected", {})
for flow in payload.get("flows", []): # type: ignore[union-attr]
for kind in ("automated", "manual"):
for relative in flow.get("evidence", {}).get(kind, []):
self.write_evidence(relative)
self.inventory_path.write_text(
json.dumps(payload, indent=2, sort_keys=True) + "\n",
encoding="utf-8",
)
return payload, expected # type: ignore[return-value]
def required_surfaces(self) -> set[str]:
oracle = self.load_revision_fixture("source-backed-capabilities.json")
return {
item["surface"]
for item in oracle["items"] # type: ignore[index]
if item["role"] == "server"
}
def test_at_3_1_01_full_reviewed_candidate_passes_the_validity_gate(self) -> None:
"""Target oracle: the FULL reviewed candidate is an accepted v2 inventory (Gate A, exit 0).
This is a genuine behavioural RED on the current revision: the validator has no v2 `protocol`
block, so it answers `schema_version 1 is required` / `UNKNOWN_FIELD`. The assertions below
describe the agreed target behaviour and are deliberately NOT relaxed to the current one.
"""
self.write_candidate_inventory()
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertEqual(
result.returncode,
0,
"the complete reviewed v2 candidate must pass the validity gate, observed: " + combined,
)
# The agreed validity output is the existing one-line summary plus the protocol counts.
self.assertIn("Capability inventory validation passed", combined)
self.assertRegex(combined, r"\bprotocol_items=50\b")
self.assertRegex(combined, r"\brevisions=2\b")
def test_at_3_1_01_scoped_pre_atdd_candidate_stays_a_scoped_input(self) -> None:
"""Preserved pre-ATDD input: the scoped window candidate is NOT promoted to full validity.
Pure oracle-input provenance - no validator run, so this is not labelled validator GREEN. The
file keeps its own recorded verdict (`counts_as_exhaustive: false`, completeness BLOCKED) and
stays byte-identical (checked by the ATDD snapshot verifier); the reviewed candidate above is
the completeness basis.
"""
payload, expected = self.write_revision_inventory("inventory-two-revision-window.json")
protocol: Any = payload["protocol"]
cells = protocol["capabilities"]
self.assertEqual(payload["schema_version"], 2)
self.assertEqual(
[entry["revision"] for entry in protocol["revisions"]],
["2026-07-28", "2025-11-25"],
)
self.assertEqual(
set(entry["revision"] for entry in protocol["revisions"])
& set(protocol["withdrawn"]),
set(),
)
self.assertIn("scope_note", payload)
self.assertEqual(expected["gate"], "validity-shape")
self.assertEqual(expected["verdict"], "scoped-candidate-not-full-validity")
self.assertEqual(expected["completeness"], "blocked-scoped-subset")
self.assertEqual({cell["surface"] for cell in cells}, self.required_surfaces())
def test_at_3_1_01_third_revision_outside_the_approved_window_is_rejected_by_name(self) -> None:
"""Bounded one-factor mutation OF THE REVIEWED CANDIDATE: one extra ledger revision entry."""
payload = self.write_candidate_inventory("inventory-mutation-third-revision.json")
revisions = [entry["revision"] for entry in payload["protocol"]["revisions"]] # type: ignore[index]
self.assertEqual(revisions[:2], ["2026-07-28", "2025-11-25"])
self.assertEqual(revisions[2:], ["2025-03-26"], "only one revision entry may be added")
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertIn("2025-03-26", combined)
def test_at_3_1_03_reviewed_candidate_omission_is_rejected_by_the_triple(self) -> None:
"""Bounded one-factor mutation OF THE REVIEWED CANDIDATE: exactly one reviewed row dropped."""
payload = self.write_candidate_inventory("inventory-mutation-omission.json")
observed = {
(cell["role"], cell["kind"], cell["surface"])
for cell in payload["protocol"]["capabilities"] # type: ignore[index]
}
self.assertEqual(len(observed), 49, "only one reviewed identity may be dropped")
self.assertNotIn(("client", "method", "prompts/get"), observed)
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
lines = [line for line in combined.splitlines() if "OMISSION" in line]
self.assertTrue(
any("prompts/get" in line for line in lines),
f"the omitted triple must be printed by name: {combined}",
)
self.assertTrue(
any("client" in line and "method" in line for line in lines),
f"the full (role, kind, surface) triple must be printed: {combined}",
)
def test_at_3_1_03_undocumented_surface_is_rejected_by_the_triple(self) -> None:
"""Bounded one-factor mutation OF THE REVIEWED CANDIDATE: one extra undocumented triple."""
payload = self.write_candidate_inventory("inventory-mutation-undocumented-surface.json")
observed = {
(cell["role"], cell["kind"], cell["surface"])
for cell in payload["protocol"]["capabilities"] # type: ignore[index]
}
self.assertEqual(len(observed), 51, "only one extra identity may be added")
self.assertIn(("server", "method", "resources/read"), observed)
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
lines = [line for line in combined.splitlines() if "UNDOCUMENTED_SURFACE" in line]
self.assertTrue(
any("resources/read" in line for line in lines),
f"the undocumented triple must be printed by name: {combined}",
)
self.assertTrue(
any("server" in line and "method" in line for line in lines),
f"the full (role, kind, surface) triple must be printed: {combined}",
)
def test_at_3_1_01_revision_missing_only_the_digest_is_rejected_by_that_field(self) -> None:
"""One-factor provenance negative: only `provenance.sha256` of the modern revision is gone."""
payload = self.write_candidate_inventory("inventory-mutation-missing-digest.json")
modern = next(
entry
for entry in payload["protocol"]["revisions"] # type: ignore[index]
if entry["revision"] == "2026-07-28"
)
self.assertEqual(sorted(modern["provenance"]), ["captured_on", "locator"])
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
diagnostics = [line for line in combined.splitlines() if line.startswith("error[")]
digest_lines = [line for line in diagnostics if "sha256" in line]
self.assertTrue(
any("2026-07-28" in line for line in digest_lines),
f"the missing digest must be reported for the revision that lost it: {combined}",
)
self.assertFalse(
any("captured_on" in line for line in diagnostics),
f"the date is still present and must not be reported missing: {combined}",
)
def test_at_3_1_01_revision_missing_only_the_date_is_rejected_by_that_field(self) -> None:
"""One-factor provenance negative: only `provenance.captured_on` of the modern revision is gone."""
payload = self.write_candidate_inventory("inventory-mutation-missing-date.json")
modern = next(
entry
for entry in payload["protocol"]["revisions"] # type: ignore[index]
if entry["revision"] == "2026-07-28"
)
self.assertEqual(sorted(modern["provenance"]), ["locator", "sha256"])
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
diagnostics = [line for line in combined.splitlines() if line.startswith("error[")]
date_lines = [line for line in diagnostics if "captured_on" in line]
self.assertTrue(
any("2026-07-28" in line for line in date_lines),
f"the missing capture date must be reported for the revision that lost it: {combined}",
)
self.assertFalse(
any("sha256" in line for line in diagnostics),
f"the digest is still present and must not be reported missing: {combined}",
)
def test_at_3_1_03_ordered_validity_first_gate_table_is_exercised_when_mode_exists(self) -> None:
"""The agreed validity-first gate table (A0 / B3 / B0 / invalid1) on the real CLI.
While the CLI exposes no `--mode`, this stays an honest interface gap (skip, never a
synthetic red). As soon as `--mode` exists the same test body exercises every agreed row, so
a wrong Gate A/B implementation fails here instead of being skipped.
"""
probe = subprocess.run(
[sys.executable, str(VALIDATOR), "--help"],
check=False,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
help_text = probe.stdout + probe.stderr
self.assertEqual(probe.returncode, 0, help_text)
if "--mode" not in help_text:
self.skipTest(
"interface gap, not a behavioural red: the validator CLI exposes no --mode yet, so "
"the ordered validity/feature-complete gate table cannot be exercised on this "
"revision"
)
self.install_canonical_schema()
# invalid1 - structurally invalid input: `invalid` in BOTH modes, step-0 diagnostics, and no
# feature-complete evaluation at all (accepted spec `remaining-ac-spec.md:392`).
self.inventory_path.write_text("{not-json", encoding="utf-8")
for mode in ("validity", "feature-complete"):
with self.subTest(row="structural-invalid", mode=mode):
result = self.run_validator(["FR-13"], install_schema=False, mode=mode)
combined = result.stdout + result.stderr
self.assertEqual(result.returncode, 1, combined)
self.assertIn("status=invalid", combined)
self.assertIn("error[", combined)
self.assertNotIn("status=blocked", combined)
self.assertNotIn("status=complete", combined)
self.assertNotRegex(combined, r"blockers=[1-9]")
# invalid1 - semantic validity diagnostics (only the modern `provenance.sha256` is gone):
# `invalid` in BOTH modes, the targeted missing-digest diagnostic, no feature-complete output
# (accepted spec `remaining-ac-spec.md:393`).
self.write_candidate_inventory("inventory-mutation-missing-digest.json")
for mode in ("validity", "feature-complete"):
with self.subTest(row="semantic-invalid", mode=mode):
result = self.run_validator(["FR-13"], mode=mode)
combined = result.stdout + result.stderr
self.assertEqual(result.returncode, 1, combined)
self.assertIn("status=invalid", combined)
diagnostics = [line for line in combined.splitlines() if line.startswith("error[")]
self.assertTrue(
any("2026-07-28" in line and "sha256" in line for line in diagnostics),
f"the missing digest must be named for the revision that lost it: {combined}",
)
self.assertNotIn("status=blocked", combined)
self.assertNotIn("status=complete", combined)
self.assertNotRegex(combined, r"blockers=[1-9]")
# invalid1 - the rejected false-not-applicable variant: applicable scheduled work renamed to
# `not_applicable` must stay `invalid` in BOTH modes, never `complete` with 0 blockers.
self.write_candidate_inventory("inventory-mutation-false-not-applicable.json")
for mode in ("validity", "feature-complete"):
with self.subTest(row="false-not-applicable", mode=mode):
result = self.run_validator(["FR-13"], mode=mode)
combined = result.stdout + result.stderr
self.assertEqual(result.returncode, 1, combined)
self.assertIn("status=invalid", combined)
self.assertNotIn("status=blocked", combined)
self.assertNotIn("status=complete", combined)
self.assertNotRegex(combined, r"blockers=[1-9]")
# A0 / B3 - a truthful candidate passes validity and is blocked by the feature gate.
self.write_candidate_inventory()
validity = self.run_validator(["FR-13"], mode="validity")
self.assertEqual(validity.returncode, 0, validity.stdout + validity.stderr)
self.assertIn("Capability inventory validation passed", validity.stdout + validity.stderr)
feature_complete = self.run_validator(["FR-13"], mode="feature-complete")
self.assertEqual(
feature_complete.returncode,
3,
feature_complete.stdout + feature_complete.stderr,
)
self.assertIn("status=blocked", feature_complete.stdout + feature_complete.stderr)
self.assertRegex(
feature_complete.stdout + feature_complete.stderr,
r"blockers=[1-9][0-9]*",
)
# B0 - the explicitly SYNTHETIC no-blocker input (hypothetical completed state, marked with
# its own owner) is complete in the feature gate.
self.write_candidate_inventory("inventory-synthetic-no-blocker.json")
validity = self.run_validator(["FR-13"], mode="validity")
self.assertEqual(validity.returncode, 0, validity.stdout + validity.stderr)
self.assertIn("Capability inventory validation passed", validity.stdout + validity.stderr)
feature_complete = self.run_validator(["FR-13"], mode="feature-complete")
self.assertEqual(
feature_complete.returncode,
0,
feature_complete.stdout + feature_complete.stderr,
)
self.assertIn("status=complete", feature_complete.stdout + feature_complete.stderr)
self.assertRegex(
feature_complete.stdout + feature_complete.stderr,
r"blockers=0\b",
)
# --- Story 3.1 remaining-foundation ATDD additions ------------------------------------------
# Oracle inputs: the reviewed v2 candidate (`inventory-reviewed-v2-candidate.json`), its bounded
# one-factor mutations, and the independent per-era frozen projections. The reviewed identity is
# the triple `(role, kind, surface)`; `role` is one enum {server, client, both} with a
# kind-specific meaning (declarer for capability/extension, sender for method/notification).
# The target validator behaviour (v2 protocol block, Gate A/B split, named diagnostics) does not
# exist on this revision, so the assertions below are the contract the implementation stage must
# satisfy. Anything that can only fail because a CLI flag or a module is absent is recorded as an
# honest API gap, never as a behavioural red and never as a pass.
REVIEWED_IDENTITY_TRIPLES = {
# server capabilities (surface-inventory.md section 3)
("server", "capability", "experimental"),
("server", "capability", "logging"),
("server", "capability", "completions"),
("server", "capability", "prompts"),
("server", "capability", "resources"),
("server", "capability", "tools"),
("server", "capability", "extensions"),
("server", "capability", "tasks"),
# client capabilities (section 4)
("client", "capability", "experimental"),
("client", "capability", "roots"),
("client", "capability", "sampling"),
("client", "capability", "elicitation"),
("client", "capability", "extensions"),
("client", "capability", "tasks"),
# methods (section 5); role = the sending party
("client", "method", "tools/list"),
("client", "method", "tools/call"),
("client", "method", "resources/list"),
("client", "method", "resources/read"),
("client", "method", "resources/templates/list"),
("client", "method", "resources/subscribe"),
("client", "method", "resources/unsubscribe"),
("client", "method", "prompts/list"),
("client", "method", "prompts/get"),
("client", "method", "completion/complete"),
("client", "method", "logging/setLevel"),
("client", "method", "initialize"),
("both", "method", "ping"),
("client", "method", "server/discover"),
("client", "method", "subscriptions/listen"),
("server", "method", "roots/list"),
("server", "method", "sampling/createMessage"),
("server", "method", "elicitation/create"),
("both", "method", "tasks/get"),
("both", "method", "tasks/list"),
("both", "method", "tasks/result"),
("both", "method", "tasks/cancel"),
# notifications (section 6)
("server", "notification", "notifications/tools/list_changed"),
("server", "notification", "notifications/resources/list_changed"),
("server", "notification", "notifications/prompts/list_changed"),
("server", "notification", "notifications/resources/updated"),
("server", "notification", "notifications/progress"),
("server", "notification", "notifications/message"),
("server", "notification", "notifications/subscriptions/acknowledged"),
("both", "notification", "notifications/cancelled"),
("client", "notification", "notifications/initialized"),
("client", "notification", "notifications/roots/list_changed"),
("both", "notification", "notifications/tasks/status"),
("server", "notification", "notifications/elicitation/complete"),
# extensions (section 7)
("server", "extension", "io.modelcontextprotocol/tasks"),
("client", "extension", "io.modelcontextprotocol/oauth-client-credentials"),
}
REVIEWED_ROLES = {"server", "client", "both"}
REVIEWED_KINDS = {"capability", "method", "notification", "extension"}
REVIEWED_STATUSES = {"supported", "not_applicable", "experimental", "deferred"}
# Independent per-era ABSENCE oracle, read off the "absent" cells of the reviewed tables in
# `build/remaining-ac-spec/surface-inventory.md` sections 3-7 (deliberately NOT taken from the
# fixture). Rule O2 resolves an era in two steps (`remaining-ac-spec.md:296-300`): a surface whose
# `revisions[]` does not contain the era is ABSENT for that era - never `not_applicable` - and only
# then is the shallow `per_revision[era]` merge applied. Applicable per-era completeness is
# therefore `REVIEWED_IDENTITY_TRIPLES - REVIEWED_ABSENT_<era>`, not the 50-identity default union.
REVIEWED_ABSENT_MODERN = {
# sections 3/4: modern expresses Tasks as an extension, so the server `tasks` capability is
# absent, and the client `tasks` declaration does not exist in modern either
("server", "capability", "tasks"),
("client", "capability", "tasks"),
# section 5: method literals absent from the pinned modern schema
("client", "method", "resources/subscribe"),
("client", "method", "resources/unsubscribe"),
("client", "method", "logging/setLevel"),
("client", "method", "initialize"),
("both", "method", "ping"),
("both", "method", "tasks/get"),
("both", "method", "tasks/list"),
("both", "method", "tasks/result"),
("both", "method", "tasks/cancel"),
# section 6: notifications absent from the pinned modern schema
("client", "notification", "notifications/initialized"),
("client", "notification", "notifications/roots/list_changed"),
("both", "notification", "notifications/tasks/status"),
("server", "notification", "notifications/elicitation/complete"),
}
REVIEWED_ABSENT_LEGACY = {
# sections 3/4: neither legacy `ServerCapabilities` nor legacy `ClientCapabilities` has an
# `extensions` key
("server", "capability", "extensions"),
("client", "capability", "extensions"),
# sections 5/6: modern-only method literals and the subscription acknowledgement
("client", "method", "server/discover"),
("client", "method", "subscriptions/listen"),
("server", "notification", "notifications/subscriptions/acknowledged"),
# section 7: both extension identifiers are declared in the modern schema only
("server", "extension", "io.modelcontextprotocol/tasks"),
("client", "extension", "io.modelcontextprotocol/oauth-client-credentials"),
}
def load_candidate_fixture(self, name: str = "inventory-reviewed-v2-candidate.json") -> dict[str, object]:
return self.load_revision_fixture(name)
def write_candidate_inventory(self, name: str = "inventory-reviewed-v2-candidate.json") -> dict[str, object]:
"""Install a reviewed candidate/mutation fixture as the validator input."""
payload = self.load_candidate_fixture(name)
for flow in payload.get("flows", []): # type: ignore[union-attr]
for kind in ("automated", "manual"):
for relative in flow.get("evidence", {}).get(kind, []):
self.write_evidence(relative)
self.inventory_path.write_text(
json.dumps(payload, indent=2, sort_keys=True) + "\n",
encoding="utf-8",
)
return payload
def effective_entry(self, entry: dict[str, object], revision: str) -> dict[str, object]:
merged = {key: value for key, value in entry.items() if key != "per_revision"}
overrides = entry.get("per_revision", {}).get(revision, {}) # type: ignore[union-attr]
merged.update(overrides)
return merged
def test_at_3_1_03_reviewed_candidate_is_identity_complete_and_metadata_stays_separate(self) -> None:
"""The reviewed completeness basis itself: one judged entry per reviewed row, no more, no less."""
payload = self.load_candidate_fixture()
protocol: Any = payload["protocol"]
self.assertEqual(payload["schema_version"], 2)
self.assertEqual(
[entry["revision"] for entry in protocol["revisions"]],
["2026-07-28", "2025-11-25"],
)
for entry in protocol["revisions"]:
provenance = entry["provenance"]
self.assertTrue(provenance["locator"] and provenance["sha256"] and provenance["captured_on"])
self.assertEqual(protocol["withdrawn"], ["2025-06-18", "2025-03-26"])
capabilities = protocol["capabilities"]
triples = [(cell["role"], cell["kind"], cell["surface"]) for cell in capabilities]
self.assertEqual(len(triples), len(set(triples)), "identity is the (role, kind, surface) triple")
self.assertEqual(set(triples), self.REVIEWED_IDENTITY_TRIPLES)
for cell in capabilities:
self.assertIn(cell["role"], self.REVIEWED_ROLES)
self.assertIn(cell["kind"], self.REVIEWED_KINDS)
self.assertIn(cell["status"], self.REVIEWED_STATUSES)
self.assertTrue(cell["owner"] and cell["fallback"] and cell["evidence_target"])
if cell["status"] == "supported":
self.assertNotIn("reason", cell)
else:
self.assertTrue(cell["reason"], cell)
# `io.modelcontextprotocol/related-task` is a non-advertisable `_meta` metadata note, not a
# capability extension: it must stay out of the four-kind ledger and out of the advertisement.
self.assertFalse(
any(
cell["surface"] == "io.modelcontextprotocol/related-task"
for cell in capabilities
),
"related-task must not be recorded as a capability/extension entry",
)
# Per-revision overrides are resolved with a shallow per-field merge (rule O2).
progress = next(
cell
for cell in capabilities
if cell["surface"] == "notifications/progress" and cell["kind"] == "notification"
)
self.assertEqual(self.effective_entry(progress, "2025-11-25")["role"], "both")
self.assertEqual(self.effective_entry(progress, "2026-07-28")["role"], "server")
roots = next(
cell
for cell in capabilities
if cell["surface"] == "roots" and cell["kind"] == "capability"
)
self.assertEqual(self.effective_entry(roots, "2026-07-28")["subfeatures"], [])
self.assertEqual(self.effective_entry(roots, "2025-11-25")["subfeatures"], ["listChanged"])
# A `both` row satisfies both sender sides but is never advertisable.
tools = next(cell for cell in capabilities if cell["surface"] == "tools" and cell["role"] == "server")
self.assertEqual(tools["status"], "supported")
self.assertEqual(tools["advertised"], {"tools": {"listChanged": False}})
for cell in capabilities:
resolved = [self.effective_entry(cell, revision) for revision in ("2026-07-28", "2025-11-25")]
for effective in resolved:
if effective["role"] != "server" or effective["kind"] not in {"capability", "extension"}:
self.assertIsNone(effective["advertised"], cell["surface"])
if effective["kind"] in {"method", "notification"}:
self.assertIsNone(effective["advertised"], cell["surface"])
def test_at_3_1_03_duplicate_surface_identity_is_rejected_by_the_triple(self) -> None:
self.write_candidate_inventory("inventory-mutation-duplicate-identity.json")
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertIn("DUPLICATE_SURFACE_IDENTITY", combined)
self.assertIn("experimental", combined)
def test_at_3_1_03_advertised_fragment_on_a_non_advertisable_role_is_rejected(self) -> None:
self.write_candidate_inventory("inventory-mutation-advertised-on-client-role.json")
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertIn("ADVERTISED_ON_NON_ADVERTISABLE", combined)
self.assertIn("elicitation", combined)
def test_at_3_1_03_supported_server_capability_must_carry_an_advertised_fragment(self) -> None:
self.write_candidate_inventory("inventory-mutation-supported-server-without-advertised.json")
result = self.run_validator(["FR-13"])
combined = result.stdout + result.stderr
self.assertNotEqual(result.returncode, 0, result.stdout)
self.assertIn("tools", combined)
self.assertIn("advertised", combined.lower())
def test_at_3_1_03_effective_per_era_identities_follow_eligibility_then_o2(self) -> None:
"""O2 coverage beyond the default 50 identities: effective per-era identity sets.
Rule O2 resolves an era in two steps (accepted spec `remaining-ac-spec.md:296-300`): a surface
whose `revisions[]` does not contain the era is ABSENT for that era - never `not_applicable` -
and only then is the shallow `per_revision[era]` merge applied. The expectations below are the
reviewed absence sets read off `surface-inventory.md` sections 3-7, not a copy of the fixture:
the applicable set of an era is `REVIEWED_IDENTITY_TRIPLES - REVIEWED_ABSENT_<era>` (35 modern,
43 legacy on this candidate). The 50-identity default union stays a separate ORACLE-INPUT and is
never reported as per-era completeness.
"""
payload = self.load_candidate_fixture()
protocol: Any = payload["protocol"]
capabilities: Any = protocol["capabilities"]
per_era: dict[str, list[tuple[Any, Any, Any]]] = {}
progress_reviewed_default = ("server", "notification", "notifications/progress")
# The one reviewed per-era identity substitution (surface-inventory.md section 2.1/6): the
# progress sender is `server` in the modern revision and `both` in the legacy revision.
reviewed_progress_per_era = {
"2026-07-28": ("server", "notification", "notifications/progress"),
"2025-11-25": ("both", "notification", "notifications/progress"),
}
for era, absent in (
("2026-07-28", self.REVIEWED_ABSENT_MODERN),
("2025-11-25", self.REVIEWED_ABSENT_LEGACY),
):
with self.subTest(era=era):
eligible = [cell for cell in capabilities if era in cell["revisions"]]
triples = [
(self.effective_entry(cell, era)["role"], cell["kind"], cell["surface"])
for cell in eligible
]
per_era[era] = triples
expected = (
self.REVIEWED_IDENTITY_TRIPLES
- absent
- {progress_reviewed_default}
) | {reviewed_progress_per_era[era]}
self.assertEqual(
len(triples),
len(set(triples)),
"an override must not create a duplicate EFFECTIVE identity",
)
self.assertEqual(
set(triples),
expected,
f"the applicable identities of {era} must match the reviewed tables",
)
self.assertEqual(
sorted(absent),
sorted(
(cell["role"], cell["kind"], cell["surface"])
for cell in capabilities
if era not in cell["revisions"]
),
"every explicitly absent reviewed identity must be ineligible in that era",
)
self.assertEqual(
set(triples) & absent,
set(),
"an absent identity can never be part of the applicable set",
)
self.assertEqual(len(per_era["2026-07-28"]), 35)
self.assertEqual(len(per_era["2025-11-25"]), 43)
for era, triples in per_era.items():
self.assertNotEqual(
set(triples),
self.REVIEWED_IDENTITY_TRIPLES,
f"the default 50-identity union is not the applicable set of {era}",
)
# The only identity that resolves to a different ROLE per era is the agreed progress override.
overridden = set()
for cell in capabilities:
if "2026-07-28" in cell["revisions"] and "2025-11-25" in cell["revisions"]:
roles = {
era: self.effective_entry(cell, era)["role"]
for era in ("2026-07-28", "2025-11-25")
}
if roles["2026-07-28"] != roles["2025-11-25"]:
overridden.add((cell["role"], cell["kind"], cell["surface"]))
self.assertEqual(
overridden,
{("server", "notification", "notifications/progress")},
"the agreed per-era role difference is exactly the progress sender override",
)
progress = next(
cell
for cell in capabilities
if cell["surface"] == "notifications/progress" and cell["kind"] == "notification"
)
self.assertEqual(progress["role"], "server")
self.assertEqual(progress["per_revision"]["2025-11-25"]["role"], "both")
self.assertEqual(self.effective_entry(progress, "2026-07-28")["role"], "server")
self.assertEqual(self.effective_entry(progress, "2025-11-25")["role"], "both")
# --- B0 / invalid1 inputs of the agreed Gate table (round-2 corrections) ----------------------
# Both are fixture oracles only: they inspect the input documents and never run the validator, so
# nothing here is called validator GREEN. The executable Gate rows live in the `--mode` table above
# and stay an honest interface gap until the CLI exposes `--mode`.
def test_at_3_1_03_synthetic_no_blocker_variant_is_a_hypothetical_completed_state(self) -> None:
"""`inventory-synthetic-no-blocker.json` (B0 row) is synthetic, never a status relabel.
Every `deferred` reviewed surface is resolved to the hypothetical completed state
(`supported`), never to `not_applicable`; advertisable server capability/extension rows carry
the exact `advertised` fragment their reviewed `subfeatures` declare; and every flipped row is
marked with the owner `atdd-synthetic-no-blocker-input`. The document therefore contains no
deferral at all - a no-blocker input under the agreed gate reading and under any stricter one.
"""
payload = self.load_candidate_fixture("inventory-synthetic-no-blocker.json")
protocol: Any = payload["protocol"]
capabilities: Any = protocol["capabilities"]
reviewed_payload: dict[str, Any] = self.load_candidate_fixture()
reviewed: Any = reviewed_payload["protocol"]["capabilities"]
reviewed_by_identity = {
(cell["role"], cell["kind"], cell["surface"]): cell for cell in reviewed
}
self.assertEqual(
[cell["surface"] for cell in capabilities if cell["status"] == "deferred"],
[],
"the no-blocker input must not defer any reviewed surface",
)
self.assertEqual(
sorted(cell["surface"] for cell in capabilities if cell["status"] == "not_applicable"),
sorted(cell["surface"] for cell in reviewed if cell["status"] == "not_applicable"),
"the reviewed `not_applicable` rows must stay exactly as reviewed",
)
flipped = 0
for cell in capabilities:
original = reviewed_by_identity[(cell["role"], cell["kind"], cell["surface"])]
if original["status"] != "deferred":
self.assertEqual(
cell,
original,
f"only deferred rows may differ from the reviewed candidate: {cell['surface']}",
)
continue
flipped += 1
self.assertEqual(cell["status"], "supported", cell["surface"])
self.assertNotIn("reason", cell, "a hypothetical `supported` row carries no reason")
self.assertEqual(cell["owner"], "atdd-synthetic-no-blocker-input", cell["surface"])
self.assertEqual(
sorted(cell),
sorted(set(original) - {"reason"}),
"a flipped row may only change status/reason/advertised/open_subfeatures",
)
self.assertEqual(flipped, 26, "every deferred reviewed row must be flipped")
for cell in capabilities:
if cell["owner"].startswith("atdd-synthetic") and cell["role"] == "server" and cell[
"kind"
] in {"capability", "extension"}:
self.assertIsNotNone(
cell["advertised"],
f"a supported server declaration must advertise: {cell['surface']}",
)
def test_at_3_1_03_false_not_applicable_input_keeps_the_planned_reasons(self) -> None:
"""`inventory-mutation-false-not-applicable.json` (invalid1 row) is the REJECTED predecessor.
It is the variant that renames every `deferred` status to `not_applicable` while keeping the
planned/deferred reasons, i.e. it claims that applicable, scheduled work is inapplicable. A
truthful validity gate must answer `invalid` in BOTH modes and never `complete` / 0 blockers;
the executable assertion lives in the `--mode` table, which is an honest interface gap until
`--mode` exists.
"""
payload = self.load_candidate_fixture("inventory-mutation-false-not-applicable.json")
protocol: Any = payload["protocol"]
capabilities: Any = protocol["capabilities"]
reviewed_payload: dict[str, Any] = self.load_candidate_fixture()
reviewed: Any = reviewed_payload["protocol"]["capabilities"]
reviewed_by_identity = {
(cell["role"], cell["kind"], cell["surface"]): cell for cell in reviewed
}
relabelled = 0
falsely_inapplicable_server_capabilities = []
for cell in capabilities:
original = reviewed_by_identity[(cell["role"], cell["kind"], cell["surface"])]
if original["status"] != "deferred":
self.assertEqual(cell, original, f"only deferred rows may be relabelled: {cell['surface']}")
continue
relabelled += 1
self.assertEqual(cell["status"], "not_applicable", cell["surface"])
self.assertEqual(
cell["reason"],
original["reason"],
"the relabel keeps the planned/deferred reason - that is the false claim",
)
if cell["role"] == "server" and cell["kind"] == "capability":
falsely_inapplicable_server_capabilities.append(cell["surface"])
self.assertEqual(relabelled, 26, "every deferred reviewed row must be relabelled")
self.assertEqual(
sorted(falsely_inapplicable_server_capabilities),
["completions", "logging", "prompts", "tasks"],
"applicable server capabilities must never be declared inapplicable",
)
if __name__ == "__main__":
unittest.main()