Autonomous SWE-Bench Task Factory & Self-Improving Agent Harness

Turn Any Codebase Into Verified FAIL_TO_PASS Coding Benchmarks

FORGEBENCH compiles deterministic AST wikis, filters duplicate proposals in Qdrant, verifies every benchmark across 4 isolated worktree checks, and enforces AST mutation strength before committing a single task.

OpenAI HarnessGoogle Harness 2.0Karpathy WikiQdrant Vector DBAST Mutation Testing
HARNESS EXECUTION RECEIPTmain protected
Target Packagesample_shop_app
Verified Benchmarks4 TP · F1 1.00
AST Knowledge Graph37 nodes · 91 edges
RL Pacing PolicyACCELERATE (batch=2)
Active Skills & MCPs6 skills · 4 MCPs
Every task executes inside a disposable /tmp/fb_wt_* worktree with 4 pytest checks and ≥ 50% AST mutant kill verification.

Live Task & Mutation Studio

Configure a target module and explanation tone, launch the autonomous benchmark factory, or harvest a Spatie Flare crash into a 4-check verified FAIL_TO_PASS bundle.

Simulation Mode (Offline Fallback)

Quick Start Autonomous Runner

Select target module and explanation register, then execute the 5-stage RL pipeline.

Stage 1DONE

Where am I?

Stage 2DONE

Where to go?

Stage 3DONE

Novelty & Split Check

Stage 4DONE

Isolated Worktree 4-Check + Mutation

Stage 5DONE

Pacing & Output Ready

4-Check FAIL_TO_PASS Pipeline

task/task-low-stock-and-cart-update · reward +1.0
Step 1PASS

Baseline Before

sample_shop_app/tests green on HEAD

Step 2FAIL

New Test on Base

Reproduces missing feature or crash

Step 3APPLIED

Reference Patch Applied

Isolated /tmp/fb_wt_* worktree

Step 4PASS

New Test Patched

FAIL_TO_PASS assertion verified

Step 5PASS

Baseline After

Zero regression on existing suite

task-low-stock-and-cart-update
ValidationHard

Add inventory low-stock alerts and cart quantity updates

Add Inventory.get_low_stock_products(threshold=3) in sample_shop_app/inventory.py returning products at or below the threshold sorted by SKU, and add ShoppingCart.update_quantity(sku, quantity) in sample_shop_app/cart.py to update line quantity with stock validation or remove the item when quantity is 0.

Target Files

sample_shop_app/inventory.pysample_shop_app/cart.py

Qdrant Novelty

82.5%

cos sim 0.175 (< 0.85)

Verification Gate

4 / 4 PASS

qdrant_http

AST Mutant Kill Rate

66.7%
Killed 2 / 3 mutantsThreshold ≥ 50%
  • L53: flip Lt -> LtE

    sample_shop_app/inventory.py

    SURVIVED
  • L55: early return None

    sample_shop_app/inventory.py

    KILLED
  • L21: early return None

    sample_shop_app/inventory.py

    KILLED
COMMITTED
diff --git a/sample_shop_app/inventory.py b/sample_shop_app/inventory.py
--- a/sample_shop_app/inventory.py
+++ b/sample_shop_app/inventory.py
@@ -46,3 +46,13 @@
product = self.get_product(sku)
product.stock += quantity
return product
+
+
+ def get_low_stock_products(self, threshold: int = 3) -> list[Product]:
+ """Return products whose stock is at or below ``threshold``, sorted by SKU."""
+ if threshold < 0:
+ raise ValueError("Low-stock threshold cannot be negative.")
+ return sorted(
+ (p for p in self._products.values() if p.stock <= threshold),
+ key=lambda p: p.sku,
+ )
diff --git a/sample_shop_app/cart.py b/sample_shop_app/cart.py
--- a/sample_shop_app/cart.py
+++ b/sample_shop_app/cart.py
@@ -46,6 +46,23 @@
else:
item.quantity -= quantity
+ def update_quantity(self, sku: str, quantity: int) -> CartItem | None:
+ """Set cart line quantity for ``sku``, removing the item when quantity is 0."""
+ if sku not in self._items:
+ raise KeyError(f"Item {sku} is not in the cart.")
+ if quantity < 0:
+ raise ValueError("Quantity cannot be negative.")
+ if quantity == 0:
+ del self._items[sku]
+ return None
+ product = self.inventory.get_product(sku)
+ if not self.inventory.check_stock(sku, quantity):
+ raise ValueError(
+ f"Insufficient stock for {sku}: requested {quantity}, available {product.stock}."
+ )
+ self._items[sku].quantity = quantity
+ return self._items[sku]

