Skip to content

Add autoloop — autonomous improvement loop (karpathy/autoresearch) - #27

Merged
5uck1ess merged 3 commits into
mainfrom
feat/autoloop
Apr 6, 2026
Merged

Add autoloop — autonomous improvement loop (karpathy/autoresearch)#27
5uck1ess merged 3 commits into
mainfrom
feat/autoloop

Conversation

@5uck1ess

@5uck1ess 5uck1ess commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

Autonomous codebase improvement loop inspired by karpathy/autoresearch. Three files, zero new Go code — YAML workflow executed by the existing Go engine.

How it works

Each cycle is a discrete, auditable experiment:

  1. Baseline — run metric command, record starting number + direction
  2. Audit — analyze codebase, pick single highest-impact hypothesis
  3. Fix — agent makes the recommended change (minimal, focused)
  4. Measure — run the SAME metric command again
  5. Compare — IMPROVED or REGRESSED based on direction
  6. Keep (if improved) — git commit, update scratchpad, loop to audit
  7. Revert (if regressed) — git checkout ., update scratchpad, loop to audit
  8. Report — final summary with kept/reverted counts and net improvement

Key design decisions

  • Measurement is deterministic — same Bash command in baseline and measure steps
  • Keep/discard is a branch decision — not agent judgment
  • Scratchpad prevents repeating failures — .devkit/scratchpads/current.md
  • No new Go code — YAML workflow + existing engine handles everything
  • Skill asks questions first — objective, metric, direction, iterations, scope

Files

  • workflows/autoloop.yml — 8-step workflow with branch-loop pattern
  • skills/autoloop/SKILL.md — triggers on "autoloop", gathers inputs
  • commands/autoloop.md — slash command

Test plan

  • CI passes (validate-counts: 23 commands, 17 skills, 15 workflows)
  • YAML parses correctly via devkit workflow autoloop
  • Run on devkit itself: autoloop "improve test coverage" with go test -cover ./...

5uck1ess added 3 commits April 5, 2026 20:39
…esearch

Three files, zero new Go code:

workflows/autoloop.yml — 8-step deterministic loop via Go engine:
  baseline → audit → fix → measure → compare → branch(keep/revert) → loop
  Each cycle is a discrete, auditable experiment. Metric measurement is
  its own step. Keep/revert is a branch decision, not agent judgment.
  Scratchpad prevents repeating failed approaches.

skills/autoloop/SKILL.md — triggers on "autoloop", asks clarifying questions
  (objective, metric, direction, iterations, scope), auto-detects metric
  from stack, then invokes the workflow.

commands/autoloop.md — slash command for direct invocation.
Critical:
- Add AUTOLOOP_COMPLETE path to revert step (was missing — all-revert
  loops would burn entire budget with no exit)
- Add iteration counting in both keep and revert steps

Warnings:
- Remove {{revert}}{{keep}} from audit (undefined on first iteration),
  rely on scratchpad instead
- Add SCORE: sentinel for structured numeric extraction
- Add DIRECTION: sentinel for structured comparison

Suggestions:
- Baseline now reports AUTOLOOP_ERROR if metric command fails
- Replace git add -A with targeted file staging (protect untracked work)
- Replace git clean -fd with targeted checkout (protect untracked files)
- Fix step now tracks MODIFIED FILES for targeted git operations
@5uck1ess
5uck1ess merged commit fb5c30c into main Apr 6, 2026
3 checks passed
@5uck1ess
5uck1ess deleted the feat/autoloop branch April 6, 2026 00:58
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.

1 participant