topos.mcp.tools.evaluate¶
Evaluation tools: code string, single file, whole project.
The single-file tool is the P0 bug fix — the previous evaluate_file
delegated to evaluate_code and dropped the filepath, so ModuleDependencyGraph
was never built and COMPOSABLE/IDEAL were unreachable via MCP.
- topos.mcp.tools.evaluate.topos_evaluate_code(params)[source]
Classify a raw code string on the free Heyting algebra H(G_qual).
SIMPLE and SECURE generators are scored from CFG / CPG built on the source. COMPOSABLE requires a
ModuleDependencyGraph(and is therefore unreachable from a bare string); usetopos_evaluate_filewithgitnexus_dirto enable it.- Lattice values are the 8 elements of the 3-cube H(G_qual):
SLOP (⊥) No generator satisfied. SIMPLE / COMPOSABLE / SECURE One generator satisfied. SIMPLE_COMPOSABLE / SIMPLE_SECURE / COMPOSABLE_SECURE Two satisfied. IDEAL (⊤) All three generators satisfied.
- topos.mcp.tools.evaluate.topos_evaluate_file(params)[source]
Evaluate a file on disk. Enables the COMPOSABLE generator.
When
gitnexus_diris provided (or auto-detected at<project_root>/.gitnexus), aModuleDependencyGraphis attached to the classifier so the COMPOSABLE generator can be scored. CFG and CPG (SIMPLE and SECURE generators) always run.Generate a
.gitnexus/directory withtopos depgraph generatefirst (requiresnpm install -g gitnexus).
- async topos.mcp.tools.evaluate.topos_evaluate_project(params, ctx=<fastmcp.server.dependencies._CurrentContext object>)[source]
Recursively evaluate every Python file in a directory.
Reports progress to the client via
ctx.report_progressso the UI shows a live bar during long walks. Rolls up per-dimension scores using the project-wide minimum (CharacteristicMorphism.combine_dimensions).Returns a paginated per-file table plus the overall rollup. Use
limit/offsetto page through large codebases.
- topos.mcp.tools.evaluate.render_project_md(r)[source]