{"at":"2026-11-23T04:42:43.161Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T04:42:43.802Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T04:42:43.953Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T04:42:44.503Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":true},"resources":{"listChanged":true},"tools":{"listChanged":true}},"instructions":"Kibi is a branch-local requirements knowledge base for software traceability. Start with kb_search (ask it a question; its answer layer names the governing requirements, facts, ADRs and tests), then kb_query for exact lookups before any mutation. Model requirements as linked facts via kb_model (mode requirement) or kb_upsert (create endpoints before linking them); preflight writes with kb_upsert dryRun:true. Mutate sequentially with kb_upsert and kb_delete; validate with kb_check during iteration and run an unfiltered kb_check before completion. Confirm branch freshness with kb_status. For first-time repository setup, use the kibi-bootstrap prompt.","protocolVersion":"2025-11-25","serverInfo":{"description":"Agent-native requirements compiler: branch-local knowledge base for requirements, scenarios, tests, facts, and code-symbol traceability.","icons":[{"mimeType":"image/svg+xml","sizes":["any"],"src":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDggMzA5Ij48cmVjdCB3aWR0aD0iMzA4IiBoZWlnaHQ9IjMwOSIgcng9IjY0IiBmaWxsPSIjMUQxRTIzIi8+PGVsbGlwc2UgY3g9IjExMy4zIiBjeT0iMTUwLjkiIHJ4PSI1MS4zIiByeT0iNTEuNSIgZmlsbD0iI0EyRDNGNCIvPjxwYXRoIGQ9Ik0yMjguMSAxOTcuOEwyMjcuNiAxNjUuNUgxNTYuNUw5NS40IDE2NS4zVjEzNS4xSDE1Ni41TDIyNy41IDEzNS4xVjEwMS4ySDI1Mi4yVjE5Ny44WiIgZmlsbD0iI0EyRDNGNCIvPjwvc3ZnPg==","theme":"dark"}],"name":"kibi-mcp","title":"Kibi MCP (Kibi 2026.11.3)","version":"3.27.1","websiteUrl":"https://github.com/Looted/kibi"}}}}
{"at":"2026-11-23T04:42:44.503Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T04:42:44.503Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T04:42:44.564Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Query Kibi entities"},"description":"Read entities from the KB with exact filters, or ask typed fact questions. Use for lookup by id, type, tags or sourceFile, and for precise questions about modeled facts: predicate facts by name with named arguments (predicate + where), property facts of a subject (subjectKey + propertyKey), the domain view of a subject (factKind 'subject' + subjectKey: its definition, broader and narrower subjects, every current requirement about it and the claims and scenarios on it), or the catalog of facts of one kind (factKind; 'predicate_schema' lists the predicates you can ask about with their argument names and constants). Typed answers return matching fact rows plus factQuery: the schema used, distinct counts, values that do exist when nothing matched, warnings about the question and the next call to make. Read-only. Tags filter by metadata tags only, not entity IDs.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"args":{"description":"Positional argument values for predicate when it has no schema; null matches any value. Example: ['admin', null, null, 'allow']. Prefer where.","items":{"type":["string","null"]},"type":"array"},"distinct":{"description":"Optional argument name to count distinct values of across the matching predicate facts, e.g. distinct: 'role' with predicate 'has_role' and where {user: 'alice'} answers how many roles alice has.","type":"string"},"factKind":{"anyOf":[{"const":"subject","type":"string"},{"const":"property_value","type":"string"},{"const":"predicate","type":"string"},{"const":"predicate_schema","type":"string"},{"const":"observation","type":"string"},{"const":"meta","type":"string"},{"const":"rule","type":"string"},{"const":"rule_schema","type":"string"}],"description":"Typed fact filter: list facts of one kind with their typed fields. 'predicate_schema' returns the catalog of askable predicates (argument names, constants, fact counts). Example: 'predicate_schema'."},"id":{"description":"Optional exact entity ID. Example: 'REQ-cli-gc'. If omitted, returns matching entities by other filters.","type":"string"},"includeBody":{"description":"With id only: also return the entity's authored Markdown body (the prose after its front matter) as body {id, path, text}, so a stale statement in it can be corrected; kb_upsert document.body replaces it. Default: false.","type":"boolean"},"kb":{"description":"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","type":"string"},"limit":{"description":"Optional max rows to return after filtering. Default: 100 when omitted. Example: 25.","type":"number"},"namespace":{"description":"Optional predicate namespace when the same name exists in several. Default: any namespace.","type":"string"},"offset":{"description":"Optional zero-based pagination offset. Default: 0. Example: 50 to skip first 50 rows.","type":"number"},"polarity":{"anyOf":[{"const":"assert","type":"string"},{"const":"deny","type":"string"}],"description":"Optional polarity filter for predicate facts. Default: both."},"predicate":{"description":"Typed fact filter: predicate name to ask about, e.g. 'has_role' or 'permission_rule'. Combine with where for named arguments. Returns every stored fact of that predicate with its arguments, polarity and allow/deny effect.","type":"string"},"propertyKey":{"description":"Optional property key under subjectKey, e.g. 'max_roles'. Returns operator, value and unit of each fact.","type":"string"},"scope":{"anyOf":[{"const":"all","type":"string"},{"const":"current_requirements","type":"string"}],"description":"Optional: 'current_requirements' keeps only facts a current (not superseded or retired) requirement requires."},"sourceFile":{"description":"Optional source-file substring filter. Example: 'src/auth/login.ts'. Uses KB source linkage, not file-system scanning.","type":"string"},"subjectKey":{"description":"Typed fact filter: dotted subject key whose property facts to list, e.g. 'user.role_assignment'. Combine with propertyKey for one property, or with factKind 'subject' for the subject's domain view.","type":"string"},"tags":{"description":"Optional tag filter. Matches entities that contain any provided tag. Example: ['security','billing'].","items":{"type":"string"},"type":"array"},"type":{"anyOf":[{"const":"req","type":"string"},{"const":"scenario","type":"string"},{"const":"test","type":"string"},{"const":"adr","type":"string"},{"const":"flag","type":"string"},{"const":"event","type":"string"},{"const":"symbol","type":"string"},{"const":"fact","type":"string"}],"description":"Optional entity type filter. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'."},"where":{"additionalProperties":{},"description":"Named argument values for predicate, order-free, using the argument names from the predicate's schema. Example: {actor: 'admin', decision: 'allow'}. An unknown name returns a warning with the declared names; no match returns the values that do exist.","properties":{},"type":"object"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_query","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"body":{"additionalProperties":{},"properties":{},"type":"object"},"branchStore":{"additionalProperties":{},"properties":{},"type":"object"},"count":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"entities":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"factQuery":{"additionalProperties":{},"properties":{},"type":"object"}},"required":["entities","count"],"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_query","type":"string"},"resultVersion":{"const":"kibi.kb_query.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Search Kibi knowledge base"},"description":"Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic with their statement and recorded reason (why), what must stay true (linked facts), the deciding ADRs and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"answer":{"description":"Intent-v1 only, first page only. When true (default) the result includes an answer layer: current governing requirements with their linked facts, scenarios, tests and ADRs, superseded requirements listed separately, and observation facts labelled as notes. Bounded in size; discovery, not proof.","type":"boolean"},"fields":{"anyOf":[{"const":"summary","type":"string"},{"const":"full","type":"string"}],"description":"Optional result detail. 'summary' returns identifying metadata plus the match snippet for discovery. Use 'full' to include complete entity bodies, each result's evidence graph paths and each answer fact's kb_query call, or follow up with kb_query for the exact entities you need."},"hints":{"description":"Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer.","type":"boolean"},"kb":{"description":"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","type":"string"},"limit":{"description":"Optional max rows to return after ranking. Default: 10; raise it or page with offset when the answer layer is not enough.","maximum":9007199254740991,"minimum":0,"type":"integer"},"minScore":{"description":"Intent-v1 acceptance threshold between 0 and 1. Low-confidence queries abstain instead of returning misleading matches.","maximum":1,"minimum":0,"type":"number"},"offset":{"description":"Optional zero-based pagination offset. Default: 0.","maximum":9007199254740991,"minimum":0,"type":"integer"},"query":{"description":"Free-text query for metadata and markdown body discovery. Example: 'OAuth login flow'.","maxLength":4096,"minLength":1,"type":"string"},"rankingMode":{"anyOf":[{"const":"legacy","type":"string"},{"const":"intent-v1","type":"string"}],"description":"Optional deterministic ranking mode. Default intent-v1: question-aware ranking with semantic facets, source-aware evidence, graph boosts, superseded demotion and abstention. Use legacy for the older lexical ranking."},"semanticFacets":{"description":"Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model.","properties":{"actions":{"items":{"type":"string"},"maxItems":20,"type":"array"},"actors":{"items":{"type":"string"},"maxItems":20,"type":"array"},"aliases":{"items":{"type":"string"},"maxItems":20,"type":"array"},"constraints":{"items":{"type":"string"},"maxItems":20,"type":"array"},"objects":{"items":{"type":"string"},"maxItems":20,"type":"array"}},"type":"object"},"sourceLocations":{"description":"Optional changed-code locations. Results are matched to source-linked symbols/entities and include source evidence.","items":{"properties":{"column":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"line":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"path":{"description":"Workspace-relative source path.","minLength":1,"type":"string"},"symbol":{"minLength":1,"type":"string"}},"required":["path"],"type":"object"},"maxItems":20,"type":"array"},"type":{"anyOf":[{"const":"req","type":"string"},{"const":"scenario","type":"string"},{"const":"test","type":"string"},{"const":"adr","type":"string"},{"const":"flag","type":"string"},{"const":"event","type":"string"},{"const":"symbol","type":"string"},{"const":"fact","type":"string"}],"description":"Optional entity type filter to narrow discovery. Example: 'req'."},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["query"],"type":"object"},"name":"kb_search","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"answer":{"additionalProperties":{},"properties":{},"type":"object"},"branch":{"type":["string","null"]},"branchStore":{"additionalProperties":{},"properties":{},"type":"object"},"count":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"queryAnalysis":{"additionalProperties":{},"properties":{},"type":"object"},"results":{"items":{},"type":"array"},"returned":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"truncated":{"type":"boolean"}},"required":["results","count"],"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_search","type":"string"},"resultVersion":{"const":"kibi.kb_search.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Inspect Kibi branch status"},"description":"Report current branch, KB snapshot, freshness metadata, schema status, and a typed kibi.migration-plan.v2 action graph. Call it first to orient on a branch or after a failed call; use kb_check for validation findings and kb_coverage for proof status. Read-only status inspection with no mutation side effects; damaged stores are diagnosed without starting the engine.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"kb":{"description":"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","type":"string"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_status","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"attachedDev":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"attachedGeneration":{"type":"string"},"attachedIno":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"attachedPath":{"type":"string"},"bootstrap":{"additionalProperties":{},"properties":{},"type":"object"},"branch":{"type":"string"},"branchAttachment":{"additionalProperties":{},"properties":{},"type":"object"},"branchStore":{"additionalProperties":{},"properties":{},"type":"object"},"dirty":{"type":"boolean"},"engineStatus":{"additionalProperties":{},"properties":{},"type":"object"},"kbPath":{"type":"string"},"lastSyncSource":{"type":"string"},"migrationPlan":{"additionalProperties":{},"properties":{},"type":"object"},"notices":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"proofSnapshot":{"type":"string"},"proofSnapshotAvailable":{"type":"boolean"},"proofSnapshotChangeCount":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"proofSnapshotChanges":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"proofSnapshotChangesTruncated":{"type":"boolean"},"proofSnapshotDirty":{"type":"boolean"},"proofSnapshotError":{"type":"string"},"proofSnapshotFileCount":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"proofSnapshotVersion":{"type":"string"},"schemaStatus":{"additionalProperties":{},"properties":{},"type":"object"},"sessionBrief":{"type":"string"},"snapshotId":{"type":"string"},"staleReasonCount":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"staleReasons":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"staleReasonsTruncated":{"type":"boolean"},"syncState":{"type":"string"},"syncedAt":{"type":["string","null"]}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":2,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_status","type":"string"},"resultVersion":{"const":"kibi.kb_status.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Read bundled Kibi skills"},"description":"Read bundled Kibi agent skills (workflow guidance). action:list returns the catalog; action:load returns a skill's metadata, Markdown body, declared resources and content hash (start with id 'kibi-usage'); action:read returns one manifest-declared resource. Read-only; does not require Prolog.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"action":{"anyOf":[{"const":"list","type":"string"},{"const":"load","type":"string"},{"const":"read","type":"string"}],"description":"list, load (needs id) or read (needs id and resource)."},"id":{"description":"Bundled skill ID. Example: 'kibi-usage'.","type":"string"},"resource":{"description":"Manifest-declared resource path to read. Example: 'resources/workflows.md'.","type":"string"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["action"],"type":"object"},"name":"kb_skills","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"anyOf":[{"additionalProperties":false,"properties":{"action":{"const":"list","type":"string"},"skills":{"items":{},"type":"array"}},"required":["action","skills"],"type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"load","type":"string"},"body":{"type":"string"},"contentHash":{"type":"string"},"metadata":{"additionalProperties":{},"properties":{},"type":"object"},"resources":{"items":{},"type":"array"},"sourceType":{"type":"string"}},"required":["action"],"type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"read","type":"string"},"content":{"type":"string"}},"required":["action","content"],"type":"object"}]},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_skills","type":"string"},"resultVersion":{"const":"kibi.kb_skills.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Find missing Kibi relationships"},"description":"List KB entities by the relationships they lack or have. Use for questions like which requirements lack scenarios or tests; all filters must match, and a relationship counts in either direction. Use kb_coverage instead for proof status and repair plans, and kb_check for rule violations. No mutation side effects.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"kb":{"description":"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","type":"string"},"limit":{"description":"Maximum rows to return; count reports the full total.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"missingRelationships":{"description":"Relationship types the entity must have none of, in either direction, for example specified_by or verified_by. verified_by and validates satisfy each other.","items":{"type":"string"},"type":"array"},"offset":{"description":"Zero-based row offset for pagination.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"presentRelationships":{"description":"Relationship types the entity must have at least one of each, in either direction.","items":{"type":"string"},"type":"array"},"sourceFile":{"description":"Keep entities whose source path contains this substring.","type":"string"},"tags":{"description":"Keep entities carrying any of these metadata tags. Bootstrap provenance stubs appear in rows only when this names bootstrap:provenance-stub.","items":{"type":"string"},"type":"array"},"type":{"anyOf":[{"const":"req","type":"string"},{"const":"scenario","type":"string"},{"const":"test","type":"string"},{"const":"adr","type":"string"},{"const":"flag","type":"string"},{"const":"event","type":"string"},{"const":"symbol","type":"string"},{"const":"fact","type":"string"}],"description":"Only report entities of this type. Omit for all types."},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_find_gaps","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"count":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"meta":{"additionalProperties":{},"properties":{},"type":"object"},"rows":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"summary":{"additionalProperties":{},"properties":{},"type":"object"}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_find_gaps","type":"string"},"resultVersion":{"const":"kibi.kb_find_gaps.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Report Kibi coverage and proofs"},"description":"Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Use it to ask which requirements are tested end to end, how strong each requirement's evidence is (evidenceLevel: proved, tested, asserted or unverified), and what blocks the rest; use kb_find_gaps for a plain list of missing links and kb_check for rule violations. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation occurs.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"by":{"anyOf":[{"const":"req","type":"string"},{"const":"symbol","type":"string"},{"const":"type","type":"string"}],"description":"Report shape: req gives per-requirement proof status and a repair plan, symbol gives per-symbol ownership coverage, type gives counts per entity type."},"includeMigrationPreview":{"description":"Opt in to a deterministic, read-only kibi.legacy-migration-plan.v1 preview for ready semantic-inventory repair batches.","type":"boolean"},"includePassing":{"description":"Also return rows that are already tested or not applicable. By default only rows that still need repair are returned.","type":"boolean"},"includeTransitive":{"description":"Count symbol coverage reached transitively through linked entities, not only direct links.","type":"boolean"},"kb":{"description":"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","type":"string"},"limit":{"description":"Maximum rows to return. When the repair plan reports scope.complete false, rerun with offset 0 and a larger limit.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"migrationLimit":{"description":"Maximum requirement migration batches to preview. Defaults to one review batch.","maximum":10,"minimum":1,"type":"integer"},"migrationOffset":{"description":"Zero-based offset into ready semantic-inventory batches.","maximum":9007199254740991,"minimum":0,"type":"integer"},"migrationPredicateLimit":{"description":"Maximum exact predicate-schema candidates retained per assertive proposition.","maximum":20,"minimum":1,"type":"integer"},"migrationPredicateMinScore":{"description":"Minimum deterministic predicate-schema rank score retained in migration previews.","maximum":1,"minimum":0,"type":"number"},"offset":{"description":"Zero-based row offset for pagination.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"statuses":{"description":"Requirement proof-status filter (req mode): include only rows whose proofStatus is listed. Selecting statuses implies include-passing; not_applicable rows carry their typed applicability reason in proofStages.applicability.reason. The summary always reflects the whole KB.","items":{"anyOf":[{"const":"tested","type":"string"},{"const":"missing","type":"string"},{"const":"unresolved","type":"string"},{"const":"not_applicable","type":"string"}]},"type":"array"},"tags":{"description":"Keep rows for entities carrying any of these metadata tags.","items":{"type":"string"},"type":"array"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_coverage","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"legacyMigrationPlan":{"additionalProperties":{},"properties":{},"type":"object"},"meta":{"additionalProperties":{},"properties":{},"type":"object"},"migrationPlan":{"additionalProperties":{},"properties":{},"type":"object"},"repairPlan":{"additionalProperties":{},"properties":{},"type":"object"},"rows":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"summary":{"additionalProperties":{},"properties":{},"type":"object"},"symbolRepairPlan":{"additionalProperties":{},"properties":{},"type":"object"}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_coverage","type":"string"},"resultVersion":{"const":"kibi.kb_coverage.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Traverse Kibi graph"},"description":"Run bounded graph traversal from one or more seed IDs across curated relationship types and return the nodes and edges reached. Use it to follow links from IDs you already have, such as a requirement to its scenarios and tests or a symbol to the requirements it implements; use kb_query to find entities by filter and kb_search to ask a question. Traversal stops at depth, maxNodes or maxEdges and then sets truncated. No mutation side effects.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"depth":{"description":"Number of hops from the seeds.","maximum":5,"minimum":1,"type":"integer"},"direction":{"anyOf":[{"const":"outgoing","type":"string"},{"const":"incoming","type":"string"},{"const":"both","type":"string"}],"description":"outgoing follows links from each node, incoming follows links pointing at it, both does either."},"entityTypes":{"description":"Keep only nodes of these types (req, scenario, test, adr, flag, event, symbol, fact) in the result, and the edges between them. Traversal still passes through other types.","items":{"type":"string"},"type":"array"},"kb":{"description":"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","type":"string"},"maxEdges":{"description":"Stop and set truncated once this many edges are reached.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"maxNodes":{"description":"Stop and set truncated once this many nodes are reached.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"relationships":{"description":"Relationship types to follow, for example specified_by, verified_by or implements. Omit to follow every relationship type.","items":{"type":"string"},"type":"array"},"seedIds":{"description":"Entity IDs to start from, for example REQ-... or SCEN-.... Seeds are always returned as nodes.","items":{"type":"string"},"type":"array"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["seedIds"],"type":"object"},"name":"kb_graph","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"edges":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"meta":{"additionalProperties":{},"properties":{},"type":"object"},"nodes":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"truncated":{"type":"boolean"}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_graph","type":"string"},"resultVersion":{"const":"kibi.kb_graph.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Model Kibi requirement prose"},"description":"Turn requirement prose into checkable structure without writing the KB. Use it for one requirement's prose; to plan a whole change request use kb_compile_intent. mode:analyze returns the semantic advisor receipt: the clause ledger, what is grounded, what is ambiguous and suggested modeling (pass clauses for compound prose and optional typed kibi.logic.v1 interpretations). mode:requirement converts one claim (subjectKey, propertyKey, operator, value, or typed logic) into a strict-lane write set and applyPlan. mode:predicates ranks ontology predicate schemas and returns an applicable predicate-fact plan only for reviewed bindings, otherwise an ontology-gap observation. With requirementId, mode:predicates also returns a hash-bound plan (fact write plus requires_predicate link) for kb_apply_plan, whose contradictionAnalysis is the what-if over the current KB; other returned plans apply with kb_upsert, and kb_upsert dryRun with plannedFacts previews a requirement before its facts exist.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"argumentBindings":{"additionalProperties":{},"description":"Optional exact predicate argument values keyed by a candidate schema's argument_names. Required before applying a candidate whose binding_status is incomplete; Kibi never substitutes guessed values for unbound arguments.","properties":{},"type":"object"},"claimKey":{"description":"Optional advisor-issued claim key for the exact proposition represented by logic.","type":"string"},"claimText":{"description":"Optional exact proposition text represented by logic; defaults to text.","type":"string"},"clauses":{"description":"Optional complete list of atomic requirement clauses supplied by the caller. Each clause must be a verbatim fragment of text (whitespace may differ); a clause that does not occur in text fails the call with VALIDATION_FAILED naming it. Use this for compound prose so every normative clause receives a stable claim key and independent grounding review.","items":{"type":"string"},"type":"array"},"confidence":{"description":"Confidence score for the extracted claim. >= 0.70 yields strict-lane output; lower confidence yields observation-only review output.","maximum":1,"minimum":0,"type":"number"},"existingLogicClaims":{"description":"Existing requirement logic_claims values. The returned requirement update merges the new atomic claim key into this manifest instead of replacing prior claims.","items":{"pattern":"^CLAIM-[A-F0-9]{16}$","type":"string"},"type":"array","uniqueItems":true},"id":{"description":"Optional requirement ID used for deterministic draft relationship guidance.","type":"string"},"includeExistingSchemas":{"description":"Whether to include existing KB fact_kind=predicate_schema facts alongside Kibi's built-in predicate catalog. Default: true.","type":"boolean"},"interpretations":{"description":"Optional host-LLM typed kibi.logic.v1 interpretations. Kibi validates and canonicalizes them; raw Prolog is not accepted.","items":{"additionalProperties":{},"properties":{"claim_key":{"type":"string"},"claim_text":{"type":"string"},"confidence":{"maximum":1,"minimum":0,"type":"number"},"ir":{"additionalProperties":{},"properties":{},"type":"object"},"span":{"additionalProperties":{},"properties":{},"type":"object"}},"required":["claim_key","claim_text","ir"],"type":"object"},"maxItems":3,"type":"array"},"logic":{"additionalProperties":{},"description":"Optional typed kibi.logic.v1 IR. Kibi validates and canonicalizes it into a rule fact; raw Prolog is rejected.","properties":{},"type":"object"},"maxCandidates":{"description":"Maximum ranked predicate candidates to return. Default: 5.","maximum":20,"minimum":1,"type":"integer"},"minScore":{"description":"Minimum candidate score. Higher values make ontology-gap fallback more likely. Default: 0.35.","maximum":1,"minimum":0,"type":"number"},"mode":{"anyOf":[{"const":"analyze","type":"string"},{"const":"requirement","type":"string"},{"const":"predicates","type":"string"}],"description":"analyze (advisor receipt), requirement (strict claim write set) or predicates (ontology predicate plan)."},"operator":{"anyOf":[{"const":"eq","type":"string"},{"const":"gt","type":"string"},{"const":"gte","type":"string"},{"const":"lt","type":"string"},{"const":"lte","type":"string"},{"const":"neq","type":"string"},{"const":"bool","type":"string"},{"const":"polarity","type":"string"},{"const":"matches","type":"string"},{"const":"includes","type":"string"},{"const":"subset_of","type":"string"},{"const":"excludes","type":"string"}],"description":"Optional extracted semantic claim operator. Use gt/lt for strict bounds ('greater than zero' is gt 0, not gte 0). A set claim takes a list value with eq (exactly these), includes (at least these), subset_of (only these) or excludes (none of these); matches takes a regular expression string. Example: 'eq'."},"polarityHint":{"anyOf":[{"const":"assert","type":"string"},{"const":"deny","type":"string"}],"description":"Optional reviewed polarity override for claims whose surface negation does not express predicate denial. Use only after reviewing the selected schema and full claim scope."},"propertyKey":{"description":"Optional extracted semantic claim propertyKey. Example: 'Retention Years'.","type":"string"},"provenance":{"description":"Optional extracted text reference. Falls back to source when omitted. Example: '.kb/requirements/customer-retention.md#L1'.","type":"string"},"requirementId":{"description":"Optional requirement ID. The strict write set updates this requirement instead of minting a REQ-AUTO id, and a typed logic rule attaches its requires_rule relationship to it.","type":"string"},"schemaId":{"description":"Optional exact reviewed predicate schema ID. When supplied, Kibi selects that schema instead of lexical rank order and fails closed if it is unavailable.","minLength":1,"type":"string"},"source":{"description":"Optional primary source path or provenance root used for stable IDs and text refs. Example: '.kb/requirements/customer-retention.md'.","type":"string"},"sourceFiles":{"description":"Optional related source files. The first value is used as the source fallback when source is omitted.","items":{"type":"string"},"type":"array"},"status":{"description":"Optional requirement status for draft suggestions.","type":"string"},"subjectHint":{"description":"Optional canonical subject key to use as the first predicate argument. Example: 'editor.annotation'.","type":"string"},"subjectKey":{"description":"Optional extracted semantic claim subjectKey. Example: 'Customer.Data'.","type":"string"},"text":{"description":"Required prose requirement text to model. Example: 'Customer data must be retained for 7 years.'","type":"string"},"title":{"description":"Optional requirement title for draft apply plans.","type":"string"},"type":{"anyOf":[{"const":"req","type":"string"},{"const":"scenario","type":"string"},{"const":"test","type":"string"},{"const":"adr","type":"string"},{"const":"flag","type":"string"},{"const":"event","type":"string"},{"const":"symbol","type":"string"},{"const":"fact","type":"string"}],"description":"Entity type context for analysis. Requirement, domain-fact, and supporting prose all receive a proposition ledger; only requirements receive deterministic modeling suggestions."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"items":{"type":"string"},"minItems":1,"type":"array"}],"description":"Optional extracted semantic claim value: a string, number or boolean, or a list of strings for a set claim. Example: ['requireAuth'] with operator includes."},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["mode","text"],"type":"object"},"name":"kb_model","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"anyOf":[{"additionalProperties":false,"properties":{"capabilityPlugins":{"additionalProperties":{},"properties":{},"type":"object"},"mode":{"const":"analyze","type":"string"},"receipt":{"additionalProperties":{},"properties":{},"type":"object"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["mode"],"type":"object"},{"additionalProperties":false,"properties":{"applyPlan":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"claim":{"additionalProperties":{},"properties":{},"type":"object"},"claimKey":{"type":"string"},"confidence":{"type":"number"},"extractionMode":{"type":"string"},"extractionWarnings":{"items":{"type":"string"},"type":"array"},"isStrict":{"type":"boolean"},"logic":{"additionalProperties":{},"properties":{},"type":"object"},"logicClaims":{"items":{"type":"string"},"type":"array"},"migrationWarning":{"type":["string","null"]},"mode":{"const":"requirement","type":"string"},"source":{"type":"string"},"sourceFiles":{"items":{"type":"string"},"type":"array"},"statement":{"type":"string"},"vocabularyAlignment":{"additionalProperties":false,"properties":{"diagnostics":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"fallbackUsed":{"type":"boolean"},"redundancyCandidates":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"reviewPlan":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"stamps":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"subject":{"additionalProperties":{},"properties":{},"type":"object"}},"required":["subject","redundancyCandidates","reviewPlan","stamps","fallbackUsed","diagnostics"],"type":"object"},"warnings":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"writeSet":{"additionalProperties":{},"properties":{},"type":"object"}},"required":["mode"],"type":"object"},{"additionalProperties":false,"properties":{"applyPlan":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"bindingHints":{"description":"On provide_argument_bindings: one entry per unbound argument of the recommended candidate with its type, declared constants (allowedValues) when the vocabulary is closed, schema example values and the reason the current value was not accepted. Empty otherwise.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"candidates":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"claimKey":{"type":"string"},"decisionConflicts":{"description":"When no hash-bound plan ran the contradiction analysis: stored decision facts of current requirements that agree with the complete candidate on its key arguments and decide the opposite (requirementId, factId, effect, proposedEffect, canonicalKey). A warning repeats each one.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"existingGrounding":{"description":"The grounding links requirementId already has for this claim: matched by claim_key (the same proposition text) or, for a predicate fact, by the recommended candidate's canonical_key (the same predicate tuple in other words; matchedBy says which).","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"logicClaims":{"items":{"type":"string"},"type":"array"},"mode":{"const":"predicates","type":"string"},"plan":{"anyOf":[{"additionalProperties":{},"description":"With requirementId and a complete candidate: the hash-bound kibi.compile-plan.v1 that writes the predicate fact and links requires_predicate in one kb_apply_plan call (approvedPlanHash = plan.planHash). Its contradictionAnalysis is the what-if over the current KB plus the plan; a conflict leaves the plan blocked. Null when no plan applies.","properties":{},"type":"object"},{"description":"With requirementId and a complete candidate: the hash-bound kibi.compile-plan.v1 that writes the predicate fact and links requires_predicate in one kb_apply_plan call (approvedPlanHash = plan.planHash). Its contradictionAnalysis is the what-if over the current KB plus the plan; a conflict leaves the plan blocked. Null when no plan applies.","type":"null"}]},"recommendedAction":{"anyOf":[{"const":"apply_requires_predicate","type":"string"},{"const":"provide_argument_bindings","type":"string"},{"const":"resolve_schema_reference","type":"string"},{"const":"record_ontology_gap","type":"string"},{"const":"review_nonlogical","type":"string"},{"const":"replace_grounding","type":"string"},{"const":"extend_requirement","type":"string"},{"const":"keep_existing_grounding","type":"string"}]},"recommendedPredicateSchema":{"anyOf":[{"additionalProperties":{},"properties":{},"type":"object"},{"type":"null"}]},"relationshipPlan":{"anyOf":[{"additionalProperties":{},"properties":{},"type":"object"},{"type":"null"}]},"relationshipTarget":{"anyOf":[{"description":"The planned predicate fact id (FACT-PRED-...) that a requires_predicate link must target. Candidate ids (SUGGEST-...) are never relationship targets.","type":"string"},{"description":"The planned predicate fact id (FACT-PRED-...) that a requires_predicate link must target. Candidate ids (SUGGEST-...) are never relationship targets.","type":"null"}]},"replacementPlan":{"anyOf":[{"additionalProperties":{},"properties":{},"type":"object"},{"type":"null"}]},"requirementId":{"type":["string","null"]},"source":{"type":["string","null"]},"subject":{"type":"string"},"text":{"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["mode"],"type":"object"}]},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_model","type":"string"},"resultVersion":{"const":"kibi.kb_model.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Create or update Kibi entities"},"description":"Create or update one entity and its relationships. Use it for modeling, updates and every write kb_record does not take (a newly stated rule is one kb_record call). dryRun:true validates without writing. Model prose with kb_model before hand-writing strict property or predicate facts. An update keeps what it leaves out: send the changed fields (with title and status) and only the links to add. Relationship endpoints must already exist. A requirement that contradicts a current one on the same subject is rejected; to replace it, add a `supersedes` link from the new requirement and upsert the old one with status closed. For a requirement send the statement as `document.body` and the reason as `why` (never invent one: write 'Reason not stated'); give other entities a prose body. A requirement write returns its open kb_check steps as nextActions. Side effects: writes KB; dryRun:true writes nothing.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"document":{"description":"Optional source-first document write. Paths are workspace-relative; omit body when updating to preserve the existing body bytes (a requirement whose semantic_text changes gets the new statement in place of the old one, with its context sections kept). For a new requirement pass a sectioned body: statement, '## Context' (why, who asked, constraints), '## Source' (blockquoted excerpt and reference); context never changes the checked meaning, which stays in semantic_text.","properties":{"body":{"type":"string"},"path":{"minLength":1,"type":"string"}},"type":"object"},"dryRun":{"description":"Validate the payload and return schema/modeling errors, a normalized preview and the semantic advisor receipt without writing the KB or workspace. Use it as the preflight before the real write.","type":"boolean"},"id":{"description":"Unique entity ID (string). Example: 'REQ-cli-gc'. Name entities by the behavior they govern (<TYPE>-<area>-<behavior>), never by the next free number. Existing ID updates the entity; new ID creates it.","type":"string"},"implementedBy":{"description":"req only: the declarations that implement it, each {sourceFile, symbol} (function, Class.method or exported constant), with optional coveredBy test ids. Kibi creates or reuses each symbol, links it with implements and to each coveredBy test with covered_by; an entry that resolves to no single granular declaration is refused with candidates.","items":{"properties":{"coveredBy":{"items":{"minLength":1,"type":"string"},"type":"array"},"sourceFile":{"minLength":1,"type":"string"},"symbol":{"minLength":1,"type":"string"}},"required":["sourceFile","symbol"],"type":"object"},"minItems":1,"type":"array"},"plannedFacts":{"description":"dryRun only. Fact upsert payloads (type, id, properties, optional relationships) that will be written before this payload, typically the applyPlan entries kb_model returned. They are validated in order and staged with the payload, so a requires_predicate or requires_property target that does not exist yet resolves, its claim_key is read from the plan, and the contradiction preview runs against the KB as it would be after the whole batch (result: stagedFacts, whatIf). A conflict the batch would introduce, such as an allow and a deny permission_rule on the same key, is refused as the commit would refuse it. Rejected without dryRun: write the facts first.","items":{"additionalProperties":{},"properties":{"id":{"minLength":1,"type":"string"},"properties":{"additionalProperties":{},"properties":{},"type":"object"},"relationships":{"description":"Optional relationship rows to create in the same call. For requirement encoding, prefer `constrains` + `requires_property` for strict property facts or `requires_predicate` for ontology predicate facts. Side effect: asserts edges in KB.","items":{"additionalProperties":{},"properties":{"from":{"description":"Source entity ID (must exist). Example: 'SYM-login-handler'.","type":"string"},"to":{"description":"Target entity ID (must exist). Example: 'REQ-cli-gc'.","type":"string"},"type":{"anyOf":[{"const":"depends_on","type":"string"},{"const":"specified_by","type":"string"},{"const":"verified_by","type":"string"},{"const":"validates","type":"string"},{"const":"implements","type":"string"},{"const":"covered_by","type":"string"},{"const":"executable_for","type":"string"},{"const":"constrained_by","type":"string"},{"const":"constrains","type":"string"},{"const":"requires_property","type":"string"},{"const":"requires_predicate","type":"string"},{"const":"requires_rule","type":"string"},{"const":"guards","type":"string"},{"const":"publishes","type":"string"},{"const":"consumes","type":"string"},{"const":"supersedes","type":"string"},{"const":"restates","type":"string"},{"const":"assumes","type":"string"},{"const":"exempts","type":"string"},{"const":"relates_to","type":"string"}],"description":"Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test)."}},"required":["type","from","to"],"type":"object"},"type":"array"},"type":{"const":"fact","type":"string"}},"required":["type","id","properties"],"type":"object"},"type":"array"},"properties":{"additionalProperties":{},"allOf":[{"if":{"required":["claim_key"]},"then":{"required":["claim_text"]}},{"if":{"required":["proof_receipts"]},"then":{"required":["verification_scope"]}}],"description":"Entity fields to persist. Must include title and status. If created_at, updated_at, or source are omitted, server fills defaults.","properties":{"aliases":{"description":"Optional vocabulary aliases for predicate discovery.","items":{"type":"string"},"type":"array"},"approval_ref":{"description":"Requirement-only. Optional reference to the exception's approval decision record.","minLength":1,"type":"string"},"approved_by":{"description":"Requirement-only. The human who approved this exception requirement. An exception that exempts a requirement and is specified_by a success scenario makes that scenario feasible only when approved_by is set.","minLength":1,"type":"string"},"argument_aliases":{"additionalProperties":{},"description":"predicate_schema only: legacy spellings keyed by argument name, each mapped to a declared constant, e.g. {\"severity\": {\"warn\": \"warning\"}}. kibi migrate rewrites facts that still use an alias.","properties":{},"type":"object"},"argument_constants":{"additionalProperties":{},"description":"predicate_schema only: allowed constants keyed by argument name, e.g. {\"severity\": [\"warning\", \"info\"]}. Predicate facts must use a listed constant for those arguments; unlisted arguments stay open.","properties":{},"type":"object"},"argument_descriptions":{"description":"Optional ordered argument explanations.","items":{"type":"string"},"type":"array"},"argument_names":{"description":"Ordered argument role names for predicate_schema facts.","items":{"type":"string"},"type":"array"},"argument_types":{"description":"Ordered argument types for predicate_schema facts.","items":{"type":"string"},"type":"array"},"canonical_key":{"description":"Optional canonical identity key for predicate or strict fact claims.","type":"string"},"case_waiver":{"description":"Fact-only. Why the edge cases derived from this fact are covered some other way or cannot occur. Waives uncovered_case once case_waiver_approved_by is set.","minLength":1,"type":"string"},"case_waiver_approved_by":{"description":"Fact-only. The person who accepted case_waiver.","minLength":1,"type":"string"},"claim_key":{"description":"Stable key of the atomic prose clause grounded by this fact, derived from claim_text. Optional: when omitted, Kibi derives it; when sent, it must equal the derived key.","pattern":"^CLAIM-[A-F0-9]{16}$","type":"string"},"claim_span_end":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"claim_span_start":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"claim_text":{"description":"Exact atomic requirement clause represented by this fact, retained for human audit. On a grounding fact Kibi derives claim_key from it; an observation or meta fact quotes the clause it is about without a key.","type":"string"},"closed_world":{"description":"Optional closed-world marker for strict fact interpretation.","type":"boolean"},"dimension_waiver":{"description":"Fact-only. Why the quantifier word in claim_text ranges over nothing, so the claim needs no count, set or rule. Waives dimension_unrepresented once dimension_waiver_approved_by is set.","minLength":1,"type":"string"},"dimension_waiver_approved_by":{"description":"Fact-only. The person who accepted dimension_waiver.","minLength":1,"type":"string"},"distinct_from":{"description":"subject facts: similar defined subject keys this subject was checked to differ from; property_value facts: subject_key.property_key of value facts that state a different quantity. The body says how. Silences subject-duplicate or quantity-duplicate for those pairs.","items":{"type":"string"},"type":"array"},"examples":{"description":"Optional ground-term examples for a predicate schema.","items":{"type":"string"},"type":"array"},"exempts_claims":{"description":"Requirement-only. Claim keys of the exempted requirement whose constraints this exception waives; omit to waive the whole requirement.","items":{"pattern":"^CLAIM-[A-F0-9]{16}$","type":"string"},"minItems":1,"type":"array","uniqueItems":true},"fact_kind":{"anyOf":[{"const":"subject","type":"string"},{"const":"property_value","type":"string"},{"const":"observation","type":"string"},{"const":"meta","type":"string"},{"const":"predicate_schema","type":"string"},{"const":"predicate","type":"string"},{"const":"rule_schema","type":"string"},{"const":"rule","type":"string"}],"description":"Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model (mode requirement or predicates) when starting from prose."},"failure_side_waiver":{"description":"Requirement-only. Why the requirement has no failure side to test (its claims state a capability or output shape). Waives happy_path_only once failure_side_waiver_approved_by is set.","minLength":1,"type":"string"},"failure_side_waiver_approved_by":{"description":"Requirement-only. The person who accepted failure_side_waiver.","minLength":1,"type":"string"},"firmness":{"anyOf":[{"const":"firm","type":"string"},{"const":"default","type":"string"},{"const":"exploratory","type":"string"}],"description":"req/adr only. firm = a human stated it as a rule (needs origin.ref to their words); its title, meaning or firmness changes only with new human words (a new origin.ref) or by supersede. default = delegated or agent choice; exploratory = flagged guess. Absent = default if an agent wrote it, else firm."},"granularity_reason":{"anyOf":[{"const":"config-artifact","type":"string"},{"const":"module-level-behavior","type":"string"},{"const":"extractor-miss","type":"string"},{"const":"legacy-link","type":"string"},{"const":"test-suite","type":"string"}],"description":"Optional justification for a coarse file/module-level symbol traceability relationship when narrower function/class/type symbols exist."},"key_arguments":{"description":"predicate_schema only: argument names that determine the remaining arguments (a functional dependency), e.g. [\"sensor\"] for reading(sensor, value). Rule contradiction analysis treats two atoms with identical keys as the same fact; without it the predicate is multivalued and opposing rules stay unresolved instead of disjoint.","items":{"minLength":1,"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"kind_of":{"description":"subject only: defined subject keys this subject is a kind of (a read-only review is a kind of review view).","items":{"type":"string"},"type":"array"},"links":{"description":"Optional references. Example: ['REQ-cli-gc','https://example.com/spec'].","items":{"type":"string"},"type":"array"},"logic_claims":{"description":"Requirement-only manifest of every atomic normative claim key returned by kb_model mode analyze (CLI: kibi model). A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.","items":{"pattern":"^CLAIM-[A-F0-9]{16}$","type":"string"},"minItems":1,"type":"array","uniqueItems":true},"operator":{"anyOf":[{"const":"eq","type":"string"},{"const":"neq","type":"string"},{"const":"lt","type":"string"},{"const":"lte","type":"string"},{"const":"gt","type":"string"},{"const":"gte","type":"string"},{"const":"matches","type":"string"},{"const":"includes","type":"string"},{"const":"subset_of","type":"string"},{"const":"excludes","type":"string"}],"description":"Optional comparison operator for property_value facts. Example: 'eq'. 'matches' (string facts only): value_string is a JavaScript regular expression (u flag) every value must match as a whole. Set facts only: 'includes' means every member of value_set has the property and other members may have it too; 'subset_of' means every member that has the property is in value_set ('every env var the server reads is one of ...'); 'excludes' means no member of value_set has it ('never imports md5'); 'eq' on a set means exactly those members."},"origin":{"description":"Optional provenance: who authored the entity (kind: human, agent, migration, import) and on what authority (ref, approved_by, recorded_at). Omit it to keep an existing entity's origin; a new entity written without one is recorded as {kind: agent, recorded_at: <write time>}. A supplied origin without recorded_at gets the write time.","properties":{"approved_by":{"description":"The person who reviewed and approved this entity's content, not the approved_by of an exception requirement.","minLength":1,"pattern":"\\S","type":"string"},"kind":{"anyOf":[{"const":"human","type":"string"},{"const":"agent","type":"string"},{"const":"migration","type":"string"},{"const":"import","type":"string"}],"description":"Who authored the entity: human, agent, migration (backfilled by kibi migrate) or import."},"recorded_at":{"description":"ISO-8601 time the provenance was recorded.","pattern":"^\\d{4}-\\d{2}-\\d{2}(?:[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})?)?$","type":"string"},"ref":{"description":"Source reference for the authored content: URL, document path, ticket, commit or conversation id.","minLength":1,"pattern":"\\S","type":"string"}},"required":["kind"],"type":"object"},"owner":{"description":"Optional owner name/team. Example: 'platform-team'.","type":"string"},"pair_reviews":{"description":"Requirement only: verdicts on stored pairs (a relates_to edge or a shared subject) whose unmodeled claims cannot be modeled. Each entry: with (the other requirement, which a relates_to edge must link), verdict (no_conflict with separated_by naming the condition or term that separates them; interacts with resolved_by naming what resolves it: a scenario either requirement is specified_by, a fact either links, a third current requirement, or a condition or exception claim_key of either, never the two requirements themselves; conflict, which stays blocking until a person decides), claims (the claim_key of each unmodeled claim; a payload_hash is accepted and ignored) and origin (kind human or agent; on a must or firm pair, a verdict whose origin is missing or agent, or that sits on a requirement an agent wrote, counts only with approved_by from a person). Model the claims first; a verdict is the fallback.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"part_of":{"description":"subject only: defined subject keys this subject is a part of. A dotted key prefix that is itself a defined subject is broader already.","items":{"type":"string"},"type":"array"},"polarity":{"anyOf":[{"const":"require","type":"string"},{"const":"forbid","type":"string"},{"const":"assert","type":"string"},{"const":"deny","type":"string"}],"description":"Optional polarity for property_value or predicate facts."},"predicate_args":{"description":"Optional ordered predicate arguments for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_args.","items":{"type":"string"},"type":"array"},"predicate_arity":{"description":"Required arity for predicate_schema facts.","maximum":9007199254740991,"minimum":1,"type":"integer"},"predicate_name":{"description":"Optional predicate name for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_name.","type":"string"},"predicate_namespace":{"description":"Optional namespace for a project-local predicate schema.","type":"string"},"priority":{"description":"Optional priority label. Example: 'high'.","type":"string"},"proof_bindings":{"description":"Optional native-runner bindings (native ids, aliases, source coordinates) for proof obligations. Bindings are provenance metadata and never replace the semantic contract.","items":{"properties":{"aliases":{"items":{"minLength":1,"type":"string"},"type":"array"},"line":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"native_id":{"minLength":1,"type":"string"},"source_file":{"minLength":1,"type":"string"},"symbol_id":{"minLength":1,"type":"string"},"target":{"minLength":1,"type":"string"}},"required":["symbol_id","target"],"type":"object"},"type":"array"},"proof_contract":{"description":"Semantic proof contract binding this test to explicit proof obligations executed by one configured integration.","properties":{"constraint_source":{"description":"arithmetic and smt: the typed numeric property_value facts the certificate's assumptions come from. Kibi checks the assumptions (or the query's assertions) are exactly these facts' constraints, so the proof is about the knowledge base, not numbers the test chose.","properties":{"fact_ids":{"items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"}},"required":["fact_ids"],"type":"object"},"domain_source":{"description":"exhaustive and typecheck: the symbol that defines the finite domain (typecheck: also the type whose fields a required_fields fact names). state_machine: the transition table or next-state function. The proof must import it from its source file; a hand-listed domain downgrades the receipt to example. Kibi reads the export named `export`, or the symbol's title when `export` is absent.","properties":{"arg":{"description":"A SWI-Prolog predicate's argument (1-based) whose solutions Kibi reads, when the predicate takes more than one argument (operator/2 with arg 1 lists each operator's name).","maximum":9007199254740991,"minimum":1,"type":"integer"},"export":{"description":"The name the domain is exported under in the symbol's source file, when the symbol's title is not that name.","minLength":1,"type":"string"},"field":{"description":"exhaustive: when the export is a list of records, the field of each record that names a domain member (a catalog's name).","minLength":1,"type":"string"},"symbol_id":{"minLength":1,"type":"string"}},"required":["symbol_id"],"type":"object"},"domains":{"additionalProperties":{},"description":"rule: the finite domain of each argument type, keyed by type name (an array, Set, Map or object export, or a Python list, set, dict or Enum), or {source} for the members Kibi reads from a project source (every route, every table, every environment variable). state_machine with a next-state function: the `state` and `event` domains it is called on.","properties":{},"type":"object"},"initial_source":{"description":"state_machine: the export holding the initial state (or states), needed for initial_states and reachable_states facts.","properties":{"arg":{"description":"A SWI-Prolog predicate's argument (1-based) whose solutions Kibi reads, when the predicate takes more than one argument (operator/2 with arg 1 lists each operator's name).","maximum":9007199254740991,"minimum":1,"type":"integer"},"export":{"minLength":1,"type":"string"},"symbol_id":{"minLength":1,"type":"string"}},"required":["symbol_id"],"type":"object"},"integration":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"e2e","type":"string"},{"const":"example","type":"string"},{"const":"property","type":"string"},{"const":"exhaustive","type":"string"},{"const":"typecheck","type":"string"},{"const":"arithmetic","type":"string"},{"const":"smt","type":"string"},{"const":"rule","type":"string"},{"const":"state_machine","type":"string"},{"const":"regex","type":"string"},{"const":"source","type":"string"}],"description":"What the checker establishes; absent means e2e. exhaustive, typecheck, arithmetic, smt, rule, state_machine and regex must leave a kibi.code-certificate.v1 that Kibi re-checks before the receipt counts as proved. source reads the contract's source itself: the run may leave {version, kind: source, test_id, source} or nothing, and Kibi stores its own read as the certificate."},"pattern_source":{"description":"regex: the export holding the code's pattern (a RegExp, or a Python re.Pattern) or string constant that a string fact is about.","properties":{"arg":{"description":"A SWI-Prolog predicate's argument (1-based) whose solutions Kibi reads, when the predicate takes more than one argument (operator/2 with arg 1 lists each operator's name).","maximum":9007199254740991,"minimum":1,"type":"integer"},"export":{"minLength":1,"type":"string"},"symbol_id":{"minLength":1,"type":"string"}},"required":["symbol_id"],"type":"object"},"predicate_source":{"additionalProperties":{},"description":"rule: the code function behind each predicate a claim's rule, predicate or set fact names, keyed by predicate name. Each export takes the predicate's arguments in order and returns a boolean; Kibi calls it on every combination of its argument domains.","properties":{},"type":"object"},"proves":{"description":"Certificate kinds: the requirement claim keys (CLAIM-...) this certificate proves. Each must be a modeled claim of a current requirement the test reaches through its scenarios. Kibi derives what the certificate must establish from the claim's grounding fact (a set fact for exhaustive or typecheck, a numeric fact for arithmetic or smt, a rule, predicate or set fact for rule and state_machine, a string fact for regex); a claim with no such derivation is only attested and never counts as proved.","items":{"pattern":"^CLAIM-","type":"string"},"minItems":1,"type":"array","uniqueItems":true},"required_proofs":{"items":{"properties":{"symbol_id":{"minLength":1,"type":"string"},"target":{"minLength":1,"type":"string"}},"required":["symbol_id","target"],"type":"object"},"maxItems":1000,"minItems":1,"type":"array"},"source":{"additionalProperties":{},"description":"source: the project source a source proof reads. A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?} over TypeScript, JavaScript, Python and SWI-Prolog files. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. prolog: {file, functor: Name/Arity, arg?} reads one argument of every fact with that functor in a SWI-Prolog file (requires/1 in pack.pl), without running it. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.","properties":{"reader":{"anyOf":[{"const":"json","type":"string"},{"const":"yaml","type":"string"},{"const":"glob","type":"string"},{"const":"openapi","type":"string"},{"const":"references","type":"string"},{"const":"schema","type":"string"},{"const":"routes","type":"string"},{"const":"validator","type":"string"},{"const":"prolog","type":"string"}]}},"required":["reader"],"type":"object"},"success_policy":{"anyOf":[{"const":"all_required_first_attempt","type":"string"},{"const":"own_results_first_attempt","type":"string"}]},"value_source":{"description":"arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. A dotted export (POLICY.eventLimit) reads one field of an object export. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).","items":{"properties":{"arg":{"description":"A SWI-Prolog predicate's argument (1-based) whose solutions Kibi reads, when the predicate takes more than one argument (operator/2 with arg 1 lists each operator's name).","maximum":9007199254740991,"minimum":1,"type":"integer"},"export":{"minLength":1,"type":"string"},"measure":{"anyOf":[{"const":"value","type":"string"},{"const":"count","type":"string"}],"description":"value (default for an export): the export is a number. count (the only measure of a source): the number of members of a list, set, map or object export, or of a source."},"source":{"additionalProperties":{},"description":"A project source Kibi reads by itself. reader json or yaml: {file, path?, select?: keys|values|items}. glob: {pattern, capture?, ignore?} (capture true reads what each * matched). openapi: {file, select?: operations|unsecured_operations|security_schemes|responses}. references: {files, extract: env|imports|calls|string_args|thrown|property, callee?, key?, ignore?} over TypeScript, JavaScript, Python and SWI-Prolog files. schema: {format: drizzle|prisma|sql, file (drizzle, prisma) or files (sql migrations), exports?, table?, select?: tables|columns|required_columns|nullable_columns|foreign_keys}. routes: {file, export, framework?: hono|express, path_prefix?, names_from?, select?: routes|middleware}. validator: {file, export, select?: fields|required_fields|optional_fields}. prolog: {file, functor: Name/Arity, arg?} reads one argument of every fact with that functor in a SWI-Prolog file (requires/1 in pack.pl), without running it. Paths are repository-relative. A member Kibi cannot read statically fails the read with its location.","properties":{"reader":{"anyOf":[{"const":"json","type":"string"},{"const":"yaml","type":"string"},{"const":"glob","type":"string"},{"const":"openapi","type":"string"},{"const":"references","type":"string"},{"const":"schema","type":"string"},{"const":"routes","type":"string"},{"const":"validator","type":"string"},{"const":"prolog","type":"string"}]}},"required":["reader"],"type":"object"},"symbol_id":{"minLength":1,"type":"string"}},"type":"object"},"minItems":1,"type":"array"},"version":{"const":"kibi.proof-contract.v1","type":"string"},"witness":{"description":"typecheck: the repository-relative witness file Kibi compiles (an exhaustive switch ending in never, or a mapped type over the domain).","properties":{"path":{"minLength":1,"type":"string"}},"required":["path"],"type":"object"}},"required":["version","integration","required_proofs","success_policy"],"type":"object"},"proof_receipts":{"description":"Append-only proof evidence. Proof accepts only the newest valid passed receipt bound to the current code snapshot, current contract hash, and effective execution fingerprint within the seven-day freshness window. Ingest rotates the oldest entries at the cap.","items":{"description":"Kibi-derived kibi.proof-receipt.v2 (kibi.proof-receipt.v1 entries are still read). Receipts are never caller-authored; kb_ingest_proof derives them from kibi.proof-run.v1 artifacts.","properties":{"artifact_digest":{"pattern":"^[a-f0-9]{64}$","type":"string"},"binding_hash":{"pattern":"^[a-f0-9]{64}$","type":"string"},"certificate":{"additionalProperties":{},"properties":{},"type":"object"},"certificate_digest":{"pattern":"^[a-f0-9]{64}$","type":"string"},"certificate_rejection":{"minLength":1,"type":"string"},"claim_bindings":{"description":"Certificate kinds: how the certificate binds to each claim its contract names in proves, judged at ingest. derived means Kibi derived the certificate's obligation from the claim's grounding fact and the certificate satisfies it; attested means no derivation exists and the author vouches for it (never proved); rejected names why.","items":{"properties":{"binding":{"anyOf":[{"const":"derived","type":"string"},{"const":"attested","type":"string"},{"const":"rejected","type":"string"}]},"claim_key":{"minLength":1,"type":"string"},"fact_id":{"minLength":1,"type":"string"},"obligation":{"additionalProperties":{},"properties":{},"type":"object"},"reason":{"minLength":1,"type":"string"},"requirement_id":{"minLength":1,"type":"string"},"scope":{"anyOf":[{"const":"code","type":"string"},{"const":"source","type":"string"},{"const":"harness","type":"string"},{"const":"intent","type":"string"}]}},"required":["claim_key","binding"],"type":"object"},"type":"array"},"code_snapshot":{"pattern":"^[a-f0-9]{64}$","type":"string"},"command_argv":{"items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"},"contract_hash":{"pattern":"^[a-f0-9]{64}$","type":"string"},"environment_hash":{"pattern":"^[a-f0-9]{64}$","type":"string"},"evidence_level":{"anyOf":[{"const":"proved","type":"string"},{"const":"tested","type":"string"}]},"fingerprint":{"pattern":"^[a-f0-9]{64}$","type":"string"},"fingerprint_components":{"properties":{"bindings":{"pattern":"^[a-f0-9]{64}$","type":"string"},"command":{"pattern":"^[a-f0-9]{64}$","type":"string"},"contract":{"pattern":"^[a-f0-9]{64}$","type":"string"},"integration":{"pattern":"^[a-f0-9]{64}$","type":"string"},"producer":{"pattern":"^[a-f0-9]{64}$","type":"string"}},"required":["contract","integration","command","bindings","producer"],"type":"object"},"finished_at":{"minLength":1,"type":"string"},"gaps":{"items":{"properties":{"reason":{"minLength":1,"type":"string"},"symbol_id":{"minLength":1,"type":"string"},"target":{"minLength":1,"type":"string"}},"required":["symbol_id","target","reason"],"type":"object"},"type":"array"},"integration_id":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"e2e","type":"string"},{"const":"example","type":"string"},{"const":"property","type":"string"},{"const":"exhaustive","type":"string"},{"const":"typecheck","type":"string"},{"const":"arithmetic","type":"string"},{"const":"smt","type":"string"},{"const":"rule","type":"string"},{"const":"state_machine","type":"string"},{"const":"regex","type":"string"},{"const":"source","type":"string"}]},"outcome":{"anyOf":[{"const":"passed","type":"string"},{"const":"failed","type":"string"},{"const":"errored","type":"string"},{"const":"cancelled","type":"string"},{"const":"skipped","type":"string"},{"const":"timed_out","type":"string"},{"const":"interrupted","type":"string"}]},"producer":{"properties":{"name":{"minLength":1,"type":"string"},"version":{"minLength":1,"type":"string"}},"required":["name"],"type":"object"},"proof_results":{"items":{"properties":{"attempts":{},"binding":{"anyOf":[{"const":"native_case","type":"string"},{"const":"aggregate_run","type":"string"}]},"native_id":{"minLength":1,"type":"string"},"outcome":{"anyOf":[{"const":"passed","type":"string"},{"const":"failed","type":"string"},{"const":"timed_out","type":"string"},{"const":"skipped","type":"string"},{"const":"interrupted","type":"string"},{"const":"errored","type":"string"}]},"symbol_id":{"minLength":1,"type":"string"},"target":{"minLength":1,"type":"string"}},"required":["symbol_id","target","outcome","binding","attempts"],"type":"object"},"maxItems":1000,"minItems":0,"type":"array"},"receipt_id":{"pattern":"^PR-[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$","type":"string"},"run_outcome":{"anyOf":[{"const":"passed","type":"string"},{"const":"failed","type":"string"},{"const":"errored","type":"string"},{"const":"cancelled","type":"string"},{"const":"timed_out","type":"string"},{"const":"interrupted","type":"string"},{"const":"no_results","type":"string"}]},"scope":{"anyOf":[{"const":"unit","type":"string"},{"const":"integration","type":"string"},{"const":"end_to_end","type":"string"}]},"started_at":{"minLength":1,"type":"string"},"test_id":{"minLength":1,"type":"string"},"version":{"anyOf":[{"const":"kibi.proof-receipt.v1","type":"string"},{"const":"kibi.proof-receipt.v2","type":"string"}]}},"required":["version","receipt_id","test_id","scope","outcome","code_snapshot","environment_hash","started_at","finished_at","artifact_digest","contract_hash","fingerprint","fingerprint_components","integration_id","producer","command_argv","run_outcome","proof_results"],"type":"object"},"maxItems":50,"type":"array"},"property_key":{"description":"Snake_case only. Optional canonical property key for property_value facts. Example: 'session.timeout_minutes'. Do not use propertyKey in kb_upsert.properties.","type":"string"},"rationale":{"description":"Requirement-only. Why the requirement exists, in one or two sentences in the words of whoever stated the intent. Send it in the same write whenever they gave a reason, and never write one of your own; not part of the checked meaning.","minLength":1,"type":"string"},"required_evidence":{"anyOf":[{"const":"proved","type":"string"},{"const":"tested","type":"string"},{"const":"asserted","type":"string"},{"const":"unverified","type":"string"}],"description":"Requirement-only. Weakest evidence level it accepts; the evidence-floor rule fails below it. Absent = tested if firm, else unverified."},"rule_hash":{"description":"Deterministic hash of canonical rule_ir.","type":"string"},"rule_ir":{"additionalProperties":{},"description":"Schema-validated kibi.logic.v1 rule IR. It is persisted as data and never executed as caller-supplied Prolog.","properties":{},"type":"object"},"rule_name":{"description":"Stable rule schema name.","type":"string"},"rule_schema_id":{"description":"Rule schema fact ID used to validate this rule.","type":"string"},"scope":{"description":"Optional scope qualifier for fact entities.","type":"string"},"semantic_clauses":{"description":"Optional complete atomic decomposition used by kb_model mode analyze and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.","items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"},"semantic_inventory":{"description":"Requirement proposition ledger returned by kb_model mode analyze (CLI: kibi model); preserve entries while modeling each assertive span. An unmodeled normative, condition, exception or definition entry must carry `subjects`: the defined subject keys it is about.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"semantic_inventory_version":{"const":"kibi.semantic-inventory.v1","description":"Requirement-only proposition ledger contract version returned by kb_model mode analyze (CLI: kibi model).","type":"string"},"semantic_key":{"description":"Canonical semantic identity of the normalized logical model.","type":"string"},"semantic_source_field":{"anyOf":[{"const":"semantic_text","type":"string"},{"const":"text_ref","type":"string"},{"const":"title","type":"string"}],"description":"Requirement field whose exact UTF-8 bytes anchor semantic_inventory spans."},"semantic_source_hash":{"description":"SHA-256 of the exact semantic source text returned in the advisor inventory contract.","pattern":"^[a-f0-9]{64}$","type":"string"},"semantic_text":{"description":"Requirement-only authored prose used for semantic inventory hashes and UTF-8 spans. Keep text_ref available for independent document or code evidence.","type":"string"},"severity":{"description":"Optional severity label. Example: 'critical'.","type":"string"},"source":{"description":"Optional provenance string. Example: '.kb/requirements/REQ-cli-gc.md'. Defaults to 'mcp://kibi/upsert'.","type":"string"},"sourceFile":{"description":"Optional code source file for symbol entities. Example: 'src/auth/login.ts'.","type":"string"},"status":{"description":"Required lifecycle state. Allowed values depend on entity type; backward-compatible legacy statuses are also accepted. Examples: 'open', 'passing', 'accepted', 'active'.","type":"string"},"subject_key":{"description":"Snake_case only. Optional canonical subject key for strict fact entities. Example: 'user.session'. Do not use subjectKey in kb_upsert.properties.","type":"string"},"symbol_role":{"anyOf":[{"const":"behavioral","type":"string"},{"const":"structural","type":"string"},{"const":"type-shape","type":"string"},{"const":"config","type":"string"},{"const":"module","type":"string"},{"const":"unknown","type":"string"}],"description":"Optional role classification for symbol entities. Example: 'behavioral'."},"tags":{"description":"Optional categorization tags. Example: ['security','api'].","items":{"type":"string"},"type":"array"},"text_ref":{"description":"Optional text anchor/reference. Example: 'requirements.md#L40'.","type":"string"},"title":{"description":"Required short title. Example: 'Protect account settings endpoint'.","type":"string"},"unit":{"description":"Optional unit for numeric property_value facts.","type":"string"},"value_bool":{"description":"Optional boolean value for property_value facts.","type":"boolean"},"value_int":{"description":"Optional integer value for property_value facts.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"value_number":{"description":"Optional number value for property_value facts.","type":"number"},"value_set":{"description":"Optional exact set of values for property_value facts with value_type set, such as the members a domain must have.","items":{"minLength":1,"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"value_string":{"description":"Optional string value for property_value facts.","type":"string"},"value_type":{"anyOf":[{"const":"string","type":"string"},{"const":"int","type":"string"},{"const":"number","type":"string"},{"const":"bool","type":"string"},{"const":"set","type":"string"}],"description":"Optional typed value discriminator for property_value facts. Pair with exactly one value_string, value_int, value_number, value_bool, or value_set (set: a list of members, with operator eq, includes, subset_of or excludes); do not use generic value."},"verification_perspective":{"anyOf":[{"const":"internal","type":"string"},{"const":"consumer","type":"string"}],"description":"Optional typed verification perspective for test entities. Example: 'consumer'."},"verification_scope":{"anyOf":[{"const":"unit","type":"string"},{"const":"integration","type":"string"},{"const":"end_to_end","type":"string"}],"description":"Optional typed verification scope for test entities. Example: 'end_to_end'."}},"required":["title","status"],"type":"object"},"relationships":{"description":"Optional relationship rows to create in the same call. For requirement encoding, prefer `constrains` + `requires_property` for strict property facts or `requires_predicate` for ontology predicate facts. Side effect: asserts edges in KB.","items":{"additionalProperties":{},"properties":{"from":{"description":"Source entity ID (must exist). Example: 'SYM-login-handler'.","type":"string"},"to":{"description":"Target entity ID (must exist). Example: 'REQ-cli-gc'.","type":"string"},"type":{"anyOf":[{"const":"depends_on","type":"string"},{"const":"specified_by","type":"string"},{"const":"verified_by","type":"string"},{"const":"validates","type":"string"},{"const":"implements","type":"string"},{"const":"covered_by","type":"string"},{"const":"executable_for","type":"string"},{"const":"constrained_by","type":"string"},{"const":"constrains","type":"string"},{"const":"requires_property","type":"string"},{"const":"requires_predicate","type":"string"},{"const":"requires_rule","type":"string"},{"const":"guards","type":"string"},{"const":"publishes","type":"string"},{"const":"consumes","type":"string"},{"const":"supersedes","type":"string"},{"const":"restates","type":"string"},{"const":"assumes","type":"string"},{"const":"exempts","type":"string"},{"const":"relates_to","type":"string"}],"description":"Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test)."}},"required":["type","from","to"],"type":"object"},"type":"array"},"type":{"anyOf":[{"const":"req","type":"string"},{"const":"scenario","type":"string"},{"const":"test","type":"string"},{"const":"adr","type":"string"},{"const":"flag","type":"string"},{"const":"event","type":"string"},{"const":"symbol","type":"string"},{"const":"fact","type":"string"}],"description":"Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'."},"why":{"description":"req only: why the requirement exists, in the words of the person who asked ('Reason not stated' when they gave none). Kibi records it as rationale and as the body's Context section, with origin.ref as its Source.","minLength":1,"type":"string"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["type","id","properties"],"type":"object"},"name":"kb_upsert","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"anyOf":[{"additionalProperties":false,"properties":{"claimKey":{"description":"For a fact with claim_text: the stored claim_key, derived from claim_text when the payload did not supply it.","type":"string"},"contradictionCheck":{"additionalProperties":{},"properties":{},"type":"object"},"created":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"effectFailures":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"implementedBy":{"description":"Each implementedBy entry's symbolId and whether it was created.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"inventoryApplied":{"description":"Each claim recorded for a requirement sent without its inventory contract.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"nextActions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"relatedRequirements":{"description":"Current requirements on the same terms.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"relationships_created":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"semanticAdvisor":{"additionalProperties":{},"properties":{},"type":"object"},"siblings":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"sourceWrites":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"status":{"type":"string"},"updated":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"warnings":{"items":{},"type":"array"}},"type":"object"},{"additionalProperties":false,"properties":{"dryRun":{"const":true,"type":"boolean"},"errorCode":{"type":"string"},"errors":{"items":{},"type":"array"},"implementedBy":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"inventoryApplied":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"nextActions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"normalizedPreview":{"anyOf":[{"additionalProperties":{},"properties":{},"type":"object"},{"type":"null"}]},"rejection":{"additionalProperties":{},"properties":{},"type":"object"},"semanticAdvisor":{"anyOf":[{"additionalProperties":{},"properties":{},"type":"object"},{"type":"null"}]},"siblings":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"skippedEffects":{"items":{"type":"string"},"type":"array"},"stagedFacts":{"items":{"type":"string"},"type":"array"},"valid":{"type":"boolean"},"warnings":{"items":{},"type":"array"},"whatIf":{"additionalProperties":{},"properties":{},"type":"object"}},"required":["valid","dryRun","skippedEffects"],"type":"object"}],"description":"Committed upsert payload, or the validation preview when dryRun:true wrote nothing."},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":2,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_upsert","type":"string"},"resultVersion":{"const":"kibi.kb_upsert.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Delete a Kibi entity"},"description":"Delete entities by ID, or exact relationship triples. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. An entity authored in a Markdown or YAML source is not deleted directly: the call writes nothing and returns outcome plan_returned with a hash-bound deletionPlan and a nextActions entry holding the exact kb_apply_plan input ({plan, approvedPlanHash}); apply that unmodified, or repeat this call with approvedPlanHash = deletionPlan.planHash to apply the freshly computed plan in one step (a stale or different hash fails with DELETE_PLAN_HASH_MISMATCH and writes nothing). Authored requirements are never deleted: outcome supersession_required points to kb_upsert with a supersedes relationship. dryRun:true previews any delete and writes nothing. Side effects: mutates and saves KB and authored sources; skips entities with dependents; dryRun and plan_returned write nothing.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"approvedPlanHash":{"description":"With ids only: the deletionPlan.planHash a prior call for the same ids returned. The plan is recomputed and applied through kb_apply_plan when its hash still matches; a mismatch fails with DELETE_PLAN_HASH_MISMATCH and writes nothing. Not allowed with relationships or dryRun.","pattern":"^[a-fA-F0-9]{64}$","type":"string"},"dryRun":{"description":"Preview without writing. Relationship and direct entity deletes run their preflight and return outcome dry_run with wouldDelete counts, the sourceWrites (paths and hashes) a commit would make, and skippedEffects. Authored ids return the same deletion plan as without dryRun.","type":"boolean"},"ids":{"description":"Entity IDs to delete after dependency checks.","items":{"type":"string"},"minItems":1,"type":"array"},"relationships":{"description":"Exact relationship triples to retract, including legacy shard records.","items":{"properties":{"from":{"minLength":1,"type":"string"},"to":{"minLength":1,"type":"string"},"type":{"minLength":1,"type":"string"}},"required":["type","from","to"],"type":"object"},"minItems":1,"type":"array"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_delete","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"deleted":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"deletionPlan":{"additionalProperties":{},"properties":{},"type":"object"},"dryRun":{"const":true,"type":"boolean"},"effectFailures":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"error_codes":{"items":{},"type":"array"},"errors":{"items":{},"type":"array"},"nextActions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"outcome":{"anyOf":[{"const":"plan_returned","type":"string"},{"const":"supersession_required","type":"string"},{"const":"plan_applied","type":"string"},{"const":"dry_run","type":"string"}],"description":"Absent on a direct delete. plan_returned: deletionPlan was returned and nothing was written; nextActions[0].input is the exact kb_apply_plan input. supersession_required: an authored requirement must be superseded with kb_upsert instead. plan_applied: approvedPlanHash matched and the plan was applied. dry_run: dryRun:true previewed the delete and nothing was written."},"planHash":{"type":"string"},"recoveryJournalId":{"type":"string"},"relationship_results":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"relationships_deleted":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"skipped":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"skippedEffects":{"items":{"type":"string"},"type":"array"},"sourcePaths":{"items":{"type":"string"},"type":"array"},"sourceWrites":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"status":{"type":"string"},"supersessionPlan":{"additionalProperties":{},"properties":{},"type":"object"},"sync_required":{"type":"boolean"},"wouldDelete":{"additionalProperties":{},"properties":{},"type":"object"}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":2,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_delete","type":"string"},"resultVersion":{"const":"kibi.kb_delete.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Validate Kibi knowledge base"},"description":"Run KB validation rules and return violations, quality diagnostics, and typed kibi.migration-plan.v2 actions. Use before or after mutations and after source edits; checks remain read-only and never infer or apply actions from prose suggestions.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"async":{"description":"When true, start the check as a background job and return a kibi.job.v1 receipt immediately instead of holding the request until the tool timeout. Poll kb_job_status with the returned jobId. Use for full checks on large KBs that exceed the configured tool timeout. The MCP server registers kb_job_status only when KIBI_MCP_OPTIONAL_TOOLS includes it; otherwise async runs the check synchronously.","type":"boolean"},"changed":{"description":"When true, run the commit gate (kibi check --staged) over the working tree plus the index, as a commit of every current change would be judged, without touching the real index; with sourceFiles, only those files and .kb are added. Returns commitAllowed and the gate's findings, each with blocks: \"commit\" when it refuses the commit or \"none\" when it is advice. Without changed, each finding carries blocks: \"merge\" (fails the full check run in CI), \"commit\" (a blocking impact diagnostic) or \"none\". Use after editing code, before finishing: it is the verdict git commit will give.","type":"boolean"},"includeImpactDiagnostics":{"description":"When true, include changed-file impact diagnostics such as symbol_granularity_violation, symbol_semantic_review_needed, source_file_unowned and requirement_statement_unverified (each current requirement the changed code implements, with its statement and firmness, since the check never compares code with a statement) in structured output.","type":"boolean"},"includeMigrationPlan":{"description":"Return the full migrationPlan (its actions, for kb_apply_plan) instead of migrationPlanSummary, which a check with sourceFiles always gives and any other check gives when the result is over its size budget.","type":"boolean"},"includeSymbolDebt":{"description":"Without rules or sourceFiles: list the unrecorded declarations per file under symbolDebt.files. By default symbolDebt carries only total and fileCount; the debt never blocks.","type":"boolean"},"includeWorkingTreeDiff":{"description":"When true, inspect current unstaged working-tree diffs for impact diagnostics. Pair with sourceFiles to scope the analysis.","type":"boolean"},"maxDiagnostics":{"description":"Optional maximum number of impact diagnostics to return. Graph validation violations are not capped by this value.","maximum":9007199254740991,"minimum":0,"type":"integer"},"rules":{"description":"Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, symbol-granularity, symbol-coordinates-missing, no-dangling-refs, source-relationship-parity, branch-store-not-compiled, source-path-dangling, no-cycles, required-fields, deprecated-adr-no-successor, superseded-requirement-open, scenario-feasibility, scenario-feasibility-unknown, scenario-outcome-mismatch, exception-claim-keys, numeric-string-value, rule-key-arguments-missing, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, retired-reason-missing, retired-owner-only, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, related-requirement-unmodeled, claim-subject-missing, claim-subject-undefined, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, exception-unapproved, exception-approval-self-attested, agent-requirement-unapproved, requirement-rationale-missing, symbol-owner-superseded, adr-unlinked, adr-proposed, predicate-schema-conformance, entity-context-missing, subject-definition-missing, subject-duplicate, quantity-duplicate, subject-hierarchy-invalid, entity-context-acknowledged, decision-firm-unreferenced, decision-firm-superseded, decision-firm-edited, supersedes-reason-missing, supersedes-reason-acknowledged, policy-ownership, policy-markers, kb-consistency, kb-consistency-unresolved, evidence-floor, agent-requirement-unapproved-implemented, must-positive-scenario, proof-contract-claims. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.","items":{"anyOf":[{"const":"must-priority-coverage","type":"string"},{"const":"symbol-coverage","type":"string"},{"const":"symbol-traceability","type":"string"},{"const":"symbol-granularity","type":"string"},{"const":"symbol-coordinates-missing","type":"string"},{"const":"no-dangling-refs","type":"string"},{"const":"source-relationship-parity","type":"string"},{"const":"branch-store-not-compiled","type":"string"},{"const":"source-path-dangling","type":"string"},{"const":"no-cycles","type":"string"},{"const":"required-fields","type":"string"},{"const":"deprecated-adr-no-successor","type":"string"},{"const":"superseded-requirement-open","type":"string"},{"const":"scenario-feasibility","type":"string"},{"const":"scenario-feasibility-unknown","type":"string"},{"const":"scenario-outcome-mismatch","type":"string"},{"const":"exception-claim-keys","type":"string"},{"const":"numeric-string-value","type":"string"},{"const":"rule-key-arguments-missing","type":"string"},{"const":"domain-contradictions","type":"string"},{"const":"logic-coverage","type":"string"},{"const":"rule-safety","type":"string"},{"const":"rule-verifiability","type":"string"},{"const":"query-plan-safety","type":"string"},{"const":"req-status-vocabulary","type":"string"},{"const":"retired-reason-missing","type":"string"},{"const":"retired-owner-only","type":"string"},{"const":"strict-fact-shape","type":"string"},{"const":"strict-req-fact-pairing","type":"string"},{"const":"predicate-verifiability","type":"string"},{"const":"strict-readiness","type":"string"},{"const":"semantic-completeness","type":"string"},{"const":"related-requirement-unmodeled","type":"string"},{"const":"claim-subject-missing","type":"string"},{"const":"claim-subject-undefined","type":"string"},{"const":"proof-contract-symbols","type":"string"},{"const":"entity-id-style","type":"string"},{"const":"domain-redundancy","type":"string"},{"const":"domain-implication","type":"string"},{"const":"subject-key-identity","type":"string"},{"const":"subject-key-shape","type":"string"},{"const":"ontology-quality","type":"string"},{"const":"exception-unapproved","type":"string"},{"const":"exception-approval-self-attested","type":"string"},{"const":"agent-requirement-unapproved","type":"string"},{"const":"requirement-rationale-missing","type":"string"},{"const":"symbol-owner-superseded","type":"string"},{"const":"adr-unlinked","type":"string"},{"const":"adr-proposed","type":"string"},{"const":"predicate-schema-conformance","type":"string"},{"const":"entity-context-missing","type":"string"},{"const":"subject-definition-missing","type":"string"},{"const":"subject-duplicate","type":"string"},{"const":"quantity-duplicate","type":"string"},{"const":"subject-hierarchy-invalid","type":"string"},{"const":"entity-context-acknowledged","type":"string"},{"const":"decision-firm-unreferenced","type":"string"},{"const":"decision-firm-superseded","type":"string"},{"const":"decision-firm-edited","type":"string"},{"const":"supersedes-reason-missing","type":"string"},{"const":"supersedes-reason-acknowledged","type":"string"},{"const":"policy-ownership","type":"string"},{"const":"policy-markers","type":"string"},{"const":"kb-consistency","type":"string"},{"const":"kb-consistency-unresolved","type":"string"},{"const":"evidence-floor","type":"string"},{"const":"agent-requirement-unapproved-implemented","type":"string"},{"const":"must-positive-scenario","type":"string"},{"const":"proof-contract-claims","type":"string"}]},"type":"array"},"sourceFiles":{"description":"Optional repo-relative source files to inspect for early impact diagnostics. Use with includeImpactDiagnostics after meaningful source edits. Scopes the result to those files: blocking violations are listed for entities the changed symbols link to, entities whose KB document changed, and store-level rules; the rest are counted in omittedViolations (count still includes them). The migration plan comes as migrationPlanSummary, and a result over its size budget is cut (truncated: true).","items":{"type":"string"},"type":"array"},"staged":{"description":"When true, inspect staged source changes for impact diagnostics using the shared CLI impact analyzer without shelling out to kibi check.","type":"boolean"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_check","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"anyOf":[{"additionalProperties":false,"properties":{"changed":{"const":true,"description":"Set by changed:true: the commit gate judged the working tree plus the index.","type":"boolean"},"commitAllowed":{"description":"changed:true only. True when a commit of these changes passes the commit gate.","type":"boolean"},"count":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"diagnostics":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"evaluated":{"additionalProperties":{},"properties":{},"type":"object"},"extractedSymbols":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"impactDiagnostics":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"linkedEntities":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"messages":{"items":{"type":"string"},"type":"array"},"migrationPlan":{"additionalProperties":{},"properties":{},"type":"object"},"migrationPlanSummary":{"additionalProperties":{},"properties":{},"type":"object"},"nextActions":{"items":{},"type":"array"},"omittedViolations":{"additionalProperties":{},"properties":{},"type":"object"},"operationalError":{"type":"string"},"ownerFindings":{"items":{},"type":"array"},"qualityDiagnostics":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"sourceFiles":{"items":{"type":"string"},"type":"array"},"staged":{"additionalProperties":{},"properties":{},"type":"object"},"symbolDebt":{"additionalProperties":false,"description":"Unscoped checks only. Declarations without a symbol record in source files that have at least one record, as counts; files lists them only with includeSymbolDebt. Non-blocking: the staged gate judges them only when a commit adds or changes them.","properties":{"fileCount":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"files":{"items":{"additionalProperties":false,"properties":{"path":{"type":"string"},"unrecorded":{"items":{"type":"string"},"type":"array"}},"required":["path","unrecorded"],"type":"object"},"type":"array"},"total":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"}},"required":["total","fileCount"],"type":"object"},"truncated":{"const":true,"type":"boolean"},"truncation":{"additionalProperties":{},"properties":{},"type":"object"},"violationGroups":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"violations":{"items":{},"type":"array"}},"type":"object"},{"additionalProperties":false,"properties":{"jobId":{"type":"string"},"jobVersion":{"const":"kibi.job.v1","type":"string"},"kibiProtocol":{"const":1,"type":"number"},"pollWith":{"const":"kb_job_status","type":"string"},"status":{"type":"string"},"tool":{"type":"string"}},"required":["kibiProtocol","jobVersion","jobId","tool","status","pollWith"],"type":"object"}],"description":"Synchronous check payload, or a kibi.job.v1 receipt when async:true detached the check into a background job (poll kb_job_status with the jobId)."},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":2,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_check","type":"string"},"resultVersion":{"const":"kibi.kb_check.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Prepare an impact review"},"description":"Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Use it when kb_check reports that changed files need an impact review; it does not plan KB changes. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"scope":{"description":"What to review: {\"kind\":\"staged\"} for the staged snapshot, or {\"kind\":\"diff\",\"baseCommit\":\"<sha>\",\"headCommit\":\"<sha>\"} with full commit hashes."},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["scope"],"type":"object"},"name":"kb_prepare_impact_review","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"authorship":{"additionalProperties":false,"properties":{"analysisReviewSchema":{"additionalProperties":{},"properties":{},"type":"object"},"authoredFields":{"items":{"type":"string"},"type":"array"},"decisionSchema":{"additionalProperties":{},"properties":{},"type":"object"},"instructions":{"type":"string"},"isValidImpactReviewRecord":{"const":false,"type":"boolean"},"recordSchema":{"additionalProperties":{},"properties":{},"type":"object"},"recordTemplate":{"additionalProperties":false,"properties":{"isValidImpactReviewRecord":{"const":false,"type":"boolean"},"record":{"additionalProperties":false,"properties":{"contractVersion":{"const":"kibi.impact-review.v1","type":"string"},"evaluator":{"additionalProperties":false,"properties":{"contractVersion":{"const":"kibi.impact-evaluator.v1","type":"string"},"fingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["contractVersion","fingerprint"],"type":"object"},"files":{"items":{"anyOf":[{},{}]},"type":"array"},"policy":{"additionalProperties":false,"properties":{"fingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","fingerprint"],"type":"object"},"reviewedAt":{"type":"null"},"reviewer":{"additionalProperties":false,"properties":{"id":{"type":"null"},"source":{"const":"self-claimed-local","type":"string"}},"required":["id","source"],"type":"object"},"scope":{"additionalProperties":false,"properties":{"fingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"knowledgeFingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"providerSetFingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["fingerprint","knowledgeFingerprint","providerSetFingerprint"],"type":"object"}},"required":["contractVersion","policy","evaluator","scope","reviewer","reviewedAt","files"],"type":"object"},"templateVersion":{"const":"kibi.impact-review-authoring-template.v1","type":"string"}},"required":["templateVersion","isValidImpactReviewRecord","record"],"type":"object"},"templateSchema":{"additionalProperties":{},"properties":{},"type":"object"},"templateVersion":{"const":"kibi.impact-review-authoring-template.v1","type":"string"}},"required":["templateVersion","isValidImpactReviewRecord","instructions","authoredFields","recordSchema","decisionSchema","analysisReviewSchema","templateSchema","recordTemplate"],"type":"object"},"files":{"items":{"anyOf":[{},{}]},"type":"array"},"preparationVersion":{"const":"kibi.impact-review-preparation.v1","type":"string"},"recordHeaders":{"additionalProperties":false,"properties":{"contractVersion":{"const":"kibi.impact-review.v1","type":"string"},"evaluator":{"additionalProperties":false,"properties":{"contractVersion":{"const":"kibi.impact-evaluator.v1","type":"string"},"fingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["contractVersion","fingerprint"],"type":"object"},"policy":{"additionalProperties":false,"properties":{"fingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"id":{"type":"string"},"version":{"type":"string"}},"required":["id","version","fingerprint"],"type":"object"},"scope":{"additionalProperties":false,"properties":{"fingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"knowledgeFingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"},"providerSetFingerprint":{"pattern":"^sha256:[0-9a-f]{64}$","type":"string"}},"required":["fingerprint","knowledgeFingerprint","providerSetFingerprint"],"type":"object"}},"required":["contractVersion","policy","evaluator","scope"],"type":"object"},"requirementScopes":{"items":{"additionalProperties":false,"properties":{"after":{"items":{},"type":"array"},"before":{"items":{},"type":"array"},"path":{"type":"string"},"requirementIds":{"items":{"type":"string"},"type":"array"}},"required":["path","requirementIds","before","after"],"type":"object"},"type":"array"},"residualReviewObligations":{"items":{},"type":"array"},"snapshot":{"additionalProperties":false,"properties":{"baseCommit":{},"baseTree":{"pattern":"^(?:[0-9a-f]{40}|[0-9a-f]{64})$","type":"string"},"headCommit":{},"headTree":{"pattern":"^(?:[0-9a-f]{40}|[0-9a-f]{64})$","type":"string"},"headTreeSource":{"anyOf":[{"const":"index","type":"string"},{"const":"commit","type":"string"}]},"kind":{"anyOf":[{"const":"staged","type":"string"},{"const":"diff","type":"string"}]}},"required":["kind","baseCommit","baseTree","headCommit","headTree","headTreeSource"],"type":"object"},"status":{"const":"ready_for_authoring","type":"string"}},"required":["preparationVersion","status","snapshot","recordHeaders","files","requirementScopes","residualReviewObligations","authorship"],"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":2,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_prepare_impact_review","type":"string"},"resultVersion":{"const":"kibi.kb_prepare_impact_review.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Plan Kibi bootstrap"},"description":"Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Use it only to onboard a repository whose KB is empty or incomplete (the kibi-bootstrap skill drives it); for a change in an onboarded project use kb_compile_intent. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"bootstrapContext":{"additionalProperties":{},"description":"Optional declared bootstrap context supplied by the agent to ground the read-only synthesis output.","properties":{"conflicts":{"description":"Contradictions the agent found between declared intentClaims and leaves for the human to resolve. Each becomes a cited fact candidate with fact_kind observation tagged review:conflict. Every claimReference must match a declared claim's sourceId and reference. Bound into the plan hash.","items":{"properties":{"claimReferences":{"items":{"properties":{"reference":{"minLength":1,"type":"string"},"sourceId":{"minLength":1,"type":"string"}},"required":["sourceId","reference"],"type":"object"},"maxItems":10,"minItems":2,"type":"array"},"note":{"description":"What disagrees, in one sentence, without resolving it.","minLength":1,"type":"string"}},"required":["claimReferences","note"],"type":"object"},"maxItems":50,"type":"array"},"intentClaims":{"description":"Statements the agent harvested from knowledgeSources, each citing its source. Intent claims (the default kind) that the strict modeler can ground become cited req candidates; the rest become explicit authoring follow-ups. Observation and open_question claims never become requirements: they become cited fact candidates with fact_kind observation, open questions tagged review:open-question. Every intent and observation claim needs an excerpt: the created entity's body keeps the statement, then a '## Source' section with the blockquoted excerpt, the source title and the reference. Bound into the plan hash.","items":{"properties":{"component":{"description":"Optional component the claim is about (for example recorder). Generated subject keys take the shape component.aspect with the aspect from the claim's subject. Without a component on the claim or its knowledge source, a claim whose subject is not a single word or already dotted becomes an authoring follow-up with a diagnostic instead of a malformed subject key.","minLength":1,"type":"string"},"excerpt":{"description":"Verbatim passage from the source the claim came from. Required for intent and observation claims (optional for open_question): Kibi persists it with the knowledge source title and reference in the created entity's '## Source' section, because the ticket or page may be gone by the next migration.","minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"intent","type":"string"},{"const":"observation","type":"string"},{"const":"open_question","type":"string"}],"description":"intent: intended behavior (may become a req). observation: how things are today, without stating intent. open_question: something the sources leave undecided. Default: intent."},"rationale":{"description":"Optional reason the requirement exists, as the source states it or the human answered when asked. It becomes the requirement's rationale and its body's '## Context' section. Never invent one.","minLength":1,"type":"string"},"reference":{"description":"Exact citation inside the source: a ticket key, page URL, or section anchor.","minLength":1,"type":"string"},"sourceId":{"description":"The id of a declared knowledge source.","type":"string"},"statement":{"description":"One normative statement in the source's meaning, for example 'Refunds must not exceed the original charge.'","minLength":1,"type":"string"}},"required":["statement","sourceId","reference"],"type":"object"},"maxItems":200,"type":"array"},"knowledgeSources":{"description":"Knowledge sources outside the code that the human confirmed during the bootstrap interview (issue trackers, wikis, specs, decision logs). Kibi never contacts them; the agent reads them through its own connectors and cites them from intentClaims. Bound into the plan hash.","items":{"properties":{"authority":{"anyOf":[{"const":"authoritative","type":"string"},{"const":"supporting","type":"string"},{"const":"stale","type":"string"}],"description":"The human's call: authoritative claims become higher-confidence candidates, supporting claims lower ones, and stale sources are cited but never produce candidates."},"component":{"description":"Optional component this source's claims are about (for example recorder). It becomes the first segment of each generated subject_key (component.aspect); a claim's own component overrides it.","minLength":1,"type":"string"},"connector":{"description":"Optional name of the MCP server or tool the agent used to read the source.","type":"string"},"id":{"description":"Stable kebab-case handle that intentClaims cite, for example jira-payments.","pattern":"^[a-z0-9][a-z0-9-]*$","type":"string"},"kind":{"anyOf":[{"const":"issue_tracker","type":"string"},{"const":"wiki","type":"string"},{"const":"specification","type":"string"},{"const":"design","type":"string"},{"const":"decision_log","type":"string"},{"const":"support","type":"string"},{"const":"chat","type":"string"},{"const":"repository_docs","type":"string"},{"const":"other","type":"string"}]},"locator":{"description":"Where the source lives: a URL, project key, space name, or repo-relative path.","minLength":1,"type":"string"},"notes":{"type":"string"},"title":{"minLength":1,"type":"string"}},"required":["id","kind","title","locator","authority"],"type":"object"},"maxItems":50,"type":"array"},"priorityRoots":{"description":"Optional repo roots the bootstrap flow should prioritize when authoring entities.","items":{"type":"string"},"type":"array"},"projectSummary":{"description":"Optional short summary of the project or bootstrap goal.","type":"string"},"sourceOfTruthNotes":{"description":"Optional notes about how to interpret the declared sources of truth.","items":{"type":"string"},"type":"array"},"sourceOfTruthPaths":{"description":"Optional repo-relative paths that should be treated as declared sources of truth.","items":{"type":"string"},"type":"array"},"verificationAnchors":{"description":"Optional verification commands, documents, or checkpoints to reference in the output.","items":{"type":"string"},"type":"array"}},"type":"object"},"entityTypes":{"description":"Optional filter to limit candidate generation to specific entity types.","items":{"anyOf":[{"const":"req","type":"string"},{"const":"scenario","type":"string"},{"const":"test","type":"string"},{"const":"adr","type":"string"},{"const":"fact","type":"string"},{"const":"symbol","type":"string"}]},"type":"array"},"includeGenericMarkdown":{"description":"Whether to include generic markdown file content as candidate facts. Default: true, or false when bootstrapContext declares intentClaims (the declared sources already carry the intent); set it explicitly to override.","type":"boolean"},"maxCandidates":{"description":"Budget for candidates Kibi discovers itself (symbols, tests, repository documents). Declared intentClaims sit outside it: they are never capped and never use its slots. Clamped to [1, 200]. Default: 50.","maximum":200,"minimum":1,"type":"integer"},"minConfidence":{"description":"Minimum confidence threshold for candidates. Clamped to [0.60, 0.95]. Default: 0.80.","maximum":0.95,"minimum":0.6,"type":"number"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_plan_bootstrap","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"actions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"activation":{"additionalProperties":{},"properties":{},"type":"object"},"activationMode":{"type":"string"},"activationReason":{"type":"string"},"activationState":{"type":"string"},"applyBlocked":{"type":"boolean"},"bootstrapMode":{"type":"string"},"candidates":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"confidence":{"additionalProperties":{},"properties":{},"type":"object"},"contextQuestions":{"items":{"type":"string"},"type":"array"},"declaredContext":{"additionalProperties":{},"properties":{},"type":"object"},"diagnostics":{"items":{"type":"string"},"type":"array"},"discoverySummary":{"additionalProperties":{},"properties":{},"type":"object"},"expected":{"additionalProperties":{},"properties":{},"type":"object"},"handoffMessage":{"type":"string"},"migrationWarning":{"type":["string","null"]},"payoffSummary":{"additionalProperties":{},"properties":{},"type":"object"},"plan":{"additionalProperties":{},"properties":{},"type":"object"},"planHash":{"type":"string"},"pluginOffers":{"description":"Optional plugins that fit this workspace and that the project has neither activated nor declined. Ask the operator; on yes install and activate the package, on no add it to package.json kibi.declinedPlugins.","items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"promptBlock":{"type":"string"},"recommendedActions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"sourceWrites":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"status":{"type":"string"},"suppressedCandidates":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"tldr":{"type":"string"},"version":{"type":"string"}},"required":["plan","diagnostics"],"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":1,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_plan_bootstrap","type":"string"},"resultVersion":{"const":"kibi.kb_plan_bootstrap.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Compile Kibi change intent"},"description":"Compile complete change intent into a deterministic, snapshot-bound read-only plan. Use it before editing code for a change request that may touch several requirements; use kb_model for one requirement's prose and kb_plan_bootstrap for first-time onboarding. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a related current requirement without logic leaves it unresolved with reasons and reviewCandidates to compare and judge through conflictReviews. No mutation side effects.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"clauses":{"description":"Optional complete atomic clause decomposition. Each clause must be a verbatim fragment of intent (whitespace may differ); a clause that does not occur in intent fails the call with VALIDATION_FAILED naming it. Each assertive clause receives independent proposition accounting.","items":{"minLength":1,"type":"string"},"maxItems":64,"type":"array"},"conflictReviews":{"description":"Your verdict on each contradictionAnalysis.reviewCandidates entry of a previous compile: whether the intent contradicts that current requirement, which Kibi could not compare logically. A conflict verdict blocks the plan; a no_conflict verdict clears that candidate. A verdict may also name a current requirement discovery did not rank.","items":{"properties":{"note":{"maxLength":2000,"type":"string"},"requirementId":{"minLength":1,"type":"string"},"verdict":{"anyOf":[{"const":"conflict","type":"string"},{"const":"no_conflict","type":"string"}]}},"required":["requirementId","verdict"],"type":"object"},"maxItems":20,"type":"array"},"context":{"description":"Why the requirement exists, who asked and anything that does not fit its checked meaning. Required when mode is create (validation error naming this field otherwise); rendered as a '## Context' section of the requirement document, never as part of the checked meaning. Never invent a reason: write 'Reason not stated' when the requester gave none. An update keeps the existing document body unless context is supplied.","maxLength":10000,"type":"string"},"intent":{"description":"Complete post-change normative intent. Send the desired behavior, not a patch fragment.","maxLength":10000,"minLength":1,"type":"string"},"interpretations":{"description":"Optional host-supplied typed kibi.logic.v1 interpretations; Kibi validates them before including rule steps.","items":{"additionalProperties":{},"properties":{"claim_key":{"type":"string"},"claim_text":{"type":"string"},"confidence":{"maximum":1,"minimum":0,"type":"number"},"ir":{"additionalProperties":{},"properties":{},"type":"object"},"span":{"additionalProperties":{},"properties":{},"type":"object"}},"required":["claim_key","claim_text","ir"],"type":"object"},"maxItems":3,"type":"array"},"mode":{"anyOf":[{"const":"create","type":"string"},{"const":"update","type":"string"}],"description":"Create a new requirement or update an existing one. Update auto-selection is allowed only with a high-confidence, well-separated candidate."},"proposalDecisions":{"description":"Explicit decisions for deterministic traceability proposals. Pending proposals never enter steps.","items":{"additionalProperties":{},"properties":{"decision":{"anyOf":[{"const":"accept","type":"string"},{"const":"reject","type":"string"}]},"proposalId":{"minLength":1,"type":"string"}},"required":["proposalId","decision"],"type":"object"},"maxItems":20,"type":"array"},"requirementId":{"description":"Optional exact requirement ID. Required for an update when automatic selection is below the confidence and margin gates.","type":"string"},"scenarioDrafts":{"description":"Optional scenario drafts. Each is linked requirement -> scenario with specified_by.","items":{"additionalProperties":{},"properties":{"body":{"minLength":1,"type":"string"},"id":{"type":"string"},"title":{"minLength":1,"type":"string"}},"required":["title","body"],"type":"object"},"maxItems":20,"type":"array"},"semanticFacets":{"description":"Host-agent facets forwarded to deterministic intent-v1 discovery.","properties":{"actions":{"items":{"type":"string"},"maxItems":20,"type":"array"},"actors":{"items":{"type":"string"},"maxItems":20,"type":"array"},"aliases":{"items":{"type":"string"},"maxItems":20,"type":"array"},"constraints":{"items":{"type":"string"},"maxItems":20,"type":"array"},"objects":{"items":{"type":"string"},"maxItems":20,"type":"array"}},"type":"object"},"sourceExcerpt":{"description":"Optional verbatim text the intent came from (a ticket, a message, a document passage). Rendered as a blockquote in the requirement's '## Source' section; requires context.","maxLength":10000,"type":"string"},"sourceLocations":{"description":"Workspace-relative source coordinates used for discovery and before-hash binding.","items":{"properties":{"column":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"line":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"path":{"minLength":1,"type":"string"},"symbol":{"minLength":1,"type":"string"}},"required":["path"],"type":"object"},"maxItems":20,"type":"array"},"sourceReference":{"description":"Optional locator of the source text (ticket id, URL, path). Rendered in the requirement's '## Source' section; requires context.","maxLength":2000,"type":"string"},"testDrafts":{"description":"Optional test drafts. Tests are attached to scenarios with verified_by; direct req -> test proof links are not emitted.","items":{"additionalProperties":{},"properties":{"body":{"minLength":1,"type":"string"},"id":{"type":"string"},"scenarioIds":{"description":"Stable scenario draft IDs verified by this test. Required when multiple scenario drafts are supplied.","items":{"minLength":1,"type":"string"},"maxItems":20,"type":"array"},"title":{"minLength":1,"type":"string"},"verificationPerspective":{"anyOf":[{"const":"internal","type":"string"},{"const":"consumer","type":"string"}]},"verificationScope":{"anyOf":[{"const":"unit","type":"string"},{"const":"integration","type":"string"},{"const":"end_to_end","type":"string"}]}},"required":["title","body"],"type":"object"},"maxItems":20,"type":"array"},"title":{"description":"Optional requirement title; existing title is preserved for updates when omitted.","type":"string"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["intent","mode"],"type":"object"},"name":"kb_compile_intent","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"capabilityPlugins":{"additionalProperties":{},"properties":{},"type":"object"},"contradictionAnalysis":{"additionalProperties":{},"properties":{},"type":"object"},"diagnostics":{"items":{"type":"string"},"type":"array"},"discovery":{"additionalProperties":{},"properties":{},"type":"object"},"expected":{"additionalProperties":{},"properties":{},"type":"object"},"planHash":{"type":"string"},"proposals":{"items":{},"type":"array"},"propositions":{"items":{},"type":"array"},"sourceWrites":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"status":{"type":"string"},"steps":{"items":{},"type":"array"},"target":{"additionalProperties":{},"properties":{},"type":"object"},"version":{"type":"string"}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":2,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_compile_intent","type":"string"},"resultVersion":{"const":"kibi.kb_compile_intent.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Apply an approved Kibi plan"},"description":"Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Compile plans apply all-or-nothing: a durable journal records every source write and store mutation before the first write, all steps commit in one store transaction, and an interrupted application is completed or rolled back by the next mutating call. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"approvedActionIds":{"description":"Required for migration-plan.v2. Exact action IDs explicitly approved for this application: automatic actions, or review actions with a cli invocation that Kibi executes only when approved by id (for example semantic_inventory_rederive_drop_grounding).","items":{"minLength":1,"type":"string"},"type":"array"},"approvedPlanHash":{"description":"Exact SHA-256 planHash returned by kb_plan_bootstrap, kb_compile_intent, or another approved plan after human review.","pattern":"^[a-fA-F0-9]{64}$","type":"string"},"async":{"description":"MCP only. When true, start the apply as a background job and return a kibi.job.v1 receipt immediately instead of holding the request open; poll kb_job_status with the returned jobId for the final result. Use for large bootstrap plans (hundreds of actions) that can outlast a client's request timeout. The MCP server registers kb_job_status only when KIBI_MCP_OPTIONAL_TOOLS includes it; otherwise async applies synchronously. A synchronous apply sends notifications/progress after each bootstrap action when the request carries a progressToken. The CLI ignores this field.","type":"boolean"},"plan":{"additionalProperties":{},"description":"The complete kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or hash-bound kibi.entity-deletion-plan.v1 object. Migration plans require approvedActionIds and reject blocked actions and review actions Kibi cannot execute.","properties":{},"type":"object"},"recoveryJournalId":{"description":"Typed recovery journal identifier returned by a committed_with_repairs result or a PLAN_APPLY_RECOVERY_REQUIRED error. Recovery replays only the immutable journal and never the original plan request; a compile-plan journal (plan-apply-*) is completed or rolled back deterministically and reports which. A bootstrap journal left `applying` by a process that died mid-action is resumed without edits: the interrupted action is re-applied and a source lock held by the dead process is reclaimed and recorded in the journal.","pattern":"^[A-Za-z0-9._-]+$","type":"string"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"type":"object"},"name":"kb_apply_plan","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"anyOf":[{"additionalProperties":false,"properties":{"actionResults":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"changedEntities":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"changedPaths":{"items":{"type":"string"},"type":"array"},"changedRelationships":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"closeout":{"additionalProperties":{},"properties":{},"type":"object"},"deleted":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"effectFailures":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"finalSnapshots":{"additionalProperties":{},"properties":{},"type":"object"},"nextActions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"notes":{"items":{"type":"string"},"type":"array"},"outcome":{"type":"string"},"planHash":{"type":"string"},"recoveryJournalId":{"type":["string","null"]},"remainingPlan":{"additionalProperties":{},"properties":{},"type":"object"},"sourcePaths":{"items":{"type":"string"},"type":"array"},"status":{"type":"string"},"validationSummary":{"additionalProperties":{},"properties":{},"type":"object"},"version":{"type":"string"}},"type":"object"},{"additionalProperties":false,"properties":{"jobId":{"type":"string"},"jobVersion":{"const":"kibi.job.v1","type":"string"},"kibiProtocol":{"const":1,"type":"number"},"pollWith":{"const":"kb_job_status","type":"string"},"status":{"type":"string"},"tool":{"type":"string"}},"required":["kibiProtocol","jobVersion","jobId","tool","status","pollWith"],"type":"object"}],"description":"Synchronous apply result, or a kibi.job.v1 receipt when async:true detached the apply into a background job (poll kb_job_status with the jobId)."},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":4,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_apply_plan","type":"string"},"resultVersion":{"const":"kibi.kb_apply_plan.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Ingest proof-run evidence"},"description":"Ingest a producer-emitted kibi.proof-run.v1 artifact and evaluate it against each selected test's kibi.proof-contract.v1 proof obligations. Revalidates the live workspace snapshot, integration command binding, run-level outcome, attempt history, success policy, and append-only proof-receipt history before deriving and appending idempotent kibi.proof-receipt.v1 receipts. Producers report what happened; Kibi evaluates proof. Prefer `kibi prove` so the configured producer runs automatically; direct ingestion is an integration path for custom producers and agents.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":{},"properties":{"artifact":{"description":"Producer-emitted kibi.proof-run.v1 proof artifact. Producers report what happened; Kibi evaluates proof obligations and policies. Produce it via `kibi prove` or direct kb_ingest_proof calls.","properties":{"certificates":{"description":"kibi.code-certificate.v1 objects the run left for certificate-kind contracts, one per test. Kibi re-checks each before a receipt counts as proved.","items":{"additionalProperties":{},"properties":{},"type":"object"},"maxItems":1000,"type":"array"},"code_snapshot":{"pattern":"^[a-f0-9]{64}$","type":"string"},"command_argv":{"items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"},"diagnostics":{"items":{"minLength":1,"type":"string"},"type":"array"},"environment":{"additionalProperties":{},"properties":{},"type":"object"},"executor":{"properties":{"name":{"minLength":1,"type":"string"},"version":{"minLength":1,"type":"string"}},"required":["name"],"type":"object"},"integration":{"minLength":1,"type":"string"},"producer":{"properties":{"name":{"minLength":1,"type":"string"},"version":{"minLength":1,"type":"string"}},"required":["name"],"type":"object"},"proof_results":{"items":{"description":"One observed proof result. binding distinguishes native-case observations from aggregate-run bindings; attempts must report facts only.","properties":{"attempts":{},"binding":{"anyOf":[{"const":"native_case","type":"string"},{"const":"aggregate_run","type":"string"}]},"diagnostics":{"items":{"minLength":1,"type":"string"},"type":"array"},"native_id":{"minLength":1,"type":"string"},"outcome":{"anyOf":[{"const":"passed","type":"string"},{"const":"failed","type":"string"},{"const":"timed_out","type":"string"},{"const":"skipped","type":"string"},{"const":"interrupted","type":"string"},{"const":"errored","type":"string"}]},"symbol_id":{"description":"Stable proof symbol ID (SYM-*).","minLength":1,"type":"string"},"target":{"description":"Ecosystem-neutral execution target (browser, runtime, database, device, deployment, or default).","minLength":1,"type":"string"}},"required":["symbol_id","target","outcome","binding","attempts"],"type":"object"},"maxItems":1000,"minItems":1,"type":"array"},"run":{"properties":{"exit_code":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"failure_phase":{"anyOf":[{"const":"setup","type":"string"},{"const":"collection","type":"string"},{"const":"execution","type":"string"},{"const":"teardown","type":"string"},{"const":"infrastructure","type":"string"}]},"finished_at":{"minLength":1,"type":"string"},"outcome":{"anyOf":[{"const":"passed","type":"string"},{"const":"failed","type":"string"},{"const":"errored","type":"string"},{"const":"cancelled","type":"string"},{"const":"timed_out","type":"string"},{"const":"interrupted","type":"string"},{"const":"no_results","type":"string"}]},"started_at":{"minLength":1,"type":"string"}},"required":["outcome","exit_code","started_at","finished_at"],"type":"object"},"version":{"const":"kibi.proof-run.v1","type":"string"}},"required":["version","producer","command_argv","code_snapshot","environment","run","proof_results"],"type":"object"},"snapshot":{"description":"Workspace snapshot captured immediately before the run.","pattern":"^[a-f0-9]{64}$","type":"string"},"testIds":{"description":"Existing test entities with proof_contract.v1. Omit to evaluate every test contracted to the artifact's integration.","items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"},"workspaceRoot":{"description":"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available.","type":"string"}},"required":["snapshot","artifact"],"type":"object"},"name":"kb_ingest_proof","outputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"data":{"additionalProperties":false,"properties":{"artifactDigest":{"type":"string"},"effectFailures":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"environmentHash":{"type":"string"},"failed":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"integration":{"type":"string"},"nextActions":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"passed":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"results":{"items":{"additionalProperties":{},"properties":{},"type":"object"},"type":"array"},"status":{"type":"string"},"unchanged":{"maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"}},"type":"object"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"category":{"type":"string"},"code":{"type":"string"},"detail":{},"file":{"type":"string"},"message":{"type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"suggestion":{"type":"string"}},"required":["message"],"type":"object"},"type":"array"},"effects":{"items":{"additionalProperties":false,"properties":{"detail":{},"errorCode":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"not_applicable","type":"string"}]}},"required":["kind","status"],"type":"object"},"minItems":3,"type":"array"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"type":"object"},"kibiProtocol":{"const":1,"type":"number"},"nextActions":{"items":{"additionalProperties":false,"properties":{"input":{},"operation":{"type":"string"},"reason":{"type":"string"},"required":{"type":"boolean"}},"required":["operation","reason","required"],"type":"object"},"type":"array"},"operation":{"const":"kb_ingest_proof","type":"string"},"resultVersion":{"const":"kibi.kb_ingest_proof.v1","type":"string"},"status":{"anyOf":[{"const":"success","type":"string"},{"const":"committed_with_repairs","type":"string"},{"const":"error","type":"string"}]}},"required":["kibiProtocol","operation","resultVersion","status","data","effects","diagnostics","nextActions"],"type":"object"}}]}}}
