Scenario:
Codebase Mutation & Hypothesis Tree
Cycle Step: 4 / 4
Active AI Code Diff
p-retry wrapper
Terminal / Runtime Trace
1. The Invariant Principle
Before prompting the model with an error string, state the specific system invariant in your own words. If you cannot explain the pre-condition, the AI tool will patch symptoms by creating ad-hoc wrappers.
2. Stop at 2 Retries
If an AI re-prompt does not resolve the bug on attempt two, freeze all generative edits immediately. Revert to HEAD and log real thread traces or reproduction unit tests before re-engaging.
3. Zero-Package Rule
Forbid generative fixes that introduce foreign npm dependencies (`p-retry`, `async-mutex`, `p-queue`) to solve internal architecture races unless explicitly verified as an architectural decision.