Skip to content

Add Test-Driven autoloop strategy#188

Merged
mrjf merged 3 commits intomainfrom
copilot/add-test-driven-autoloop-strategy
Apr 23, 2026
Merged

Add Test-Driven autoloop strategy#188
mrjf merged 3 commits intomainfrom
copilot/add-test-driven-autoloop-strategy

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Ships a second autoloop strategy alongside AlphaEvolve. Where AlphaEvolve drives optimization (evolve an artifact against a scalar fitness), Test-Driven drives specification (pin behaviour in a failing test, implement until green) — covering the API-porting and bug-fix workloads that don't fit AlphaEvolve.

Layout

Mirrors .autoloop/strategies/alphaevolve/ so the two feel like siblings. No workflow changes needed — strategy discovery already routes off program.md's ## Evolution Strategy pointer.

.autoloop/strategies/test-driven/
├── strategy.md
├── CUSTOMIZE.md
└── prompts/
    ├── write-test.md
    ├── make-green.md
    └── refactor.md

Files

  • strategy.md — runtime playbook. 8-step loop: load state → pick target → red → green → refactor → evaluate → update Test Harness → fold through to default loop. Includes deterministic overrides (failing tests are obligations; 3× error → forced rethink-test), a 5-attempt cap that pauses the program with td-stuck: rather than thrashing, and the Test Harness schema (t{NNN} ids, status transitions, range-collapse compression at harness_size_cap).
  • CUSTOMIZE.md — creator-time guide (parallels alphaevolve's). When-to-pick rules, copy commands, the ## Evolution Strategy pointer block to drop into program.md, marker-by-marker guidance, and a worked tsb-bugfix example.
  • prompts/write-test.md — red-phase framing: domain-knowledge slot, framework-setup slot, validity checklist (must fail with a useful message, must not couple to implementation details), reasoning template.
  • prompts/make-green.md — green-phase framing: minimum-change discipline, explicit don't-modify list, anti-patterns (overfitting, speculative generality, weakening tests to shrink the diff).
  • prompts/refactor.md — refactor-phase framing, gated on a green suite. Refactor vocabulary, an explicit not-a-refactor list (renaming for taste, formatting, comment polish), skip conditions, and the hard rule that the test set must be identical before/after — if a "refactor" needs a test edit, it's a behaviour change and belongs in a red iteration.

All <CUSTOMIZE: …> markers are preserved as fill-in points; grep -R "<CUSTOMIZE" strategy/ should return nothing once an adopter resolves them for a specific program.

Copilot AI changed the title [WIP] Add Test-Driven as the second autoloop strategy Add Test-Driven autoloop strategy Apr 23, 2026
Copilot finished work on behalf of mrjf April 23, 2026 04:00
Copilot AI requested a review from mrjf April 23, 2026 04:00
@mrjf mrjf marked this pull request as ready for review April 23, 2026 04:24
@mrjf mrjf merged commit e805a63 into main Apr 23, 2026
17 checks passed
@mrjf mrjf deleted the copilot/add-test-driven-autoloop-strategy branch April 23, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Test-Driven as the second autoloop strategy (red/green/refactor playbook)

2 participants