GitFlow adopts a layered risk assessment strategy, determining the level of automation based on the danger level of the operation. This cautious approach is necessary because Git operations can sometimes be destructive, and incorrect automated decisions may lead to data loss.
Safe Level operations include detached HEAD state repair and standard merge conflict resolution. These operations have low risk, so the Agent can directly perform recovery and generate a PR report. For example, when a detached HEAD is detected, the Agent can automatically create a branch to save the current state and then guide the user back to the correct branch.
Warning Level involves scenarios where uncommitted local changes may be lost. In such cases, the Agent first creates a safe backup branch, then performs the repair operation, and proactively notifies the user of what happened and what protective measures were taken.
Dangerous Level includes irreversible operations such as force pushes and permanent deletion of commits. For such operations, the Agent strictly follows the principle of manual confirmation, providing clear options for the user to choose from and never executing them without permission.