Superpowers v7.0.2 Execution Pipeline

Native obra/superpowers integration enforcing Two-Stage Review, 4-phase systematic debugging, concurrent worktree dispatch, and session forensics across all 15 installed skills.

Two-Stage Subagent Review Gate

Simulation Fallback · 4820.4 ms · worktree_clean=true

Stage 1 · Spec Compliance

Diff bounded to sample_shop_app/ & protected paths untouched

Spec Compliance: PASS

Stage 2 · Code Quality Audit

Zero assert True, empty tests, bare except:, or SUT mocks

Code Quality Audit: PASS
Track 1 · task-promo-coupon-supportkill 100% · 4/4 PASS

branch: task/par-1-task-promo-coupon-support (pruned)

Track 2 · task-tiered-bulk-discountskill 66.7% · 4/4 PASS

branch: task/par-2-task-tiered-bulk-discounts (pruned)

Superpowers v7.0.2 Skill Matrix (15 Skills)

.agents/skills/superpowers/skills/
Testing2
test-driven-developmentverification-before-completion
Debugging2
systematic-debuggingdiagnosing-superpowers
Collaboration9
brainstormingdispatching-parallel-agentsexecuting-plansfinishing-a-development-branchreceiving-code-reviewrequesting-code-reviewsubagent-driven-developmentusing-git-worktreeswriting-plans
Meta2
using-superpowerswriting-skills

Session Forensics (`diagnosing-superpowers`)

HEALTHY

4-Check Bundles

4 / 4

Avg Mutant Kill

75%

Evidence Citations (path:line)

  • analytics/telemetry.json:1 (episodes=4, f1=1.0)
  • harness/failure_ledger.json:1 (guardrails=6, failures=0)
  • generated_tasks/task-promo-coupon-support/rl_trace.json:1 (status=COMMITTED)
  • generated_tasks/task-tiered-bulk-discounts/rl_trace.json:1 (status=COMMITTED)

Knowledge Graph & Active Skills Matrix

AST-compiled dependency graph of sample_shop_app alongside installed agent skills and MCP tool servers.

37 Nodes91 EdgesAvg Complexity 3.41

Interactive AST Topology (sample_shop_app)

sample_shop_appcartinventorymodelspricingtest_shopShoppingCartInventoryProductCartItemOrder
cartcomplexity 14

sample_shop_app/cart.py:1

Shopping cart operations including item management, summaries, and checkout.

Connected edges (6):

sample_shop_app --[imports]--> cart
cart --[defines]--> ShoppingCart
cart --[imports]--> inventory
cart --[imports]--> models
cart --[imports]--> pricing
test_shop --[imports]--> cart

Installed Agent Skills (6)

.agents/skills/
  • superpowers15 sub-skills

    Strict TDD, brainstorming, and verification-before-completion workflow bundle (15 sub-skills).

  • impeccable27 sub-skills

    Anti-slop UI craft, typography, color contrast, and layout discipline bundle (27 sub-skills).

  • understand-anything9 sub-skills

    AST codebase knowledge graph parser & dependency topology analyzer (9 sub-skills).

  • mutation-testingSKILL.md active

    Verify generated tests by injecting deterministic AST mutations and confirming mutant kill rate.

  • git-worktree-guardSKILL.md active

    Enforce isolated git worktree execution so main working tree is never modified or reset.

  • flare-crash-harvesterSKILL.md active

    Convert Spatie Flare production stack traces into reproducible FAIL_TO_PASS regression tasks.

