myco_traverse
Walk the cross-reference graph of your cognitive substrate to detect knowledge islands via orphan nodes and dangling edges.
Instructions
Walk the substrate's cross-reference graph and report health: node count, edge count, src-node count (code files under src/), orphan nodes (no inbound references), dangling edges (point at missing targets), and per-node proposals for reconnection. Anastomosis is the fungal analogy: hyphae (markdown files + references:) fuse into a connected network; orphans + dangling edges are the dead tissue signal.
Use this: periodically (weekly / per-release cadence) to detect knowledge islands forming; before a release to verify docs haven't drifted from code; when debugging "why can't I find X" — dangling edges show what the substrate thinks exists but doesn't. Cheap and read-only — safe to run often.
Side effects: none. Writes a cached graph JSON to .myco/state/graph.json for subsequent traverse calls (bypass with internal use_cache=false). The cache is invalidated by file mtime on re-entry.
Returns: { exit_code, scope, orphans: [...], dangling: [...], proposals: [...], node_count, edge_count, src_node_count, cached }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Which subset of the substrate to walk. One of: 'canon' (just _canon.yaml + its outbound refs), 'notes' (notes/raw/**, notes/integrated/**, notes/distilled/**), 'docs' (docs/**), 'all' (default — everything including src/ python imports). Narrow scopes are cheaper on large substrates. | all |
| 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. |