AAWEA.ORG
AAWEA.ORG
AAWEA.ORG
Automation Manual trigger πŸ‘‘ Official πŸ›‘ Hardened

Guardrails Learning Loop

When a check fails twice the same way, append a guardrail sign to .ralph/guardrails.md so the next iteration avoids repeating it.

πŸ‘ 2,166 views πŸ“₯ 1,688 installs πŸ‘€ by loops!
Download loop
Share Now
Manual start
↓
  1. 1
    Read guardrails

    Read .ralph/guardrails.md before any work. Treat each sign as a hard constraint.

  2. 2
    Run checks

    Run the project's backpressure commands.

    > npm test && npm run lint
  3. 3
    Record failure sign

    If the same error occurred before, append a concise sign to guardrails.md: what failed and how to avoid it.

  4. 4
    Fix with guardrails

    Apply a fix that respects all guardrail signs. Do not repeat prior failed approaches.

↓
βœ“
Exit condition: tests_pass

Checks pass and no repeated failure pattern remains

> npm test && npm run lint
πŸ“¦ Install Files
These files are included when you download the loop.
πŸ“„ .ralph/guardrails.md
# Guardrails

Signs from repeated failures. Read before every iteration.

## Signs
- Never commit without running tests first.
πŸ“Š Flow Diagram
flowchart TD Start(["Manual start"]) Start --> S0 S0("Read guardrails") S1("Run checks") S0 --> S1 S2("Record failure sign") S1 --> S2 S3("Fix with guardrails") S2 --> S3 Exit{"Checks pass and no repeated failure pattern remains"} S3 --> Exit Exit -- "No" --> S0 Exit -- "Yes" --> Done(["Success"]) style Exit fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e style Done fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#065f46
Kickoff prompt
Start the "Guardrails Learning Loop" loop.

Goal: tests and lint pass without repeating prior failure patterns
Max iterations: 12
Between iterations run: npm test && npm run lint
Exit when: all checks pass

Step 1: Read .ralph/guardrails.md, run checks, and if a failure repeats, add a sign before fixing.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.
Anti-gaming rules
Rules the agent must follow so it cannot cheat the exit condition.
  • Do not modify the check command or exit criteria to force success
  • Do not skip, disable, or bypass checks to pass the exit condition
  • If stuck after several iterations, stop and report blockers instead of gaming metrics