Read ontoindex-navigation first.
Refactoring with OntoIndex
- Check
impact({action: 'symbol', repo: '<repo>', target: '<symbol>', direction: 'upstream'})before editing to map callers. - Run
audit({action: "safe_edit_check", repo: '<repo>', symbol: '<symbol>', intent: 'modify-body'})before making the change; useintent: 'rename'for a rename. - For a rename, preview candidates with
refactor({action: 'rename', repo: '<repo>', target: '<symbol>', new_name: '<new>', dry_run: true}). This is preview only (applied: false). Review every candidate, then edit the files directly. Graph edits are candidates that need review; dynamic references can be missed. - For extract, move, or modify-body operations, use
refactor({action: "safe_refactor", ...})withrepoand the matchingintent;dryRundefaults totrue. Review the preview before any apply. - After edits, call
audit({action: "verify_diff", ...})with explicitchangedFilesandexpectedFiles, then useaudit({action: "test_gap", ...})to inspect affected test evidence. Run the focused tests indicated by the change.
Pass repo explicitly to each OntoIndex call. Use stale/refreshing results with freshness labels, and verify edited or new code from source. Follow ontoindex-navigation for degraded/untrusted evidence or failed calls; staleness alone never requires grep-only fallback.