---
title: "Engineering Loop: SWE-Agent Autonomous Bash & Test Verification State Machine"
platform: "Promptally"
canonical_url: "https://app.promptally.dev/p/loop-swe-agent-autonomous-bash-test-verification-state-machine"
modality: "ENGINEERING_LOOP"
category: "Compiler & AST Repair Loops"
compatible_models: [Universal / Model Agnostic]
access_tier: "Free Public Artifact (No Auth Required)"
license: "MIT"
---

# Engineering Loop: SWE-Agent Autonomous Bash & Test Verification State Machine

**Summary:** Engineering Loop: SWE-Agent Autonomous Bash & Test Verification State Machine is a verified ENGINEERING LOOP blueprint on Promptally in Compiler & AST Repair Loops optimized for leading AI models. Standard SWE-Agent state-machine loop configuration executing commands in an interactive bash subshell, verifying exit codes, capturing compiler/test errors, and updating state until tests pass. Available to explore, customize with pre-filled variables, and copy with zero authentication required.

## Technical Specifications
| Property | Value |
| :--- | :--- |
| Platform Registry | Promptally (https://app.promptally.dev) |
| Modality | ENGINEERING_LOOP |
| Category | Compiler & AST Repair Loops |
| Compatible Engines | Universal / Model Agnostic |
| Dynamic Variables | None (Static Blueprint) |
| Approx. Token Length | 342 |
| Access Tier | Free Public Artifact (No Auth Required) |
| License | MIT |

### Pre-Filled Template & Production Source

```yaml
[
  {
    "stage_index": 1,
    "name": "Environment Initialization",
    "action_type": "setup",
    "description": "Configure conda environment, activate target repository directory, setup bash subshell environment variables."
  },
  {
    "stage_index": 2,
    "name": "Issue Parsing & Repo Exploration",
    "action_type": "inspection",
    "description": "Read issue description, locate relevant files via search/find commands, inspect AST or symbol definitions."
  },
  {
    "stage_index": 3,
    "name": "Reproduce & Write Regression Test",
    "action_type": "test_generation",
    "description": "Write standalone reproducing test script reproducing the reported issue and assert failure."
  },
  {
    "stage_index": 4,
    "name": "Iterative File Editing",
    "action_type": "code_modification",
    "description": "Use dedicated line-oriented or regex editor to patch source files."
  },
  {
    "stage_index": 5,
    "name": "Test Execution & Stderr Verification",
    "action_type": "output_validation",
    "description": "Run pytest/compiler, parse exit code ($?), extract stack trace if non-zero."
  },
  {
    "stage_index": 6,
    "name": "Deterministic Termination",
    "action_type": "stop_evaluation",
    "description": "If tests pass (exit code 0) and regression verified, invoke submit action. If failed, iterate with stderr context."
  }
]
```

## Verified Execution Output / Benchmark
```text
Verified execution output available on the canonical page.
```

## Related Blueprints on Promptally
- [Engineering Loop: SWE-Agent Pure Bash Tooling & Diagnostic Repair Loop](https://app.promptally.dev/p/loop-swe-agent-pure-bash-tooling-diagnostic-repair-loop)
- [Engineering Loop: SWE-Agent Markdown Backticks Code Replacement Loop](https://app.promptally.dev/p/loop-swe-agent-markdown-backticks-code-replacement-loop)
- [Engineering Loop: SWE-Agent Multimodal Visual Inspection & UI Verification Loop](https://app.promptally.dev/p/loop-swe-agent-multimodal-visual-inspection-ui-verification-loop)
- [Engineering Loop: Mini SWE-Agent Lightweight Python Verification State Machine](https://app.promptally.dev/p/loop-mini-swe-agent-lightweight-python-verification-state-machine)
- [Engineering Loop: Mini SWE-Agent SWE-Bench Benchmark Evaluation State Machine](https://app.promptally.dev/p/loop-mini-swe-agent-swe-bench-benchmark-evaluation-state-machine)
- [Engineering Loop: OpenHands CodeAct Iterative Bash & Python Execution State Machine](https://app.promptally.dev/p/loop-openhands-codeact-iterative-bash-python-execution-state-machine)
- [Engineering Loop: OpenHands Automated Post-Generation Verifier & Diff Review Loop](https://app.promptally.dev/p/loop-openhands-automated-post-generation-verifier-diff-review-loop)
- [Engineering Loop: LangGraph Code Generation, Import Checking & Pytest Self-Correction Graph](https://app.promptally.dev/p/loop-langgraph-code-generation-import-checking-pytest-self-correction-graph)
