@mobrienv/autoloop 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -0
- package/bin/autoloop +2 -0
- package/dist/backend/index.d.ts +10 -0
- package/dist/backend/index.js +59 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/run-command.d.ts +7 -0
- package/dist/backend/run-command.js +50 -0
- package/dist/backend/run-command.js.map +1 -0
- package/dist/backend/run-mock.d.ts +1 -0
- package/dist/backend/run-mock.js +6 -0
- package/dist/backend/run-mock.js.map +1 -0
- package/dist/backend/run-pi.d.ts +5 -0
- package/dist/backend/run-pi.js +5 -0
- package/dist/backend/run-pi.js.map +1 -0
- package/dist/backend/types.d.ts +21 -0
- package/dist/backend/types.js +2 -0
- package/dist/backend/types.js.map +1 -0
- package/dist/chains/budget.d.ts +7 -0
- package/dist/chains/budget.js +42 -0
- package/dist/chains/budget.js.map +1 -0
- package/dist/chains/load.d.ts +12 -0
- package/dist/chains/load.js +80 -0
- package/dist/chains/load.js.map +1 -0
- package/dist/chains/render.d.ts +2 -0
- package/dist/chains/render.js +46 -0
- package/dist/chains/render.js.map +1 -0
- package/dist/chains/run.d.ts +17 -0
- package/dist/chains/run.js +175 -0
- package/dist/chains/run.js.map +1 -0
- package/dist/chains/types.d.ts +37 -0
- package/dist/chains/types.js +2 -0
- package/dist/chains/types.js.map +1 -0
- package/dist/chains.d.ts +5 -0
- package/dist/chains.js +5 -0
- package/dist/chains.js.map +1 -0
- package/dist/commands/chain.d.ts +1 -0
- package/dist/commands/chain.js +51 -0
- package/dist/commands/chain.js.map +1 -0
- package/dist/commands/inspect.d.ts +1 -0
- package/dist/commands/inspect.js +95 -0
- package/dist/commands/inspect.js.map +1 -0
- package/dist/commands/list.d.ts +1 -0
- package/dist/commands/list.js +12 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/loops.d.ts +1 -0
- package/dist/commands/loops.js +72 -0
- package/dist/commands/loops.js.map +1 -0
- package/dist/commands/memory.d.ts +1 -0
- package/dist/commands/memory.js +65 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/pi-adapter.d.ts +1 -0
- package/dist/commands/pi-adapter.js +6 -0
- package/dist/commands/pi-adapter.js.map +1 -0
- package/dist/commands/run.d.ts +1 -0
- package/dist/commands/run.js +185 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.js +169 -0
- package/dist/config.js.map +1 -0
- package/dist/events/decode.d.ts +2 -0
- package/dist/events/decode.js +45 -0
- package/dist/events/decode.js.map +1 -0
- package/dist/events/encode.d.ts +2 -0
- package/dist/events/encode.js +33 -0
- package/dist/events/encode.js.map +1 -0
- package/dist/events/guards.d.ts +5 -0
- package/dist/events/guards.js +42 -0
- package/dist/events/guards.js.map +1 -0
- package/dist/events/types.d.ts +25 -0
- package/dist/events/types.js +2 -0
- package/dist/events/types.js.map +1 -0
- package/dist/harness/config-helpers.d.ts +24 -0
- package/dist/harness/config-helpers.js +231 -0
- package/dist/harness/config-helpers.js.map +1 -0
- package/dist/harness/coordination.d.ts +1 -0
- package/dist/harness/coordination.js +127 -0
- package/dist/harness/coordination.js.map +1 -0
- package/dist/harness/display.d.ts +20 -0
- package/dist/harness/display.js +130 -0
- package/dist/harness/display.js.map +1 -0
- package/dist/harness/emit.d.ts +15 -0
- package/dist/harness/emit.js +220 -0
- package/dist/harness/emit.js.map +1 -0
- package/dist/harness/index.d.ts +13 -0
- package/dist/harness/index.js +124 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/iteration.d.ts +4 -0
- package/dist/harness/iteration.js +129 -0
- package/dist/harness/iteration.js.map +1 -0
- package/dist/harness/journal.d.ts +13 -0
- package/dist/harness/journal.js +106 -0
- package/dist/harness/journal.js.map +1 -0
- package/dist/harness/metareview.d.ts +4 -0
- package/dist/harness/metareview.js +33 -0
- package/dist/harness/metareview.js.map +1 -0
- package/dist/harness/metrics.d.ts +12 -0
- package/dist/harness/metrics.js +180 -0
- package/dist/harness/metrics.js.map +1 -0
- package/dist/harness/parallel.d.ts +37 -0
- package/dist/harness/parallel.js +158 -0
- package/dist/harness/parallel.js.map +1 -0
- package/dist/harness/prompt.d.ts +35 -0
- package/dist/harness/prompt.js +328 -0
- package/dist/harness/prompt.js.map +1 -0
- package/dist/harness/scratchpad.d.ts +2 -0
- package/dist/harness/scratchpad.js +65 -0
- package/dist/harness/scratchpad.js.map +1 -0
- package/dist/harness/stop.d.ts +5 -0
- package/dist/harness/stop.js +63 -0
- package/dist/harness/stop.js.map +1 -0
- package/dist/harness/tools.d.ts +3 -0
- package/dist/harness/tools.js +39 -0
- package/dist/harness/tools.js.map +1 -0
- package/dist/harness/types.d.ts +81 -0
- package/dist/harness/types.js +2 -0
- package/dist/harness/types.js.map +1 -0
- package/dist/harness/wave/finalize-wave.d.ts +9 -0
- package/dist/harness/wave/finalize-wave.js +60 -0
- package/dist/harness/wave/finalize-wave.js.map +1 -0
- package/dist/harness/wave/launch-branches.d.ts +6 -0
- package/dist/harness/wave/launch-branches.js +218 -0
- package/dist/harness/wave/launch-branches.js.map +1 -0
- package/dist/harness/wave/parse-objectives.d.ts +3 -0
- package/dist/harness/wave/parse-objectives.js +29 -0
- package/dist/harness/wave/parse-objectives.js.map +1 -0
- package/dist/harness/wave/types.d.ts +43 -0
- package/dist/harness/wave/types.js +2 -0
- package/dist/harness/wave/types.js.map +1 -0
- package/dist/harness/wave.d.ts +6 -0
- package/dist/harness/wave.js +98 -0
- package/dist/harness/wave.js.map +1 -0
- package/dist/json.d.ts +8 -0
- package/dist/json.js +80 -0
- package/dist/json.js.map +1 -0
- package/dist/loops/health.d.ts +14 -0
- package/dist/loops/health.js +104 -0
- package/dist/loops/health.js.map +1 -0
- package/dist/loops/list.d.ts +6 -0
- package/dist/loops/list.js +21 -0
- package/dist/loops/list.js.map +1 -0
- package/dist/loops/render.d.ts +18 -0
- package/dist/loops/render.js +87 -0
- package/dist/loops/render.js.map +1 -0
- package/dist/loops/show.d.ts +8 -0
- package/dist/loops/show.js +31 -0
- package/dist/loops/show.js.map +1 -0
- package/dist/loops/watch.d.ts +8 -0
- package/dist/loops/watch.js +77 -0
- package/dist/loops/watch.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +101 -0
- package/dist/main.js.map +1 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.js +66 -0
- package/dist/markdown.js.map +1 -0
- package/dist/memory-render.d.ts +6 -0
- package/dist/memory-render.js +81 -0
- package/dist/memory-render.js.map +1 -0
- package/dist/memory.d.ts +23 -0
- package/dist/memory.js +314 -0
- package/dist/memory.js.map +1 -0
- package/dist/pi-adapter.d.ts +1 -0
- package/dist/pi-adapter.js +220 -0
- package/dist/pi-adapter.js.map +1 -0
- package/dist/registry/derive.d.ts +8 -0
- package/dist/registry/derive.js +81 -0
- package/dist/registry/derive.js.map +1 -0
- package/dist/registry/harness.d.ts +7 -0
- package/dist/registry/harness.js +57 -0
- package/dist/registry/harness.js.map +1 -0
- package/dist/registry/index.d.ts +5 -0
- package/dist/registry/index.js +5 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/read.d.ts +11 -0
- package/dist/registry/read.js +50 -0
- package/dist/registry/read.js.map +1 -0
- package/dist/registry/rebuild.d.ts +5 -0
- package/dist/registry/rebuild.js +19 -0
- package/dist/registry/rebuild.js.map +1 -0
- package/dist/registry/types.d.ts +19 -0
- package/dist/registry/types.js +2 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/registry/update.d.ts +2 -0
- package/dist/registry/update.js +7 -0
- package/dist/registry/update.js.map +1 -0
- package/dist/testing/mock-backend.d.ts +11 -0
- package/dist/testing/mock-backend.js +76 -0
- package/dist/testing/mock-backend.js.map +1 -0
- package/dist/topology.d.ts +25 -0
- package/dist/topology.js +188 -0
- package/dist/topology.js.map +1 -0
- package/dist/usage.d.ts +8 -0
- package/dist/usage.js +114 -0
- package/dist/usage.js.map +1 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.js +79 -0
- package/dist/utils.js.map +1 -0
- package/package.json +52 -0
- package/presets/autocode/README.md +81 -0
- package/presets/autocode/autoloops.toml +22 -0
- package/presets/autocode/harness.md +19 -0
- package/presets/autocode/miniloops.toml +22 -0
- package/presets/autocode/roles/build.md +33 -0
- package/presets/autocode/roles/critic.md +40 -0
- package/presets/autocode/roles/finalizer.md +43 -0
- package/presets/autocode/roles/planner.md +40 -0
- package/presets/autocode/topology.toml +32 -0
- package/presets/autodoc/README.md +42 -0
- package/presets/autodoc/autoloops.toml +21 -0
- package/presets/autodoc/harness.md +19 -0
- package/presets/autodoc/miniloops.toml +21 -0
- package/presets/autodoc/roles/auditor.md +39 -0
- package/presets/autodoc/roles/checker.md +43 -0
- package/presets/autodoc/roles/publisher.md +51 -0
- package/presets/autodoc/roles/writer.md +37 -0
- package/presets/autodoc/topology.toml +31 -0
- package/presets/autofix/README.md +56 -0
- package/presets/autofix/autoloops.toml +21 -0
- package/presets/autofix/harness.md +24 -0
- package/presets/autofix/miniloops.toml +21 -0
- package/presets/autofix/roles/closer.md +48 -0
- package/presets/autofix/roles/diagnoser.md +42 -0
- package/presets/autofix/roles/fixer.md +28 -0
- package/presets/autofix/roles/verifier.md +31 -0
- package/presets/autofix/topology.toml +33 -0
- package/presets/autoideas/README.md +73 -0
- package/presets/autoideas/autoloops.toml +18 -0
- package/presets/autoideas/harness.md +31 -0
- package/presets/autoideas/miniloops.toml +18 -0
- package/presets/autoideas/roles/analyst.md +32 -0
- package/presets/autoideas/roles/reviewer.md +36 -0
- package/presets/autoideas/roles/scanner.md +26 -0
- package/presets/autoideas/roles/synthesizer.md +48 -0
- package/presets/autoideas/topology.toml +32 -0
- package/presets/autoperf/README.md +56 -0
- package/presets/autoperf/autoloops.toml +21 -0
- package/presets/autoperf/harness.md +21 -0
- package/presets/autoperf/miniloops.toml +21 -0
- package/presets/autoperf/roles/judge.md +38 -0
- package/presets/autoperf/roles/measurer.md +36 -0
- package/presets/autoperf/roles/optimizer.md +35 -0
- package/presets/autoperf/roles/profiler.md +38 -0
- package/presets/autoperf/topology.toml +32 -0
- package/presets/autoqa/README.md +76 -0
- package/presets/autoqa/autoloops.toml +21 -0
- package/presets/autoqa/harness.md +30 -0
- package/presets/autoqa/miniloops.toml +21 -0
- package/presets/autoqa/roles/executor.md +43 -0
- package/presets/autoqa/roles/inspector.md +45 -0
- package/presets/autoqa/roles/planner.md +55 -0
- package/presets/autoqa/roles/reporter.md +74 -0
- package/presets/autoqa/topology.toml +31 -0
- package/presets/autoresearch/README.md +63 -0
- package/presets/autoresearch/autoloops.toml +18 -0
- package/presets/autoresearch/harness.md +28 -0
- package/presets/autoresearch/miniloops.toml +18 -0
- package/presets/autoresearch/roles/benchmarker.md +34 -0
- package/presets/autoresearch/roles/evaluator.md +33 -0
- package/presets/autoresearch/roles/implementer.md +26 -0
- package/presets/autoresearch/roles/strategist.md +43 -0
- package/presets/autoresearch/topology.toml +31 -0
- package/presets/autoreview/README.md +51 -0
- package/presets/autoreview/autoloops.toml +21 -0
- package/presets/autoreview/harness.md +20 -0
- package/presets/autoreview/miniloops.toml +21 -0
- package/presets/autoreview/roles/checker.md +36 -0
- package/presets/autoreview/roles/reader.md +33 -0
- package/presets/autoreview/roles/suggester.md +26 -0
- package/presets/autoreview/roles/summarizer.md +57 -0
- package/presets/autoreview/topology.toml +31 -0
- package/presets/autosec/README.md +51 -0
- package/presets/autosec/autoloops.toml +21 -0
- package/presets/autosec/harness.md +20 -0
- package/presets/autosec/miniloops.toml +21 -0
- package/presets/autosec/roles/analyst.md +38 -0
- package/presets/autosec/roles/hardener.md +36 -0
- package/presets/autosec/roles/reporter.md +63 -0
- package/presets/autosec/roles/scanner.md +38 -0
- package/presets/autosec/topology.toml +31 -0
- package/presets/autosimplify/README.md +83 -0
- package/presets/autosimplify/autoloops.toml +22 -0
- package/presets/autosimplify/harness.md +25 -0
- package/presets/autosimplify/miniloops.toml +22 -0
- package/presets/autosimplify/roles/reviewer.md +38 -0
- package/presets/autosimplify/roles/scoper.md +42 -0
- package/presets/autosimplify/roles/simplifier.md +51 -0
- package/presets/autosimplify/roles/verifier.md +40 -0
- package/presets/autosimplify/topology.toml +32 -0
- package/presets/autospec/README.md +84 -0
- package/presets/autospec/autoloops.toml +21 -0
- package/presets/autospec/harness.md +23 -0
- package/presets/autospec/miniloops.toml +21 -0
- package/presets/autospec/roles/clarifier.md +38 -0
- package/presets/autospec/roles/critic.md +41 -0
- package/presets/autospec/roles/designer.md +37 -0
- package/presets/autospec/roles/planner.md +38 -0
- package/presets/autospec/roles/researcher.md +33 -0
- package/presets/autospec/topology.toml +38 -0
- package/presets/autotest/README.md +55 -0
- package/presets/autotest/autoloops.toml +21 -0
- package/presets/autotest/harness.md +21 -0
- package/presets/autotest/miniloops.toml +21 -0
- package/presets/autotest/roles/assessor.md +57 -0
- package/presets/autotest/roles/runner.md +31 -0
- package/presets/autotest/roles/surveyor.md +39 -0
- package/presets/autotest/roles/writer.md +37 -0
- package/presets/autotest/topology.toml +32 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# AutoQA miniloop
|
|
2
|
+
|
|
3
|
+
An autoloop-native zero-dependency, domain-adaptive validation orchestrator.
|
|
4
|
+
|
|
5
|
+
AutoQA inspects a target repo, discovers what validation tools are already available, plans a validation pass using only those native surfaces, executes each step, and compiles a QA report.
|
|
6
|
+
|
|
7
|
+
Shape:
|
|
8
|
+
- inspector
|
|
9
|
+
- planner
|
|
10
|
+
- executor
|
|
11
|
+
- reporter
|
|
12
|
+
|
|
13
|
+
## Fail-closed contract
|
|
14
|
+
|
|
15
|
+
AutoQA is adversarial toward claims of health.
|
|
16
|
+
|
|
17
|
+
- A repo only truly passes when critical discovered surfaces were actually executed and evidenced.
|
|
18
|
+
- Missing, blocked, or unverifiable surfaces are gaps, not silent passes.
|
|
19
|
+
- Only a `task.complete` report with explicit PASS evidence counts as all-clear.
|
|
20
|
+
- Zero-dependency means “use what exists”, not “guess optimistically”.
|
|
21
|
+
|
|
22
|
+
## How it works
|
|
23
|
+
|
|
24
|
+
1. **Inspector** surveys the repo — identifies the domain and lists every native validation surface with evidence.
|
|
25
|
+
2. **Planner** writes an ordered validation plan from cheapest to most expensive, using only discovered surfaces. Every surface becomes a step or an explicit skip.
|
|
26
|
+
3. **Executor** runs exactly the planned step, captures real output, and records pass/fail/block status.
|
|
27
|
+
4. **Reporter** compiles results into `.autoloop/qa-report.md` and decides whether to continue, fail, or complete.
|
|
28
|
+
|
|
29
|
+
## Zero-dependency guarantee
|
|
30
|
+
|
|
31
|
+
AutoQA never installs frameworks, test runners, linters, or any tools. It uses only what the repo already has. If the repo has nothing, the report says so honestly.
|
|
32
|
+
|
|
33
|
+
## Files
|
|
34
|
+
|
|
35
|
+
- `autoloops.toml` — loop + backend config
|
|
36
|
+
- `topology.toml` — role deck + handoff graph
|
|
37
|
+
- `harness.md` — shared harness rules loaded every iteration
|
|
38
|
+
- `roles/inspector.md`
|
|
39
|
+
- `roles/planner.md`
|
|
40
|
+
- `roles/executor.md`
|
|
41
|
+
- `roles/reporter.md`
|
|
42
|
+
|
|
43
|
+
## Shared working files created by the loop
|
|
44
|
+
|
|
45
|
+
- `.autoloop/qa-plan.md` — validation plan with discovered surfaces and ordered steps
|
|
46
|
+
- `.autoloop/qa-report.md` — compiled validation report with pass/fail evidence
|
|
47
|
+
- `.autoloop/progress.md` — current step tracking plus per-surface status
|
|
48
|
+
|
|
49
|
+
## Backend
|
|
50
|
+
|
|
51
|
+
This preset assumes the built-in Pi adapter:
|
|
52
|
+
|
|
53
|
+
```toml
|
|
54
|
+
backend.kind = "pi"
|
|
55
|
+
backend.command = "pi"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For deterministic local harness debugging only, switch to the repo mock backend:
|
|
59
|
+
|
|
60
|
+
```toml
|
|
61
|
+
backend.kind = "command"
|
|
62
|
+
backend.command = "../../examples/mock-backend.sh"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Run
|
|
66
|
+
|
|
67
|
+
From the repo root:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
autoloop run presets/autoqa /path/to/target-repo
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## AutoQA vs AutoTest
|
|
74
|
+
|
|
75
|
+
- **AutoQA** = validation orchestration using native, existing surfaces. Does not create tests.
|
|
76
|
+
- **AutoTest** = formal test creation and test-suite tightening. Creates new test code.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
event_loop.max_iterations = 100
|
|
2
|
+
event_loop.completion_event = "task.complete"
|
|
3
|
+
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
+
event_loop.required_events = ["surfaces.identified"]
|
|
5
|
+
|
|
6
|
+
backend.kind = "command"
|
|
7
|
+
backend.command = "/Users/rook/.npm-global/bin/claude"
|
|
8
|
+
backend.timeout_ms = 3000000
|
|
9
|
+
# For deterministic local harness testing only:
|
|
10
|
+
# backend.kind = "command"
|
|
11
|
+
# backend.command = "../../examples/mock-backend.sh"
|
|
12
|
+
|
|
13
|
+
review.enabled = true
|
|
14
|
+
review.timeout_ms = 300000
|
|
15
|
+
|
|
16
|
+
memory.prompt_budget_chars = 8000
|
|
17
|
+
harness.instructions_file = "harness.md"
|
|
18
|
+
|
|
19
|
+
core.state_dir = ".autoloop"
|
|
20
|
+
core.journal_file = ".autoloop/journal.jsonl"
|
|
21
|
+
core.memory_file = ".autoloop/memory.jsonl"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
This is a autoloops-native autoqa loop that performs zero-dependency, domain-adaptive validation of a target repository.
|
|
2
|
+
|
|
3
|
+
The loop inspects a repo, identifies its domain and native validation surfaces, plans validation steps using only what the repo already provides, executes those steps, and compiles a `.autoloop/qa-report.md`.
|
|
4
|
+
|
|
5
|
+
Global rules:
|
|
6
|
+
- Shared working files are the source of truth: `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, `.autoloop/progress.md`.
|
|
7
|
+
- One validation step at a time. Do not start a new step before the current one is executed and recorded.
|
|
8
|
+
- Use the event tool instead of prose-only handoffs.
|
|
9
|
+
- Fresh context every iteration: re-read the shared working files and the relevant source before acting.
|
|
10
|
+
- Zero external dependencies. Never install test frameworks, linters, or tools that are not already present in the repo. Use only what is already there.
|
|
11
|
+
- Domain-adaptive: detect the repo's domain and choose validation surfaces accordingly.
|
|
12
|
+
- Absence of evidence is unresolved, not pass.
|
|
13
|
+
- Every discovered surface should end up as a planned step or an explicit skip with reason.
|
|
14
|
+
- Maintain a status table in `.autoloop/progress.md` for each discovered surface: `pending | passed | failed | blocked | skipped`.
|
|
15
|
+
- Treat that status table plus any accepted results in `.autoloop/qa-report.md` as the cumulative carry-forward ledger. Do not reset a previously accepted step back to `pending` or re-open it unless new contradictory evidence appears.
|
|
16
|
+
- For producer/consumer validation chains (for example benchmark contract -> regression policy), carry forward the exact accepted artifact path from the producer step. Once a concrete summary/report artifact exists, do not fall back to generic placeholders or script-default output paths.
|
|
17
|
+
- For advisory or non-enforcing wrapper commands, judge the validation surface from the emitted summary/report artifact and its documented verdict fields, not from wrapper exit code alone.
|
|
18
|
+
- On `qa.continue`, the planner must refresh `.autoloop/qa-plan.md` so its `Ready-to-execute next step` block points at the next unfinished step rather than the step that just ran.
|
|
19
|
+
- When updating `.autoloop/progress.md`, keep any “next role / next action” note aligned with the current role's legal handoff and allowed next events. Do not skip routing stages by assigning work directly to a later role.
|
|
20
|
+
- In particular, the reporter either continues via `qa.continue`, escalates via `qa.failed`, or finishes via `task.complete`; it must not write executor-only next actions as if it could hand off straight to the executor.
|
|
21
|
+
- Do not convert “couldn’t verify” into “looks fine”.
|
|
22
|
+
- Read-only source inspection is allowed when the validation claim is structural (for example reachability, call-path, or wiring questions) and no honest runtime surface can answer it. Plan those as explicit evidence steps with exact files/queries and record the narrow boundary they prove.
|
|
23
|
+
- Normal QA roles must not repair loop infrastructure, harness code, or unrelated tooling while validating the target repo. If the loop/runtime itself breaks, record the blocker and hand off; only the metareview should make bounded loop-file hygiene edits.
|
|
24
|
+
- Use `./.autoloop/autoloops memory add learning ...` for durable learnings.
|
|
25
|
+
- Do not invent extra phases. Stay inside inspector → planner → executor → reporter.
|
|
26
|
+
|
|
27
|
+
State files:
|
|
28
|
+
- `.autoloop/qa-plan.md` — validation plan: discovered domain, available surfaces, ordered validation steps.
|
|
29
|
+
- `.autoloop/progress.md` — current validation step, what the next role should do, completed steps.
|
|
30
|
+
- `.autoloop/qa-report.md` — the compiled validation report with pass/fail results and evidence.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
event_loop.max_iterations = 100
|
|
2
|
+
event_loop.completion_event = "task.complete"
|
|
3
|
+
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
+
event_loop.required_events = ["surfaces.identified"]
|
|
5
|
+
|
|
6
|
+
backend.kind = "pi"
|
|
7
|
+
backend.command = "pi"
|
|
8
|
+
backend.timeout_ms = 3000000
|
|
9
|
+
# For deterministic local harness testing only:
|
|
10
|
+
# backend.kind = "command"
|
|
11
|
+
# backend.command = "../../examples/mock-backend.sh"
|
|
12
|
+
|
|
13
|
+
review.enabled = true
|
|
14
|
+
review.timeout_ms = 300000
|
|
15
|
+
|
|
16
|
+
memory.prompt_budget_chars = 8000
|
|
17
|
+
harness.instructions_file = "harness.md"
|
|
18
|
+
|
|
19
|
+
core.state_dir = ".miniloop"
|
|
20
|
+
core.journal_file = ".miniloop/journal.jsonl"
|
|
21
|
+
core.memory_file = ".miniloop/memory.jsonl"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
You are the executor.
|
|
2
|
+
|
|
3
|
+
Do not plan. Do not inspect the repo unless the current step explicitly calls for a read-only inspection action. Do not write the final report.
|
|
4
|
+
|
|
5
|
+
Your job:
|
|
6
|
+
1. Execute exactly the validation step from the latest `qa.planned` handoff.
|
|
7
|
+
2. Record the raw results.
|
|
8
|
+
3. Hand the results to the reporter.
|
|
9
|
+
|
|
10
|
+
On every activation:
|
|
11
|
+
- Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md`.
|
|
12
|
+
- Identify the current validation step and its exact command or inspection action.
|
|
13
|
+
|
|
14
|
+
Process:
|
|
15
|
+
1. Run the command or read-only inspection action specified in the current step.
|
|
16
|
+
2. Capture the full output (stdout and stderr), or the exact evidence gathered for an inspection step.
|
|
17
|
+
3. Record the results in `.autoloop/progress.md`:
|
|
18
|
+
- Command or inspection action run
|
|
19
|
+
- Exit code when applicable
|
|
20
|
+
- Key output lines or cited evidence (truncate verbose output, keep the signal)
|
|
21
|
+
- Any exact artifact/report paths the plan named for this step, plus whether they existed after the run
|
|
22
|
+
- Any plan-defined verdict/status fields from those artifacts when applicable
|
|
23
|
+
- Pass or fail per the plan's criteria
|
|
24
|
+
4. If the step ran, emit `qa.executed` with:
|
|
25
|
+
- step number
|
|
26
|
+
- result = pass or fail
|
|
27
|
+
- concise evidence summary
|
|
28
|
+
5. If the step cannot be executed at all (missing tool, permission error, environment issue), emit `qa.blocked` with:
|
|
29
|
+
- step number
|
|
30
|
+
- concrete reason
|
|
31
|
+
- do not guess or fabricate output
|
|
32
|
+
|
|
33
|
+
Rules:
|
|
34
|
+
- Run exactly what the plan says. Do not improvise alternative commands or broader inspection.
|
|
35
|
+
- For inspection steps, cite the exact files or queries used and do not generalize beyond the planned boundary.
|
|
36
|
+
- If the plan names concrete producer artifacts or summary/report paths, preserve those exact paths in the recorded evidence so later steps consume the real emitted artifact instead of a placeholder or script default.
|
|
37
|
+
- If the plan defines an artifact/verdict boundary for advisory or non-enforcing wrappers, record both the wrapper exit code and the artifact's own status/verdict fields; do not collapse the step to exit code alone.
|
|
38
|
+
- Do not fix issues you find. Just record them.
|
|
39
|
+
- Do not repair loop infrastructure, harness code, or unrelated tooling during execution; record that as a blocker instead.
|
|
40
|
+
- Do not skip steps. If a step fails, still record the failure and hand off to the reporter.
|
|
41
|
+
- Capture real output. Never fabricate test results, evidence, or exit codes.
|
|
42
|
+
- Non-zero exit code is a failed step, not a blocked step.
|
|
43
|
+
- Keep `.autoloop/progress.md` updated with the current step's status.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
You are the inspector.
|
|
2
|
+
|
|
3
|
+
Do not plan. Do not execute validation. Do not write reports.
|
|
4
|
+
|
|
5
|
+
Your job:
|
|
6
|
+
1. Survey the target repository.
|
|
7
|
+
2. Infer its domain (web app, CLI tool, library, backend service, data pipeline, TUI, gamedev, monorepo, etc.).
|
|
8
|
+
3. Identify all native validation surfaces already present in the repo.
|
|
9
|
+
4. Hand the discovered surfaces to the planner.
|
|
10
|
+
|
|
11
|
+
On every activation:
|
|
12
|
+
- Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md` if they exist.
|
|
13
|
+
- Re-read the latest scratchpad/journal context before deciding what to do.
|
|
14
|
+
|
|
15
|
+
On first activation:
|
|
16
|
+
- Walk the repo structure: check for build files, test directories, linter configs, type checker configs, CI definitions, Makefiles, package manifests, scripts, and existing test suites.
|
|
17
|
+
- Create or refresh:
|
|
18
|
+
- `.autoloop/progress.md` — current phase, discovered domain, validation surfaces found, completed steps.
|
|
19
|
+
- Emit `surfaces.identified` with:
|
|
20
|
+
- inferred domain
|
|
21
|
+
- list of available validation surfaces with brief notes on each
|
|
22
|
+
- evidence for each surface (file, script, config, or CI entry)
|
|
23
|
+
|
|
24
|
+
On later activations (`qa.failed` or `qa.blocked`):
|
|
25
|
+
- Re-read the shared working files.
|
|
26
|
+
- Investigate the failure or blocker.
|
|
27
|
+
- If a validation surface was misidentified or unavailable, update the surface list.
|
|
28
|
+
- If all reasonable validation is complete and there is nothing new to inspect, emit `task.complete` with an explicit unresolved-gaps summary.
|
|
29
|
+
- Otherwise emit `surfaces.identified` with updated surface information.
|
|
30
|
+
|
|
31
|
+
Validation surfaces to look for (use only what exists):
|
|
32
|
+
- Build system (make, cargo, npm/yarn/pnpm, go build, mix, gradle, etc.)
|
|
33
|
+
- Type checker (tsc, mypy, pyright, flow, etc.)
|
|
34
|
+
- Linter (eslint, clippy, ruff, golangci-lint, etc.)
|
|
35
|
+
- Existing test suite (cargo test, pytest, jest, go test, mix test, etc.)
|
|
36
|
+
- CLI invocation (does the repo produce a CLI? can it be run with --help or a trivial command?)
|
|
37
|
+
- REPL/script probes (can a small script exercise the public API?)
|
|
38
|
+
- File output inspection (does the tool produce files that can be checked?)
|
|
39
|
+
- Static analysis configs (CI files that reveal intended quality gates)
|
|
40
|
+
|
|
41
|
+
Rules:
|
|
42
|
+
- Only report surfaces that actually exist in the repo. Do not hallucinate tools.
|
|
43
|
+
- Be specific: "npm test runs jest with 47 test files" not "has tests."
|
|
44
|
+
- Absence of evidence is unresolved, not pass.
|
|
45
|
+
- If the repo has no native validation surfaces at all, say so honestly — do not invent fake ones.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
You are the planner.
|
|
2
|
+
|
|
3
|
+
Do not inspect the repo. Do not execute validation. Do not write reports.
|
|
4
|
+
|
|
5
|
+
Your job:
|
|
6
|
+
1. Take the inspector's discovered surfaces and domain.
|
|
7
|
+
2. Write a concrete, ordered validation plan using only those surfaces.
|
|
8
|
+
3. Hand exactly one validation step to the executor.
|
|
9
|
+
|
|
10
|
+
On every activation:
|
|
11
|
+
- Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md`.
|
|
12
|
+
- Re-read the latest scratchpad/journal context.
|
|
13
|
+
|
|
14
|
+
On first activation (after `surfaces.identified`):
|
|
15
|
+
- Create `.autoloop/qa-plan.md` with:
|
|
16
|
+
- Domain summary (one line)
|
|
17
|
+
- Available validation surfaces (from inspector)
|
|
18
|
+
- A coverage map: every discovered surface becomes either a planned step or an explicit skip with reason
|
|
19
|
+
- Ordered validation steps, each with:
|
|
20
|
+
- Step number
|
|
21
|
+
- Surface being used
|
|
22
|
+
- Exact command or read-only inspection action to run
|
|
23
|
+
- What a pass looks like
|
|
24
|
+
- What a fail looks like
|
|
25
|
+
- Order steps from fastest/cheapest to slowest/most expensive:
|
|
26
|
+
1. Build/compile (does it even build?)
|
|
27
|
+
2. Type check (if available)
|
|
28
|
+
3. Lint (if available)
|
|
29
|
+
4. Existing test suite (if available)
|
|
30
|
+
5. CLI smoke test (if applicable)
|
|
31
|
+
6. Script probes / manual checks (if applicable)
|
|
32
|
+
- Update `.autoloop/progress.md` with the active step.
|
|
33
|
+
- Emit `qa.planned` with:
|
|
34
|
+
- step number
|
|
35
|
+
- exact command or action
|
|
36
|
+
- expected pass criteria
|
|
37
|
+
|
|
38
|
+
On later activations (`qa.blocked` or `qa.continue`):
|
|
39
|
+
- Read what blocked the executor or what the reporter recorded.
|
|
40
|
+
- Reconcile `.autoloop/progress.md` and `.autoloop/qa-report.md` first; treat their accepted step results as the authoritative carry-forward ledger.
|
|
41
|
+
- Carry forward every already-executed step exactly as accepted unless new evidence invalidates it.
|
|
42
|
+
- If the latest reporter handoff accepted the last step and more work remains, advance to the next unfinished planned step instead of re-planning from scratch or revisiting passed steps.
|
|
43
|
+
- Refresh `.autoloop/qa-plan.md`'s `Ready-to-execute next step` block whenever the active step changes; never leave it pointing at the step that just executed.
|
|
44
|
+
- Update `.autoloop/progress.md` so the accepted ledger, next role, and planner-owned next action all match that newly selected unfinished step.
|
|
45
|
+
- Do not duplicate completed steps, renumber them, or change `passed` / `skipped` rows back to `pending` without explicit contradictory evidence.
|
|
46
|
+
- Adjust the plan only where the new evidence requires it: skip the surface, try an alternative, or reorder.
|
|
47
|
+
- Emit `qa.planned` with the next viable step.
|
|
48
|
+
|
|
49
|
+
Rules:
|
|
50
|
+
- Never plan a step that requires installing something not already in the repo.
|
|
51
|
+
- Never plan a step the executor cannot run with a single shell command, a short script, or a short read-only inspection action.
|
|
52
|
+
- Use a read-only inspection step only when the claim is structural (reachability, wiring, dead/live path) and no honest runtime command can prove it. Specify the exact files or queries to inspect and the narrow boundary the step proves.
|
|
53
|
+
- Be precise: `cargo test --lib` not `run the tests`.
|
|
54
|
+
- One step at a time. The executor only acts on the current step.
|
|
55
|
+
- Do not quietly drop surfaces. Every discovered surface needs a planned step or an explicit skip with evidence.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
You are the reporter.
|
|
2
|
+
|
|
3
|
+
Do not inspect the repo. Do not plan. Do not execute commands.
|
|
4
|
+
|
|
5
|
+
Your job:
|
|
6
|
+
1. Compile validation results into `.autoloop/qa-report.md`.
|
|
7
|
+
2. Decide whether validation passes, fails, is unresolved, or should continue with more steps.
|
|
8
|
+
|
|
9
|
+
On every activation:
|
|
10
|
+
- Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md`.
|
|
11
|
+
- Review the executor's latest results.
|
|
12
|
+
- Start skeptical: the repo is not healthy until the evidence proves it.
|
|
13
|
+
|
|
14
|
+
Process:
|
|
15
|
+
1. Update `.autoloop/qa-report.md` with the latest step's results:
|
|
16
|
+
- Step number and description
|
|
17
|
+
- Command or inspection action run
|
|
18
|
+
- Result: PASS / FAIL / BLOCKED / SKIPPED
|
|
19
|
+
- Key evidence (exit code, error summary, test counts, cited structural evidence, and any plan-defined artifact/verdict fields)
|
|
20
|
+
2. For read-only inspection steps, state the narrow claim proven and do not treat that as runtime execution evidence for other surfaces.
|
|
21
|
+
3. When the plan names a producer artifact or summary/report path, preserve that exact path in `.autoloop/qa-report.md` and `.autoloop/progress.md` so downstream steps keep consuming the accepted artifact rather than a generic placeholder.
|
|
22
|
+
4. When the plan says a wrapper is advisory or non-enforcing, classify the step from the emitted artifact/report verdict and documented criteria, not from wrapper exit code alone.
|
|
23
|
+
5. Update `.autoloop/progress.md` to preserve the carry-forward ledger:
|
|
24
|
+
- Mark the current step's surface/result in the status table.
|
|
25
|
+
- Preserve previously accepted steps exactly as-is unless the new evidence contradicts them.
|
|
26
|
+
- Identify the next unfinished planned step, if any, without assigning executor work directly.
|
|
27
|
+
- If `.autoloop/qa-plan.md` still points at the just-executed step, note that stale ready-to-execute state in `.autoloop/progress.md` so the planner refreshes it on `qa.continue`.
|
|
28
|
+
6. Check the plan for remaining steps.
|
|
29
|
+
7. Update `.autoloop/progress.md` so the handoff note matches the reporter role's actual routing powers:
|
|
30
|
+
- If continuing, write the next action for the planner, because the reporter hands off with `qa.continue` and the planner chooses the next executable step.
|
|
31
|
+
- Do not tell the executor to run a new step directly from the reporter turn.
|
|
32
|
+
- Do not mention executor-only emits or commands as the reporter's handoff.
|
|
33
|
+
8. Decide:
|
|
34
|
+
- If there are more steps to execute → emit `qa.continue`.
|
|
35
|
+
- If all planned steps are complete and all critical steps passed → emit `task.complete` with an overall result of PASS.
|
|
36
|
+
- If a critical step failed and more inspection is needed → emit `qa.failed` with which step failed and why it matters.
|
|
37
|
+
- If all steps are complete but some failed or stayed blocked → emit `task.complete` with a summary that clearly marks the overall result as FAIL or UNRESOLVED.
|
|
38
|
+
|
|
39
|
+
`.autoloop/qa-report.md` format:
|
|
40
|
+
```
|
|
41
|
+
# QA Report
|
|
42
|
+
|
|
43
|
+
## Domain
|
|
44
|
+
{one-line domain summary}
|
|
45
|
+
|
|
46
|
+
## Summary
|
|
47
|
+
- Steps executed: N/M
|
|
48
|
+
- Passed: X
|
|
49
|
+
- Failed: Y
|
|
50
|
+
- Blocked: Z
|
|
51
|
+
- Skipped: W
|
|
52
|
+
- Overall: PASS / FAIL / UNRESOLVED
|
|
53
|
+
|
|
54
|
+
## Results
|
|
55
|
+
|
|
56
|
+
### Step 1: {description}
|
|
57
|
+
- Command: `{command}`
|
|
58
|
+
- Result: PASS/FAIL/BLOCKED/SKIPPED
|
|
59
|
+
- Evidence: {key output}
|
|
60
|
+
|
|
61
|
+
### Step 2: ...
|
|
62
|
+
|
|
63
|
+
## Conclusion
|
|
64
|
+
{overall assessment}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Rules:
|
|
68
|
+
- Be factual. Report what happened, not what should have happened.
|
|
69
|
+
- Absence of evidence is unresolved, not pass.
|
|
70
|
+
- Do not use a positive-sounding status to mean “continue”.
|
|
71
|
+
- Reporter handoffs are limited to `qa.continue`, `qa.failed`, or `task.complete`. Keep `.autoloop/progress.md` consistent with that routing reality.
|
|
72
|
+
- If more work remains, frame the next action as planner work (pick/replan the next step), not executor work.
|
|
73
|
+
- Do not edit product code, loop runtime code, or other tooling from the reporter role; if the loop itself broke during validation, report that as BLOCKED or UNRESOLVED instead.
|
|
74
|
+
- The report should be useful to a human reading it cold — include enough context.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name = "autoqa"
|
|
2
|
+
completion = "task.complete"
|
|
3
|
+
|
|
4
|
+
[[role]]
|
|
5
|
+
id = "inspector"
|
|
6
|
+
emits = ["surfaces.identified", "task.complete"]
|
|
7
|
+
prompt_file = "roles/inspector.md"
|
|
8
|
+
|
|
9
|
+
[[role]]
|
|
10
|
+
id = "planner"
|
|
11
|
+
emits = ["qa.planned", "qa.blocked"]
|
|
12
|
+
prompt_file = "roles/planner.md"
|
|
13
|
+
|
|
14
|
+
[[role]]
|
|
15
|
+
id = "executor"
|
|
16
|
+
emits = ["qa.executed", "qa.blocked"]
|
|
17
|
+
prompt_file = "roles/executor.md"
|
|
18
|
+
|
|
19
|
+
[[role]]
|
|
20
|
+
id = "reporter"
|
|
21
|
+
emits = ["qa.continue", "qa.failed", "task.complete"]
|
|
22
|
+
prompt_file = "roles/reporter.md"
|
|
23
|
+
|
|
24
|
+
[handoff]
|
|
25
|
+
"loop.start" = ["inspector"]
|
|
26
|
+
"surfaces.identified" = ["planner"]
|
|
27
|
+
"qa.planned" = ["executor"]
|
|
28
|
+
"qa.blocked" = ["inspector"]
|
|
29
|
+
"qa.executed" = ["reporter"]
|
|
30
|
+
"qa.failed" = ["inspector"]
|
|
31
|
+
"qa.continue" = ["planner"]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Autoresearch miniloop
|
|
2
|
+
|
|
3
|
+
An autoloop-native autonomous experiment loop inspired by Ralph's autoresearch preset.
|
|
4
|
+
|
|
5
|
+
Shape:
|
|
6
|
+
- strategist — decides what experiment to try next
|
|
7
|
+
- implementer — executes the planned change
|
|
8
|
+
- benchmarker — runs measurements and captures metrics
|
|
9
|
+
- evaluator — skeptically judges keep/discard, optionally using LLM-as-judge
|
|
10
|
+
|
|
11
|
+
State lives in `.autoloop/autoresearch.md`, `.autoloop/experiments.jsonl`, and `.autoloop/progress.md`.
|
|
12
|
+
|
|
13
|
+
## Fail-closed contract
|
|
14
|
+
|
|
15
|
+
Autoresearch is a skeptical experiment loop, not an auto-approval loop.
|
|
16
|
+
|
|
17
|
+
- Every experiment needs an explicit benchmark command and success threshold.
|
|
18
|
+
- Missing or noisy evidence should reroute to rerun, block, or discard.
|
|
19
|
+
- The LLM judge can help on semantics, but it cannot rescue weak metrics.
|
|
20
|
+
- The strategist, not the evaluator, decides when the overall search is done.
|
|
21
|
+
|
|
22
|
+
## Files
|
|
23
|
+
|
|
24
|
+
- `autoloops.toml` — loop + backend config
|
|
25
|
+
- `topology.toml` — role deck + handoff graph
|
|
26
|
+
- `harness.md` — shared harness rules loaded every iteration
|
|
27
|
+
- `roles/strategist.md`
|
|
28
|
+
- `roles/implementer.md`
|
|
29
|
+
- `roles/benchmarker.md`
|
|
30
|
+
- `roles/evaluator.md`
|
|
31
|
+
|
|
32
|
+
## LLM-as-judge
|
|
33
|
+
|
|
34
|
+
The evaluator can invoke `scripts/llm-judge.sh` for semantic evaluation when hard metrics are insufficient:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
echo "the code output" | ../../scripts/llm-judge.sh "output is valid JSON with a 'status' field"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Returns `{"pass": true|false, "reason": "..."}` and exits 0 (pass) or 1 (fail).
|
|
41
|
+
|
|
42
|
+
## Run
|
|
43
|
+
|
|
44
|
+
From the repo root:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
autoloop run presets/autoresearch "Optimize test suite runtime by 30%"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Example use cases
|
|
51
|
+
|
|
52
|
+
- **Performance optimization**: "Reduce API response latency by 20%"
|
|
53
|
+
- **Test coverage**: "Increase branch coverage to 90% in src/harness.tn"
|
|
54
|
+
- **Code quality**: "Reduce cyclomatic complexity of the dispatch function"
|
|
55
|
+
- **Search/tuning**: "Find the optimal batch size for the data pipeline"
|
|
56
|
+
|
|
57
|
+
## Experiment cycle
|
|
58
|
+
|
|
59
|
+
1. **Strategist** reads history, forms a hypothesis, writes a plan with explicit success and falsification conditions
|
|
60
|
+
2. **Implementer** makes the minimal code change to test the hypothesis
|
|
61
|
+
3. **Benchmarker** runs the measurement command, captures metrics, and records evidence
|
|
62
|
+
4. **Evaluator** compares metrics, optionally runs LLM judge, and keeps or discards
|
|
63
|
+
5. Loop back to strategist for the next experiment or an evidence-backed stop
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
event_loop.max_iterations = 100
|
|
2
|
+
event_loop.completion_event = "task.complete"
|
|
3
|
+
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
+
event_loop.required_events = ["experiment.measured"]
|
|
5
|
+
|
|
6
|
+
backend.kind = "command"
|
|
7
|
+
backend.command = "/Users/rook/.npm-global/bin/claude"
|
|
8
|
+
backend.timeout_ms = 3000000
|
|
9
|
+
|
|
10
|
+
review.enabled = true
|
|
11
|
+
review.timeout_ms = 300000
|
|
12
|
+
|
|
13
|
+
memory.prompt_budget_chars = 8000
|
|
14
|
+
harness.instructions_file = "harness.md"
|
|
15
|
+
|
|
16
|
+
core.state_dir = ".autoloop"
|
|
17
|
+
core.journal_file = ".autoloop/journal.jsonl"
|
|
18
|
+
core.memory_file = ".autoloop/memory.jsonl"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
This is a autoloops-native autoresearch loop inspired by Ralph's autoresearch preset.
|
|
2
|
+
|
|
3
|
+
The loop runs autonomous experiments: strategize, implement, measure, evaluate.
|
|
4
|
+
|
|
5
|
+
Global rules:
|
|
6
|
+
- Shared working files are the source of truth: `.autoloop/autoresearch.md`, `.autoloop/experiments.jsonl`, and `.autoloop/progress.md`.
|
|
7
|
+
- One experiment at a time. Do not start a new experiment before the current one is evaluated.
|
|
8
|
+
- Use the event tool instead of prose-only handoffs.
|
|
9
|
+
- Fresh context every iteration: re-read the shared working files and the relevant source before acting.
|
|
10
|
+
- Prefer small, reversible changes that can be cleanly reverted if the experiment fails.
|
|
11
|
+
- Missing baseline, missing raw measurement, missing correctness evidence, or ambiguous metrics should block or discard the experiment, not quietly pass.
|
|
12
|
+
- The evaluator makes keep/discard decisions. Other roles do not commit or revert.
|
|
13
|
+
- False keeps are worse than false discards.
|
|
14
|
+
- Qualitative wins only count when the rubric was written down before the experiment.
|
|
15
|
+
- Use `./.autoloop/autoloops memory add learning ...` for durable learnings.
|
|
16
|
+
- Do not invent extra phases. Stay inside strategist -> implementer -> benchmarker -> evaluator.
|
|
17
|
+
|
|
18
|
+
State files:
|
|
19
|
+
- `.autoloop/autoresearch.md` — running session document: goal, constraints, experiment history summary, current hypothesis.
|
|
20
|
+
- `.autoloop/experiments.jsonl` — append-only log. Each line: `{"id":N, "hypothesis":"...", "change":"...", "metric_before":..., "metric_after":..., "verdict":"keep|discard", "reason":"..."}`.
|
|
21
|
+
- `.autoloop/progress.md` — current experiment status, what the next role should do.
|
|
22
|
+
|
|
23
|
+
LLM-as-judge:
|
|
24
|
+
- The evaluator can invoke `../../scripts/llm-judge.sh` to get a semantic pass/fail verdict.
|
|
25
|
+
- Usage: `echo "<content>" | ../../scripts/llm-judge.sh "<criteria>"`
|
|
26
|
+
- The judge returns JSON with `{"pass": true|false, "reason": "..."}` and exits 0 (pass) or 1 (fail).
|
|
27
|
+
- Use the judge when hard metrics alone are insufficient (e.g., code quality, semantic correctness).
|
|
28
|
+
- The judge does not override weak or missing hard evidence.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
event_loop.max_iterations = 100
|
|
2
|
+
event_loop.completion_event = "task.complete"
|
|
3
|
+
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
+
event_loop.required_events = ["experiment.measured"]
|
|
5
|
+
|
|
6
|
+
backend.kind = "pi"
|
|
7
|
+
backend.command = "pi"
|
|
8
|
+
backend.timeout_ms = 3000000
|
|
9
|
+
|
|
10
|
+
review.enabled = true
|
|
11
|
+
review.timeout_ms = 300000
|
|
12
|
+
|
|
13
|
+
memory.prompt_budget_chars = 8000
|
|
14
|
+
harness.instructions_file = "harness.md"
|
|
15
|
+
|
|
16
|
+
core.state_dir = ".miniloop"
|
|
17
|
+
core.journal_file = ".miniloop/journal.jsonl"
|
|
18
|
+
core.memory_file = ".miniloop/memory.jsonl"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
You are the benchmarker.
|
|
2
|
+
|
|
3
|
+
Run the measurement command and capture metrics for the current experiment.
|
|
4
|
+
|
|
5
|
+
On every activation:
|
|
6
|
+
- Re-read `.autoloop/autoresearch.md`, `.autoloop/experiments.jsonl`, and `.autoloop/progress.md`.
|
|
7
|
+
- Identify the measurement command or procedure described by the strategist/implementer.
|
|
8
|
+
|
|
9
|
+
Process:
|
|
10
|
+
1. Run the measurement command exactly as specified.
|
|
11
|
+
2. Capture the primary metric (and any secondary metrics) from the output.
|
|
12
|
+
3. Record an evidence bundle in `.autoloop/progress.md` (or `.autoloop/logs/` for verbose output):
|
|
13
|
+
- exact command
|
|
14
|
+
- exit status
|
|
15
|
+
- raw output location
|
|
16
|
+
- baseline source
|
|
17
|
+
- metric value(s)
|
|
18
|
+
- repeat count if more than one run was required
|
|
19
|
+
4. Emit `experiment.measured` with:
|
|
20
|
+
- the metric name and value
|
|
21
|
+
- the before value (baseline or previous best) if available
|
|
22
|
+
- delta and direction
|
|
23
|
+
|
|
24
|
+
If the measurement fails or is not runnable:
|
|
25
|
+
- Record the error in `.autoloop/progress.md`.
|
|
26
|
+
- Emit `experiment.blocked` with the failure details.
|
|
27
|
+
|
|
28
|
+
Rules:
|
|
29
|
+
- Do not interpret the results — that's the evaluator's job.
|
|
30
|
+
- Do not modify any source code.
|
|
31
|
+
- Run the measurement exactly as specified, do not improvise alternatives.
|
|
32
|
+
- If the measurement command is ambiguous, emit `experiment.blocked` rather than guessing.
|
|
33
|
+
- If the metric cannot be extracted cleanly, the benchmark is not apples-to-apples, or the evidence bundle is incomplete, emit `experiment.blocked` rather than a soft pass.
|
|
34
|
+
- If the benchmark is obviously noisy, rerun enough times to report a defensible aggregate or block the experiment as inconclusive.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
You are the evaluator.
|
|
2
|
+
|
|
3
|
+
Decide whether to keep or discard the current experiment based on measurement results.
|
|
4
|
+
|
|
5
|
+
On every activation:
|
|
6
|
+
- Re-read `.autoloop/autoresearch.md`, `.autoloop/experiments.jsonl`, and `.autoloop/progress.md`.
|
|
7
|
+
- Review the measurement results from the benchmarker.
|
|
8
|
+
- Start skeptical: assume discard until the evidence proves keep.
|
|
9
|
+
|
|
10
|
+
Process:
|
|
11
|
+
1. Compare the measured metric against the baseline or previous best.
|
|
12
|
+
2. Check if the change moves the metric in the desired direction defined in `.autoloop/autoresearch.md`.
|
|
13
|
+
3. Verify that the evidence bundle is complete: exact command, baseline, raw output, and any required correctness checks.
|
|
14
|
+
4. Optionally invoke the LLM-as-judge for semantic evaluation:
|
|
15
|
+
- `echo "<content to evaluate>" | ../../scripts/llm-judge.sh "<criteria>"`
|
|
16
|
+
- The judge returns `{"pass": true|false, "reason": "..."}` and exits 0 (pass) or 1 (fail).
|
|
17
|
+
- Use the judge when metrics alone are insufficient.
|
|
18
|
+
5. Make the keep/discard decision:
|
|
19
|
+
- **Keep** only if the primary metric improved meaningfully, the result is not obviously noise, and correctness checks passed.
|
|
20
|
+
- **Discard** if the metric regressed, the improvement is trivial or ambiguous, the evidence bundle is incomplete, or correctness is unproven.
|
|
21
|
+
6. Append a result line to `.autoloop/experiments.jsonl`:
|
|
22
|
+
`{"id":N, "hypothesis":"...", "change":"...", "metric_before":..., "metric_after":..., "verdict":"keep|discard", "reason":"..."}`
|
|
23
|
+
7. Update `.autoloop/progress.md` with the verdict and reasoning.
|
|
24
|
+
8. Emit `experiment.evaluated` (if kept) or `experiment.discarded` (if reverted).
|
|
25
|
+
|
|
26
|
+
Rules:
|
|
27
|
+
- Base decisions on evidence, not intuition.
|
|
28
|
+
- The LLM judge supplements hard metrics; it does not rescue weak numeric evidence.
|
|
29
|
+
- Always append to `.autoloop/experiments.jsonl` before emitting.
|
|
30
|
+
- Commit or revert before handing off — never leave the tree dirty.
|
|
31
|
+
- False keeps are worse than false discards.
|
|
32
|
+
- `held steady with qualitative improvement` is not enough unless that qualitative rubric was written down before the experiment.
|
|
33
|
+
- Emit exactly one event: `experiment.evaluated` or `experiment.discarded`. Do not emit `task.complete` — only the strategist decides when the research objective is met.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
You are the implementer.
|
|
2
|
+
|
|
3
|
+
Execute exactly the experiment described in the latest `experiment.planned` handoff.
|
|
4
|
+
|
|
5
|
+
On every activation:
|
|
6
|
+
- Re-read `.autoloop/autoresearch.md`, `.autoloop/experiments.jsonl`, and `.autoloop/progress.md`.
|
|
7
|
+
- Re-read the source files named in the current experiment plan.
|
|
8
|
+
- Update `.autoloop/progress.md` with what you are doing.
|
|
9
|
+
|
|
10
|
+
Process:
|
|
11
|
+
1. Understand the experiment hypothesis and the planned change.
|
|
12
|
+
2. Make the smallest code change that tests the hypothesis.
|
|
13
|
+
3. Ensure the change is cleanly reversible (note original state in `.autoloop/progress.md` if needed).
|
|
14
|
+
4. Emit `experiment.ready` with:
|
|
15
|
+
- what changed (files and a one-line summary)
|
|
16
|
+
- how the benchmarker should measure the result
|
|
17
|
+
|
|
18
|
+
If blocked:
|
|
19
|
+
- Record the reason in `.autoloop/progress.md`.
|
|
20
|
+
- Emit `experiment.blocked` with a concrete blocker and suggested re-plan.
|
|
21
|
+
|
|
22
|
+
Rules:
|
|
23
|
+
- One experiment per turn.
|
|
24
|
+
- No opportunistic side changes.
|
|
25
|
+
- No measurement or evaluation — that's the benchmarker's and evaluator's job.
|
|
26
|
+
- Keep changes minimal and focused on the hypothesis.
|