Modelica — 130 Operations for AI Agents
Modelica models physical systems — thermal, mechanical, electrical — as equations engineers simulate before they build. act101 navigates models, connectors, and parameters structurally, so agents work in simulation code with engineering precision.
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze Modelica code through the act MCP server. 130 operations available: 56 refactor, 18 query, 42 analysis, 14 verification. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
Premium language. Operations on Modelica require an Elite license or above. See pricing.
18Query
56Refactor
42Analysis
14Verify
Query
| Operation | Description |
|---|---|
callers |
Find every call site of a function or method across the codebase. Use to understand who depends on a function before changing its signature. Requires LSP. Params: symbol (string) [, file (string)] |
control_flow |
Get a function's control flow — branches, loops, early returns, and basic blocks in execution order. Use to understand complex logic without reading the full implementation. Params: target (string), file (string) |
data_flow |
Intra-procedural def-use — variable definitions, uses, def→use edges, and which locals flow into the return. The dual of control_flow. Single-file. Params: target (string), file (string) |
definition |
Jump to definition — find where a symbol is defined given a usage location. Uses AST-based parsing by default, no LSP required. Params: symbol (string), file (string), line (u32), column (u32) |
diagnostics |
Get compiler errors and warnings from the language server. Omit `file` for workspace-wide diagnostics. Pass a file path or directory path to scope results. Requires LSP. Params: none [, file (string)] |
effect_closure |
Transitive effect closure of a function across the call graph — composed reads/writes/raises/allocates/blocks/awaits with provenance, recorded cycles, and the unresolved-call frontier. Params: target (string), file (string) [, max_depth (u32), max_nodes (u32)] |
effect_summary |
Get a function's effect signature — reads, writes, raises, allocates, blocking calls, and awaits — plus the unresolved-call frontier. Single-file, intra-procedural. Params: target (string), file (string) |
fix_auto |
Auto-fix all deterministic issues in a file, directory, or workspace — missing imports, unused imports, simple type errors. Runs multiple fix-revalidate cycles. Use after making changes to clean up automatically. Requires LSP. Params: none [, file (string), workspace_mode (bool), category (string), commit (bool), max_rounds (u32)] |
get_type |
Get the compiler-inferred type of any expression at a position. Use to understand types without reading surrounding code. Requires LSP. Params: file (string), line (u32), column (u32) |
graph |
Build a dependency graph from a file — trace what it imports and what imports it, across multiple hops. Use to understand module relationships and change impact before refactoring. Params: file (string) [, depth (u32), direction (string), leaves (bool), order (string)] |
import_organize |
Organize, sort, and deduplicate imports in a file. Removes unused imports. Use after adding new code or moving symbols to clean up import blocks automatically. Params: file (string) [, preview (bool)] |
interface |
Get a symbol's public API — signatures, types, and docstrings without implementation bodies. Like skeleton but for a single symbol. Use to understand how to call something without reading its internals. Params: target (string), file (string) [, include_private (bool)] |
mutations |
Identify side effects — what external state a function reads or writes (globals, file I/O, network, etc.). Use to understand if a function is pure or has hidden dependencies. Params: target (string), file (string) |
references |
Find every usage of a symbol across the entire codebase — all files, not just the current one. Use before renaming, refactoring, or deleting to understand full impact. Requires LSP. Params: symbol (string), file (string) |
repo_outline |
Get a compressed overview of the entire repository in one call — file tree with languages, line counts, and optionally symbol names per file. Orders of magnitude cheaper than listing directories and reading files individually. Params: none [, path (string), depth (u32), include (glob), exclude (glob), symbols (bool), max_files (u32), relative (bool)] |
skeleton |
Get a file's structure — function signatures, class declarations, type definitions — without implementation bodies. Use INSTEAD of reading the full file to understand its API. Typically 5-10x fewer tokens than reading the raw file. Params: file (string) |
symbols |
List all symbols (functions, classes, variables, types, constants) defined in a file with their locations and kinds. Use INSTEAD of reading a file when you need to know what's defined in it. Much cheaper than reading the full file. IMPORTANT: file must be a path to a single source file — never a directory or empty string. Params: file (string) |
symbols_batch |
Retrieve symbols from multiple files in a single call. Use instead of calling symbols() in a loop — one request instead of N. Params: none [, files (string[]), ids (string[]), kinds (string[])] — provide files or ids |
Refactor
| Operation | Description |
|---|---|
add-connection |
Insert a `connect(a, b);` equation into a named Modelica class's equation section. Rejects if the class or equation section is missing, an endpoint is not a valid component reference, or an identical connect is already present. |
add-extends |
Insert an `extends <BaseClass>;` clause as the first element of a named Modelica class body. Rejects if the class is missing or already extends the base. |
add-flow-variable |
Add a variable declaration to a Modelica connector class (`flow <type> <name>;` when flow is true, else `<type> <name>;`). Rejects if the target is not a connector, the connector is missing, or the name is invalid. |
add-parameter |
Insert a parameter declaration into a named Modelica class among its existing declarations. |
convert-equation-to-algorithm |
Move one simple equation `lhs = rhs;` out of the equation section into the class's algorithm section as `lhs := rhs;`. Creates an `algorithm` section if none exists. Rejects if the equation is not simple or lives in an `initial equation` section. |
convert-model-to-block |
Convert a `model` class to a `block` by replacing the `model` keyword token in its ClassPrefixes with `block` via the AST keyword-token byte range. Does NOT reclassify connector inputs/outputs (ambiguous, out of scope). Rejects if the class is missing, not a model, or already a block. |
convert-to-expandable-connector |
Convert a Modelica connector class to `expandable connector` by inserting the `expandable` keyword into its ClassPrefixes. Rejects if the target is not a connector, the connector is missing, or it is already expandable. |
convert-to-replaceable |
Prefix a named Modelica component declaration with `replaceable`. Rejects if the component is missing or already replaceable. |
extract-base-class |
Move a named Modelica class's component declarations into a new partial model block inserted before it, and rewrite the source class body to `extends <Base>;` (preserving its equation section). Rejects if the class is missing or has no component declarations. |
extract-connector |
Group two related scalar variable declarations in a class into a new connector block inserted before the source class, and replace the two declarations with a single instantiation. |
extract-function |
Extract a single algorithm-section assignment statement (`target := <rhs>;`) into a new top-level function with one output and replace the statement with a call. Equation-section sources (`target = <rhs>;`) are rejected. |
extract-model |
Extract a component declaration and the equations referencing it into a new model block inserted before the source class, and replace the component with an instantiation. |
extract-parameter |
Extract a numeric literal in an equation/algorithm into a named parameter declaration and replace the literal with a reference. |
extract-record |
Group two or more named variable/parameter declarations in a class into a new record block inserted before the source class, and replace those declarations with a single instantiation. |
extract_function |
Extract a code selection into a new function — automatically infers parameters, return types, and inserts the call site. Use instead of manually cutting/pasting code. Works without LSP; LSP improves type inference. Params: file (string), new_name (string), start_line (u32), start_column (u32), end_line (u32), end_column (u32) [, preview (bool), receipt (bool)] |
extract_variable |
Extract an expression into a named variable — inserts the declaration and replaces the expression with the variable name. Works without LSP. Params: file (string), new_name (string), start_line (u32), start_column (u32), end_line (u32), end_column (u32) [, preview (bool)] |
fix-missing-parameter-value |
Add a default/start value to a Modelica `parameter` declaration that has none by inserting ` = <value>` before the declaration's trailing `;` at the AST byte offset. Rejects if the parameter is missing, is not a `parameter`, or already has a value. |
fix-missing-units |
Add a `unit` attribute to a Modelica component declaration lacking one: inserts `(unit="<unit>")` after the variable name when no modification exists, or appends `, unit="<unit>"` before the closing `)` of an existing modification list. Does not validate the unit string. Rejects if the variable is missing or already has a unit attribute. |
fix-type-mismatch |
Change a component's declared type by replacing the TypeSpecifier node text (e.g. `Real x;` -> `Integer x;`). This is a textual type swap, NOT semantic type inference: it does not check assignment compatibility. Rejects if the variable is missing. |
fix-unbalanced-connector |
Balance a Modelica connector that has one variable kind but not the other. Provide `flow_name` to add a `flow Real <name>;` when the connector has a potential but no flow variable, or `potential_name` to add a `Real <name>;` when it has only a flow variable. Exactly one of the two names must be given. Rejects if the target is not a connector, already balanced, or already has the requested kind. |
fix-unconnected-connector |
Add a `connect(<connector>, <target>);` equation to a class's equation section for an unconnected connector component, mirroring add_connection. Rejects if the class, connector component, or equation section is missing, or the connector is already referenced by an existing connect equation. |
fix-unused-component |
Annotate a proven-unused Modelica component with a leading `// unused: <reason>` comment line before its declaration (preserves the declaration, unlike remove_unused_component). Defaults the reason to `unreferenced` when omitted. Rejects if the component is missing or actually referenced in equations/connect clauses. |
gen-block |
Append a causal `block <name>` scaffold at EOF with `input Real <i>;` per input, `output Real <o>;` per output, and an equation section with a stub assignment. Parse-valid even with empty inputs/outputs. Rejects an invalid name. |
gen-connector |
Append a balanced `connector <name>` scaffold at EOF with one potential (`Real <potential_name>;`) and one flow variable (`flow Real <flow_name>;`). Defaults potential_name to `v` and flow_name to `i`. Rejects an invalid name. |
gen-documentation-template |
Append a `model <name>` class carrying `annotation(Documentation(info=...))`. The annotation is wrapped in a model class because a bare top-level annotation is not valid Modelica. Defaults info to `<html></html>`. Rejects an invalid name. |
gen-function |
Append a `function <name>` scaffold at EOF with `input Real <i>;` per input, `output Real <o>;` per output, and a minimal algorithm section with one stub assignment. Parse-valid even with empty inputs/outputs. Rejects an invalid name. |
gen-icon-annotation |
Append a `model <name>` class carrying a minimal stub `annotation(Icon(coordinateSystem(extent=...)))` (default extent only, no graphics primitives). The annotation is wrapped in a model class because a bare top-level annotation is not valid Modelica. Rejects an invalid name. |
gen-model-scaffold |
Append a minimal `model <name>` scaffold at EOF with one `parameter Real <p>;` per parameter, one `Real <c>;` per component, and a single equation section with a stub equation. Parse-valid even with empty parameters/components. Rejects an invalid name. |
gen-package |
Append a `package <name>` scaffold at EOF with one stub class per entry (each stub is `model <c>` with an empty body). Parse-valid even with an empty classes list. Rejects an invalid name. |
gen-partial-base |
Append a `partial model <name>` inheritance-template base at EOF with one `parameter Real <p>;` per parameter. Parse-valid even with an empty parameters list. Rejects an invalid name. |
gen-record |
Append a `record <name>` scaffold at EOF with `Real <field>;` per field. Parse-valid even with an empty fields list. Rejects an invalid name or field name. |
gen-test-model |
Append a `model <name>` test harness that instantiates a unit-under-test (`<uut> u;`) and carries `annotation(experiment(StartTime=0, StopTime=<stop_time>))`. Defaults stop_time to 1.0. Rejects an invalid name. |
inline |
Inline a variable, function, or method — replace every usage with its definition body, then remove the original. The inverse of extract. Works without LSP (single-file); LSP enables cross-file inlining. Params: file (string), symbol (string) [, line (u32), preview (bool), receipt (bool)] |
inline-function |
Inline a simple single-input single-output single-statement Modelica function at its single call site, substituting the argument into the body, and delete the function definition. |
inline-model |
Flatten a component's instantiated model into the enclosing class: move the sub-model's component declarations and equations into the parent (qualifying internal references by the instance name), remove the instantiation, and delete the sub-model. Rejects if the sub-model has parameters/inputs/outputs, nested classes, or references outside its own components. |
insert_body |
Replace a function's implementation body with new code. AST-validated — rejects if the result has parse errors, so you can't accidentally break syntax. Use instead of manual text editing for function rewrites. Params: file (string), symbol (string), code (string) [, commit (bool)] |
introduce-initial-equation |
Move one simple equation into an `initial equation` section. Creates `initial equation` before the regular equation section if none exists. Rejects if the equation is not simple or already lives in an initial section. |
make-partial |
Insert the `partial` keyword into a named Modelica class's ClassPrefixes (before the class-kind keyword). Rejects if the class is missing or already partial. |
move-to-package |
Wrap a file's top-level classes in a new `package <name> ... end <name>;`, re-indenting the wrapped lines by two spaces. Rejects if the file has no top-level classes or already contains a top-level package (refuses to double-wrap). |
move_symbol |
Move a function, class, or type to a different file and automatically update all imports across the codebase. Use instead of manually cut/paste + fixing imports. Works without LSP (single-file); LSP enables cross-file import updates. Params: file (string), symbol (string), destination (string) [, preview (bool), receipt (bool)] |
organize-imports |
Sort, deduplicate, and reorder Modelica import clauses within a file's contiguous import region. |
promote-parameter |
Lift a sub-component's parameter modification to the parent class: adds `parameter <T> <param> = <value>;` to the parent (type derived from the sub-type's parameter declaration) and removes the `<param>=<value>` from the sub-component's modification (removing the whole `(...)` when it was the only key). Rejects if the sub-component lacks the modification or the sub-type lacks the parameter. |
recipe_run |
Run a codemod recipe: declarative match → transform → optional verify across modeled grammars. Preview lists matches; apply writes with optional E7 receipts and all-or-nothing rollback. Returns a per-site report. |
remove-connection |
Remove a `connect(a, b);` equation matching the given endpoints from a named Modelica class. Rejects if the class or the matching connect equation is missing. |
remove-extends |
Remove an `extends <BaseClass>;` clause from a Modelica class by base name, deleting the whole physical line. Rejects if the class or extends clause is missing. |
remove-parameter |
Remove a parameter declaration by name from a Modelica class. Rejects if the parameter is still referenced. |
remove-unused-component |
Remove a component declaration that is never referenced in equations or connect() clauses within its Modelica class. Rejects if the component is referenced. |
rename |
Rename a symbol and automatically update ALL references across the codebase. Safer and faster than find-and-replace — AST-aware, won't rename strings or comments. Works without LSP (single-file); LSP enables cross-file renames. Params: file (string), old_name (string), new_name (string) [, line (u32), column (u32), preview (bool), receipt (bool)] |
rename-class |
Rename a Modelica class and same-file references. |
rename-component |
Rename a Modelica component instance and same-class modifications, equation, and connect() references. |
rename-connector |
Rename a Modelica connector class and file-wide component declarations and connect() references. |
rename-function |
Rename a Modelica function class and file-wide call sites. |
rename-parameter |
Rename a Modelica parameter declaration and same-class modifications and references. |
rename-variable |
Rename a Modelica variable in the correct class scope and update equation/algorithm references. |
set-modification |
Set or replace a named modification value on a component declaration in a named class. Replaces the existing value when the key is present, appends `, key=value` when a modification list exists but lacks the key, or inserts `(key=value)` after the component name when no modification exists. Rejects if the class, component, key, or value is missing. |
vectorize-equation |
Collapse exactly two consecutive scalar array-indexed equations (e.g. `x[1] = a[1];` then `x[2] = a[2];`) into one `for i in 1:2 loop ... end for;`. Rejects if there are not exactly two consecutive equations, the indices are not consecutive integers starting at 1, or the equations differ in structure beyond the index. |
Analysis
| Operation | Description |
|---|---|
analyze_api_diff |
Diff the exported/public symbol surface between merge-base(base_ref, HEAD) and the working tree: per-symbol verdict rows (breaking / possibly-breaking / additive) with both signatures where they changed — removed public symbols, gained parameters, and visibility narrowing are breaking; new exports additive. Visibility-unmodeled grammars yield unjudgeable rows naming the grammar (never silence, never guessed-private); type-level claims only where types are modeled. Params: none [, base_ref (string — omit to diff against HEAD)] |
analyze_chokepoints |
Find files that act as critical bottlenecks — high betweenness centrality in the dependency graph (R4). granularity="symbol" ranks individual functions over the call graph instead of files (capped, with truncation disclosure). Params: none [, granularity (string), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_clarity |
Measure architectural clarity — per-function complexity and per-class cohesion each ranked as a percentile residual within its own shape cohort (so a small file isn't penalized for being small), rolled up to per-file and repo-level neutral density-outlier bands (U-2). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_clones |
Detect duplicated code as clone classes — type-1 (exact) and type-2 (renamed identifiers/literals) subtree clones with member ranges, token counts, and an extract_function remediation pointer when all members sit in function bodies; type-3 (gapped) clones are not detected. Params: none [, include (string[]), exclude (string[]), min_tokens (number)]. Use include/exclude to restrict the scan scope; min_tokens overrides the minimum clone size (default 50). |
analyze_clusters |
Identify tightly coupled groups of files using community detection. Use to discover natural module boundaries and understand which files change together. Clusters where a hub file glues unrelated files together are flagged via hub_collapse=true and top_hubs (named hub files); pass dampen_top_k (u32) to exclude the top-k highest-degree files from propagation and reveal genuine neighborhoods. Params: none [, granularity (string), min_size (u32), dampen_top_k (u32), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_cohesion |
Measure intra-module cohesion for each file — ratio of internal to total symbol edges (H2); counts call edges between symbols (syntactic, LSP-enriched when available). Also reports class-level LCOM4 (connected components of each class's method graph — methods linked by a shared field access or intra-class call) with coverage-law disclosure of which grammars were modeled. Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_conformance |
Evaluate the [architecture] contract in .act/config.toml against the actual import graph — deny-rule, layer-rank, and public-surface violations with the offending import's file:line, plus named cycle exemptions (suppressed but counted). Returns contract_present: false when no contract section exists. Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope. |
analyze_coupling |
Measure coupling per file — how many files depend on it (afferent) vs how many it depends on (efferent), plus instability and abstractness scores; symbol granularity reflects call relationships (syntactic, LSP-enriched when available). Use to find the most critical/fragile files. Params: none [, granularity (string), sort (string: coupling|instability|distance|afferent|efferent, default coupling = most entangled first), threshold (f64), top_n (u32, default 200), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_cycle_risk |
Score each circular dependency cycle by its external risk surface (R6 circular risk zones analysis). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_cycles |
Find circular dependency chains in the codebase. Use to identify import cycles that cause build issues or indicate architecture problems. Params: none [, granularity (string), max_length (u32), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_dead_code |
Find dead code — functions, classes, and types that are never referenced from any entry point; reachability follows call edges (syntactic, LSP-enriched when available). Use before cleanup to safely identify what can be deleted. Params: none [, entry (string[]), granularity (string), include_tests (bool), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_depth |
Compute longest transitive dependency chain per file (S4 dependency depth analysis). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_entry_points |
Detect entry points: main functions, HTTP routes, CLI commands, event listeners, test files (S5). Params: none [, include (string[]), exclude (string[])]. |
analyze_export |
Export the full semantic graph (files, symbols, dependencies) in JSON, DOT (Graphviz), or CSV format. Use for visualization or external analysis. Responses are size-bounded: large graphs return truncated:true plus next_cursor — pass it back as cursor to page through; stats always reports full node/edge counts. Params: none [, format (string), cursor (u32), max_bytes (u32, default 1000000, hard cap 4000000), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_extraction |
Score clusters for service or package extraction viability (M2 extraction candidates analysis); skips hub-collapse artifact clusters (flagged by analyze_clusters). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_fan_balance |
Compute fan-in/fan-out imbalance for migration ordering guidance (M6 fan balance analysis). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_features |
Inventory language-specific AST features used in the codebase — async, generics, decorators, etc. (M3). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_hotspots |
Rank files by composite complexity score — max cyclomatic complexity, statement count, nesting depth (H1). Test files are excluded by default (is_test_file conventions); summary.test_files_excluded discloses the count. Item-level exclusion (e.g. Rust #[cfg(test)]) is per-grammar; summary.item_level_exclusion_grammars names grammars where it was modeled. Params: none [, top_n (u32), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_impact |
Compute change impact — two modes. File mode (Free, default): finds all files directly and transitively depending on `target` (R1). Symbol mode (Architecture): when `symbol` is set, returns transitive callers of that function symbol — syntactic-floor analysis, LSP-enhanced when available, no LSP required. Append `::<line>` to `symbol` to disambiguate overloads (e.g. `"process::42"`). Params: target (string) [, symbol (string), max_depth (u32), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). Errors: SYMBOL_NOT_FOUND, AMBIGUOUS_SYMBOL, UNSUPPORTED_SYMBOL_KIND. |
analyze_inconsistencies |
Detect inconsistent abstractions — sibling files in the same directory that diverge from the group's structural pattern (H5). Params: none [, include (string[]), exclude (string[])]. |
analyze_inheritance |
Detect tangled inheritance — deep hierarchies (>N levels) and diamond inheritance (H6). Params: none [, include (string[]), exclude (string[])]. |
analyze_interface_bloat |
Detect interface bloat — files where the public API is disproportionately large relative to implementation (H3). Params: none [, include (string[]), exclude (string[])]. |
analyze_interfaces |
Map cross-module interfaces — symbols that cross directory-module boundaries, ranked by interface width (M4). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_layers |
Detect architectural layers from directory names and find dependency direction violations (S1+S2); result carries classification_coverage and is marked unreliable below 0.5 coverage (verdicts not-modeled). Params: none [, detect_only (bool), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_orphan_types |
Find type definitions used exclusively outside their defining directory (H4 orphan types analysis). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_patterns |
Find code smells — god functions, deep nesting, high coupling, and other structural issues. Use to identify refactoring targets or assess code quality. Params: none [, tier (string), pattern (string), file (string), severity (string), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_platform_deps |
Detect platform-specific API usage by scanning imports (M5 platform dependencies analysis). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_readiness |
Compute migration readiness scores per file — composite of complexity, coupling, porting blockers (M1). Params: none [, include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_roles |
Classify files by architectural role: entry point, routing, business logic, data access, config, test, utility, types, generated (S3). Params: none [, include (string[]), exclude (string[])]. |
analyze_seams |
Find the natural boundaries between file clusters — the narrowest points where groups of files communicate. Use to identify where to split modules or add API boundaries. Params: none [, min_cluster_size (u32), max_seam_width (u32), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_stability |
Compute stability index (R2) and detect stable dependency violations (R3) — flags edges where stable modules depend on unstable ones. Params: none [, index_only (bool), include (string[]), exclude (string[])]. |
analyze_surface |
Measure API surface area — count exposed functions, types, and complexity at a module boundary. Use to assess whether an API is too large or leaky. Params: none [, boundary (string), files (string), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_test_gaps |
Detect source files with no or partial test coverage (R5). When coverage_report is supplied (lcov, JaCoCo XML, or coverage.py JSON), statuses are evidence-based (evidence: "lcov"); otherwise convention-based (evidence: "convention"). Params: none [, coverage_report (string), include (string[]), exclude (string[])]. Use include/exclude to restrict the scan scope (e.g. include=["crates"], exclude=["corpus"]). |
analyze_type_completeness |
Analyze type boundary completeness — detect 'any' types, untyped parameters, missing return types at exported function boundaries (M7). Params: none [, include (string[]), exclude (string[])]. |
churn_hotspots |
Rank code by git churn — change frequency weighted by recency. Workspace mode (no `file`, Architecture) ranks symbols by score = Σ recency-decayed changes; single-file mode (`file`, Free teaser) returns that file's bare commit count. Honest degradation: grammars without symbol extraction yield file-level facts only. Params: none [, file (string), top_n (u32)=50, max_files (u32)=500] |
co_change_clusters |
Cluster symbols that change together across git history (co-change coupling). Returns clusters with support (shared commits) and confidence. Useful for finding hidden coupling and shotgun-surgery risk. Params: none [, min_support (u32)=3, min_confidence (f64)=0.7, max_files (u32)=500] |
coverage_overlay |
Join line coverage onto symbols — per-symbol covered/hits, plus the count of coverage records that mapped to no symbol. Joins against the current working tree; a disclosure field flags tree-relative unmapped counts and stale-report line drift. Makes test-gap analysis concrete. Auto-detects the report format: lcov, JaCoCo XML, or coverage.py native JSON. Params: report (string, path to a coverage report) [, top_n (u32)] |
ownership_map |
Map code ownership from git blame — per-symbol author line shares and a bus factor (smallest author set owning >50% of lines). Low bus factor = knowledge concentration risk. Identities consolidate via .mailmap when present; otherwise fragmentation_hints disclose suspect identity pairs. Workspace-wide results are ranked lowest-bus-factor-first and capped at top_n. Params: none [, file (string), max_files (u32)=500, top_n (u32)=50] |
profile_overlay |
Join a CPU/sample profile onto symbols — per-symbol self% / total% / inclusive samples, ranked hottest first, plus an unmapped-frames count. Auto-detects the report format: speedscope JSON, or pprof (gzipped protobuf). Params: report (string, path to a profile report) [, top_n (u32)] |
simulate |
Simulate structural refactors in-memory and report before/after deltas — never touches disk (simulated: true). ops is an ordered change script: move_file{from,to}, remove_edge{from,to}, split_file{file,groups:[[symbol]]}, merge_files{files,to}, delete_module{file} (the deletion test — drops the module and re-wires transitive bridges A→M→B⇒A→B). Returns cycles (resolved/introduced), coupling deltas per affected unit, chokepoint centrality changes, deletion deltas for delete_module ops (surface_consumers + surface_modeled — the load-bearing signal of external symbols calling/extending the module's own surface, plus rewired vs severed file-routing edges), and — when an [architecture] contract exists in .act/config.toml — conformance violation deltas (cleared/introduced). Params: ops (required, non-empty) [, include (string[]), exclude (string[])]. |
split_module |
Propose how to split a file into cohesive modules — detects symbol clusters (label propagation), scores per-cluster cohesion (compute_cohesion), runs compute_extraction on the real workspace graph to produce a file-level extraction_score, and counts boundary edges (seams). Returns a ModuleSplit with confidence_floor=Syntactic, modeled_kinds=[clusters,cohesion,extraction,seams], and proposed_modules sorted by cohesion descending. Params: file (string) |
trace_overlay |
Join OpenTelemetry spans onto symbols — per-symbol span count and whether the symbol lies on a trace's critical (longest-duration) path. Shows which code actually runs in production. Auto-detects the report format: OTLP/JSON or OTLP-protobuf. Params: report (string, path to an OTLP trace file) [, top_n (u32)] |
Verify
| Operation | Description |
|---|---|
bisect_regression |
Semantic git-bisect: walk good_ref..bad_ref oldest-to-newest, apply verify_diff_semantics to each adjacent commit pair for the target symbol, and return the first commit that introduced a Behavior hunk. Returns BisectResult { target, file, culprit: { commit, author } | null, scanned, modeled_kinds }. Pairs where the file is absent at either revision are skipped. Params: file (string), target (string), good_ref (string), bad_ref (string) |
gate |
Deterministic merge gate: discover changed functions from the git diff (working tree vs HEAD, or vs merge-base of base_ref), run verify_diff_semantics + verify_test_impact + verify_side_effects per function, and synthesize MERGE | REVIEW | BLOCK | UNKNOWN per function and overall — UNKNOWN is never presented as MERGE; unmodeled dimensions and tier-blocked files degrade to UNKNOWN with the evidence quoted. receipts: write verification receipts to .act/receipts/ (consumption of valid receipts is always on). Params: none [, base_ref (string), root (string), receipts (boolean)] |
generate_test_harness |
Generate a test scaffold for a target function — extracts the Contract (signature, guards, raises) and synthesises a test file with one happy-path case + one case per guard + one case per error path. Supported across tier-1+ programming languages (TypeScript/TSX, JavaScript, Python, Rust, Go, Java, Kotlin, C#, Swift, Ruby, C, C++, PHP, Scala); grammars with no unit-test idiom return supported:false (documented opt-out). Params: file (string), target (string) |
scan |
Scan a repository for AI-code security issues (hardcoded credentials, .cursorrules backdoors, MCP-config RCE) and return an AI-Code Health Score + remediation bundle (JSON). Private repos require an act101 scan entitlement; public repos are free. Coverage auto-discovery: conventional lcov reports (coverage/lcov.info, lcov.info, target/coverage/lcov.info) are probed and, when found, test-gap statuses are coverage-evidence-based with the report named (and stale-flagged) in the coverage record. Params: none [, root (string), visibility ("public"|"private"), files (string[] — path-scoped scan; report gains scope section, scores cover the selected files only; conflicts with baseline_write), baseline (string — compare against a committed baseline; report gains new/baselined partition), baseline_write (string — record current findings as the baseline; full scans only), base_ref (string — diff-scoped scan vs merge-base(ref, HEAD); report gains scope section; conflicts with baseline_write)] |
secret_surface |
Surface secret-touching code in a file — credential params, token vars, signing keys, env-secret reads, and hardcoded secret literals — with per-item confidence. Heuristic; LSP upgrades confidence. Params: file (string) |
summarize_pr |
Summarize a changed file by composing verify_diff_semantics across changed symbols and tallying signature, behavior, and format-only changes. Params: file (string) [, base_ref (string)='HEAD', before (string), after (string), targets (string[])] |
taint_flow |
Trace tainted (untrusted) data from sources (request params, env/file reads, argv) to dangerous sinks (raw SQL, eval, command exec, fs path, deserialization) across the call graph, with per-flow steps and the unresolved-call frontier. Params: target (string), file (string) [, max_depth (u32), max_nodes (u32)] |
unsafe_surface |
Surface dangerous constructs in a file — unsafe blocks, dynamic eval, raw SQL sinks, FFI calls, reflective invocation, unsafe deserialization — with per-item confidence. Params: file (string) |
verify_behavioral_equivalence |
Verify two versions of a function have equivalent behavior by structural CFG diff (same branch/loop/exception/return shape). Verdict: equivalent | changed{dimensions} | unknown{reason}. scope='refactor' (default, Engineering) or 'port' (Enterprise, cross-language). Params: target (string), file (string) [, base_ref (string)='HEAD', before (string), after (string), scope (string)='refactor'] |
verify_contract_preserved |
Verify a function's public + behavioral contract (signature, effects, control-flow shape, return shape, guards, raises) is preserved across two versions. Verdict: preserved | broken{dimensions} | unknown{dimensions} — never claims preserved on a dimension the grammar does not model. Params: target (string), file (string) [, base_ref (string)='HEAD', before (string), after (string)] |
verify_diff_semantics |
Classify how a function changed across two versions: each hunk as format | signature | behavior (rename/move when symbol-identity is available). Uses model diffs (signature via interface, behavior via CFG/effect diff, format via AST-equal-but-text-different). Params: target (string), file (string) [, base_ref (string)='HEAD', before (string), after (string)] |
verify_port_parity |
Cross-language contract equivalence check (v1): compare the source and ported symbol's signature arity, return presence, effect-kind set, CFG shape, and raise count. A dimension that either grammar doesn't model contributes no evidence — never a false Preserved. Verdict: 'diverged' if any compared dimension differs (dominates); 'preserved' only if all compared dimensions match AND at least two dimensions were jointly modeled (matching signature arity alone is not parity evidence); 'unknown' when too few dimensions are jointly modeled to claim parity (e.g. only signature was comparable). Tier-1 contract analysis runs by default — no code execution. OPT-IN Tier-2: pass execute=true to ALSO run subprocess differential execution for interpreter languages whose runtime is present (node, python3) and a JSON-able source signature — it generates inputs, runs both functions under a ulimit resource cap (CPU/address-space/file-size) in a throwaway temp CWD, and diffs their JSON outputs; verified_by becomes 'execution' and an executed output divergence forces 'diverged'. This is a RESOURCE boundary, NOT a security sandbox (no network isolation). When execution is not eligible (compiled language, absent runtime, non-JSON-able signature) it falls back to Tier-1 cleanly with no false parity claim. Returns ParityReport { verdict: preserved|diverged|unknown, dimensions_checked, mismatches, verified_by: 'contract'|'execution', modeled_kinds, execution?: { cases_run, mismatches, note } }. Params: source_file (string), source_target (string), ported_file (string), ported_target (string), execute (bool, optional, default false) |
verify_side_effects |
Diff a function's side effects between two versions (git working-tree vs HEAD by default, or an explicit before/after pair) — added/removed effects plus the dropped-cleanup class (a removed write/blocking call while an allocation is kept). Params: target (string), file (string) [, base_ref (string)='HEAD', before (string), after (string)] |
verify_test_impact |
The minimal set of tests whose call graph reaches a change — pass `target` for one changed symbol, or omit it to derive the changed set from the file's before/after symbol diff (git working-tree vs base_ref, or explicit before/after). Composes the call-graph engine + test-file detection. Params: file (string) [, target (string), base_ref (string)='HEAD', before (string), after (string), max_depth (u32)=32] |