myco_immune
Run the substrate's lint dimensions to enforce contract invariants and report findings with severity, category, location, and message. Optionally auto-repair fixable issues.
Instructions
Run the substrate's 50 lint dimensions and report findings (severity + category + location + message per finding). Dimensions fall in four categories: mechanical (canon invariants, write-surface coverage, LLM-boundary), shipped (package version ↔ canon version parity), metabolic (raw-note backlog, stale integrated), semantic (graph connectedness, orphan detection). Per L2 homeostasis.md, this is the substrate's autonomic health check.
Use this: routinely during development (cheap, ~1-2s), at release time (R7 top-down layering checks); with fix=true to auto-repair mechanically-fixable findings (M2 entry-point, MB1 raw_backlog). Do NOT use this to validate external code hygiene — immune only checks substrate contract invariants, not application correctness (that's what pytest is for).
Side effects: none by default. With fix=true, applies safe repairs per each dimension's fixable contract: M2 creates missing entry-point stubs, MB1 can auto-assimilate raw notes over threshold. All fixes respect R6 write_surface. List-mode
explain-mode are pure read.
Returns: { exit_code, findings: [...], dimensions_run, skeleton_downgrade_applied, exit_on, fix, fixes: [...] }. exit_code 0 when no critical findings; non-zero otherwise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dimensions | No | Optional subset of dimension IDs to run (e.g. ['M1','SE1','MB2']). When empty, runs all 46. Use to re-check specific dimensions after fixing their findings without the full suite's cost. IDs are case-sensitive; see myco_immune --list for the full enumeration. | |
| fix | No | When true, apply safe auto-repairs for fixable dimensions (M2 entry-point stub creation, MB1 raw-note promotion). Only dimensions with fixable=True in their class definition act; others remain informational. Respects R6 write_surface — a fix attempt that would write outside allowed paths is refused. Default false (report-only). | |
| list | No | When true, enumerate every registered dimension (id, category, default_severity, fixable, doc) without actually running them. Useful for discovery. Mutually incompatible with fix=true and explain= (mode-level exclusivity; CLI enforces). | |
| explain | No | When non-null, print the prose documentation (class docstring) for the named dimension and exit. Passing an unknown dimension id raises UsageError. Mutually incompatible with fix=true and list=true. | |
| project_dir | No | Absolute path of the workspace / project whose Myco substrate this call targets. Overrides auto-discovery. When omitted, Myco resolves via MCP roots/list, then MYCO_PROJECT_DIR, then cwd — the substrate_pulse field in every response echoes which source answered. |