{"at":"2026-11-23T06:18:04.791Z","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-23T06:18:04.968Z","dir":"received","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"topos_mcp","version":"0.15.0+build.1795414684"}},"cacheScope":"private","capabilities":{"extensions":{"io.modelcontextprotocol/tasks":{}},"prompts":{},"resources":{},"tools":{}},"instructions":"Topos evaluates structural code quality on a diamond lattice. For agent loops, load the compact contract with `topos_get_doc(topic=\"agent-contract\")` or fetch `topos://docs/agent-contract`. Default loop: topos_evaluate_file, edit in place, then topos_assess_worktree_change (baseline = git ref). For uncommitted or untracked baselines, snapshot first with topos_begin_refactor, then verify with topos_assess_snapshot. Use topos_assess_improvement only for side-by-side variants. Use gitnexus_dir (default: ./.gitnexus) to enable COMPOSABLE/IDEAL; check graph state with topos_depgraph_status and build/refresh it with topos_generate_depgraph. topos_calculate_coverage reports test-suite coverage — structural (UAST) declaration matching and k-gram recall — as a separate signal, outside the lattice. Read `topos://build` to confirm which binary and file root are serving you. Prefer absolute file paths in tool parameters: a relative one is resolved against the directory this server started in, which the host chose and which may be a different repository; the result says which file it resolved to.","resultType":"complete","supportedVersions":["2024-11-05","2025-03-26","2025-06-18","2025-11-25","2026-07-28"],"ttlMs":0}}}
{"at":"2026-11-23T06:18:04.968Z","dir":"sent","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T06:18:04.969Z","dir":"received","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","result":{"cacheScope":"public","resultType":"complete","tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Changeset Assessment"},"description":"Assess a multi-file changeset against a git baseline and roll the\nper-file verdicts into a project before/after (read-only).\nUse for a module split or any edit spanning several files. Each file\nis compared to `baseline_ref` (new files have no baseline). Flags\n`complexity_relocated_within_file` and `project_regression`. Returns\na ChangesetResult.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"baseline_ref":{"default":"HEAD","description":"Git baseline ref each file is compared against.","type":"string"},"files":{"description":"Edited file paths (working tree) that make up the changeset.","items":{"type":"string"},"type":"array"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."}},"required":["files"],"type":"object"},"name":"topos_assess_changeset"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Assessment"},"description":"Compare a baseline to a side-by-side proposed variant (read-only).\nFor normal edit-in-place loops, use `topos_assess_worktree_change`\nor snapshot first with `topos_begin_refactor` then\n`topos_assess_snapshot`. This tool is for variants supplied as\n`proposed_code` or `proposed_filepath`. Returns an AssessmentResult\nwith `status` and score/metric deltas.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"current_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Inline baseline source; COMPOSABLE is unavailable."},"filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Baseline file path for side-by-side assessment."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"language":{"default":"python","description":"Language for inline code.","type":"string"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."},"proposed_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Proposed source."},"proposed_filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Proposed file path."}},"type":"object"},"name":"topos_assess_improvement"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Assessment"},"description":"Assess the current file against a baseline captured by\ntopos_begin_refactor.\nLoads the stored baseline by `snapshot_id` and compares it to the\ncurrent on-disk file, with the same status semantics as\n`topos_assess_improvement`. A missing or expired snapshot is\nreported via `blocked_by`.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"filepath":{"description":"Edited file path.","type":"string"},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"snapshot_id":{"description":"Snapshot id from topos_begin_refactor.","type":"string"}},"required":["snapshot_id","filepath"],"type":"object"},"name":"topos_assess_snapshot"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Assessment"},"description":"Assess an in-place edit against a git revision — the common refactor\nloop.\nStateless: the baseline is read from git (`git show\n<baseline_ref>:<path>`, default `HEAD`) and compared to the current\nworking-tree file. No prior call required. For untracked/new files\nor an uncommitted pre-edit baseline, use `topos_begin_refactor` +\n`topos_assess_snapshot`.\nDo not call if you have not edited the file. A no-change result on a\npassing file has no `next_tool`.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"baseline_ref":{"default":"HEAD","description":"Git baseline ref.","type":"string"},"filepath":{"description":"Edited file path.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."}},"required":["filepath"],"type":"object"},"name":"topos_assess_worktree_change"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Begin Refactor"},"description":"Persist the file's current source as a baseline snapshot before you\nedit it (writes a snapshot record — its only side effect).\nReturns a `snapshot_id`; edit the file in place, then call\n`topos_assess_snapshot(snapshot_id, filepath)`. Use this when the\nbaseline is not a committed git revision.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"filepath":{"description":"File path to snapshot. Prefer an absolute path.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."}},"required":["filepath"],"type":"object"},"name":"topos_begin_refactor"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Structural Coverage"},"description":"Measure how well a test suite exercises its program-under-test, via\nstructural (UAST) coverage (read-only).\nA standalone signal, separate from the four-pillar quality lattice;\nfor a quality verdict use `topos_evaluate_*` instead.\nComputes UAST bipartite declaration matching and k-gram path\nrecall. Returns a CoverageResult.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"coverage_threshold":{"default":0.5,"description":"Minimum threshold for the declaration coverage policy.","format":"double","type":"number"},"include_unknown":{"default":false,"description":"Whether to include Unknown UAST nodes in the analysis.","type":"boolean"},"k":{"default":3,"description":"Length of kind n-grams for path recall.","format":"uint","minimum":0,"type":"integer"},"language":{"default":"python","description":"Programming language (for parsing).","type":"string"},"put_files":{"description":"Paths to the program-under-test files (relative to project root).","items":{"type":"string"},"type":"array"},"test_files":{"default":[],"description":"Paths to the test suite files (relative to project root). Optional:\ninline tests in `put_files` (Rust `#[cfg(test)]`, Go `Test*`,\nPython `test_*`) are counted on the test side.","items":{"type":"string"},"type":"array"}},"required":["put_files"],"type":"object"},"name":"topos_calculate_coverage"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Structural Comparison"},"description":"Compute the AST (tree-edit) distance between two source-code\nstrings.\nRead-only and idempotent; parses both snippets in memory, never\nwrites or scores. Use for clone detection or to measure refactor\nimpact; the `topos_assess_*` tools already fold this in as an\nanti-gaming check, so call it directly only for the raw number.\nReturns a ComparisonResult: `normalized_distance` in [0, 1],\n`similarity` (= 1 - it), `raw_distance`, an `operations` edit-count\nmap, and `source_valid`/`target_valid` (`error` set if either fails\nto parse).","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"language":{"default":"python","description":"python, rust, javascript, typescript, cpp, or go.","type":"string"},"source_code":{"description":"Baseline code.","type":"string"},"target_code":{"description":"Proposed/target code.","type":"string"}},"required":["source_code","target_code"],"type":"object"},"name":"topos_compare_code"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Structural Comparison"},"description":"Compute the AST (tree-edit) distance between two source files on\ndisk.\nRead-only; parses both files, never writes or scores. Both files are\nparsed in the language their suffix names, the same way\n`topos compare` does; an unsupported suffix or two different\nlanguages is an error. Use for clone detection or refactor impact; use\n`topos_assess_*` for a quality verdict. Returns a ComparisonResult\n(see `topos_compare_code`).","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"source":{"description":"Baseline file path (prefer absolute).","type":"string"},"target":{"description":"Comparison file path (prefer absolute).","type":"string"}},"required":["source","target"],"type":"object"},"name":"topos_compare_files"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Depgraph Status"},"description":"Report `.gitnexus` availability and freshness (read-only).\nDistinguishes a missing graph from a stale one and from a\nload/schema failure, so an agent knows whether COMPOSABLE can be\ntrusted and what to do next. Never shells out and never mutates\nstate.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"directory":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Repo root to inspect (default: MCP file root / process project root)."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the project root (default:\n`<project root>/.gitnexus`)."}},"type":"object"},"name":"topos_depgraph_status"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Code Evaluation"},"description":"Score a raw code string on the SIMPLE / SECURE / NAVIGABLE quality\nlattice (read-only; never writes or runs the code).\nUse for a snippet not yet on disk. SIMPLE, SECURE, and NAVIGABLE are\nreachable here (CFG/CPG/UAST); COMPOSABLE needs a module dependency\ngraph, so for it use `topos_evaluate_file` with `gitnexus_dir`, or\n`topos_evaluate_project` for a whole tree.\nReturns an EvaluationResult: the lattice verdict (SLOP…IDEAL),\nper-generator scores, and a next-step agent contract.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"code":{"description":"Source code to evaluate.","type":"string"},"language":{"default":"python","description":"Language: python, rust, javascript, typescript, cpp, or go.","type":"string"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."},"verbose":{"default":false,"description":"Include raw metrics.","type":"boolean"}},"required":["code"],"type":"object"},"name":"topos_evaluate_code"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Code Evaluation"},"description":"Score a file on disk on the SIMPLE / COMPOSABLE / SECURE / NAVIGABLE\nlattice — the only evaluate tool that can reach COMPOSABLE\n(side-effecting).\nUnless `no_composable` is set, this generates/refreshes `.gitnexus`\n(given by `gitnexus_dir` or auto-detected at `<root>/.gitnexus`) when\nit's missing or stale, then attaches the resulting\nModuleDependencyGraph — the same default behavior as the CLI's\n`topos evaluate`. SIMPLE/SECURE/NAVIGABLE always run. When GitNexus\nisn't installed or generation fails, `coupling_available` is false\nand `warnings` explains why; the rest of the evaluation still\nsucceeds.\nDo not call again when `agent_contract.next_tool` is absent: the\nfile already passes, or this call already returned the edit span.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"filepath":{"description":"Source file path. Prefer an absolute path.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the file root (default: `<file root>/.gitnexus`);\ngenerated/refreshed when missing or stale (see `no_composable`)."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"no_composable":{"default":false,"description":"Use no dependency graph, even an existing `.gitnexus`; score\nSIMPLE/SECURE/NAVIGABLE only.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."},"refactor_targets":{"default":3,"description":"Ranked edit targets to return, gate failures first (default 3;\n0 = off; capped at 25).","format":"uint","minimum":0,"type":"integer"},"security_scan":{"default":false,"description":"Run Sighthound even if SECURE passed; report-only.","type":"boolean"},"verbose":{"default":false,"description":"Include raw metrics.","type":"boolean"}},"required":["filepath"],"type":"object"},"name":"topos_evaluate_file"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Code Evaluation"},"description":"Recursively score every supported source file in a directory on the\nSIMPLE / COMPOSABLE / SECURE / NAVIGABLE lattice, with a project\nrollup (side-effecting).\nAutodetects all supported languages in one walk. Returns a summary\nby default: the rollup (`aggregate_floor_verdict` is the pillars\nevery scored file holds), the five `worst` files with absolute paths\nand the metric behind each, counts, and warnings. `detail: \"full\"`\nreturns per-file rows (`limit` / `offset`) and the named lists.\nUnless `no_composable` is set, generates/refreshes `.gitnexus` when\nmissing or stale before scoring, same as `topos_evaluate_file` and\nthe CLI's `topos evaluate` — `coupling_available`/`warnings` explain\nit when that isn't possible, without failing the evaluation.\nDo not call this for one file, or after a file already passed. It\nwalks the tree. A person asks for the project rollup; an agent\nediting one file does not.","inputSchema":{"$defs":{"Detail":{"enum":["summary","full"],"type":"string"},"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"Dangerous-call patterns to acknowledge for this run only.","items":{"type":"string"},"type":"array"},"detail":{"$ref":"#/$defs/Detail","description":"`summary` (default): rollups and worst files. `full`: per-file rows."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the file root (default: `<file root>/.gitnexus`);\ngenerated/refreshed when missing or stale (see `no_composable`), or\nCOMPOSABLE is reported unavailable if generation fails."},"include_security_findings":{"default":false,"description":"When true, attach per-file SECURE findings to each entry; off by\ndefault to keep responses compact.","type":"boolean"},"limit":{"default":25,"description":"Per-file rows to return per page (1–500, default 25).","format":"uint","minimum":0,"type":"integer"},"no_composable":{"default":false,"description":"Use no dependency graph, even an existing `.gitnexus`; score\nSIMPLE/SECURE/NAVIGABLE only.","type":"boolean"},"offset":{"default":0,"description":"Zero-based row offset for pagination; pass the response's\n`next_offset` to fetch the next page.","format":"uint","minimum":0,"type":"integer"},"path":{"description":"Directory to evaluate, walked recursively. Prefer an absolute path. Must\nresolve inside the trusted file root. Languages are autodetected.","type":"string"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional ranking of simple/composable/secure/navigable (best first).\nTop-ranked sets scorer priority (default SIMPLE)."},"verbose":{"default":false,"description":"When true, include each file's raw metric values alongside scores.","type":"boolean"}},"required":["path"],"type":"object"},"name":"topos_evaluate_project"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Generate Depgraph"},"description":"Generate the `.gitnexus` dependency graph via GitNexus\n(side-effecting).\nEnsures the graph by default: no-ops when current, otherwise runs\n`gitnexus analyze`. `force=true` always regenerates.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"directory":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Repo root to analyze (default: MCP file root / process project root)."},"force":{"default":false,"description":"Regenerate even when current.","type":"boolean"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the project root."}},"type":"object"},"name":"topos_generate_depgraph"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Documentation"},"description":"Return a Topos documentation page as Markdown.\nUse when your MCP client does not expose resource fetching to the\nagent. Clients that do surface resources should prefer the\nequivalent resource URI for efficiency: `topos://docs/{topic}`.\nTopics: `agent-contract` (compact loop contract, read first for\nrefactors), `lattice` (the 16-element H(G_qual) over four generators),\n`metrics` (every metric key, thresholds, interpretation),\n`preferences` (strict generator rankings and preference walks),\n`priority` (priority profiles), `workflows` (the expanded refactor\nloop guide).","inputSchema":{"$defs":{"DocTopic":{"description":"Topic for `topos_get_doc`.","enum":["agent-contract","lattice","metrics","preferences","priority","workflows"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"topic":{"$ref":"#/$defs/DocTopic","description":"agent-contract | lattice | metrics | preferences | priority | workflows"}},"required":["topic"],"type":"object"},"name":"topos_get_doc"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Detailed Inspection"},"description":"Full metric breakdown for a single code unit (inline string or\nfile).\nProvide exactly one of `code` or `filepath`. Use when you need the\nper-function detail behind a verdict; use `topos_evaluate_*` when the\nmedal alone is enough. Returns an InspectionResult: the lattice\n`evaluation`, a *top-N* function complexity table\n(`top_n_functions`, default 10), `total_functions`, and entropy\ndetails.\nWith `filepath`, the verdict is scored on all four generators and\nagrees with `topos_evaluate_file`: unless `no_composable` is set,\nthis generates/refreshes `.gitnexus` (given by `gitnexus_dir` or\nauto-detected at `<root>/.gitnexus`) when missing or stale, then\nattaches the ModuleDependencyGraph — so this tool is side-effecting.\nWith inline `code` there is no module to place in the graph, so only\nSIMPLE/SECURE/NAVIGABLE are reachable, as in `topos_evaluate_code`.\nDo not call after `topos_evaluate_file` already returned a passing\nverdict or a `refactor_targets` span. This is the detail view, not\nthe next step.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns for this inspection.","items":{"type":"string"},"type":"array"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Inline source code."},"filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Source file path inside the project root (prefer for large files)."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the file root (default: `<file root>/.gitnexus`);\nonly used with `filepath`."},"language":{"default":"python","description":"Language for inline `code`; ignored for `filepath`, which is\nautodetected from the file extension.","type":"string"},"no_composable":{"default":false,"description":"Use no dependency graph, even an existing `.gitnexus`; score\nSIMPLE/SECURE/NAVIGABLE only.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Strict total order on the four generators; see\n`topos://docs/preferences`."},"top_n_functions":{"default":10,"description":"Return at most this many functions, sorted by descending cyclomatic\ncomplexity. Keeps agent context lean on large files.","format":"uint","minimum":0,"type":"integer"},"verbose":{"default":false,"description":"Include raw probe metric floats under each file in the response.","type":"boolean"}},"type":"object"},"name":"topos_inspect_code"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos PR Recap"},"description":"Structural PR or commit-range recap: gate readiness, blocking findings, files needing attention. Summary by default; `detail: \"full\"` for `topos.pr_recap.v3`.","inputSchema":{"$defs":{"Detail":{"enum":["summary","full"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"base":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Base commit ref (default `HEAD`)."},"detail":{"$ref":"#/$defs/Detail","description":"`summary` (default) or `full` v3 document."},"directory":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Repository directory (default: MCP file root)."},"head":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Head commit ref or `:worktree` (default `:worktree` or `HEAD`)."},"max_files":{"default":0,"description":"Max scored files by churn (default 0 = all).","format":"uint","minimum":0,"type":"integer"},"no_coupling":{"default":false,"description":"Skip coupling graph preparation.","type":"boolean"},"paths":{"default":[],"description":"Absolute or repo-relative paths of files whose full records to include.","items":{"type":"string"},"type":"array"},"pr":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Pull request number (mutually exclusive with `base`/`head`)."},"preset":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Built-in gate preset (`relaxed`, `recommended`, or `strict`)."},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Priority pillar or comma-separated ranking."},"strict":{"default":false,"description":"Fail readiness check on `warn` as well as `block`.","type":"boolean"}},"type":"object"},"name":"topos_pr_recap"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Preference Walk"},"description":"Turn a generator ranking into a preference-ordered relaxation walk.\nPure and read-only (lattice math only; no files, no scoring). Call\nafter an evaluation to pick the next verdict to aim for, or to relax\nthe goal gracefully under a token/time budget. Returns a\nPreferenceWalkResult: `walk` (steps from target down to just above\n`current`), `next_step`, `progress` in [0, 1],\n`aspirational_target`/`fallback_target`, and `induced_order` (all 16\nverdicts ranked).","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"current":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional current verdict; truncates the walk to steps strictly above\nit and sets `next_step`. Defaults to the full walk."},"gate_scores":{"additionalProperties":{"format":"double","type":"number"},"default":{},"description":"Pillar gate scores in `[0, 1]`. Enables `next_pillar`.","type":"object"},"ranking":{"description":"Permutation of {simple, composable, secure, navigable}, most-preferred first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional aspirational-target override; defaults to IDEAL."}},"required":["ranking"],"type":"object"},"name":"topos_preference_walk"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Suggestions"},"description":"Rank structural refactor hotspots for one file (read-only, advisory).\nDoes not score the four pillars — use `topos_evaluate_*` for\nmedals and `topos_assess_*` to verify edits afterward. `target`\nselects the engine: `cycles` (CFG loop/branch bodies),\n`dependencies` (MDG Forman curvature on imports; needs `.gitnexus`),\nor `process` (execution choke points; needs `.gitnexus`). Returns a\nRefactorResult with ranked `hotspots` (`kind`, `label`, `score`,\n`suggestion`, optional lines).","inputSchema":{"$defs":{"RefactorTargetKind":{"description":"Engine selector for `topos_refactor`.","oneOf":[{"const":"cycles","description":"CFG cycle-basis: loop/branch bodies driving cyclomatic complexity.","type":"string"},{"const":"dependencies","description":"MDG Forman curvature: load-bearing import edges (needs `.gitnexus`).","type":"string"},{"const":"process","description":"Process-graph choke points (needs `.gitnexus`).","type":"string"}]}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"filepath":{"description":"Source file path relative to the MCP file root.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Override `.gitnexus` directory (`dependencies` / `process` targets)."},"limit":{"default":5,"description":"Maximum hotspots to return (default 5).","format":"uint","minimum":0,"type":"integer"},"target":{"$ref":"#/$defs/RefactorTargetKind","description":"Which analysis engine to run: `cycles` (CFG), or `dependencies` /\n`process` (need `.gitnexus`)."}},"required":["target","filepath"],"type":"object"},"name":"topos_refactor"}],"ttlMs":86400000}}}
{"at":"2026-11-23T06:18:05.070Z","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-23T06:18:05.244Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"extensions":{"io.modelcontextprotocol/tasks":{}},"prompts":{},"resources":{},"tools":{}},"instructions":"Topos evaluates structural code quality on a diamond lattice. For agent loops, load the compact contract with `topos_get_doc(topic=\"agent-contract\")` or fetch `topos://docs/agent-contract`. Default loop: topos_evaluate_file, edit in place, then topos_assess_worktree_change (baseline = git ref). For uncommitted or untracked baselines, snapshot first with topos_begin_refactor, then verify with topos_assess_snapshot. Use topos_assess_improvement only for side-by-side variants. Use gitnexus_dir (default: ./.gitnexus) to enable COMPOSABLE/IDEAL; check graph state with topos_depgraph_status and build/refresh it with topos_generate_depgraph. topos_calculate_coverage reports test-suite coverage — structural (UAST) declaration matching and k-gram recall — as a separate signal, outside the lattice. Read `topos://build` to confirm which binary and file root are serving you. Prefer absolute file paths in tool parameters: a relative one is resolved against the directory this server started in, which the host chose and which may be a different repository; the result says which file it resolved to.","protocolVersion":"2025-11-25","serverInfo":{"name":"topos_mcp","version":"0.15.0+build.1795414684"}}}}
{"at":"2026-11-23T06:18:05.245Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T06:18:05.245Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T06:18:05.245Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"cacheScope":"public","tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Changeset Assessment"},"description":"Assess a multi-file changeset against a git baseline and roll the\nper-file verdicts into a project before/after (read-only).\nUse for a module split or any edit spanning several files. Each file\nis compared to `baseline_ref` (new files have no baseline). Flags\n`complexity_relocated_within_file` and `project_regression`. Returns\na ChangesetResult.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"baseline_ref":{"default":"HEAD","description":"Git baseline ref each file is compared against.","type":"string"},"files":{"description":"Edited file paths (working tree) that make up the changeset.","items":{"type":"string"},"type":"array"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."}},"required":["files"],"type":"object"},"name":"topos_assess_changeset"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Assessment"},"description":"Compare a baseline to a side-by-side proposed variant (read-only).\nFor normal edit-in-place loops, use `topos_assess_worktree_change`\nor snapshot first with `topos_begin_refactor` then\n`topos_assess_snapshot`. This tool is for variants supplied as\n`proposed_code` or `proposed_filepath`. Returns an AssessmentResult\nwith `status` and score/metric deltas.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"current_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Inline baseline source; COMPOSABLE is unavailable."},"filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Baseline file path for side-by-side assessment."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"language":{"default":"python","description":"Language for inline code.","type":"string"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."},"proposed_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Proposed source."},"proposed_filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Proposed file path."}},"type":"object"},"name":"topos_assess_improvement"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Assessment"},"description":"Assess the current file against a baseline captured by\ntopos_begin_refactor.\nLoads the stored baseline by `snapshot_id` and compares it to the\ncurrent on-disk file, with the same status semantics as\n`topos_assess_improvement`. A missing or expired snapshot is\nreported via `blocked_by`.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"filepath":{"description":"Edited file path.","type":"string"},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"snapshot_id":{"description":"Snapshot id from topos_begin_refactor.","type":"string"}},"required":["snapshot_id","filepath"],"type":"object"},"name":"topos_assess_snapshot"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Assessment"},"description":"Assess an in-place edit against a git revision — the common refactor\nloop.\nStateless: the baseline is read from git (`git show\n<baseline_ref>:<path>`, default `HEAD`) and compared to the current\nworking-tree file. No prior call required. For untracked/new files\nor an uncommitted pre-edit baseline, use `topos_begin_refactor` +\n`topos_assess_snapshot`.\nDo not call if you have not edited the file. A no-change result on a\npassing file has no `next_tool`.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"baseline_ref":{"default":"HEAD","description":"Git baseline ref.","type":"string"},"filepath":{"description":"Edited file path.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."}},"required":["filepath"],"type":"object"},"name":"topos_assess_worktree_change"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Begin Refactor"},"description":"Persist the file's current source as a baseline snapshot before you\nedit it (writes a snapshot record — its only side effect).\nReturns a `snapshot_id`; edit the file in place, then call\n`topos_assess_snapshot(snapshot_id, filepath)`. Use this when the\nbaseline is not a committed git revision.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"filepath":{"description":"File path to snapshot. Prefer an absolute path.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":".gitnexus directory."},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."}},"required":["filepath"],"type":"object"},"name":"topos_begin_refactor"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Structural Coverage"},"description":"Measure how well a test suite exercises its program-under-test, via\nstructural (UAST) coverage (read-only).\nA standalone signal, separate from the four-pillar quality lattice;\nfor a quality verdict use `topos_evaluate_*` instead.\nComputes UAST bipartite declaration matching and k-gram path\nrecall. Returns a CoverageResult.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"coverage_threshold":{"default":0.5,"description":"Minimum threshold for the declaration coverage policy.","format":"double","type":"number"},"include_unknown":{"default":false,"description":"Whether to include Unknown UAST nodes in the analysis.","type":"boolean"},"k":{"default":3,"description":"Length of kind n-grams for path recall.","format":"uint","minimum":0,"type":"integer"},"language":{"default":"python","description":"Programming language (for parsing).","type":"string"},"put_files":{"description":"Paths to the program-under-test files (relative to project root).","items":{"type":"string"},"type":"array"},"test_files":{"default":[],"description":"Paths to the test suite files (relative to project root). Optional:\ninline tests in `put_files` (Rust `#[cfg(test)]`, Go `Test*`,\nPython `test_*`) are counted on the test side.","items":{"type":"string"},"type":"array"}},"required":["put_files"],"type":"object"},"name":"topos_calculate_coverage"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Structural Comparison"},"description":"Compute the AST (tree-edit) distance between two source-code\nstrings.\nRead-only and idempotent; parses both snippets in memory, never\nwrites or scores. Use for clone detection or to measure refactor\nimpact; the `topos_assess_*` tools already fold this in as an\nanti-gaming check, so call it directly only for the raw number.\nReturns a ComparisonResult: `normalized_distance` in [0, 1],\n`similarity` (= 1 - it), `raw_distance`, an `operations` edit-count\nmap, and `source_valid`/`target_valid` (`error` set if either fails\nto parse).","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"language":{"default":"python","description":"python, rust, javascript, typescript, cpp, or go.","type":"string"},"source_code":{"description":"Baseline code.","type":"string"},"target_code":{"description":"Proposed/target code.","type":"string"}},"required":["source_code","target_code"],"type":"object"},"name":"topos_compare_code"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Structural Comparison"},"description":"Compute the AST (tree-edit) distance between two source files on\ndisk.\nRead-only; parses both files, never writes or scores. Both files are\nparsed in the language their suffix names, the same way\n`topos compare` does; an unsupported suffix or two different\nlanguages is an error. Use for clone detection or refactor impact; use\n`topos_assess_*` for a quality verdict. Returns a ComparisonResult\n(see `topos_compare_code`).","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"source":{"description":"Baseline file path (prefer absolute).","type":"string"},"target":{"description":"Comparison file path (prefer absolute).","type":"string"}},"required":["source","target"],"type":"object"},"name":"topos_compare_files"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Depgraph Status"},"description":"Report `.gitnexus` availability and freshness (read-only).\nDistinguishes a missing graph from a stale one and from a\nload/schema failure, so an agent knows whether COMPOSABLE can be\ntrusted and what to do next. Never shells out and never mutates\nstate.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"directory":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Repo root to inspect (default: MCP file root / process project root)."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the project root (default:\n`<project root>/.gitnexus`)."}},"type":"object"},"name":"topos_depgraph_status"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Code Evaluation"},"description":"Score a raw code string on the SIMPLE / SECURE / NAVIGABLE quality\nlattice (read-only; never writes or runs the code).\nUse for a snippet not yet on disk. SIMPLE, SECURE, and NAVIGABLE are\nreachable here (CFG/CPG/UAST); COMPOSABLE needs a module dependency\ngraph, so for it use `topos_evaluate_file` with `gitnexus_dir`, or\n`topos_evaluate_project` for a whole tree.\nReturns an EvaluationResult: the lattice verdict (SLOP…IDEAL),\nper-generator scores, and a next-step agent contract.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"code":{"description":"Source code to evaluate.","type":"string"},"language":{"default":"python","description":"Language: python, rust, javascript, typescript, cpp, or go.","type":"string"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."},"verbose":{"default":false,"description":"Include raw metrics.","type":"boolean"}},"required":["code"],"type":"object"},"name":"topos_evaluate_code"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Code Evaluation"},"description":"Score a file on disk on the SIMPLE / COMPOSABLE / SECURE / NAVIGABLE\nlattice — the only evaluate tool that can reach COMPOSABLE\n(side-effecting).\nUnless `no_composable` is set, this generates/refreshes `.gitnexus`\n(given by `gitnexus_dir` or auto-detected at `<root>/.gitnexus`) when\nit's missing or stale, then attaches the resulting\nModuleDependencyGraph — the same default behavior as the CLI's\n`topos evaluate`. SIMPLE/SECURE/NAVIGABLE always run. When GitNexus\nisn't installed or generation fails, `coupling_available` is false\nand `warnings` explains why; the rest of the evaluation still\nsucceeds.\nDo not call again when `agent_contract.next_tool` is absent: the\nfile already passes, or this call already returned the edit span.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns.","items":{"type":"string"},"type":"array"},"filepath":{"description":"Source file path. Prefer an absolute path.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the file root (default: `<file root>/.gitnexus`);\ngenerated/refreshed when missing or stale (see `no_composable`)."},"include_security_findings":{"default":true,"description":"Include SECURE findings.","type":"boolean"},"no_composable":{"default":false,"description":"Use no dependency graph, even an existing `.gitnexus`; score\nSIMPLE/SECURE/NAVIGABLE only.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional generator ranking."},"refactor_targets":{"default":3,"description":"Ranked edit targets to return, gate failures first (default 3;\n0 = off; capped at 25).","format":"uint","minimum":0,"type":"integer"},"security_scan":{"default":false,"description":"Run Sighthound even if SECURE passed; report-only.","type":"boolean"},"verbose":{"default":false,"description":"Include raw metrics.","type":"boolean"}},"required":["filepath"],"type":"object"},"name":"topos_evaluate_file"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Code Evaluation"},"description":"Recursively score every supported source file in a directory on the\nSIMPLE / COMPOSABLE / SECURE / NAVIGABLE lattice, with a project\nrollup (side-effecting).\nAutodetects all supported languages in one walk. Returns a summary\nby default: the rollup (`aggregate_floor_verdict` is the pillars\nevery scored file holds), the five `worst` files with absolute paths\nand the metric behind each, counts, and warnings. `detail: \"full\"`\nreturns per-file rows (`limit` / `offset`) and the named lists.\nUnless `no_composable` is set, generates/refreshes `.gitnexus` when\nmissing or stale before scoring, same as `topos_evaluate_file` and\nthe CLI's `topos evaluate` — `coupling_available`/`warnings` explain\nit when that isn't possible, without failing the evaluation.\nDo not call this for one file, or after a file already passed. It\nwalks the tree. A person asks for the project rollup; an agent\nediting one file does not.","inputSchema":{"$defs":{"Detail":{"enum":["summary","full"],"type":"string"},"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"Dangerous-call patterns to acknowledge for this run only.","items":{"type":"string"},"type":"array"},"detail":{"$ref":"#/$defs/Detail","description":"`summary` (default): rollups and worst files. `full`: per-file rows."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the file root (default: `<file root>/.gitnexus`);\ngenerated/refreshed when missing or stale (see `no_composable`), or\nCOMPOSABLE is reported unavailable if generation fails."},"include_security_findings":{"default":false,"description":"When true, attach per-file SECURE findings to each entry; off by\ndefault to keep responses compact.","type":"boolean"},"limit":{"default":25,"description":"Per-file rows to return per page (1–500, default 25).","format":"uint","minimum":0,"type":"integer"},"no_composable":{"default":false,"description":"Use no dependency graph, even an existing `.gitnexus`; score\nSIMPLE/SECURE/NAVIGABLE only.","type":"boolean"},"offset":{"default":0,"description":"Zero-based row offset for pagination; pass the response's\n`next_offset` to fetch the next page.","format":"uint","minimum":0,"type":"integer"},"path":{"description":"Directory to evaluate, walked recursively. Prefer an absolute path. Must\nresolve inside the trusted file root. Languages are autodetected.","type":"string"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Optional ranking of simple/composable/secure/navigable (best first).\nTop-ranked sets scorer priority (default SIMPLE)."},"verbose":{"default":false,"description":"When true, include each file's raw metric values alongside scores.","type":"boolean"}},"required":["path"],"type":"object"},"name":"topos_evaluate_project"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Generate Depgraph"},"description":"Generate the `.gitnexus` dependency graph via GitNexus\n(side-effecting).\nEnsures the graph by default: no-ops when current, otherwise runs\n`gitnexus analyze`. `force=true` always regenerates.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"directory":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Repo root to analyze (default: MCP file root / process project root)."},"force":{"default":false,"description":"Regenerate even when current.","type":"boolean"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the project root."}},"type":"object"},"name":"topos_generate_depgraph"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Documentation"},"description":"Return a Topos documentation page as Markdown.\nUse when your MCP client does not expose resource fetching to the\nagent. Clients that do surface resources should prefer the\nequivalent resource URI for efficiency: `topos://docs/{topic}`.\nTopics: `agent-contract` (compact loop contract, read first for\nrefactors), `lattice` (the 16-element H(G_qual) over four generators),\n`metrics` (every metric key, thresholds, interpretation),\n`preferences` (strict generator rankings and preference walks),\n`priority` (priority profiles), `workflows` (the expanded refactor\nloop guide).","inputSchema":{"$defs":{"DocTopic":{"description":"Topic for `topos_get_doc`.","enum":["agent-contract","lattice","metrics","preferences","priority","workflows"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"topic":{"$ref":"#/$defs/DocTopic","description":"agent-contract | lattice | metrics | preferences | priority | workflows"}},"required":["topic"],"type":"object"},"name":"topos_get_doc"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Topos Detailed Inspection"},"description":"Full metric breakdown for a single code unit (inline string or\nfile).\nProvide exactly one of `code` or `filepath`. Use when you need the\nper-function detail behind a verdict; use `topos_evaluate_*` when the\nmedal alone is enough. Returns an InspectionResult: the lattice\n`evaluation`, a *top-N* function complexity table\n(`top_n_functions`, default 10), `total_functions`, and entropy\ndetails.\nWith `filepath`, the verdict is scored on all four generators and\nagrees with `topos_evaluate_file`: unless `no_composable` is set,\nthis generates/refreshes `.gitnexus` (given by `gitnexus_dir` or\nauto-detected at `<root>/.gitnexus`) when missing or stale, then\nattaches the ModuleDependencyGraph — so this tool is side-effecting.\nWith inline `code` there is no module to place in the graph, so only\nSIMPLE/SECURE/NAVIGABLE are reachable, as in `topos_evaluate_code`.\nDo not call after `topos_evaluate_file` already returned a passing\nverdict or a `refactor_targets` span. This is the detail view, not\nthe next step.","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"},"UserPreferencesInput":{"additionalProperties":false,"description":"Strict ranking over simple, composable, secure, and navigable.","properties":{"ranking":{"description":"Permutation of simple/composable/secure/navigable, best first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional explicit target verdict."}},"required":["ranking"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allow":{"default":[],"description":"One-off acknowledged dangerous-call patterns for this inspection.","items":{"type":"string"},"type":"array"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Inline source code."},"filepath":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Source file path inside the project root (prefer for large files)."},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"`.gitnexus` store under the file root (default: `<file root>/.gitnexus`);\nonly used with `filepath`."},"language":{"default":"python","description":"Language for inline `code`; ignored for `filepath`, which is\nautodetected from the file extension.","type":"string"},"no_composable":{"default":false,"description":"Use no dependency graph, even an existing `.gitnexus`; score\nSIMPLE/SECURE/NAVIGABLE only.","type":"boolean"},"preferences":{"anyOf":[{"$ref":"#/$defs/UserPreferencesInput"},{"type":"null"}],"description":"Strict total order on the four generators; see\n`topos://docs/preferences`."},"top_n_functions":{"default":10,"description":"Return at most this many functions, sorted by descending cyclomatic\ncomplexity. Keeps agent context lean on large files.","format":"uint","minimum":0,"type":"integer"},"verbose":{"default":false,"description":"Include raw probe metric floats under each file in the response.","type":"boolean"}},"type":"object"},"name":"topos_inspect_code"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos PR Recap"},"description":"Structural PR or commit-range recap: gate readiness, blocking findings, files needing attention. Summary by default; `detail: \"full\"` for `topos.pr_recap.v3`.","inputSchema":{"$defs":{"Detail":{"enum":["summary","full"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"base":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Base commit ref (default `HEAD`)."},"detail":{"$ref":"#/$defs/Detail","description":"`summary` (default) or `full` v3 document."},"directory":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Repository directory (default: MCP file root)."},"head":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Head commit ref or `:worktree` (default `:worktree` or `HEAD`)."},"max_files":{"default":0,"description":"Max scored files by churn (default 0 = all).","format":"uint","minimum":0,"type":"integer"},"no_coupling":{"default":false,"description":"Skip coupling graph preparation.","type":"boolean"},"paths":{"default":[],"description":"Absolute or repo-relative paths of files whose full records to include.","items":{"type":"string"},"type":"array"},"pr":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Pull request number (mutually exclusive with `base`/`head`)."},"preset":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Built-in gate preset (`relaxed`, `recommended`, or `strict`)."},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Priority pillar or comma-separated ranking."},"strict":{"default":false,"description":"Fail readiness check on `warn` as well as `block`.","type":"boolean"}},"type":"object"},"name":"topos_pr_recap"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Preference Walk"},"description":"Turn a generator ranking into a preference-ordered relaxation walk.\nPure and read-only (lattice math only; no files, no scoring). Call\nafter an evaluation to pick the next verdict to aim for, or to relax\nthe goal gracefully under a token/time budget. Returns a\nPreferenceWalkResult: `walk` (steps from target down to just above\n`current`), `next_step`, `progress` in [0, 1],\n`aspirational_target`/`fallback_target`, and `induced_order` (all 16\nverdicts ranked).","inputSchema":{"$defs":{"GeneratorInput":{"description":"Wire form of a generator name.","enum":["simple","composable","secure","navigable"],"type":"string"},"LatticeElement":{"description":"The 16 elements of the free Heyting algebra H(G_qual) on the four\ngenerators SIMPLE, COMPOSABLE, SECURE, NAVIGABLE, mirroring\n`EvaluationValue` on the MCP wire.\n\nNote for clients pinned to the pre-v0.5.0 shape: `IDEAL` now requires\nall four pillars. The verdict that used to be `IDEAL` — the top of the\nthree-generator algebra — serializes as `SIMPLE_COMPOSABLE_SECURE`.\nVariants are declared in **bitmask order**, matching\n`EvaluationValue::ALL`, so the two enums convert by position. Serde\nkeys on variant names, so this ordering is an implementation detail\nand not part of the wire contract.","enum":["SLOP","SIMPLE","COMPOSABLE","SIMPLE_COMPOSABLE","SECURE","SIMPLE_SECURE","COMPOSABLE_SECURE","SIMPLE_COMPOSABLE_SECURE","NAVIGABLE","SIMPLE_NAVIGABLE","COMPOSABLE_NAVIGABLE","SIMPLE_COMPOSABLE_NAVIGABLE","SECURE_NAVIGABLE","SIMPLE_SECURE_NAVIGABLE","COMPOSABLE_SECURE_NAVIGABLE","IDEAL"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"current":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional current verdict; truncates the walk to steps strictly above\nit and sets `next_step`. Defaults to the full walk."},"gate_scores":{"additionalProperties":{"format":"double","type":"number"},"default":{},"description":"Pillar gate scores in `[0, 1]`. Enables `next_pillar`.","type":"object"},"ranking":{"description":"Permutation of {simple, composable, secure, navigable}, most-preferred first.","items":{"$ref":"#/$defs/GeneratorInput"},"type":"array"},"target":{"anyOf":[{"$ref":"#/$defs/LatticeElement"},{"type":"null"}],"default":null,"description":"Optional aspirational-target override; defaults to IDEAL."}},"required":["ranking"],"type":"object"},"name":"topos_preference_walk"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true,"title":"Topos Refactor Suggestions"},"description":"Rank structural refactor hotspots for one file (read-only, advisory).\nDoes not score the four pillars — use `topos_evaluate_*` for\nmedals and `topos_assess_*` to verify edits afterward. `target`\nselects the engine: `cycles` (CFG loop/branch bodies),\n`dependencies` (MDG Forman curvature on imports; needs `.gitnexus`),\nor `process` (execution choke points; needs `.gitnexus`). Returns a\nRefactorResult with ranked `hotspots` (`kind`, `label`, `score`,\n`suggestion`, optional lines).","inputSchema":{"$defs":{"RefactorTargetKind":{"description":"Engine selector for `topos_refactor`.","oneOf":[{"const":"cycles","description":"CFG cycle-basis: loop/branch bodies driving cyclomatic complexity.","type":"string"},{"const":"dependencies","description":"MDG Forman curvature: load-bearing import edges (needs `.gitnexus`).","type":"string"},{"const":"process","description":"Process-graph choke points (needs `.gitnexus`).","type":"string"}]}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"filepath":{"description":"Source file path relative to the MCP file root.","type":"string"},"gitnexus_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Override `.gitnexus` directory (`dependencies` / `process` targets)."},"limit":{"default":5,"description":"Maximum hotspots to return (default 5).","format":"uint","minimum":0,"type":"integer"},"target":{"$ref":"#/$defs/RefactorTargetKind","description":"Which analysis engine to run: `cycles` (CFG), or `dependencies` /\n`process` (need `.gitnexus`)."}},"required":["target","filepath"],"type":"object"},"name":"topos_refactor"}],"ttlMs":86400000}}}
