@mobrienv/autoloop 0.1.4 → 0.2.0
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 +13 -0
- package/bin/autoloop +0 -0
- package/dist/agent-map.d.ts +10 -0
- package/dist/agent-map.js +58 -0
- package/dist/agent-map.js.map +1 -0
- package/dist/backend/acp-client.d.ts +32 -0
- package/dist/backend/acp-client.js +210 -0
- package/dist/backend/acp-client.js.map +1 -0
- package/dist/backend/index.d.ts +1 -1
- package/dist/backend/index.js +17 -5
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/kiro-bridge.d.ts +17 -0
- package/dist/backend/kiro-bridge.js +80 -0
- package/dist/backend/kiro-bridge.js.map +1 -0
- package/dist/backend/kiro-worker.d.ts +1 -0
- package/dist/backend/kiro-worker.js +83 -0
- package/dist/backend/kiro-worker.js.map +1 -0
- package/dist/backend/run-command.js +2 -2
- package/dist/backend/run-command.js.map +1 -1
- package/dist/backend/run-kiro.d.ts +3 -0
- package/dist/backend/run-kiro.js +12 -0
- package/dist/backend/run-kiro.js.map +1 -0
- package/dist/backend/run-pi.js.map +1 -1
- package/dist/chains/budget.js +16 -4
- package/dist/chains/budget.js.map +1 -1
- package/dist/chains/load.d.ts +7 -1
- package/dist/chains/load.js +58 -9
- package/dist/chains/load.js.map +1 -1
- package/dist/chains/render.js +36 -8
- package/dist/chains/render.js.map +1 -1
- package/dist/chains/run.js +129 -44
- package/dist/chains/run.js.map +1 -1
- package/dist/chains/types.d.ts +1 -0
- package/dist/chains.d.ts +5 -4
- package/dist/chains.js +3 -3
- package/dist/chains.js.map +1 -1
- package/dist/commands/chain.js +6 -4
- package/dist/commands/chain.js.map +1 -1
- package/dist/commands/config.d.ts +1 -0
- package/dist/commands/config.js +74 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dashboard.d.ts +1 -0
- package/dist/commands/dashboard.js +68 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/inspect.js +125 -17
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/list.d.ts +1 -1
- package/dist/commands/list.js +6 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/loops.js +11 -11
- package/dist/commands/loops.js.map +1 -1
- package/dist/commands/memory.js +2 -2
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/run.d.ts +1 -1
- package/dist/commands/run.js +102 -15
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/runs.d.ts +1 -0
- package/dist/commands/runs.js +50 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/task.d.ts +1 -0
- package/dist/commands/task.js +74 -0
- package/dist/commands/task.js.map +1 -0
- package/dist/commands/worktree.d.ts +1 -0
- package/dist/commands/worktree.js +162 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/config.d.ts +15 -1
- package/dist/config.js +90 -21
- package/dist/config.js.map +1 -1
- package/dist/dashboard/app.d.ts +12 -0
- package/dist/dashboard/app.js +23 -0
- package/dist/dashboard/app.js.map +1 -0
- package/dist/dashboard/routes/api.d.ts +3 -0
- package/dist/dashboard/routes/api.js +103 -0
- package/dist/dashboard/routes/api.js.map +1 -0
- package/dist/dashboard/routes/pages.d.ts +2 -0
- package/dist/dashboard/routes/pages.js +14 -0
- package/dist/dashboard/routes/pages.js.map +1 -0
- package/dist/dashboard/views/alpine-vendor.d.ts +1 -0
- package/dist/dashboard/views/alpine-vendor.js +10 -0
- package/dist/dashboard/views/alpine-vendor.js.map +1 -0
- package/dist/dashboard/views/shell.d.ts +1 -0
- package/dist/dashboard/views/shell.js +714 -0
- package/dist/dashboard/views/shell.js.map +1 -0
- package/dist/events/decode.js.map +1 -1
- package/dist/events/encode.js +2 -2
- package/dist/events/encode.js.map +1 -1
- package/dist/harness/config-helpers.d.ts +11 -0
- package/dist/harness/config-helpers.js +242 -64
- package/dist/harness/config-helpers.js.map +1 -1
- package/dist/harness/coordination.js +12 -12
- package/dist/harness/coordination.js.map +1 -1
- package/dist/harness/display.d.ts +4 -3
- package/dist/harness/display.js +57 -11
- package/dist/harness/display.js.map +1 -1
- package/dist/harness/emit.js +31 -13
- package/dist/harness/emit.js.map +1 -1
- package/dist/harness/index.d.ts +7 -7
- package/dist/harness/index.js +151 -35
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/iteration.d.ts +12 -0
- package/dist/harness/iteration.js +66 -64
- package/dist/harness/iteration.js.map +1 -1
- package/dist/harness/journal.d.ts +17 -0
- package/dist/harness/journal.js +74 -5
- package/dist/harness/journal.js.map +1 -1
- package/dist/harness/metareview.js +30 -15
- package/dist/harness/metareview.js.map +1 -1
- package/dist/harness/metrics.js +12 -12
- package/dist/harness/metrics.js.map +1 -1
- package/dist/harness/parallel.d.ts +1 -1
- package/dist/harness/parallel.js +141 -62
- package/dist/harness/parallel.js.map +1 -1
- package/dist/harness/prompt.d.ts +18 -9
- package/dist/harness/prompt.js +80 -44
- package/dist/harness/prompt.js.map +1 -1
- package/dist/harness/scratchpad.js +8 -6
- package/dist/harness/scratchpad.js.map +1 -1
- package/dist/harness/stop.js +16 -9
- package/dist/harness/stop.js.map +1 -1
- package/dist/harness/tools.js +39 -13
- package/dist/harness/tools.js.map +1 -1
- package/dist/harness/types.d.ts +29 -0
- package/dist/harness/wave/finalize-wave.d.ts +1 -1
- package/dist/harness/wave/finalize-wave.js +36 -9
- package/dist/harness/wave/finalize-wave.js.map +1 -1
- package/dist/harness/wave/launch-branches.d.ts +2 -2
- package/dist/harness/wave/launch-branches.js +147 -51
- package/dist/harness/wave/launch-branches.js.map +1 -1
- package/dist/harness/wave/parse-objectives.js +4 -1
- package/dist/harness/wave/parse-objectives.js.map +1 -1
- package/dist/harness/wave.d.ts +2 -2
- package/dist/harness/wave.js +89 -28
- package/dist/harness/wave.js.map +1 -1
- package/dist/isolation/index.d.ts +4 -0
- package/dist/isolation/index.js +3 -0
- package/dist/isolation/index.js.map +1 -0
- package/dist/isolation/resolve.d.ts +39 -0
- package/dist/isolation/resolve.js +118 -0
- package/dist/isolation/resolve.js.map +1 -0
- package/dist/isolation/run-scope.d.ts +21 -0
- package/dist/isolation/run-scope.js +50 -0
- package/dist/isolation/run-scope.js.map +1 -0
- package/dist/json.js +10 -8
- package/dist/json.js.map +1 -1
- package/dist/loops/health.d.ts +4 -2
- package/dist/loops/health.js +73 -25
- package/dist/loops/health.js.map +1 -1
- package/dist/loops/list.d.ts +2 -2
- package/dist/loops/list.js +6 -6
- package/dist/loops/list.js.map +1 -1
- package/dist/loops/policy.d.ts +6 -0
- package/dist/loops/policy.js +41 -0
- package/dist/loops/policy.js.map +1 -0
- package/dist/loops/render.d.ts +2 -1
- package/dist/loops/render.js +24 -11
- package/dist/loops/render.js.map +1 -1
- package/dist/loops/show.d.ts +2 -2
- package/dist/loops/show.js +13 -13
- package/dist/loops/show.js.map +1 -1
- package/dist/loops/watch.d.ts +7 -1
- package/dist/loops/watch.js +82 -16
- package/dist/loops/watch.js.map +1 -1
- package/dist/main.js +48 -11
- package/dist/main.js.map +1 -1
- package/dist/markdown.js +11 -11
- package/dist/markdown.js.map +1 -1
- package/dist/memory-render.js +5 -5
- package/dist/memory-render.js.map +1 -1
- package/dist/memory.d.ts +1 -2
- package/dist/memory.js +44 -40
- package/dist/memory.js.map +1 -1
- package/dist/pi-adapter.js +11 -11
- package/dist/pi-adapter.js.map +1 -1
- package/dist/profiles.d.ts +12 -0
- package/dist/profiles.js +71 -0
- package/dist/profiles.js.map +1 -0
- package/dist/registry/derive.js +10 -3
- package/dist/registry/derive.js.map +1 -1
- package/dist/registry/discover.d.ts +20 -0
- package/dist/registry/discover.js +98 -0
- package/dist/registry/discover.js.map +1 -0
- package/dist/registry/harness.js +8 -2
- package/dist/registry/harness.js.map +1 -1
- package/dist/registry/index.d.ts +4 -3
- package/dist/registry/index.js +3 -2
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/read.js.map +1 -1
- package/dist/registry/rebuild.js +7 -4
- package/dist/registry/rebuild.js.map +1 -1
- package/dist/registry/types.d.ts +9 -0
- package/dist/registry/update.js +1 -1
- package/dist/registry/update.js.map +1 -1
- package/dist/tasks-render.d.ts +2 -0
- package/dist/tasks-render.js +44 -0
- package/dist/tasks-render.js.map +1 -0
- package/dist/tasks.d.ts +24 -0
- package/dist/tasks.js +184 -0
- package/dist/tasks.js.map +1 -0
- package/dist/testing/mock-backend.js +2 -2
- package/dist/testing/mock-backend.js.map +1 -1
- package/dist/topology.d.ts +6 -0
- package/dist/topology.js +129 -8
- package/dist/topology.js.map +1 -1
- package/dist/usage.d.ts +1 -0
- package/dist/usage.js +56 -11
- package/dist/usage.js.map +1 -1
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +272 -2
- package/dist/utils.js.map +1 -1
- package/dist/worktree/clean.d.ts +12 -0
- package/dist/worktree/clean.js +98 -0
- package/dist/worktree/clean.js.map +1 -0
- package/dist/worktree/create.d.ts +14 -0
- package/dist/worktree/create.js +71 -0
- package/dist/worktree/create.js.map +1 -0
- package/dist/worktree/index.d.ts +10 -0
- package/dist/worktree/index.js +6 -0
- package/dist/worktree/index.js.map +1 -0
- package/dist/worktree/list.d.ts +9 -0
- package/dist/worktree/list.js +24 -0
- package/dist/worktree/list.js.map +1 -0
- package/dist/worktree/merge.d.ts +11 -0
- package/dist/worktree/merge.js +129 -0
- package/dist/worktree/merge.js.map +1 -0
- package/dist/worktree/meta.d.ts +17 -0
- package/dist/worktree/meta.js +34 -0
- package/dist/worktree/meta.js.map +1 -0
- package/package.json +24 -4
- package/presets/autocode/README.md +1 -1
- package/presets/autocode/autoloops.toml +9 -1
- package/presets/autocode/harness.md +12 -5
- package/presets/autocode/roles/build.md +5 -4
- package/presets/autocode/roles/critic.md +2 -2
- package/presets/autocode/roles/finalizer.md +2 -2
- package/presets/autocode/roles/planner.md +7 -7
- package/presets/autodoc/README.md +1 -1
- package/presets/autodoc/autoloops.toml +1 -1
- package/presets/autodoc/harness.md +6 -6
- package/presets/autodoc/roles/auditor.md +3 -3
- package/presets/autodoc/roles/checker.md +2 -2
- package/presets/autodoc/roles/publisher.md +3 -3
- package/presets/autodoc/roles/writer.md +4 -4
- package/presets/autofix/README.md +1 -1
- package/presets/autofix/autoloops.toml +5 -2
- package/presets/autofix/harness.md +8 -7
- package/presets/autofix/roles/closer.md +4 -4
- package/presets/autofix/roles/diagnoser.md +6 -5
- package/presets/autofix/roles/fixer.md +4 -4
- package/presets/autofix/roles/verifier.md +2 -2
- package/presets/autoideas/README.md +1 -1
- package/presets/autoideas/autoloops.toml +1 -1
- package/presets/autoideas/harness.md +11 -11
- package/presets/autoideas/roles/analyst.md +4 -4
- package/presets/autoideas/roles/reviewer.md +3 -3
- package/presets/autoideas/roles/scanner.md +3 -3
- package/presets/autoideas/roles/synthesizer.md +20 -7
- package/presets/automerge/README.md +3 -0
- package/presets/automerge/autoloops.toml +12 -0
- package/presets/automerge/harness.md +10 -0
- package/presets/automerge/miniloops.toml +12 -0
- package/presets/automerge/roles/merge.md +10 -0
- package/presets/automerge/topology.toml +10 -0
- package/presets/autoperf/README.md +1 -1
- package/presets/autoperf/autoloops.toml +1 -1
- package/presets/autoperf/harness.md +5 -5
- package/presets/autoperf/roles/judge.md +3 -3
- package/presets/autoperf/roles/measurer.md +4 -4
- package/presets/autoperf/roles/optimizer.md +4 -4
- package/presets/autoperf/roles/profiler.md +4 -4
- package/presets/autopr/README.md +99 -0
- package/presets/autopr/autoloops.toml +22 -0
- package/presets/autopr/harness.md +27 -0
- package/presets/autopr/miniloops.toml +22 -0
- package/presets/autopr/roles/collector.md +55 -0
- package/presets/autopr/roles/drafter.md +38 -0
- package/presets/autopr/roles/publisher.md +28 -0
- package/presets/autopr/roles/validator.md +31 -0
- package/presets/autopr/topology.toml +32 -0
- package/presets/autoqa/README.md +1 -1
- package/presets/autoqa/autoloops.toml +1 -1
- package/presets/autoqa/harness.md +10 -10
- package/presets/autoqa/roles/executor.md +3 -3
- package/presets/autoqa/roles/inspector.md +2 -2
- package/presets/autoqa/roles/planner.md +6 -6
- package/presets/autoqa/roles/reporter.md +9 -9
- package/presets/autoresearch/README.md +1 -1
- package/presets/autoresearch/autoloops.toml +1 -1
- package/presets/autoresearch/harness.md +5 -5
- package/presets/autoresearch/roles/benchmarker.md +3 -3
- package/presets/autoresearch/roles/evaluator.md +5 -5
- package/presets/autoresearch/roles/implementer.md +4 -4
- package/presets/autoresearch/roles/strategist.md +6 -6
- package/presets/autoreview/README.md +1 -1
- package/presets/autoreview/autoloops.toml +1 -1
- package/presets/autoreview/harness.md +5 -5
- package/presets/autoreview/roles/checker.md +4 -4
- package/presets/autoreview/roles/reader.md +5 -5
- package/presets/autoreview/roles/suggester.md +4 -4
- package/presets/autoreview/roles/summarizer.md +4 -4
- package/presets/autosec/README.md +1 -1
- package/presets/autosec/autoloops.toml +1 -1
- package/presets/autosec/harness.md +5 -5
- package/presets/autosec/roles/analyst.md +4 -4
- package/presets/autosec/roles/hardener.md +2 -2
- package/presets/autosec/roles/reporter.md +4 -4
- package/presets/autosec/roles/scanner.md +3 -3
- package/presets/autosimplify/README.md +1 -1
- package/presets/autosimplify/autoloops.toml +7 -3
- package/presets/autosimplify/harness.md +7 -7
- package/presets/autosimplify/roles/reviewer.md +3 -3
- package/presets/autosimplify/roles/scoper.md +7 -7
- package/presets/autosimplify/roles/simplifier.md +4 -4
- package/presets/autosimplify/roles/verifier.md +3 -3
- package/presets/autospec/README.md +1 -1
- package/presets/autospec/autoloops.toml +1 -1
- package/presets/autospec/harness.md +6 -6
- package/presets/autospec/roles/clarifier.md +4 -3
- package/presets/autospec/roles/critic.md +1 -1
- package/presets/autospec/roles/designer.md +3 -3
- package/presets/autospec/roles/planner.md +2 -2
- package/presets/autospec/roles/researcher.md +3 -3
- package/presets/autotest/README.md +1 -1
- package/presets/autotest/autoloops.toml +1 -1
- package/presets/autotest/harness.md +6 -6
- package/presets/autotest/roles/assessor.md +3 -3
- package/presets/autotest/roles/runner.md +2 -2
- package/presets/autotest/roles/surveyor.md +4 -4
- package/presets/autotest/roles/writer.md +4 -4
|
@@ -8,7 +8,7 @@ Your job:
|
|
|
8
8
|
3. Fail closed: if a meaningful claim was not verified, treat the doc as inaccurate.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/doc-plan.md`, `{{STATE_DIR}}/doc-report.md`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
- Start skeptical: assume the docs are wrong until you verify them.
|
|
13
13
|
|
|
14
14
|
Process:
|
|
@@ -23,7 +23,7 @@ Process:
|
|
|
23
23
|
- look for counterexamples, renamed or missing symbols, contradictory behavior, and edge cases
|
|
24
24
|
- check whether examples actually match the real interfaces and paths
|
|
25
25
|
- verify stated defaults, prerequisites, and limitations from code/config/tests, not from assumptions
|
|
26
|
-
5. Record results in
|
|
26
|
+
5. Record results in `{{STATE_DIR}}/progress.md`, separating:
|
|
27
27
|
- verified claims
|
|
28
28
|
- unverified claims
|
|
29
29
|
- incorrect or misleading claims
|
|
@@ -8,10 +8,10 @@ Your job:
|
|
|
8
8
|
3. Decide whether more gaps need attention.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/doc-plan.md`, `{{STATE_DIR}}/doc-report.md`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
|
|
13
13
|
Process:
|
|
14
|
-
1. Update
|
|
14
|
+
1. Update `{{STATE_DIR}}/doc-report.md` with the completed documentation work:
|
|
15
15
|
- Gap addressed
|
|
16
16
|
- Files written or updated
|
|
17
17
|
- Accuracy check result
|
|
@@ -20,7 +20,7 @@ Process:
|
|
|
20
20
|
- If more gaps remain → emit `doc.published` so the auditor picks the next one.
|
|
21
21
|
- If all gaps are addressed → emit `task.complete` with a summary.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
`{{STATE_DIR}}/doc-report.md` format:
|
|
24
24
|
```
|
|
25
25
|
# Documentation Report
|
|
26
26
|
|
|
@@ -8,7 +8,7 @@ Your job:
|
|
|
8
8
|
3. Leave a concrete verification checklist for the checker instead of making the checker reconstruct your claims from scratch.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/doc-plan.md`, `{{STATE_DIR}}/doc-report.md`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
- Understand exactly which gap you are addressing.
|
|
13
13
|
|
|
14
14
|
Process:
|
|
@@ -17,8 +17,8 @@ Process:
|
|
|
17
17
|
3. Write or update the documentation:
|
|
18
18
|
- For new docs: create the file in the conventional location.
|
|
19
19
|
- For stale docs: update only the parts that are incorrect or missing.
|
|
20
|
-
4. Update
|
|
21
|
-
5. Add a `Verification checklist` section to
|
|
20
|
+
4. Update `{{STATE_DIR}}/progress.md` with what was written.
|
|
21
|
+
5. Add a `Verification checklist` section to `{{STATE_DIR}}/progress.md` for this gap. For every concrete claim you introduced or changed, list:
|
|
22
22
|
- the exact claim, command, path, API name, config key, default, or example
|
|
23
23
|
- where it appears in the docs
|
|
24
24
|
- the code/config/test evidence the checker should verify against
|
|
@@ -33,5 +33,5 @@ Rules:
|
|
|
33
33
|
- Do not change code. Only write documentation.
|
|
34
34
|
- The verification checklist must be claim-level, not file-level. `Updated README for CLI` is too vague; list the actual claims that need checking.
|
|
35
35
|
- Include copy-pasteable commands and examples in the checklist exactly as written in the docs.
|
|
36
|
-
- If you removed a stale claim, note the removal in
|
|
36
|
+
- If you removed a stale claim, note the removal in `{{STATE_DIR}}/progress.md` so the checker knows the stale statement was intentionally deleted.
|
|
37
37
|
- If you cannot document the gap meaningfully (e.g., the code is too unclear), emit `write.blocked` with an explanation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AutoFix miniloop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use when you have a bug to diagnose and repair with minimal collateral changes.
|
|
4
4
|
|
|
5
5
|
AutoFix takes a bug report or failing test, reproduces the issue, traces the root cause, implements a minimal fix, and verifies the fix — all without refactoring or improving code beyond what is needed.
|
|
6
6
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
event_loop.max_iterations = 100
|
|
2
2
|
event_loop.completion_event = "task.complete"
|
|
3
3
|
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
-
|
|
4
|
+
# Note: required_events intentionally omitted. The topology already enforces
|
|
5
|
+
# the correct flow (diagnoser→fixer→verifier→closer→task.complete). Adding
|
|
6
|
+
# required_events = ["fix.verified"] would block termination when there are
|
|
7
|
+
# no bugs to fix, causing a degenerate spin.
|
|
5
8
|
|
|
6
9
|
backend.kind = "command"
|
|
7
|
-
backend.command = "
|
|
10
|
+
backend.command = "claude"
|
|
8
11
|
backend.timeout_ms = 3000000
|
|
9
12
|
# For deterministic local harness testing only:
|
|
10
13
|
# backend.kind = "command"
|
|
@@ -3,8 +3,8 @@ This is a autoloops-native autofix loop for bug diagnosis and repair.
|
|
|
3
3
|
The loop takes a bug report or failing test, reproduces the issue, traces the root cause, implements a minimal fix, and verifies the fix — iterating if the initial attempt fails or if multiple bugs are reported.
|
|
4
4
|
|
|
5
5
|
Global rules:
|
|
6
|
-
- Shared working files are the source of truth:
|
|
7
|
-
- Preserve canonical filenames exactly as they exist on disk. If the upstream report is `qa-report.md`, keep that spelling/path everywhere; never invent `qa_report.md` or move it under
|
|
6
|
+
- Shared working files are the source of truth: `{{STATE_DIR}}/bug-report.md`, `{{STATE_DIR}}/fix-log.md`, `{{STATE_DIR}}/progress.md`.
|
|
7
|
+
- Preserve canonical filenames exactly as they exist on disk. If the upstream report is `qa-report.md`, keep that spelling/path everywhere; never invent `qa_report.md` or move it under `{{STATE_DIR}}/` unless the file really lives there.
|
|
8
8
|
- If a shared working file is missing, recreate it before continuing. Do not keep going with a guessed or broken path.
|
|
9
9
|
- One bug at a time. Do not start fixing the next bug before the current one is verified and closed.
|
|
10
10
|
- Use the event tool instead of prose-only handoffs.
|
|
@@ -12,13 +12,14 @@ Global rules:
|
|
|
12
12
|
- Prefer minimal fixes. Do not refactor, clean up, or improve code beyond what is needed to fix the bug.
|
|
13
13
|
- No reproduction => no diagnosis. No before/after proof => no verified fix.
|
|
14
14
|
- Regression verification is mandatory: the failing test must pass, and existing tests must not break.
|
|
15
|
-
- Record exact commands and key outputs in
|
|
15
|
+
- Record exact commands and key outputs in `{{STATE_DIR}}/progress.md` or `{{STATE_DIR}}/fix-log.md`, not just summaries.
|
|
16
16
|
- When refreshing structured markdown, read the current file first. If you are replacing most of a report/progress section, rewrite it cleanly instead of relying on brittle exact-text patching.
|
|
17
17
|
- Scope searches to repo paths or other paths you have confirmed exist. Do not spray `rg` or `find` across optional home-directory locations.
|
|
18
|
-
- Use
|
|
18
|
+
- Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
|
|
19
19
|
- Do not invent extra phases. Stay inside diagnoser → fixer → verifier → closer.
|
|
20
|
+
- If the diagnoser finds no bugs on first activation (build passes, all tests pass, no bug report or failing test), emit `task.complete` immediately. Do not re-confirm on subsequent iterations — one clean pass is sufficient.
|
|
20
21
|
|
|
21
22
|
State files:
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
23
|
+
- `{{STATE_DIR}}/bug-report.md` — the original bug report, reproduction steps, and root cause analysis.
|
|
24
|
+
- `{{STATE_DIR}}/fix-log.md` — log of fixes applied: what was changed, why, verification results.
|
|
25
|
+
- `{{STATE_DIR}}/progress.md` — current bug being fixed, what the next role should do.
|
|
@@ -8,24 +8,24 @@ Your job:
|
|
|
8
8
|
3. Decide whether more bugs need attention.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/bug-report.md`, `{{STATE_DIR}}/fix-log.md`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
- Start skeptical: prefer `bug.reopened` over premature `task.complete`.
|
|
13
13
|
|
|
14
14
|
Process:
|
|
15
15
|
1. Review the fix: is it minimal? Does it address the root cause (not just the symptom)?
|
|
16
|
-
2. Update
|
|
16
|
+
2. Update `{{STATE_DIR}}/fix-log.md` with:
|
|
17
17
|
- Bug description
|
|
18
18
|
- Root cause
|
|
19
19
|
- Fix applied (files changed, what changed)
|
|
20
20
|
- Verification result
|
|
21
|
-
3. Make sure
|
|
21
|
+
3. Make sure `{{STATE_DIR}}/progress.md` exists and names the next action using the exact on-disk bug-report path.
|
|
22
22
|
4. Check if there are more bugs from the original report.
|
|
23
23
|
5. Decide:
|
|
24
24
|
- If the fix is good and no more bugs remain → emit `task.complete` with a summary.
|
|
25
25
|
- If the fix is good but more bugs remain → emit `bug.closed` so the diagnoser picks up the next one.
|
|
26
26
|
- If the fix is questionable, incomplete, workaround-shaped, API-breaking without justification, or weakly verified → emit `bug.reopened` with concerns for the diagnoser to reconsider.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`{{STATE_DIR}}/fix-log.md` format:
|
|
29
29
|
```
|
|
30
30
|
# Fix Log
|
|
31
31
|
|
|
@@ -9,17 +9,18 @@ Your job:
|
|
|
9
9
|
4. Hand a clear diagnosis to the fixer.
|
|
10
10
|
|
|
11
11
|
On every activation:
|
|
12
|
-
- Read
|
|
12
|
+
- Read `{{STATE_DIR}}/bug-report.md`, `{{STATE_DIR}}/fix-log.md`, and `{{STATE_DIR}}/progress.md` if they exist.
|
|
13
13
|
- Confirm any upstream bug-report or failing-test path you cite actually exists on disk, and preserve that exact spelling/path in the working files.
|
|
14
14
|
- Re-read the latest scratchpad/journal context before deciding.
|
|
15
15
|
|
|
16
16
|
On first activation:
|
|
17
17
|
- Parse the input: bug report, error message, failing test, or user description.
|
|
18
|
+
- If there is no bug report, no failing test, and the build is clean: emit `task.complete` with a brief summary. Do not continue diagnosing.
|
|
18
19
|
- Reproduce the bug: run the failing test or trigger the reported behavior.
|
|
19
20
|
- Trace the root cause: read the relevant source, follow the execution path.
|
|
20
21
|
- Create or refresh:
|
|
21
|
-
-
|
|
22
|
-
-
|
|
22
|
+
- `{{STATE_DIR}}/bug-report.md` — symptom, reproduction steps, root cause analysis, affected files.
|
|
23
|
+
- `{{STATE_DIR}}/progress.md` — current bug, diagnosis status.
|
|
23
24
|
- Emit `cause.found` with the root cause and which files/lines need to change.
|
|
24
25
|
|
|
25
26
|
On later activations (`bug.closed` or `bug.reopened`):
|
|
@@ -29,7 +30,7 @@ On later activations (`bug.closed` or `bug.reopened`):
|
|
|
29
30
|
- Carry forward the exact on-disk source path for the original report when you queue the next bug (`qa-report.md` is not `qa_report.md`).
|
|
30
31
|
|
|
31
32
|
On `diagnosis.blocked`:
|
|
32
|
-
- If you cannot reproduce or trace the bug, explain what you tried in
|
|
33
|
+
- If you cannot reproduce or trace the bug, explain what you tried in `{{STATE_DIR}}/progress.md`.
|
|
33
34
|
- Try a different approach or ask for more information by emitting `diagnosis.blocked` again with details.
|
|
34
35
|
|
|
35
36
|
Rules:
|
|
@@ -37,6 +38,6 @@ Rules:
|
|
|
37
38
|
- Be precise: `the off-by-one in line 42 of parser.rs causes the last token to be dropped` not `parser has a bug`.
|
|
38
39
|
- If the bug report is vague, state what assumptions you are making.
|
|
39
40
|
- Preserve canonical file paths exactly as they exist on disk (`qa-report.md` ≠ `qa_report.md`).
|
|
40
|
-
- If you need to replace most of
|
|
41
|
+
- If you need to replace most of `{{STATE_DIR}}/bug-report.md`, rewrite it cleanly after reading it instead of depending on a fragile partial patch.
|
|
41
42
|
- Identify the minimal scope of the fix — the fixer should know exactly what to change.
|
|
42
43
|
- No reproduction means no diagnosis.
|
|
@@ -7,22 +7,22 @@ Your job:
|
|
|
7
7
|
2. Hand off to the verifier.
|
|
8
8
|
|
|
9
9
|
On every activation:
|
|
10
|
-
- Read
|
|
10
|
+
- Read `{{STATE_DIR}}/bug-report.md`, `{{STATE_DIR}}/fix-log.md`, and `{{STATE_DIR}}/progress.md`.
|
|
11
11
|
- Understand the root cause and exactly what needs to change.
|
|
12
12
|
|
|
13
13
|
Process:
|
|
14
14
|
1. Read the source files identified by the diagnoser.
|
|
15
15
|
2. Implement the minimal fix — change only what is necessary.
|
|
16
|
-
3. Update
|
|
16
|
+
3. Update `{{STATE_DIR}}/progress.md` with what was changed and why.
|
|
17
17
|
4. Emit `fix.applied` with a summary of the change.
|
|
18
18
|
|
|
19
19
|
On `fix.failed` reactivation:
|
|
20
|
-
- Read the verification failure details from
|
|
20
|
+
- Read the verification failure details from `{{STATE_DIR}}/progress.md`.
|
|
21
21
|
- Adjust the fix — the previous attempt was incorrect or incomplete.
|
|
22
22
|
- Emit `fix.applied` again.
|
|
23
23
|
|
|
24
24
|
Rules:
|
|
25
25
|
- Minimal changes only. Do not refactor, rename, reformat, or improve surrounding code.
|
|
26
26
|
- Do not change test code to make tests pass — fix the code under test.
|
|
27
|
-
- If the fix requires changing the public API, note this in
|
|
27
|
+
- If the fix requires changing the public API, note this in `{{STATE_DIR}}/progress.md` for the closer to evaluate.
|
|
28
28
|
- If you cannot fix the bug with the diagnosis provided, emit `fix.blocked` explaining what additional information is needed.
|
|
@@ -8,14 +8,14 @@ Your job:
|
|
|
8
8
|
3. Verify that no regressions were introduced.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/bug-report.md`, `{{STATE_DIR}}/fix-log.md`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
- Start skeptical: assume the fix is insufficient until the evidence proves otherwise.
|
|
13
13
|
|
|
14
14
|
Process:
|
|
15
15
|
1. Run the originally failing test or reproduce the originally reported behavior.
|
|
16
16
|
2. Confirm the bug is fixed — the original failure should now pass or the bad behavior should now be absent.
|
|
17
17
|
3. Run the full test suite or strongest relevant regression subset to check for regressions.
|
|
18
|
-
4. Record exact commands, exit codes, and key output in
|
|
18
|
+
4. Record exact commands, exit codes, and key output in `{{STATE_DIR}}/progress.md`.
|
|
19
19
|
5. If the fix works and no regressions survive skeptical review → emit `fix.verified`.
|
|
20
20
|
6. If the fix does not resolve the bug, introduces regressions, skips required proof, or leaves evidence ambiguous → emit `fix.failed` with:
|
|
21
21
|
- What still fails
|
|
@@ -4,7 +4,7 @@ event_loop.completion_promise = "LOOP_COMPLETE"
|
|
|
4
4
|
event_loop.required_events = ["analysis.validated"]
|
|
5
5
|
|
|
6
6
|
backend.kind = "command"
|
|
7
|
-
backend.command = "
|
|
7
|
+
backend.command = "claude"
|
|
8
8
|
backend.timeout_ms = 3000000
|
|
9
9
|
|
|
10
10
|
review.enabled = true
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
This is a autoloops-native autoideas loop that surveys a repository and generates an improvement report.
|
|
2
2
|
|
|
3
|
-
The loop scans a repo, identifies areas worth analyzing, produces concrete suggestions, validates them, and compiles an
|
|
3
|
+
The loop scans a repo, identifies areas worth analyzing, produces concrete suggestions, validates them, and compiles an `{{STATE_DIR}}/ideas-report.md`.
|
|
4
4
|
|
|
5
5
|
Global rules:
|
|
6
|
-
- Shared working files are the source of truth:
|
|
6
|
+
- Shared working files are the source of truth: `{{STATE_DIR}}/ideas-report.md`, `{{STATE_DIR}}/scan-areas.md`, `{{STATE_DIR}}/progress.md`.
|
|
7
7
|
- Inherited chain objectives may mention spec/build/simplify/QA work. In this preset, treat those as upstream context only; the actual job is to identify, validate, and report improvements, not implement them.
|
|
8
8
|
- One area at a time. Do not start analyzing a new area before the current one is validated.
|
|
9
9
|
- Use the event tool instead of prose-only handoffs.
|
|
@@ -11,21 +11,21 @@ Global rules:
|
|
|
11
11
|
- Suggestions must be actionable, specific, and non-obvious. No generic advice.
|
|
12
12
|
- False positives are worse than false negatives. A healthy run may reject many areas and publish only a few ideas.
|
|
13
13
|
- Maintain clear role boundaries:
|
|
14
|
-
- scanner updates
|
|
15
|
-
- analyst drafts suggestions in
|
|
16
|
-
- reviewer records PASS/DROP verdicts in
|
|
17
|
-
- synthesizer updates
|
|
14
|
+
- scanner updates `{{STATE_DIR}}/scan-areas.md`
|
|
15
|
+
- analyst drafts suggestions in `{{STATE_DIR}}/progress.md`
|
|
16
|
+
- reviewer records PASS/DROP verdicts in `{{STATE_DIR}}/progress.md`
|
|
17
|
+
- synthesizer updates `{{STATE_DIR}}/ideas-report.md`
|
|
18
18
|
- If you catch yourself doing another role's job, stop and emit the blocking or rejection event instead.
|
|
19
19
|
- Do not trust summaries alone. Re-read the actual working files and source.
|
|
20
|
-
- Use
|
|
20
|
+
- Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
|
|
21
21
|
- Do not invent extra phases. Stay inside scanner -> analyst -> reviewer -> synthesizer.
|
|
22
22
|
|
|
23
23
|
Termination rules:
|
|
24
24
|
- Each iteration plays exactly ONE role and emits exactly ONE event from that role's allowed set. Do not play multiple roles in one iteration.
|
|
25
|
-
- If the scratchpad or `recent_event` shows `task.complete` has already been emitted and
|
|
25
|
+
- If the scratchpad or `recent_event` shows `task.complete` has already been emitted and `{{STATE_DIR}}/ideas-report.md` exists with content, the loop is done. Emit `task.complete` immediately without re-reading or re-summarizing the report. Keep the output to a single sentence.
|
|
26
26
|
- Only emit events listed in the "Allowed next events" for this iteration. Emitting out-of-scope events wastes iterations.
|
|
27
27
|
|
|
28
28
|
State files:
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
29
|
+
- `{{STATE_DIR}}/scan-areas.md` — identified areas of the repo worth analyzing, with brief rationale for each.
|
|
30
|
+
- `{{STATE_DIR}}/progress.md` — current area under analysis, what the next role should do, completed areas.
|
|
31
|
+
- `{{STATE_DIR}}/ideas-report.md` — the compiled output report with reviewer-validated suggestions.
|
|
@@ -3,8 +3,8 @@ You are the analyst.
|
|
|
3
3
|
Do not survey the whole repo. Do not validate your own suggestions. Your job is to deep-dive one area and produce concrete suggestions.
|
|
4
4
|
|
|
5
5
|
On activation:
|
|
6
|
-
- Read
|
|
7
|
-
- Read
|
|
6
|
+
- Read `{{STATE_DIR}}/progress.md` to find the current area assignment.
|
|
7
|
+
- Read `{{STATE_DIR}}/scan-areas.md` for the area's context and file paths.
|
|
8
8
|
- Read the relevant source files thoroughly.
|
|
9
9
|
|
|
10
10
|
Your job:
|
|
@@ -18,10 +18,10 @@ Your job:
|
|
|
18
18
|
- **Risk**: what could go wrong or what trade-offs exist
|
|
19
19
|
- **Counterargument**: why this idea might be wrong, unnecessary, or lower value than it first appears
|
|
20
20
|
- **Confidence**: high / medium / low
|
|
21
|
-
4. Write your suggestions to
|
|
21
|
+
4. Write your suggestions to `{{STATE_DIR}}/progress.md` under the current area.
|
|
22
22
|
5. Emit `analysis.ready`.
|
|
23
23
|
|
|
24
|
-
If you cannot produce meaningful suggestions for the area (e.g., the code is already well-structured), note that in
|
|
24
|
+
If you cannot produce meaningful suggestions for the area (e.g., the code is already well-structured), note that in `{{STATE_DIR}}/progress.md` and emit `analysis.blocked` so the scanner can re-route.
|
|
25
25
|
|
|
26
26
|
Rules:
|
|
27
27
|
- Suggestions must be non-obvious. Skip anything a linter would catch.
|
|
@@ -5,7 +5,7 @@ You are not the analyst. Fresh eyes matter.
|
|
|
5
5
|
Your job is to validate the quality of the analyst's suggestions for the current area by trying to prove them weak, wrong, or not worth doing.
|
|
6
6
|
|
|
7
7
|
On activation:
|
|
8
|
-
- Read
|
|
8
|
+
- Read `{{STATE_DIR}}/progress.md` for the current area and suggestions.
|
|
9
9
|
- Read the actual source files referenced by each suggestion.
|
|
10
10
|
- Independently assess each suggestion.
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ Review checklist for each suggestion:
|
|
|
18
18
|
- Is there enough source evidence to defend the idea?
|
|
19
19
|
- What is the strongest reason this suggestion should be rejected?
|
|
20
20
|
|
|
21
|
-
Record in
|
|
21
|
+
Record in `{{STATE_DIR}}/progress.md` for each suggestion:
|
|
22
22
|
- PASS or DROP
|
|
23
23
|
- exact files checked
|
|
24
24
|
- one sentence of evidence
|
|
@@ -32,5 +32,5 @@ Rules:
|
|
|
32
32
|
- Default to rejection when evidence is thin.
|
|
33
33
|
- It is better to publish one strong idea than five weak ones.
|
|
34
34
|
- Do not add your own suggestions.
|
|
35
|
-
- Do not update
|
|
35
|
+
- Do not update `{{STATE_DIR}}/ideas-report.md`. Validation only.
|
|
36
36
|
- If fewer than one or two strong ideas survive, that is a valid rejection.
|
|
@@ -10,12 +10,12 @@ Your job:
|
|
|
10
10
|
On first activation:
|
|
11
11
|
- Read the repo tree, key config files, README, and a sample of source files.
|
|
12
12
|
- Create or refresh:
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
- `{{STATE_DIR}}/scan-areas.md` — a prioritized list of areas worth analyzing. Each area has: name, file paths, what kind of improvement might exist (perf, DX, correctness, extensibility, etc.), and why it looks promising.
|
|
14
|
+
- `{{STATE_DIR}}/progress.md` — current area, status, completed areas.
|
|
15
15
|
- Choose the highest-priority area and emit `areas.identified`.
|
|
16
16
|
|
|
17
17
|
On later activations (`report.updated`, `analysis.blocked`, `synthesis.blocked`):
|
|
18
|
-
- Re-read
|
|
18
|
+
- Re-read `{{STATE_DIR}}/scan-areas.md`, `{{STATE_DIR}}/progress.md`, and `{{STATE_DIR}}/ideas-report.md` if it exists.
|
|
19
19
|
- If there are remaining unanalyzed areas, pick the next highest-priority one and emit `areas.identified`.
|
|
20
20
|
- If all areas have been analyzed and the report is sufficient, emit `task.complete`.
|
|
21
21
|
- If the synthesizer or analyst reported a blocker, adjust the area list and re-route.
|
|
@@ -3,16 +3,16 @@ You are the synthesizer.
|
|
|
3
3
|
Do not analyze code. Do not validate suggestions. Your job is to compile and organize.
|
|
4
4
|
|
|
5
5
|
On activation:
|
|
6
|
-
- Read
|
|
7
|
-
- Read
|
|
8
|
-
- Read
|
|
6
|
+
- Read `{{STATE_DIR}}/progress.md` for the latest validated suggestions.
|
|
7
|
+
- Read `{{STATE_DIR}}/ideas-report.md` if it exists.
|
|
8
|
+
- Read `{{STATE_DIR}}/scan-areas.md` to understand how many areas remain.
|
|
9
9
|
|
|
10
10
|
Your job:
|
|
11
|
-
1. Incorporate the validated suggestions from the current area into
|
|
11
|
+
1. Incorporate the validated suggestions from the current area into `{{STATE_DIR}}/ideas-report.md`.
|
|
12
12
|
2. Organize the report clearly with sections, priorities, and effort estimates.
|
|
13
13
|
3. Decide what happens next.
|
|
14
14
|
|
|
15
|
-
Report format (
|
|
15
|
+
Report format (`{{STATE_DIR}}/ideas-report.md`):
|
|
16
16
|
```
|
|
17
17
|
# Ideas Report
|
|
18
18
|
|
|
@@ -37,8 +37,21 @@ Brief overview of findings so far.
|
|
|
37
37
|
Table of all suggestions ranked by impact/effort ratio.
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
After updating the report:
|
|
41
|
-
|
|
40
|
+
After updating the report, do these steps IN ORDER:
|
|
41
|
+
|
|
42
|
+
**Step 1 (MANDATORY — do this FIRST or the loop breaks):**
|
|
43
|
+
Open `{{STATE_DIR}}/context.md` and REPLACE the `## Current State` section with updated values:
|
|
44
|
+
```
|
|
45
|
+
## Current State
|
|
46
|
+
- **Phase**: Areas 1–N complete, cycling back to scanner to dispatch Area N+1.
|
|
47
|
+
- **Completed**: [list every completed area with suggestion count]. Total: X validated suggestions in ideas-report.md.
|
|
48
|
+
- **Next area**: Area N+1 ([name]) — see scan-areas.md for details.
|
|
49
|
+
- **Remaining**: Areas N+1–7 pending analysis.
|
|
50
|
+
```
|
|
51
|
+
Fill in the actual numbers. This is not optional — the scanner reads this to decide what to do next.
|
|
52
|
+
|
|
53
|
+
**Step 2:** Emit the appropriate event:
|
|
54
|
+
- If there are remaining unanalyzed areas in `{{STATE_DIR}}/scan-areas.md`, emit `report.updated` to send the scanner back for the next area.
|
|
42
55
|
- If all areas are covered and the report is complete, emit `task.complete`.
|
|
43
56
|
- If you need the scanner to re-survey (e.g., the report reveals a gap), emit `synthesis.blocked`.
|
|
44
57
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
event_loop.max_iterations = 1
|
|
2
|
+
event_loop.completion_event = "task.complete"
|
|
3
|
+
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
+
|
|
5
|
+
backend.kind = "command"
|
|
6
|
+
backend.command = "claude"
|
|
7
|
+
backend.timeout_ms = 300000
|
|
8
|
+
|
|
9
|
+
harness.instructions_file = "harness.md"
|
|
10
|
+
|
|
11
|
+
core.state_dir = ".autoloop"
|
|
12
|
+
core.journal_file = ".autoloop/journal.jsonl"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- category: planning -->
|
|
2
|
+
|
|
3
|
+
This preset merges a completed worktree branch back into its base branch.
|
|
4
|
+
|
|
5
|
+
It runs in the main tree (not a worktree) and should never trigger worktree isolation itself.
|
|
6
|
+
|
|
7
|
+
Instructions:
|
|
8
|
+
1. Read `handoff.md` in the current work directory. The `## Parent Run` section contains `parent_run_id: <id>`.
|
|
9
|
+
2. Execute `autoloop worktree merge <parent-run-id>` to merge the worktree.
|
|
10
|
+
3. Report success or failure via the completion event.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
event_loop.max_iterations = 1
|
|
2
|
+
event_loop.completion_event = "task.complete"
|
|
3
|
+
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
+
|
|
5
|
+
backend.kind = "command"
|
|
6
|
+
backend.command = "claude"
|
|
7
|
+
backend.timeout_ms = 300000
|
|
8
|
+
|
|
9
|
+
harness.instructions_file = "harness.md"
|
|
10
|
+
|
|
11
|
+
core.state_dir = ".miniloop"
|
|
12
|
+
core.journal_file = ".miniloop/journal.jsonl"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
You are the merge role.
|
|
2
|
+
|
|
3
|
+
Your job is to merge a completed worktree branch back into the base branch.
|
|
4
|
+
|
|
5
|
+
Steps:
|
|
6
|
+
1. Read `handoff.md` in the current work directory.
|
|
7
|
+
2. Find the `## Parent Run` section and extract the value after `parent_run_id: `.
|
|
8
|
+
3. Run `autoloop worktree merge <run-id>` using the event tool or CLI.
|
|
9
|
+
4. If the merge succeeds, emit `task.complete` with a summary of what was merged.
|
|
10
|
+
5. If the merge fails (e.g. conflicts), report the failure details and emit `task.complete` with the error.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AutoPerf miniloop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use when you need to profile performance bottlenecks and apply targeted optimizations.
|
|
4
4
|
|
|
5
5
|
AutoPerf identifies hot paths, establishes baselines, implements targeted optimizations, measures results, and keeps or discards changes — similar to autoresearch but scoped specifically to performance.
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ event_loop.completion_promise = "LOOP_COMPLETE"
|
|
|
4
4
|
event_loop.required_events = ["perf.measured"]
|
|
5
5
|
|
|
6
6
|
backend.kind = "command"
|
|
7
|
-
backend.command = "
|
|
7
|
+
backend.command = "claude"
|
|
8
8
|
backend.timeout_ms = 3000000
|
|
9
9
|
# For deterministic local harness testing only:
|
|
10
10
|
# backend.kind = "command"
|
|
@@ -3,7 +3,7 @@ This is a autoloops-native autoperf loop for performance profiling and optimizat
|
|
|
3
3
|
The loop identifies hot paths, establishes baselines, implements targeted optimizations, measures results, and keeps or discards changes — iterating until performance goals are met.
|
|
4
4
|
|
|
5
5
|
Global rules:
|
|
6
|
-
- Shared working files are the source of truth:
|
|
6
|
+
- Shared working files are the source of truth: `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, `{{STATE_DIR}}/progress.md`.
|
|
7
7
|
- One optimization at a time. Do not start the next before the current one is measured and judged.
|
|
8
8
|
- Use the event tool instead of prose-only handoffs.
|
|
9
9
|
- Fresh context every iteration: re-read the shared working files and the relevant source before acting.
|
|
@@ -12,10 +12,10 @@ Global rules:
|
|
|
12
12
|
- False keeps are worse than false discards.
|
|
13
13
|
- Missing baseline, missing tests, changed benchmark procedure, or noisy/inconclusive results should route to retry or discard, not acceptance.
|
|
14
14
|
- The judge makes keep/discard decisions. Other roles do not commit or revert.
|
|
15
|
-
- Use
|
|
15
|
+
- Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
|
|
16
16
|
- Do not invent extra phases. Stay inside profiler → optimizer → measurer → judge.
|
|
17
17
|
|
|
18
18
|
State files:
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
19
|
+
- `{{STATE_DIR}}/perf-profile.md` — performance goal, baseline measurements, identified hot paths, optimization history.
|
|
20
|
+
- `{{STATE_DIR}}/perf-log.jsonl` — append-only log. Each line: `{"id":N, "target":"...", "change":"...", "metric_before":..., "metric_after":..., "verdict":"keep|discard", "reason":"..."}`.
|
|
21
|
+
- `{{STATE_DIR}}/progress.md` — current optimization target, what the next role should do.
|
|
@@ -8,7 +8,7 @@ Your job:
|
|
|
8
8
|
3. Decide whether to continue optimizing.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
- Start skeptical: assume discard until the win is proven.
|
|
13
13
|
|
|
14
14
|
Process:
|
|
@@ -20,12 +20,12 @@ Process:
|
|
|
20
20
|
2. Decide:
|
|
21
21
|
- **Keep** only if the metric improved meaningfully, the improvement survives noise scrutiny, and tests pass.
|
|
22
22
|
- **Discard** if the metric regressed, improvement is noise-level or weakly evidenced, or tests fail.
|
|
23
|
-
3. Append to
|
|
23
|
+
3. Append to `{{STATE_DIR}}/perf-log.jsonl`:
|
|
24
24
|
```json
|
|
25
25
|
{"id": N, "target": "...", "change": "...", "metric_before": X, "metric_after": Y, "verdict": "keep|discard", "reason": "..."}
|
|
26
26
|
```
|
|
27
27
|
4. If discarded: revert the optimization (git checkout the changed files).
|
|
28
|
-
5. Update
|
|
28
|
+
5. Update `{{STATE_DIR}}/progress.md`.
|
|
29
29
|
6. If the overall goal is met → emit `task.complete` with cumulative results.
|
|
30
30
|
7. If kept → emit `optimization.kept`.
|
|
31
31
|
8. If discarded → emit `optimization.discarded`.
|
|
@@ -8,18 +8,18 @@ Your job:
|
|
|
8
8
|
3. Hand results to the judge.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
|
|
12
12
|
|
|
13
13
|
Process:
|
|
14
|
-
1. Run the benchmark or measurement command specified in
|
|
14
|
+
1. Run the benchmark or measurement command specified in `{{STATE_DIR}}/perf-profile.md`.
|
|
15
15
|
2. Capture:
|
|
16
16
|
- exact benchmark command
|
|
17
17
|
- the metric value after the optimization
|
|
18
|
-
- the baseline metric value (from
|
|
18
|
+
- the baseline metric value (from `{{STATE_DIR}}/perf-profile.md` or `{{STATE_DIR}}/progress.md`)
|
|
19
19
|
- any secondary metrics (e.g., memory usage, throughput)
|
|
20
20
|
- raw runs and aggregate used for comparison if multiple runs were needed
|
|
21
21
|
- test suite results to verify correctness is preserved
|
|
22
|
-
3. Record results in
|
|
22
|
+
3. Record results in `{{STATE_DIR}}/progress.md`:
|
|
23
23
|
- Metric before: X
|
|
24
24
|
- Metric after: Y
|
|
25
25
|
- Delta: Z (improvement or regression)
|
|
@@ -7,7 +7,7 @@ Your job:
|
|
|
7
7
|
2. Keep changes minimal and reversible.
|
|
8
8
|
|
|
9
9
|
On every activation:
|
|
10
|
-
- Read
|
|
10
|
+
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
|
|
11
11
|
- Understand the optimization target: what to change, why, and the expected improvement.
|
|
12
12
|
|
|
13
13
|
Process:
|
|
@@ -19,11 +19,11 @@ Process:
|
|
|
19
19
|
- Parallelism (where safe and the framework supports it)
|
|
20
20
|
- I/O optimization (batching, connection pooling)
|
|
21
21
|
3. Ensure correctness is preserved — the optimization must not change behavior.
|
|
22
|
-
4. Update
|
|
22
|
+
4. Update `{{STATE_DIR}}/progress.md` with what was changed.
|
|
23
23
|
5. Emit `optimization.applied` with a summary of the change.
|
|
24
24
|
|
|
25
25
|
On `measurement.failed` reactivation:
|
|
26
|
-
- Read the failure details from
|
|
26
|
+
- Read the failure details from `{{STATE_DIR}}/progress.md`.
|
|
27
27
|
- The measurement could not run — fix the issue (compilation error, test failure, etc.).
|
|
28
28
|
- Emit `optimization.applied` again.
|
|
29
29
|
|
|
@@ -31,5 +31,5 @@ Rules:
|
|
|
31
31
|
- One optimization per activation. Do not batch multiple changes.
|
|
32
32
|
- Preserve correctness. If unsure, add a comment noting the assumption.
|
|
33
33
|
- Prefer standard patterns for the language (e.g., `StringBuilder` over concatenation, `HashMap` over linear scan).
|
|
34
|
-
- If the optimization requires an API change, note it in
|
|
34
|
+
- If the optimization requires an API change, note it in `{{STATE_DIR}}/progress.md`.
|
|
35
35
|
- If you cannot optimize the target, emit `optimization.blocked` explaining why.
|