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); use topos_evaluate_file with gitnexus_dir to 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_dir is provided (or auto-detected at <project_root>/.gitnexus), a ModuleDependencyGraph is attached to the classifier so the COMPOSABLE generator can be scored. CFG and CPG (SIMPLE and SECURE generators) always run.

Generate a .gitnexus/ directory with topos depgraph generate first (requires npm 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_progress so 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 / offset to page through large codebases.

topos.mcp.tools.evaluate.render_project_md(r)[source]