MCP Tool Servers (4)

mcp_config.json
context7

npx -y @upstash/context7-mcp

spatie-flare

npx -y @spatie/flare-mcp

n8n-mcp

npx -y n8n-mcp

sequential-thinking

npx -y @modelcontextprotocol/server-sequential-thinking

Impeccable UI Craft Audit

.agents/skills/impeccable/skill/SKILL.src.md

14 source files scanned

100/100
  • Typography Hierarchy: Authored Schibsted Grotesk + JetBrains Mono (zero banned defaults)
  • Anti-Slop Surfaces: Zero decorative gradient text or glass blur clutter
  • Elevation Discipline: Consistent 1px hairline borders with zero side-stripe or hard-offset slop
  • Contrast & Tokens: Semantic forge.* dark tokens, focus-visible ring, and WCAG-safe contrast
  • Interactive States & Iconography: Custom ForgeLogo SVG, Lucide icons, aria-label, and disabled states

RL Orchestrator & ML Telemetry

Markov Decision Process state transitions, dynamic temperature schedule, 70/15/15 split generalization, confusion matrix metrics, and Harness 2.0 self-improving guardrails.

Pacing: ACCELERATE (batch=2)HEAD 98f31fe

MDP Policy & Dynamic Temperature

PROPOSE_TASK

T = 0.75

GEN_TEST / PATCH

T = 0.05

POST-ROLLBACK

T = 0.00

Verified FAIL_TO_PASS + Novel+1.0 reward
Qdrant Cosine Duplicate (≥ 0.85)-0.5 reward
Broken Patch or Trivial Base Pass-1.0 reward
70 / 15 / 15 Dataset Split (Target Modules)5 modules
Context (3)
Val (1)
Holdout (1)

Live Confusion Matrix & Evaluation Precision

Precision 1.00Recall 1.00F1 1.00

TP (Verified)

4

FP (Base Pass)

0

FN (Filtered)

0

TN (Caught)

0

Task ID4-CheckKill RateReward
task-promo-coupon-supportPASS100%+1.0
task-tiered-bulk-discountsPASS66.7%+1.0
task-low-stock-and-cart-updatePASS66.7%+1.0
task-batch-register-and-express-shippingPASS66.7%+1.0

Harness 2.0 Learned Guardrails (Propose -> Probe -> Compose)

harness/failure_ledger.json
  • Only reference symbols, modules, classes, and function signatures verified in wiki/MODULES.md or direct AST inspection.
  • Never propose a task whose verification tests already pass on the unmodified base commit (FAIL_TO_PASS violation).
  • Never modify or delete existing passing unit tests to force a PASS outcome.
  • Reject task proposals whose embedding cosine similarity is >= 0.85 against previously generated tasks.

Human & Autonomous Co-Founders

Built with strict role separation between task proposal, deterministic sandbox evaluation, and self-improving guardrail synthesis.

Human FounderLead Architect

Shivang

Founder & Systems Architect — CS Major, Harness Engineering & RL Orchestration

Architected FORGEBENCH’s strict 3-role boundary, Karpathy AST Wiki compiler, Qdrant cosine deduplication gate, and zero-rollback git worktree harness so autonomous benchmark generation remains deterministic and auditable.

MDP Control·AST Verification·FastAPI + Next.js

Proposer Architect

Autonomous Co-Founder · T=0.75

Consumes 4,000-token Karpathy Wiki slices and AST graph context to propose novel feature, pricing, and Flare regression tasks gated by Qdrant similarity (< 0.85).

Deterministic Verifier & Mutation Tester

Autonomous Co-Founder · /tmp/fb_wt_*

Executes all 4 pytest checks inside disposable git worktrees and injects AST mutants to enforce a ≥ 50% mutant kill rate before any task commits.

Harness 2.0 Self-Improver

Autonomous Co-Founder · Propose → Probe → Compose

Probes every rejected episode signature (ImportError, TrivialPassOnBase, WeakTestMutantSurvived) and composes reusable rules into failure_ledger.json.