audit_and_fix_frankability
Audit and fix frankability issues safely: report findings, apply mechanical fixes with rollback, or use AI-assisted resolution.
Instructions
Run frank-audit and optionally apply fixes — supports a sampling-driven LLM loop that resolves findings the mechanical fixer can't safely handle.
Modes: 'report' — run audit, list findings, do not modify files 'safe-fix' — apply mechanical fixes with verify-or-rollback safety (every applied fix is verified against frank.toJSON; regressions roll back) 'full' — run safe-fix first, THEN drive an LLM loop via MCP sampling over the remaining prescriptions: 1. prescribe_frankability_fixes(dir) → JSON prescriptions 2. for each prescription (capped by max_iterations): a. ctx.session.create_message() with the strict edit-op contract prompt b. parse the LLM's JSON response c. apply_frankability_edit_ops with verify-or-rollback d. one retry on malformed JSON 3. report aggregate (mechanical + LLM fixes) Requires the host to support MCP sampling (Claude Code does; some hosts don't — falls back gracefully to safe-fix mode with a warning when ctx.session is unavailable).
Args: symbols_dir: Absolute path to the symbols/ directory. mode: 'report' | 'safe-fix' | 'full' aggressive: With safe-fix or full, also apply medium-confidence fixes. max_iterations: Cap on LLM-driven prescriptions in 'full' mode (default 20).
Returns: JSON-stringified result with schema, opId, findings, applied/skipped, rolledBack, baseline, finalState, and (in 'full' mode) llmRounds[].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | report | |
| aggressive | No | ||
| symbols_dir | Yes | ||
| max_iterations | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |