Skip to content

fix_plan tool

Extract parameterized fix plans for judgment-based lint findings inside the project root. Each plan lists the typed holes a caller must answer along with static AST and workspace evidence and candidate values. It reads the source and writes nothing.

fix_plan(paths=null, rules=null)
  • Changes no file
  • A second call with the same arguments changes nothing more
  • Stays inside the project

Tags: fix, plan.

Argument Type Required Default Description
paths list of string or null no null Python files or directories inside the project root (defaults to .).
rules list of string or null no null Optional rule or package selectors passed via --rule.

Output of xpd fix --plan --format json.

Fields of the result (18)
Field Type Required Default Description
root string yes
total_plans integer yes
plans list of object no
plans[].plan_id string yes
plans[].kind string yes
plans[].rule string yes
plans[].file string yes
plans[].file_sha256 string yes
plans[].line integer yes
plans[].column integer yes
plans[].message string yes
plans[].holes list of object no
plans[].holes[].name string yes
plans[].holes[].kind string yes
plans[].holes[].choices list of string no
plans[].holes[].default any or null no null
plans[].evidence any no null
plans[].candidates list of any no

The call below extracts fix plans for samples/pipeline/leaky.py.

{"paths":["samples/pipeline/leaky.py"]}
{"root":"...","total_plans":4,"plans":[{"kind":"defer-import-side-effect","rule":"python/import-side-effect","file":"samples/pipeline/leaky.py"},"..."]}

Paths outside the project root fail before running. When no project root is configured, the server asks for one before calling xpd.