"""Create recovery_planner
Generated by Phi-Octopus Eden
2025-11-08 06:38:55.179719
"""

```python
from typing import List, Optional


class RecoveryPlanner:
    """
    A class for creating a limited error recovery planner that can handle unexpected issues in execution.
    """

    def __init__(self):
        self.recovery_steps: List[Optional[str]] = []

    def add_recovery_step(self, step: str) -> None:
        """
        Add a recovery step to the planner.

        :param step: A string describing the recovery action.
        """
        self.recovery_steps.append(step)

    def execute_recovery_plan(self) -> int:
        """
        Execute the recovery plan in order. Returns the index of the last executed step or -1 if no steps were taken.

        :return: Index of the last executed step, or -1 if none.
        """
        for i, step in enumerate(self.recovery_steps):
            print(f"Executing recovery step {i + 1}: {step}")
            # Simulate an execution outcome
            if self.simulate_execution(i):
                continue
            return i
        return -1

    def simulate_execution(self, index: int) -> bool:
        """
        Simulate the execution of a step to determine its success.

        :param index: The index of the recovery step.
        :return: True if successful; False otherwise.
        """
        from random import randint
        success_rate = 50 + (index * 10)
        return randint(0, 100) <= success_rate


# Example usage:
if __name__ == "__main__":
    planner = RecoveryPlanner()
    steps = ["Restart the system", "Check for hardware issues", "Update software"]
    
    for step in steps:
        planner.add_recovery_step(step)
    
    print("Starting recovery plan...")
    result = planner.execute_recovery_plan()
    if result != -1:
        print(f"Recovery successful after {result + 1} steps.")
    else:
        print("No recovery steps were executed successfully.")
```

This code creates a `RecoveryPlanner` class that can manage and execute recovery steps when encountering errors. It includes methods for adding new steps, executing the plan, and simulating the success of each step. The example usage demonstrates how to use this class in practice.