> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Plan Fixes • AI Agent SDK

> plan_fixes: Produce a :class:`RepairPlan` describing what the doctor repair changes.

# plan\_fixes

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**DoctorRulesRegistry**](../classes/DoctorRulesRegistry) class in the [**doctor\_registry**](../modules/doctor_registry) module.

Produce a :class:`RepairPlan` describing what the doctor repair changes.

Safety contract:

* **Diff preview**: every applied rule records a before/after `ConfigDiff`.
* **Refuse-on-unrecoverable**: a rule that raises is skipped, its blocking
  finding(s) recorded in `refused`, and its partial change discarded.
* **Backup**: when `dry_run=False` and `backup=True` the original
  config is snapshotted to `backup_path` before returning.
* **Re-validation**: after applying, residual findings are re-collected so
  callers can report "repair left N finding(s)".

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def plan_fixes(config: Dict[str, Any]) -> RepairPlan
```

## Parameters

<ParamField query="config" type="Dict[str, Any]" required={true}>
  The configuration to repair (never mutated).
</ParamField>

### Returns

<ResponseField name="Returns" type="RepairPlan">
  class:`RepairPlan`.
</ResponseField>

## Uses

* `copy.deepcopy`
* `get_rules`
* `rule.collect_findings`
* `warnings.warn`
* `Finding`
* `rule.apply_fix`
* `ConfigDiff`
* `collect_all_findings`
* `RepairPlan`

## Used By

* [`DoctorRulesRegistry.apply_all_fixes`](../functions/DoctorRulesRegistry-apply_all_fixes)
* [`plan_fixes`](../functions/plan_fixes)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/doctor_registry.py#L79">
  `praisonaiagents/runtime/doctor_registry.py` at line 79
</Card>
