{"at":"2026-11-23T02:48:48.865Z","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-23T02:48:49.408Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"data":{"authoritative":false,"binding":{"authoritative":false,"message":"No project expectation was supplied. Call ark_identity with project.expectedRoot before treating MCP evidence as authoritative.","status":"unverified"},"processPackage":{"nextAction":"Process package version matches project install for this MCP root.","notAScore":true,"processArkgateVersion":"4.8.24","processPackageMismatch":false,"processStale":false,"projectInstalledVersion":"4.8.24","schemaVersion":"1.0"},"projectIdentity":{"arkgateVersion":"4.8.24","contractHash":"sha256:e89aa9be15d844092e8761fbc1da513a40ec88f9af9f3e1d09903703781032c4","contractSource":"default-profile","processStartedAt":"2026-11-23T02:48:49.298Z","projectId":"sha256:245b6c1049c3be2ddf860aedb691cb9f589e2d16954299bac7d421beb8052960","resolvedConfigPath":"/opt/server/ark.config.json","resolvedRoot":"/opt/server","runtimeId":"2b14d3bc-f671-43d7-97ff-304b720fe110","schemaVersion":"1.0"}},"message":"Method not found: server/discover"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T02:48:49.509Z","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-23T02:48:50.015Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"authoritative":false,"binding":{"authoritative":false,"message":"No project expectation was supplied. Call ark_identity with project.expectedRoot before treating MCP evidence as authoritative.","status":"unverified"},"capabilities":{"resources":{},"tools":{}},"processPackage":{"nextAction":"Process package version matches project install for this MCP root.","notAScore":true,"processArkgateVersion":"4.8.24","processPackageMismatch":false,"processStale":false,"projectInstalledVersion":"4.8.24","schemaVersion":"1.0"},"projectIdentity":{"arkgateVersion":"4.8.24","contractHash":"sha256:e89aa9be15d844092e8761fbc1da513a40ec88f9af9f3e1d09903703781032c4","contractSource":"default-profile","processStartedAt":"2026-11-23T02:48:49.910Z","projectId":"sha256:245b6c1049c3be2ddf860aedb691cb9f589e2d16954299bac7d421beb8052960","resolvedConfigPath":"/opt/server/ark.config.json","resolvedRoot":"/opt/server","runtimeId":"6a487dfa-0d6d-4cd5-a54c-71c9450cb179","schemaVersion":"1.0"},"protocolVersion":"2025-11-25","serverInfo":{"name":"arkgate","version":"4.8.24"}}}}
{"at":"2026-11-23T02:48:50.015Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T02:48:50.015Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T02:48:50.016Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"authoritative":false,"binding":{"authoritative":false,"message":"No project expectation was supplied. Call ark_identity with project.expectedRoot before treating MCP evidence as authoritative.","status":"unverified"},"processPackage":{"nextAction":"Process package version matches project install for this MCP root.","notAScore":true,"processArkgateVersion":"4.8.24","processPackageMismatch":false,"processStale":false,"projectInstalledVersion":"4.8.24","schemaVersion":"1.0"},"projectIdentity":{"arkgateVersion":"4.8.24","contractHash":"sha256:e89aa9be15d844092e8761fbc1da513a40ec88f9af9f3e1d09903703781032c4","contractSource":"default-profile","processStartedAt":"2026-11-23T02:48:49.910Z","projectId":"sha256:245b6c1049c3be2ddf860aedb691cb9f589e2d16954299bac7d421beb8052960","resolvedConfigPath":"/opt/server/ark.config.json","resolvedRoot":"/opt/server","runtimeId":"6a487dfa-0d6d-4cd5-a54c-71c9450cb179","schemaVersion":"1.0"},"tools":[{"description":"First call. Prove this MCP process is the right project: pass project.expectedRoot (exact absolute root) and reuse the returned projectId. Do this before any other Ark tool. A missing/unmatched root or processPackage.processStale means restart/retarget the host and use the project-local CLI until identity and package versions align.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_identity"},{"description":"Return the machine-readable architecture contract with an authoritative project binding when project.expectedRoot matches this MCP project. Prefer this tool over the ark://manifest compatibility resource, whose standard MCP read shape cannot carry a portable project expectation.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_manifest"},{"description":"Single-file lexical check of a source snippet against Ark's architecture (forbidden infra imports, unknown intents, layer-reference violations, and the enforced ArkRun / ArkRules structure / ArkOrder sensors CI runs on that file). One file can never prove the whole candidate, so the result is always partial: valid:false and isError:true until complete-candidate preflight. Read lexicalValid and violations for the snippet verdict; use ark_prepare_change (or arkgate-check) for a green result. For hard write-path blocking use the `arkgate-mcp --hook` PreToolUse hook, not this tool. Returns { valid, lexicalValid, completeness, violations, autoPatch? }. autoPatch (when present) is a mechanical-safe rewrite of the source (import type conversion); hosts may apply it instead of re-drafting.","inputSchema":{"properties":{"filePath":{"description":"Target file path (used to infer layer and for messages).","type":"string"},"layer":{"description":"Architecture layer of the target file (e.g. DomainModel). If omitted, inferred from filePath via ark.config.json layer patterns.","type":"string"},"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"},"source":{"description":"Full source text about to be written.","type":"string"}},"required":["source"],"type":"object"},"name":"validate_code","outputSchema":{"oneOf":[{"additionalProperties":false,"allOf":[{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}},"required":["completeness"]},"then":{"properties":{"valid":{"const":false}}}},{"if":{"properties":{"completeness":{"enum":["complete","partial"]},"mode":{"const":"resolved-candidate-facts"}},"required":["mode","completeness"]},"then":{"required":["policyHash","resolverIdentity","factsHash","candidateTreeHash"]}},{"else":{"properties":{"completenessReasons":{"minItems":1}}},"if":{"properties":{"completeness":{"const":"complete"}},"required":["completeness"]},"then":{"properties":{"completenessReasons":{"maxItems":0}}}}],"properties":{"authoritative":{"type":"boolean"},"binding":{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"code":{"enum":["PROJECT_ROOT_MISMATCH","PROJECT_ID_MISMATCH","INVALID_PROJECT_EXPECTATION"]},"expectedProjectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","authoritative"],"type":"object"},"candidateTreeHash":{"minLength":1,"type":"string"},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"items":{"additionalProperties":false,"properties":{"code":{"minLength":1,"type":"string"},"file":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"}},"required":["code","message"],"type":"object"},"type":"array"},"contractStale":{"type":"boolean"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"docsCodePath":{"minLength":1,"type":"string"},"evidence":{"additionalProperties":false,"properties":{"arkruleId":{"minLength":1,"type":"string"},"arkruleSource":{"minLength":1,"type":"string"},"capability":{"minLength":1,"type":"string"},"edgeKind":{"minLength":1,"type":"string"},"fromLayer":{"type":"string"},"namedBindingsTypeOnly":{"type":"boolean"},"peerIsolation":{"type":"boolean"},"portProofEligible":{"type":"boolean"},"reasonId":{"enum":["CROSS_PARENT_SLICE","CROSS_SIBLING_SLICE","CROSS_PARENT_VIA_SHARED"]},"sourcePureTypeModule":{"type":"boolean"},"target":{"type":"string"},"targetTypeOnlyExports":{"type":"boolean"},"toLayer":{"type":"string"},"typeOnly":{"type":"boolean"},"universeFrom":{"minLength":1,"type":"string"},"universeTo":{"minLength":1,"type":"string"}},"type":"object"},"findingRef":{"minLength":1,"pattern":"^fnv1a-[0-9a-f]{8}$","type":"string"},"location":{"additionalProperties":false,"properties":{"column":{"minimum":1,"type":"integer"},"file":{"minLength":1,"type":"string"},"line":{"minimum":1,"type":"integer"}},"required":["file","line","column"],"type":"object"},"message":{"minLength":1,"type":"string"},"nextAction":{"minLength":1,"type":"string"},"ruleId":{"minLength":1,"type":"string"},"severity":{"enum":["error","warning"]},"targetKey":{"minLength":1,"type":"string"}},"required":["ruleId","severity","message","location","evidence"],"type":"object"},"type":"array"},"factsHash":{"minLength":1,"type":"string"},"lexicalValid":{"type":"boolean"},"mode":{"enum":["lexical-compatibility","resolved-candidate-facts"]},"policyHash":{"minLength":1,"type":"string"},"processPackage":{"additionalProperties":false,"properties":{"nextAction":{"minLength":1,"type":"string"},"notAScore":{"const":true},"processArkgateVersion":{"type":["string","null"]},"processPackageMismatch":{"type":"boolean"},"processStale":{"type":"boolean"},"projectInstalledVersion":{"type":["string","null"]},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","notAScore","processArkgateVersion","projectInstalledVersion","processPackageMismatch","processStale","nextAction"],"type":"object"},"projectIdentity":{"additionalProperties":false,"properties":{"arkgateVersion":{"minLength":1,"type":"string"},"contractHash":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"contractSource":{"enum":["project","default-profile","manifest"]},"processStartedAt":{"format":"date-time","type":"string"},"projectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"resolvedConfigPath":{"minLength":1,"type":"string"},"resolvedRoot":{"minLength":1,"type":"string"},"runtimeId":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","projectId","resolvedRoot","resolvedConfigPath","arkgateVersion","contractHash","contractSource","runtimeId","processStartedAt"],"type":"object"},"resolverIdentity":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.5"},"valid":{"type":"boolean"},"verdict":{"additionalProperties":false,"properties":{"completeness":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"status":{"minLength":1,"type":"string"}},"required":["status","ok"],"type":"object"},"coverage":{"additionalProperties":false,"properties":{"emptyScope":{"type":["boolean","null"]},"governedPercent":{"maximum":100,"minimum":0,"type":["number","null"]},"ok":{"type":"boolean"},"unclassified":{"minimum":0,"type":["integer","null"]}},"required":["ok","governedPercent","unclassified","emptyScope"],"type":"object"},"gates":{"additionalProperties":false,"properties":{"advisoryMcpActive":{"const":true},"advisoryMcpRuntimeObserved":{"const":true},"ciMergeActive":{"anyOf":[{"type":"boolean"},{"const":"unverified"}]},"localWriteActive":{"anyOf":[{"type":"boolean"},{"const":"unverified"}]},"ok":{"type":"boolean"}},"required":["ok","localWriteActive","advisoryMcpActive","advisoryMcpRuntimeObserved","ciMergeActive"],"type":"object"},"graph":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"violations":{"minimum":0,"type":["integer","null"]}},"required":["ok","violations"],"type":"object"},"identity":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","ok"],"type":"object"},"overallOk":{"type":"boolean"}},"required":["identity","completeness","graph","coverage","gates","overallOk"],"type":"object"}},"required":["schemaVersion","mode","valid","completeness","completenessReasons","diagnostics","projectIdentity","binding","authoritative","processPackage"],"type":"object"},{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"binding":{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"code":{"enum":["PROJECT_ROOT_MISMATCH","PROJECT_ID_MISMATCH","INVALID_PROJECT_EXPECTATION"]},"expectedProjectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","authoritative"],"type":"object"},"contractStale":{"type":"boolean"},"error":{"additionalProperties":false,"properties":{"code":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"}},"required":["code","message"],"type":"object"},"ok":{"const":false},"processPackage":{"additionalProperties":false,"properties":{"nextAction":{"minLength":1,"type":"string"},"notAScore":{"const":true},"processArkgateVersion":{"type":["string","null"]},"processPackageMismatch":{"type":"boolean"},"processStale":{"type":"boolean"},"projectInstalledVersion":{"type":["string","null"]},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","notAScore","processArkgateVersion","projectInstalledVersion","processPackageMismatch","processStale","nextAction"],"type":"object"},"projectIdentity":{"additionalProperties":false,"properties":{"arkgateVersion":{"minLength":1,"type":"string"},"contractHash":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"contractSource":{"enum":["project","default-profile","manifest"]},"processStartedAt":{"format":"date-time","type":"string"},"projectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"resolvedConfigPath":{"minLength":1,"type":"string"},"resolvedRoot":{"minLength":1,"type":"string"},"runtimeId":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","projectId","resolvedRoot","resolvedConfigPath","arkgateVersion","contractHash","contractSource","runtimeId","processStartedAt"],"type":"object"}},"required":["ok","error","projectIdentity","binding","authoritative","processPackage"],"type":"object"}],"type":"object"}},{"description":"Scan the project for architecture findings (layer-import violations, forbidden globals, cycles, config warnings). Returns pass/fail/incomplete plus evidence — not a yes/no architecture score. Same engine as arkgate-check. Applies the baseline when one exists. isError when the scan fails. Prefer after ark_identity.","inputSchema":{"properties":{"baseline":{"description":"Suppress pre-frozen violations via .ark-baseline.json. Default: auto (on when the file exists).","type":"boolean"},"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"},"strict":{"description":"Fail on config warnings too (--strict-config). Default true.","type":"boolean"}},"type":"object"},"name":"ark_check","outputSchema":{"oneOf":[{"additionalProperties":false,"allOf":[{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}},"required":["completeness"]},"then":{"properties":{"valid":{"const":false}}}},{"if":{"properties":{"completeness":{"enum":["complete","partial"]},"mode":{"const":"resolved-candidate-facts"}},"required":["mode","completeness"]},"then":{"required":["policyHash","resolverIdentity","factsHash","candidateTreeHash"]}},{"else":{"properties":{"completenessReasons":{"minItems":1}}},"if":{"properties":{"completeness":{"const":"complete"}},"required":["completeness"]},"then":{"properties":{"completenessReasons":{"maxItems":0}}}}],"properties":{"authoritative":{"type":"boolean"},"binding":{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"code":{"enum":["PROJECT_ROOT_MISMATCH","PROJECT_ID_MISMATCH","INVALID_PROJECT_EXPECTATION"]},"expectedProjectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","authoritative"],"type":"object"},"candidateTreeHash":{"minLength":1,"type":"string"},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"items":{"additionalProperties":false,"properties":{"code":{"minLength":1,"type":"string"},"file":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"}},"required":["code","message"],"type":"object"},"type":"array"},"contractStale":{"type":"boolean"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"docsCodePath":{"minLength":1,"type":"string"},"evidence":{"additionalProperties":false,"properties":{"arkruleId":{"minLength":1,"type":"string"},"arkruleSource":{"minLength":1,"type":"string"},"capability":{"minLength":1,"type":"string"},"edgeKind":{"minLength":1,"type":"string"},"fromLayer":{"type":"string"},"namedBindingsTypeOnly":{"type":"boolean"},"peerIsolation":{"type":"boolean"},"portProofEligible":{"type":"boolean"},"reasonId":{"enum":["CROSS_PARENT_SLICE","CROSS_SIBLING_SLICE","CROSS_PARENT_VIA_SHARED"]},"sourcePureTypeModule":{"type":"boolean"},"target":{"type":"string"},"targetTypeOnlyExports":{"type":"boolean"},"toLayer":{"type":"string"},"typeOnly":{"type":"boolean"},"universeFrom":{"minLength":1,"type":"string"},"universeTo":{"minLength":1,"type":"string"}},"type":"object"},"findingRef":{"minLength":1,"pattern":"^fnv1a-[0-9a-f]{8}$","type":"string"},"location":{"additionalProperties":false,"properties":{"column":{"minimum":1,"type":"integer"},"file":{"minLength":1,"type":"string"},"line":{"minimum":1,"type":"integer"}},"required":["file","line","column"],"type":"object"},"message":{"minLength":1,"type":"string"},"nextAction":{"minLength":1,"type":"string"},"ruleId":{"minLength":1,"type":"string"},"severity":{"enum":["error","warning"]},"targetKey":{"minLength":1,"type":"string"}},"required":["ruleId","severity","message","location","evidence"],"type":"object"},"type":"array"},"factsHash":{"minLength":1,"type":"string"},"lexicalValid":{"type":"boolean"},"mode":{"enum":["lexical-compatibility","resolved-candidate-facts"]},"policyHash":{"minLength":1,"type":"string"},"processPackage":{"additionalProperties":false,"properties":{"nextAction":{"minLength":1,"type":"string"},"notAScore":{"const":true},"processArkgateVersion":{"type":["string","null"]},"processPackageMismatch":{"type":"boolean"},"processStale":{"type":"boolean"},"projectInstalledVersion":{"type":["string","null"]},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","notAScore","processArkgateVersion","projectInstalledVersion","processPackageMismatch","processStale","nextAction"],"type":"object"},"projectIdentity":{"additionalProperties":false,"properties":{"arkgateVersion":{"minLength":1,"type":"string"},"contractHash":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"contractSource":{"enum":["project","default-profile","manifest"]},"processStartedAt":{"format":"date-time","type":"string"},"projectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"resolvedConfigPath":{"minLength":1,"type":"string"},"resolvedRoot":{"minLength":1,"type":"string"},"runtimeId":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","projectId","resolvedRoot","resolvedConfigPath","arkgateVersion","contractHash","contractSource","runtimeId","processStartedAt"],"type":"object"},"resolverIdentity":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.5"},"valid":{"type":"boolean"},"verdict":{"additionalProperties":false,"properties":{"completeness":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"status":{"minLength":1,"type":"string"}},"required":["status","ok"],"type":"object"},"coverage":{"additionalProperties":false,"properties":{"emptyScope":{"type":["boolean","null"]},"governedPercent":{"maximum":100,"minimum":0,"type":["number","null"]},"ok":{"type":"boolean"},"unclassified":{"minimum":0,"type":["integer","null"]}},"required":["ok","governedPercent","unclassified","emptyScope"],"type":"object"},"gates":{"additionalProperties":false,"properties":{"advisoryMcpActive":{"const":true},"advisoryMcpRuntimeObserved":{"const":true},"ciMergeActive":{"anyOf":[{"type":"boolean"},{"const":"unverified"}]},"localWriteActive":{"anyOf":[{"type":"boolean"},{"const":"unverified"}]},"ok":{"type":"boolean"}},"required":["ok","localWriteActive","advisoryMcpActive","advisoryMcpRuntimeObserved","ciMergeActive"],"type":"object"},"graph":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"violations":{"minimum":0,"type":["integer","null"]}},"required":["ok","violations"],"type":"object"},"identity":{"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","ok"],"type":"object"},"overallOk":{"type":"boolean"}},"required":["identity","completeness","graph","coverage","gates","overallOk"],"type":"object"}},"required":["schemaVersion","mode","valid","completeness","completenessReasons","diagnostics","projectIdentity","binding","authoritative","processPackage"],"type":"object"},{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"binding":{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"code":{"enum":["PROJECT_ROOT_MISMATCH","PROJECT_ID_MISMATCH","INVALID_PROJECT_EXPECTATION"]},"expectedProjectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","authoritative"],"type":"object"},"contractStale":{"type":"boolean"},"error":{"additionalProperties":false,"properties":{"code":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"}},"required":["code","message"],"type":"object"},"ok":{"const":false},"processPackage":{"additionalProperties":false,"properties":{"nextAction":{"minLength":1,"type":"string"},"notAScore":{"const":true},"processArkgateVersion":{"type":["string","null"]},"processPackageMismatch":{"type":"boolean"},"processStale":{"type":"boolean"},"projectInstalledVersion":{"type":["string","null"]},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","notAScore","processArkgateVersion","projectInstalledVersion","processPackageMismatch","processStale","nextAction"],"type":"object"},"projectIdentity":{"additionalProperties":false,"properties":{"arkgateVersion":{"minLength":1,"type":"string"},"contractHash":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"contractSource":{"enum":["project","default-profile","manifest"]},"processStartedAt":{"format":"date-time","type":"string"},"projectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"resolvedConfigPath":{"minLength":1,"type":"string"},"resolvedRoot":{"minLength":1,"type":"string"},"runtimeId":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","projectId","resolvedRoot","resolvedConfigPath","arkgateVersion","contractHash","contractSource","runtimeId","processStartedAt"],"type":"object"}},"required":["ok","error","projectIdentity","binding","authoritative","processPackage"],"type":"object"}],"type":"object"}},{"description":"Classify a complete ark.config.json transition as strengthening, neutral, judgment-required, or weakening. Pass the previous baseConfig and optional candidateConfig (defaults to this project contract). Weakening and judgment-required results set isError unless acknowledgement exactly matches both policy hashes and all blocking finding ids, and adrPath names a short note under docs/adr/ or docs/decisions/. Read-only; never edits the contract.","inputSchema":{"properties":{"acknowledgement":{"description":"Optional schemaVersion/basePolicyHash/candidatePolicyHash/findingIds/reason object. When the transition needs an acknowledgement, adrPath must name a short note under docs/adr/ or docs/decisions/.","type":"object"},"baseArkRuleFiles":{"description":"Base ArkRules catalog as data: { \"<path from baseConfig.arkRules>\": <ArkRules file JSON> }. Required when baseConfig maps arkRules; otherwise the call is refused rather than classifying ArkRule demotions/deletions as neutral.","type":"object"},"baseConfig":{"description":"Previous complete ark.config.json object.","type":"object"},"candidateArkRuleFiles":{"description":"Candidate ArkRules catalog as data, same shape. Defaults to the files on disk when candidateConfig is omitted or maps the same arkRules files as the project contract (the project ark.config.json passed verbatim counts).","type":"object"},"candidateConfig":{"description":"Candidate complete config; defaults to the current project contract.","type":"object"},"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"required":["baseConfig"],"type":"object"},"name":"ark_policy_delta"},{"description":"Report what each layer actually governs: per-layer file counts, the FULL list of unclassified (ungoverned) files, layers whose patterns match nothing, and layers with no rule edge. Use this to audit config coverage instead of hand-rolling find/readdir. Report only — never an error.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_coverage"},{"description":"Place a file in the architecture: filePath is required (fail-closed without it — never invents components/*.tsx or defaults to Presentation). Returns layer, mayImport / mustNotImport, forbiddenGlobals, and goldenPattern (load-bearing for NEW code when .ark/golden-pattern.json exists — adopt generates it). When the matched layer has layers[].description, the JSON includes description; the field is omitted when absent. When the matched layer has layers[].trustBoundary (public|auth|admin|internal), the JSON includes trustBoundary; omitted when absent. When the matched layer has layers[].owners, the JSON includes owners; omitted when absent. Call BEFORE writing a new file to learn the layer. Prefer ark_prepare_write only as fallback when the host has no hard pre-hook (or that hook is missing / fail-open) and you already have the source snippet.","inputSchema":{"properties":{"description":{"description":"What you are building. Does not invent a path — pass filePath. Without filePath the tool fail-closes.","type":"string"},"filePath":{"description":"Path (relative to project root or absolute) of the file to place.","type":"string"},"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"required":["filePath"],"type":"object"},"name":"ark_place"},{"description":"Prepare a write against the architecture contract: place (filePath required; fail-closed without it — never invents a path) + constrain (layer, mayImport, mustNotImport, forbiddenGlobals) + validate source + optional mechanical-safe autoPatch + judgmentBrief when judgment is needed + contentHash for host commit. Also returns the versioned new/worsened designDelta for the proposed full file. Composes ark_place + write-gate. Fallback when the host has no trusted hard pre-hook (or that hook is fail-open). When a hard hook is installed, the host already gates the write; this tool stays available but is not the primary gate. When the matched layer has layers[].description, the JSON includes description; the field is omitted when absent. When the matched layer has layers[].trustBoundary (public|auth|admin|internal), the JSON includes trustBoundary; omitted when absent. When the matched layer has layers[].owners, the JSON includes owners; omitted when absent. Single-file evidence is partial, so valid stays false (isError:true) until complete-candidate preflight; read lexicalValid for the snippet verdict and use ark_prepare_change for a green result. Returns { filePath, layer, description?, trustBoundary?, owners?, valid, lexicalValid, violations?, autoPatch?, judgmentBrief?, contentHash, ... }.","inputSchema":{"properties":{"description":{"description":"What you are building (hint only). Does not invent a path — pass filePath. Without filePath the tool fail-closes.","type":"string"},"filePath":{"description":"Target path (preferred). Used for layer inference and autoPatch resolution.","type":"string"},"layer":{"description":"Optional explicit layer override (otherwise inferred from filePath).","type":"string"},"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"},"source":{"description":"Full source text about to be written.","type":"string"}},"required":["source","filePath"],"type":"object"},"name":"ark_prepare_write"},{"description":"Validate one complete governed-source create/update/delete batch as an atomic in-memory candidate. Catches cross-file forbidden edges and cycles before any host write, and returns per-file content hashes plus base/candidate tree and policy hashes. Never writes files.","inputSchema":{"properties":{"changeMap":{"description":"Optional strict schema 1.0 architecture change map. Omit it to use ordinary atomic preflight.","type":"object"},"changes":{"description":"Full candidate batch. Each item is {path, content} for create/update or {path, delete:true}.","items":{"properties":{"content":{"type":"string"},"delete":{"type":"boolean"},"path":{"type":"string"}},"required":["path"],"type":"object"},"type":"array"},"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"required":["changes"],"type":"object"},"name":"ark_prepare_change"},{"description":"Score this repository against templates/architecture-playbook.json and return the tool-agnostic application shape to adopt (archetype, preset, phased layer plan, analogy, anti-patterns). Same structured output as ark-check --recommend --json. Call BEFORE generating project structure on greenfield or early-adoption repos.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_recommend"},{"description":"Propose ark.config.json include roots from workspaces and nested TypeScript packages (polyglot-safe). Same idea as ark-check --suggest-include. Use when coverage is empty or the contract misses package roots.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_suggest_include"},{"description":"Deterministic brownfield rules inventory (AR13): validation-in-controller, magic constants, anemic entities, mutation-without-guard. Returns honest counts (inventoried/under-contract/frozen) — never a numeric score. Same plane as ark-check --rules-inventory.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_rules_inventory"},{"description":"Unified session/project status manifest (ACS03): project identity binding, honest write-path activation, last-check summary, ArkRules residual counts, and primary next action. Same envelope as `ark status --json`. Never prompts; never a numeric score. Prefer after ark_identity so project.expectedRoot is bound.","inputSchema":{"properties":{"project":{"additionalProperties":false,"properties":{"expectedProjectId":{"description":"Project id previously returned by ark_identity or ark_manifest.","pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"description":"Absolute expected workspace/project directory. The initial authoritative handshake requires the exact project root; descendant calls also require expectedProjectId.","minLength":1,"type":"string"}},"type":"object"}},"type":"object"},"name":"ark_status","outputSchema":{"additionalProperties":true,"properties":{"authoritative":{"type":"boolean"},"binding":{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"code":{"enum":["PROJECT_ROOT_MISMATCH","PROJECT_ID_MISMATCH","INVALID_PROJECT_EXPECTATION"]},"expectedProjectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"expectedRoot":{"minLength":1,"type":"string"},"message":{"minLength":1,"type":"string"},"status":{"enum":["matched","unverified","mismatch"]}},"required":["status","authoritative"],"type":"object"},"contractStale":{"type":"boolean"},"processPackage":{"additionalProperties":false,"properties":{"nextAction":{"minLength":1,"type":"string"},"notAScore":{"const":true},"processArkgateVersion":{"type":["string","null"]},"processPackageMismatch":{"type":"boolean"},"processStale":{"type":"boolean"},"projectInstalledVersion":{"type":["string","null"]},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","notAScore","processArkgateVersion","projectInstalledVersion","processPackageMismatch","processStale","nextAction"],"type":"object"},"projectIdentity":{"additionalProperties":false,"properties":{"arkgateVersion":{"minLength":1,"type":"string"},"contractHash":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"contractSource":{"enum":["project","default-profile","manifest"]},"processStartedAt":{"format":"date-time","type":"string"},"projectId":{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},"resolvedConfigPath":{"minLength":1,"type":"string"},"resolvedRoot":{"minLength":1,"type":"string"},"runtimeId":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.0"}},"required":["schemaVersion","projectId","resolvedRoot","resolvedConfigPath","arkgateVersion","contractHash","contractSource","runtimeId","processStartedAt"],"type":"object"},"status":{"$id":"https://unpkg.com/arkgate@4/schemas/ark.status-manifest.schema.json","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"description":"Unified session/project status snapshot for agents (identity, activation honesty, last check, rules counts, next action). Not a score.","properties":{"activation":{"additionalProperties":false,"properties":{"honestLabel":{"minLength":1,"type":"string"},"host":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"writePath":{"enum":["hard","advisory","unavailable"]}},"required":["writePath","host","honestLabel"],"type":"object"},"arkOrder":{"additionalProperties":false,"description":"ArkOrder extra residual (notAScore). present/mode from config; residual is a finding-id count (null = unknown, not green). extraMergeTeeth is honesty, never a score.","properties":{"extraMergeTeeth":{"type":"boolean"},"mode":{"anyOf":[{"enum":["advisory","enforced"]},{"type":"null"}]},"notAScore":{"const":true},"present":{"type":"boolean"},"residual":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]}},"required":["notAScore","present","mode","extraMergeTeeth","residual"],"type":"object"},"arkRun":{"additionalProperties":false,"description":"ArkRun extra residual (notAScore). present/mode from config; residual is a finding-id count (null = unknown, not green). extraMergeTeeth is honesty, never a score.","properties":{"extraMergeTeeth":{"type":"boolean"},"mode":{"anyOf":[{"enum":["advisory","enforced"]},{"type":"null"}]},"notAScore":{"const":true},"present":{"type":"boolean"},"residual":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]}},"required":["notAScore","present","mode","extraMergeTeeth","residual"],"type":"object"},"arkgateVersion":{"minLength":1,"type":"string"},"contract":{"additionalProperties":false,"description":"Present only when the resolved config fails the shared contract validator (the same fail-closed rules ark-check, MCP and ESLint apply).","properties":{"errors":{"items":{"minLength":1,"type":"string"},"minItems":1,"type":"array"},"valid":{"const":false}},"required":["valid","errors"],"type":"object"},"improvementCompass":{"additionalProperties":false,"description":"Thin improvement-compass residual ids with honesty mode (notAScore). full | subset | unavailable. Never a gate input; full lenses on doctor JSON. When full, residual ids ⊆ doctor residual for the same facts. unavailable never invents green residual.","properties":{"contractHash":{"minLength":1,"type":"string"},"factsSource":{"enum":["doctor-facts","report-snapshot","none"]},"mode":{"enum":["full","subset","unavailable"]},"notAScore":{"const":true},"reason":{"minLength":1,"type":"string"},"reasonCode":{"minLength":1,"type":"string"},"schemaVersion":{"const":"1.0"},"topResidual":{"items":{"minLength":1,"type":"string"},"maxItems":15,"type":"array"}},"required":["schemaVersion","notAScore","mode","topResidual"],"type":"object"},"lastCheck":{"additionalProperties":false,"properties":{"activeViolations":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"at":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"frozenResidual":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"verdict":{"anyOf":[{"enum":["pass","fail","incomplete"]},{"type":"null"}]}},"required":["at","verdict","activeViolations","frozenResidual"],"type":"object"},"nextAction":{"additionalProperties":false,"properties":{"id":{"minLength":1,"type":"string"},"summary":{"minLength":1,"type":"string"}},"required":["id","summary"],"type":"object"},"projectIdentity":{"additionalProperties":false,"properties":{"authoritative":{"type":"boolean"},"binding":{"enum":["matched","unverified","mismatch"]},"code":{"enum":["PROJECT_ROOT_MISMATCH","PROJECT_ID_MISMATCH","INVALID_PROJECT_EXPECTATION"]},"message":{"minLength":1,"type":"string"},"projectId":{"anyOf":[{"pattern":"^sha256:[a-f0-9]{64}$","type":"string"},{"type":"null"}]},"resolvedConfigPath":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"resolvedRoot":{"minLength":1,"type":"string"}},"required":["projectId","resolvedRoot","resolvedConfigPath","binding","authoritative"],"type":"object"},"rules":{"additionalProperties":false,"properties":{"arkRulesLoaded":{"type":"boolean"},"frozenResidual":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"inventoried":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"underContract":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]}},"required":["arkRulesLoaded","inventoried","underContract","frozenResidual"],"type":"object"},"schemaVersion":{"const":"1.0"},"vsBase":{"additionalProperties":false,"description":"Checkout vs a git base ref: pin, contract identity, baseline grow. Advisory honesty only — never a gate input.","properties":{"baseRef":{"minLength":1,"type":"string"},"baselineGrew":{"type":"boolean"},"contractEqual":{"type":"boolean"},"line":{"minLength":1,"type":"string"},"pinBase":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"pinLocal":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]}},"required":["baseRef","line","pinLocal","pinBase","contractEqual","baselineGrew"],"type":"object"}},"required":["schemaVersion","arkgateVersion","projectIdentity","activation","lastCheck","rules","nextAction"],"title":"ArkGate status manifest","type":"object"}},"type":"object"}}]}}}
