Phase 3 / Ep 15: 3-Strike Backstop Agreement

⏱ Est. reading time: 3 min Updated on 4/13/2026

In the previous section, the Agent demonstrated impressive self-healing capabilities in the traffic light test. But real-world code is often plagued by dependency errors more agonizing than mathematical interval calculations, for example: a package that simply won't install, or encountering native C++ binding errors at the operating system level.

When lacking constraints, a stubborn AI will fall into a mindless dead loop of "fix -> error -> repeat fix with the same method -> error again". Not only does the task deadlock, but it also burns through extremely expensive API Tokens!

1. Defensive Overlap Zone: Injecting a Circuit Breaker into planning-with-files

Open the workflow .agents/skills/planning-with-files/SKILL.md written in the previous stage. We need to inject the wildest and most crucial human fallback rule at the bottom of the file — the 3-Strike limit.

Append the following rules:

## Fallback Protocol: The 3-Strike Error Protocol

**Absolute Taboo: Never attempt a third time using the exact same method for the same error!**

Adhere to this troubleshooting procedure:

**ATTEMPT 1: Diagnose & Fix**
  → Read the Error message, take a deep breath, identify the error source, then modify the code and try rerunning.
  
**ATTEMPT 2: Alternative Approach**
  → If you encounter a very similar Error again? At this point, you are strictly forbidden from circling within the same logic!
  → You must switch to an entirely different library, bypass the existing framework structure, or implement it via a workaround. And clearly record the change in approach in `progress.md`.

**ATTEMPT 3: Broader Rethink**
  → Failed a second time? This indicates it's usually not a syntax Bug, but a system dependency or deep-water mine.
  → Question the requirements or major structural assumptions. Only patch the outermost configuration and try again.

**AFTER 3 FAILURES: Escalate to User**
  → As soon as failures accumulate 3 times. System, you must forcibly stop all your self-attempting actions!
  → Summarize your three failed attempts, write the error origin and code approach into `docs/bugs.md` (or a dedicated section in findings).
  → Hand over the terminal response to the human: "Sir, I have attempted 3 approaches, all of which have failed. I am unable to break through on my own. Please take over, review the logs, and provide new instructions."

2. Effect and Philosophy

There's a famous saying in the big tech development community: "Fail fast, fail early." (Fail early, end early).

We are not afraid of AI writing incorrect code, we are afraid of it hallucinating and pretending it wrote correct code.

Through the 3-Strike protocol, you can ensure that once this agent drowns in the deep waters of complex business (fails 3 consecutive attempts), it will leave behind a very valuable "troubleshooting autopsy report." After you (the officer) take over and read this report, you only need 30 seconds to point out, "Oh, it's because you haven't installed the Python environment on this machine, so it won't compile," and it can take off again.

This is a highly vital team structure!

Having dealt with the mental anti-deadlock, in the next episode, we will begin teaching the Agent the core secret to developing large-scale backend applications: how to mock third-party interfaces without sending real requests.