@mobrienv/autoloop 0.3.0 → 0.7.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 +140 -43
- package/bin/autoloop +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/testing/mock-backend.js +3 -5
- package/dist/testing/mock-backend.js.map +1 -1
- package/package.json +32 -10
- package/plugins/autoloop/.claude-plugin/plugin.json +1 -1
- package/dist/agent-map.d.ts +0 -10
- package/dist/agent-map.js +0 -58
- package/dist/agent-map.js.map +0 -1
- package/dist/backend/acp-client.d.ts +0 -38
- package/dist/backend/acp-client.js +0 -288
- package/dist/backend/acp-client.js.map +0 -1
- package/dist/backend/index.d.ts +0 -10
- package/dist/backend/index.js +0 -71
- package/dist/backend/index.js.map +0 -1
- package/dist/backend/kiro-bridge.d.ts +0 -17
- package/dist/backend/kiro-bridge.js +0 -84
- package/dist/backend/kiro-bridge.js.map +0 -1
- package/dist/backend/kiro-worker.d.ts +0 -1
- package/dist/backend/kiro-worker.js +0 -92
- package/dist/backend/kiro-worker.js.map +0 -1
- package/dist/backend/run-command.d.ts +0 -7
- package/dist/backend/run-command.js +0 -50
- package/dist/backend/run-command.js.map +0 -1
- package/dist/backend/run-kiro.d.ts +0 -3
- package/dist/backend/run-kiro.js +0 -16
- package/dist/backend/run-kiro.js.map +0 -1
- package/dist/backend/run-mock.d.ts +0 -1
- package/dist/backend/run-mock.js +0 -6
- package/dist/backend/run-mock.js.map +0 -1
- package/dist/backend/run-pi.d.ts +0 -5
- package/dist/backend/run-pi.js +0 -5
- package/dist/backend/run-pi.js.map +0 -1
- package/dist/backend/types.d.ts +0 -21
- package/dist/backend/types.js +0 -2
- package/dist/backend/types.js.map +0 -1
- package/dist/chains/budget.d.ts +0 -7
- package/dist/chains/budget.js +0 -54
- package/dist/chains/budget.js.map +0 -1
- package/dist/chains/load.d.ts +0 -18
- package/dist/chains/load.js +0 -129
- package/dist/chains/load.js.map +0 -1
- package/dist/chains/render.d.ts +0 -2
- package/dist/chains/render.js +0 -74
- package/dist/chains/render.js.map +0 -1
- package/dist/chains/run.d.ts +0 -17
- package/dist/chains/run.js +0 -260
- package/dist/chains/run.js.map +0 -1
- package/dist/chains/types.d.ts +0 -38
- package/dist/chains/types.js +0 -2
- package/dist/chains/types.js.map +0 -1
- package/dist/chains.d.ts +0 -6
- package/dist/chains.js +0 -5
- package/dist/chains.js.map +0 -1
- package/dist/commands/chain.d.ts +0 -1
- package/dist/commands/chain.js +0 -53
- package/dist/commands/chain.js.map +0 -1
- package/dist/commands/config.d.ts +0 -1
- package/dist/commands/config.js +0 -74
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -1
- package/dist/commands/dashboard.js +0 -68
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/guide.d.ts +0 -1
- package/dist/commands/guide.js +0 -33
- package/dist/commands/guide.js.map +0 -1
- package/dist/commands/inspect.d.ts +0 -1
- package/dist/commands/inspect.js +0 -203
- package/dist/commands/inspect.js.map +0 -1
- package/dist/commands/list.d.ts +0 -1
- package/dist/commands/list.js +0 -15
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/loops.d.ts +0 -1
- package/dist/commands/loops.js +0 -72
- package/dist/commands/loops.js.map +0 -1
- package/dist/commands/memory.d.ts +0 -1
- package/dist/commands/memory.js +0 -65
- package/dist/commands/memory.js.map +0 -1
- package/dist/commands/pi-adapter.d.ts +0 -1
- package/dist/commands/pi-adapter.js +0 -6
- package/dist/commands/pi-adapter.js.map +0 -1
- package/dist/commands/run.d.ts +0 -1
- package/dist/commands/run.js +0 -292
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/runs.d.ts +0 -1
- package/dist/commands/runs.js +0 -50
- package/dist/commands/runs.js.map +0 -1
- package/dist/commands/task.d.ts +0 -1
- package/dist/commands/task.js +0 -74
- package/dist/commands/task.js.map +0 -1
- package/dist/commands/worktree.d.ts +0 -1
- package/dist/commands/worktree.js +0 -162
- package/dist/commands/worktree.js.map +0 -1
- package/dist/config.d.ts +0 -31
- package/dist/config.js +0 -261
- package/dist/config.js.map +0 -1
- package/dist/dashboard/app.d.ts +0 -12
- package/dist/dashboard/app.js +0 -23
- package/dist/dashboard/app.js.map +0 -1
- package/dist/dashboard/routes/api.d.ts +0 -3
- package/dist/dashboard/routes/api.js +0 -130
- package/dist/dashboard/routes/api.js.map +0 -1
- package/dist/dashboard/routes/pages.d.ts +0 -2
- package/dist/dashboard/routes/pages.js +0 -14
- package/dist/dashboard/routes/pages.js.map +0 -1
- package/dist/dashboard/views/alpine-vendor.d.ts +0 -1
- package/dist/dashboard/views/alpine-vendor.js +0 -10
- package/dist/dashboard/views/alpine-vendor.js.map +0 -1
- package/dist/dashboard/views/shell.d.ts +0 -1
- package/dist/dashboard/views/shell.js +0 -746
- package/dist/dashboard/views/shell.js.map +0 -1
- package/dist/events/decode.d.ts +0 -2
- package/dist/events/decode.js +0 -45
- package/dist/events/decode.js.map +0 -1
- package/dist/events/encode.d.ts +0 -2
- package/dist/events/encode.js +0 -33
- package/dist/events/encode.js.map +0 -1
- package/dist/events/guards.d.ts +0 -5
- package/dist/events/guards.js +0 -42
- package/dist/events/guards.js.map +0 -1
- package/dist/events/types.d.ts +0 -26
- package/dist/events/types.js +0 -2
- package/dist/events/types.js.map +0 -1
- package/dist/harness/config-helpers.d.ts +0 -35
- package/dist/harness/config-helpers.js +0 -411
- package/dist/harness/config-helpers.js.map +0 -1
- package/dist/harness/coordination.d.ts +0 -1
- package/dist/harness/coordination.js +0 -127
- package/dist/harness/coordination.js.map +0 -1
- package/dist/harness/display.d.ts +0 -21
- package/dist/harness/display.js +0 -176
- package/dist/harness/display.js.map +0 -1
- package/dist/harness/emit.d.ts +0 -15
- package/dist/harness/emit.js +0 -240
- package/dist/harness/emit.js.map +0 -1
- package/dist/harness/index.d.ts +0 -13
- package/dist/harness/index.js +0 -240
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/iteration.d.ts +0 -16
- package/dist/harness/iteration.js +0 -131
- package/dist/harness/iteration.js.map +0 -1
- package/dist/harness/journal.d.ts +0 -31
- package/dist/harness/journal.js +0 -178
- package/dist/harness/journal.js.map +0 -1
- package/dist/harness/metareview.d.ts +0 -4
- package/dist/harness/metareview.js +0 -48
- package/dist/harness/metareview.js.map +0 -1
- package/dist/harness/metrics.d.ts +0 -12
- package/dist/harness/metrics.js +0 -180
- package/dist/harness/metrics.js.map +0 -1
- package/dist/harness/parallel.d.ts +0 -37
- package/dist/harness/parallel.js +0 -237
- package/dist/harness/parallel.js.map +0 -1
- package/dist/harness/prompt.d.ts +0 -46
- package/dist/harness/prompt.js +0 -403
- package/dist/harness/prompt.js.map +0 -1
- package/dist/harness/scratchpad.d.ts +0 -2
- package/dist/harness/scratchpad.js +0 -67
- package/dist/harness/scratchpad.js.map +0 -1
- package/dist/harness/stop.d.ts +0 -5
- package/dist/harness/stop.js +0 -70
- package/dist/harness/stop.js.map +0 -1
- package/dist/harness/tools.d.ts +0 -3
- package/dist/harness/tools.js +0 -65
- package/dist/harness/tools.js.map +0 -1
- package/dist/harness/types.d.ts +0 -110
- package/dist/harness/types.js +0 -2
- package/dist/harness/types.js.map +0 -1
- package/dist/harness/wave/finalize-wave.d.ts +0 -9
- package/dist/harness/wave/finalize-wave.js +0 -87
- package/dist/harness/wave/finalize-wave.js.map +0 -1
- package/dist/harness/wave/launch-branches.d.ts +0 -6
- package/dist/harness/wave/launch-branches.js +0 -314
- package/dist/harness/wave/launch-branches.js.map +0 -1
- package/dist/harness/wave/parse-objectives.d.ts +0 -3
- package/dist/harness/wave/parse-objectives.js +0 -32
- package/dist/harness/wave/parse-objectives.js.map +0 -1
- package/dist/harness/wave/types.d.ts +0 -43
- package/dist/harness/wave/types.js +0 -2
- package/dist/harness/wave/types.js.map +0 -1
- package/dist/harness/wave.d.ts +0 -6
- package/dist/harness/wave.js +0 -159
- package/dist/harness/wave.js.map +0 -1
- package/dist/isolation/index.d.ts +0 -4
- package/dist/isolation/index.js +0 -3
- package/dist/isolation/index.js.map +0 -1
- package/dist/isolation/resolve.d.ts +0 -39
- package/dist/isolation/resolve.js +0 -118
- package/dist/isolation/resolve.js.map +0 -1
- package/dist/isolation/run-scope.d.ts +0 -21
- package/dist/isolation/run-scope.js +0 -50
- package/dist/isolation/run-scope.js.map +0 -1
- package/dist/json.d.ts +0 -8
- package/dist/json.js +0 -82
- package/dist/json.js.map +0 -1
- package/dist/loops/health.d.ts +0 -16
- package/dist/loops/health.js +0 -152
- package/dist/loops/health.js.map +0 -1
- package/dist/loops/list.d.ts +0 -6
- package/dist/loops/list.js +0 -21
- package/dist/loops/list.js.map +0 -1
- package/dist/loops/policy.d.ts +0 -6
- package/dist/loops/policy.js +0 -41
- package/dist/loops/policy.js.map +0 -1
- package/dist/loops/render.d.ts +0 -19
- package/dist/loops/render.js +0 -100
- package/dist/loops/render.js.map +0 -1
- package/dist/loops/show.d.ts +0 -8
- package/dist/loops/show.js +0 -31
- package/dist/loops/show.js.map +0 -1
- package/dist/loops/watch.d.ts +0 -14
- package/dist/loops/watch.js +0 -143
- package/dist/loops/watch.js.map +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -148
- package/dist/main.js.map +0 -1
- package/dist/markdown.d.ts +0 -10
- package/dist/markdown.js +0 -66
- package/dist/markdown.js.map +0 -1
- package/dist/memory-render.d.ts +0 -6
- package/dist/memory-render.js +0 -81
- package/dist/memory-render.js.map +0 -1
- package/dist/memory.d.ts +0 -22
- package/dist/memory.js +0 -318
- package/dist/memory.js.map +0 -1
- package/dist/pi-adapter.d.ts +0 -1
- package/dist/pi-adapter.js +0 -220
- package/dist/pi-adapter.js.map +0 -1
- package/dist/profiles.d.ts +0 -12
- package/dist/profiles.js +0 -71
- package/dist/profiles.js.map +0 -1
- package/dist/registry/derive.d.ts +0 -8
- package/dist/registry/derive.js +0 -88
- package/dist/registry/derive.js.map +0 -1
- package/dist/registry/discover.d.ts +0 -20
- package/dist/registry/discover.js +0 -98
- package/dist/registry/discover.js.map +0 -1
- package/dist/registry/harness.d.ts +0 -7
- package/dist/registry/harness.js +0 -63
- package/dist/registry/harness.js.map +0 -1
- package/dist/registry/index.d.ts +0 -6
- package/dist/registry/index.js +0 -6
- package/dist/registry/index.js.map +0 -1
- package/dist/registry/read.d.ts +0 -11
- package/dist/registry/read.js +0 -50
- package/dist/registry/read.js.map +0 -1
- package/dist/registry/rebuild.d.ts +0 -5
- package/dist/registry/rebuild.js +0 -22
- package/dist/registry/rebuild.js.map +0 -1
- package/dist/registry/types.d.ts +0 -28
- package/dist/registry/types.js +0 -2
- package/dist/registry/types.js.map +0 -1
- package/dist/registry/update.d.ts +0 -2
- package/dist/registry/update.js +0 -7
- package/dist/registry/update.js.map +0 -1
- package/dist/tasks-render.d.ts +0 -2
- package/dist/tasks-render.js +0 -44
- package/dist/tasks-render.js.map +0 -1
- package/dist/tasks.d.ts +0 -24
- package/dist/tasks.js +0 -184
- package/dist/tasks.js.map +0 -1
- package/dist/topology.d.ts +0 -31
- package/dist/topology.js +0 -309
- package/dist/topology.js.map +0 -1
- package/dist/usage.d.ts +0 -9
- package/dist/usage.js +0 -159
- package/dist/usage.js.map +0 -1
- package/dist/utils.d.ts +0 -21
- package/dist/utils.js +0 -349
- package/dist/utils.js.map +0 -1
- package/dist/worktree/clean.d.ts +0 -12
- package/dist/worktree/clean.js +0 -98
- package/dist/worktree/clean.js.map +0 -1
- package/dist/worktree/create.d.ts +0 -14
- package/dist/worktree/create.js +0 -71
- package/dist/worktree/create.js.map +0 -1
- package/dist/worktree/index.d.ts +0 -10
- package/dist/worktree/index.js +0 -6
- package/dist/worktree/index.js.map +0 -1
- package/dist/worktree/list.d.ts +0 -9
- package/dist/worktree/list.js +0 -24
- package/dist/worktree/list.js.map +0 -1
- package/dist/worktree/merge.d.ts +0 -11
- package/dist/worktree/merge.js +0 -129
- package/dist/worktree/merge.js.map +0 -1
- package/dist/worktree/meta.d.ts +0 -17
- package/dist/worktree/meta.js +0 -34
- package/dist/worktree/meta.js.map +0 -1
- package/presets/autocode/README.md +0 -81
- package/presets/autocode/autoloops.toml +0 -30
- package/presets/autocode/harness.md +0 -26
- package/presets/autocode/miniloops.toml +0 -22
- package/presets/autocode/roles/build.md +0 -34
- package/presets/autocode/roles/critic.md +0 -40
- package/presets/autocode/roles/finalizer.md +0 -43
- package/presets/autocode/roles/planner.md +0 -40
- package/presets/autocode/topology.toml +0 -32
- package/presets/autodoc/README.md +0 -42
- package/presets/autodoc/autoloops.toml +0 -21
- package/presets/autodoc/harness.md +0 -19
- package/presets/autodoc/miniloops.toml +0 -21
- package/presets/autodoc/roles/auditor.md +0 -39
- package/presets/autodoc/roles/checker.md +0 -43
- package/presets/autodoc/roles/publisher.md +0 -51
- package/presets/autodoc/roles/writer.md +0 -37
- package/presets/autodoc/topology.toml +0 -31
- package/presets/autofix/README.md +0 -56
- package/presets/autofix/autoloops.toml +0 -24
- package/presets/autofix/harness.md +0 -25
- package/presets/autofix/miniloops.toml +0 -21
- package/presets/autofix/roles/closer.md +0 -48
- package/presets/autofix/roles/diagnoser.md +0 -43
- package/presets/autofix/roles/fixer.md +0 -28
- package/presets/autofix/roles/verifier.md +0 -31
- package/presets/autofix/topology.toml +0 -33
- package/presets/autoideas/README.md +0 -73
- package/presets/autoideas/autoloops.toml +0 -18
- package/presets/autoideas/harness.md +0 -31
- package/presets/autoideas/miniloops.toml +0 -18
- package/presets/autoideas/roles/analyst.md +0 -32
- package/presets/autoideas/roles/reviewer.md +0 -36
- package/presets/autoideas/roles/scanner.md +0 -26
- package/presets/autoideas/roles/synthesizer.md +0 -61
- package/presets/autoideas/topology.toml +0 -32
- package/presets/automerge/README.md +0 -3
- package/presets/automerge/autoloops.toml +0 -12
- package/presets/automerge/harness.md +0 -10
- package/presets/automerge/miniloops.toml +0 -12
- package/presets/automerge/roles/merge.md +0 -10
- package/presets/automerge/topology.toml +0 -10
- package/presets/autoperf/README.md +0 -56
- package/presets/autoperf/autoloops.toml +0 -21
- package/presets/autoperf/harness.md +0 -21
- package/presets/autoperf/miniloops.toml +0 -21
- package/presets/autoperf/roles/judge.md +0 -38
- package/presets/autoperf/roles/measurer.md +0 -36
- package/presets/autoperf/roles/optimizer.md +0 -35
- package/presets/autoperf/roles/profiler.md +0 -38
- package/presets/autoperf/topology.toml +0 -32
- package/presets/autopr/README.md +0 -99
- package/presets/autopr/autoloops.toml +0 -22
- package/presets/autopr/harness.md +0 -27
- package/presets/autopr/miniloops.toml +0 -22
- package/presets/autopr/roles/collector.md +0 -55
- package/presets/autopr/roles/drafter.md +0 -38
- package/presets/autopr/roles/publisher.md +0 -28
- package/presets/autopr/roles/validator.md +0 -31
- package/presets/autopr/topology.toml +0 -32
- package/presets/autoqa/README.md +0 -76
- package/presets/autoqa/autoloops.toml +0 -21
- package/presets/autoqa/harness.md +0 -30
- package/presets/autoqa/miniloops.toml +0 -21
- package/presets/autoqa/roles/executor.md +0 -43
- package/presets/autoqa/roles/inspector.md +0 -45
- package/presets/autoqa/roles/planner.md +0 -55
- package/presets/autoqa/roles/reporter.md +0 -74
- package/presets/autoqa/topology.toml +0 -31
- package/presets/autoresearch/README.md +0 -63
- package/presets/autoresearch/autoloops.toml +0 -18
- package/presets/autoresearch/harness.md +0 -28
- package/presets/autoresearch/miniloops.toml +0 -18
- package/presets/autoresearch/roles/benchmarker.md +0 -34
- package/presets/autoresearch/roles/evaluator.md +0 -33
- package/presets/autoresearch/roles/implementer.md +0 -26
- package/presets/autoresearch/roles/strategist.md +0 -43
- package/presets/autoresearch/topology.toml +0 -31
- package/presets/autoreview/README.md +0 -51
- package/presets/autoreview/autoloops.toml +0 -21
- package/presets/autoreview/harness.md +0 -20
- package/presets/autoreview/miniloops.toml +0 -21
- package/presets/autoreview/roles/checker.md +0 -36
- package/presets/autoreview/roles/reader.md +0 -33
- package/presets/autoreview/roles/suggester.md +0 -26
- package/presets/autoreview/roles/summarizer.md +0 -57
- package/presets/autoreview/topology.toml +0 -31
- package/presets/autosec/README.md +0 -51
- package/presets/autosec/autoloops.toml +0 -21
- package/presets/autosec/harness.md +0 -20
- package/presets/autosec/miniloops.toml +0 -21
- package/presets/autosec/roles/analyst.md +0 -38
- package/presets/autosec/roles/hardener.md +0 -36
- package/presets/autosec/roles/reporter.md +0 -63
- package/presets/autosec/roles/scanner.md +0 -38
- package/presets/autosec/topology.toml +0 -31
- package/presets/autosimplify/README.md +0 -83
- package/presets/autosimplify/autoloops.toml +0 -26
- package/presets/autosimplify/harness.md +0 -25
- package/presets/autosimplify/miniloops.toml +0 -22
- package/presets/autosimplify/roles/reviewer.md +0 -38
- package/presets/autosimplify/roles/scoper.md +0 -42
- package/presets/autosimplify/roles/simplifier.md +0 -51
- package/presets/autosimplify/roles/verifier.md +0 -40
- package/presets/autosimplify/topology.toml +0 -32
- package/presets/autospec/README.md +0 -84
- package/presets/autospec/autoloops.toml +0 -21
- package/presets/autospec/harness.md +0 -23
- package/presets/autospec/miniloops.toml +0 -21
- package/presets/autospec/roles/clarifier.md +0 -39
- package/presets/autospec/roles/critic.md +0 -41
- package/presets/autospec/roles/designer.md +0 -37
- package/presets/autospec/roles/planner.md +0 -38
- package/presets/autospec/roles/researcher.md +0 -33
- package/presets/autospec/topology.toml +0 -38
- package/presets/autotest/README.md +0 -55
- package/presets/autotest/autoloops.toml +0 -21
- package/presets/autotest/harness.md +0 -21
- package/presets/autotest/miniloops.toml +0 -21
- package/presets/autotest/roles/assessor.md +0 -57
- package/presets/autotest/roles/runner.md +0 -31
- package/presets/autotest/roles/surveyor.md +0 -39
- package/presets/autotest/roles/writer.md +0 -37
- package/presets/autotest/topology.toml +0 -32
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
This is a autoloops-native autoideas loop that surveys a repository and generates an improvement report.
|
|
2
|
-
|
|
3
|
-
The loop scans a repo, identifies areas worth analyzing, produces concrete suggestions, validates them, and compiles an `{{STATE_DIR}}/ideas-report.md`.
|
|
4
|
-
|
|
5
|
-
Global rules:
|
|
6
|
-
- Shared working files are the source of truth: `{{STATE_DIR}}/ideas-report.md`, `{{STATE_DIR}}/scan-areas.md`, `{{STATE_DIR}}/progress.md`.
|
|
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
|
-
- One area at a time. Do not start analyzing a new area before the current one is validated.
|
|
9
|
-
- Use the event tool instead of prose-only handoffs.
|
|
10
|
-
- Fresh context every iteration: re-read the shared working files and the relevant source before acting.
|
|
11
|
-
- Suggestions must be actionable, specific, and non-obvious. No generic advice.
|
|
12
|
-
- False positives are worse than false negatives. A healthy run may reject many areas and publish only a few ideas.
|
|
13
|
-
- Maintain clear role boundaries:
|
|
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
|
-
- If you catch yourself doing another role's job, stop and emit the blocking or rejection event instead.
|
|
19
|
-
- Do not trust summaries alone. Re-read the actual working files and source.
|
|
20
|
-
- Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
|
|
21
|
-
- Do not invent extra phases. Stay inside scanner -> analyst -> reviewer -> synthesizer.
|
|
22
|
-
|
|
23
|
-
Termination rules:
|
|
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 `{{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
|
-
- Only emit events listed in the "Allowed next events" for this iteration. Emitting out-of-scope events wastes iterations.
|
|
27
|
-
|
|
28
|
-
State files:
|
|
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.
|
|
@@ -1,18 +0,0 @@
|
|
|
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 = ["analysis.validated"]
|
|
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"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
You are the analyst.
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
On activation:
|
|
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
|
-
- Read the relevant source files thoroughly.
|
|
9
|
-
|
|
10
|
-
Your job:
|
|
11
|
-
1. Understand the current code in the assigned area.
|
|
12
|
-
2. Identify specific, actionable improvements.
|
|
13
|
-
3. For each suggestion, provide:
|
|
14
|
-
- **What**: a one-line summary of the change
|
|
15
|
-
- **Where**: exact file paths and approximate line ranges
|
|
16
|
-
- **Why**: the concrete benefit (not "better code" — quantify or specify)
|
|
17
|
-
- **How**: a brief sketch of the implementation approach
|
|
18
|
-
- **Risk**: what could go wrong or what trade-offs exist
|
|
19
|
-
- **Counterargument**: why this idea might be wrong, unnecessary, or lower value than it first appears
|
|
20
|
-
- **Confidence**: high / medium / low
|
|
21
|
-
4. Write your suggestions to `{{STATE_DIR}}/progress.md` under the current area.
|
|
22
|
-
5. Emit `analysis.ready`.
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
Rules:
|
|
27
|
-
- Suggestions must be non-obvious. Skip anything a linter would catch.
|
|
28
|
-
- Prefer suggestions that improve correctness, performance, or developer experience over cosmetic changes.
|
|
29
|
-
- 0-3 strong suggestions is better than padding with filler.
|
|
30
|
-
- Do not implement any changes. Analysis only.
|
|
31
|
-
- Do not make hand-wavy impact claims. If you cannot support the benefit from code evidence, say so.
|
|
32
|
-
- Give the reviewer something to attack, not something to rubber-stamp.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
You are the reviewer.
|
|
2
|
-
|
|
3
|
-
You are not the analyst. Fresh eyes matter.
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
On activation:
|
|
8
|
-
- Read `{{STATE_DIR}}/progress.md` for the current area and suggestions.
|
|
9
|
-
- Read the actual source files referenced by each suggestion.
|
|
10
|
-
- Independently assess each suggestion.
|
|
11
|
-
|
|
12
|
-
Review checklist for each suggestion:
|
|
13
|
-
- Is it **actionable**? Could a developer implement it from this description alone?
|
|
14
|
-
- Is it **accurate**? Does it correctly describe the current code and the proposed change?
|
|
15
|
-
- Is it **non-obvious**? Would a competent developer working in this codebase likely miss it?
|
|
16
|
-
- Is the **benefit real**? Is the claimed improvement genuine and worth the effort?
|
|
17
|
-
- Is the **risk assessment honest**? Are there unstated downsides?
|
|
18
|
-
- Is there enough source evidence to defend the idea?
|
|
19
|
-
- What is the strongest reason this suggestion should be rejected?
|
|
20
|
-
|
|
21
|
-
Record in `{{STATE_DIR}}/progress.md` for each suggestion:
|
|
22
|
-
- PASS or DROP
|
|
23
|
-
- exact files checked
|
|
24
|
-
- one sentence of evidence
|
|
25
|
-
- one sentence of skepticism or counterargument
|
|
26
|
-
|
|
27
|
-
Emit:
|
|
28
|
-
- `analysis.validated` only when every surviving suggestion has concrete source verification and the weak ones were dropped.
|
|
29
|
-
- `analysis.rejected` when the core analysis is flawed — inaccurate claims about the code, speculative impact claims, suggestions that would introduce bugs, or a set so weak that it should not be published.
|
|
30
|
-
|
|
31
|
-
Rules:
|
|
32
|
-
- Default to rejection when evidence is thin.
|
|
33
|
-
- It is better to publish one strong idea than five weak ones.
|
|
34
|
-
- Do not add your own suggestions.
|
|
35
|
-
- Do not update `{{STATE_DIR}}/ideas-report.md`. Validation only.
|
|
36
|
-
- If fewer than one or two strong ideas survive, that is a valid rejection.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
You are the scanner.
|
|
2
|
-
|
|
3
|
-
Do not analyze deeply. Do not write suggestions. Your job is to survey and prioritize.
|
|
4
|
-
|
|
5
|
-
Your job:
|
|
6
|
-
1. Survey the target repo structure, code patterns, and health signals.
|
|
7
|
-
2. Identify areas worth deeper analysis.
|
|
8
|
-
3. Hand exactly one area to the analyst.
|
|
9
|
-
|
|
10
|
-
On first activation:
|
|
11
|
-
- Read the repo tree, key config files, README, and a sample of source files.
|
|
12
|
-
- Create or refresh:
|
|
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
|
-
- Choose the highest-priority area and emit `areas.identified`.
|
|
16
|
-
|
|
17
|
-
On later activations (`report.updated`, `analysis.blocked`, `synthesis.blocked`):
|
|
18
|
-
- Re-read `{{STATE_DIR}}/scan-areas.md`, `{{STATE_DIR}}/progress.md`, and `{{STATE_DIR}}/ideas-report.md` if it exists.
|
|
19
|
-
- If there are remaining unanalyzed areas, pick the next highest-priority one and emit `areas.identified`.
|
|
20
|
-
- If all areas have been analyzed and the report is sufficient, emit `task.complete`.
|
|
21
|
-
- If the synthesizer or analyst reported a blocker, adjust the area list and re-route.
|
|
22
|
-
|
|
23
|
-
Rules:
|
|
24
|
-
- Cast a wide net: look at architecture, error handling, testing, performance, developer experience, documentation, dependencies, and security.
|
|
25
|
-
- Prioritize areas where suggestions would be most impactful.
|
|
26
|
-
- Be specific about file paths and what to look for — the analyst should not have to re-survey.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
You are the synthesizer.
|
|
2
|
-
|
|
3
|
-
Do not analyze code. Do not validate suggestions. Your job is to compile and organize.
|
|
4
|
-
|
|
5
|
-
On activation:
|
|
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
|
-
|
|
10
|
-
Your job:
|
|
11
|
-
1. Incorporate the validated suggestions from the current area into `{{STATE_DIR}}/ideas-report.md`.
|
|
12
|
-
2. Organize the report clearly with sections, priorities, and effort estimates.
|
|
13
|
-
3. Decide what happens next.
|
|
14
|
-
|
|
15
|
-
Report format (`{{STATE_DIR}}/ideas-report.md`):
|
|
16
|
-
```
|
|
17
|
-
# Ideas Report
|
|
18
|
-
|
|
19
|
-
## Summary
|
|
20
|
-
Brief overview of findings so far.
|
|
21
|
-
|
|
22
|
-
## Suggestions
|
|
23
|
-
|
|
24
|
-
### [Area Name]
|
|
25
|
-
#### 1. [Suggestion title]
|
|
26
|
-
- **Impact**: high / medium / low
|
|
27
|
-
- **Effort**: small / medium / large
|
|
28
|
-
- **What**: ...
|
|
29
|
-
- **Where**: file paths
|
|
30
|
-
- **Why**: ...
|
|
31
|
-
- **How**: implementation sketch
|
|
32
|
-
- **Risk**: ...
|
|
33
|
-
|
|
34
|
-
(repeat for each suggestion)
|
|
35
|
-
|
|
36
|
-
## Priority Matrix
|
|
37
|
-
Table of all suggestions ranked by impact/effort ratio.
|
|
38
|
-
```
|
|
39
|
-
|
|
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.
|
|
55
|
-
- If all areas are covered and the report is complete, emit `task.complete`.
|
|
56
|
-
- If you need the scanner to re-survey (e.g., the report reveals a gap), emit `synthesis.blocked`.
|
|
57
|
-
|
|
58
|
-
Rules:
|
|
59
|
-
- Preserve all previously validated suggestions when updating.
|
|
60
|
-
- Keep the report readable and well-structured.
|
|
61
|
-
- The priority matrix should help a developer decide what to tackle first.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name = "autoideas"
|
|
2
|
-
completion = "task.complete"
|
|
3
|
-
|
|
4
|
-
[[role]]
|
|
5
|
-
id = "scanner"
|
|
6
|
-
emits = ["areas.identified", "task.complete"]
|
|
7
|
-
prompt_file = "roles/scanner.md"
|
|
8
|
-
|
|
9
|
-
[[role]]
|
|
10
|
-
id = "analyst"
|
|
11
|
-
emits = ["analysis.ready", "analysis.blocked"]
|
|
12
|
-
prompt_file = "roles/analyst.md"
|
|
13
|
-
|
|
14
|
-
[[role]]
|
|
15
|
-
id = "reviewer"
|
|
16
|
-
emits = ["analysis.validated", "analysis.rejected"]
|
|
17
|
-
prompt_file = "roles/reviewer.md"
|
|
18
|
-
|
|
19
|
-
[[role]]
|
|
20
|
-
id = "synthesizer"
|
|
21
|
-
emits = ["report.updated", "synthesis.blocked", "task.complete"]
|
|
22
|
-
prompt_file = "roles/synthesizer.md"
|
|
23
|
-
|
|
24
|
-
[handoff]
|
|
25
|
-
"loop.start" = ["scanner"]
|
|
26
|
-
"report.updated" = ["scanner"]
|
|
27
|
-
"areas.identified" = ["analyst"]
|
|
28
|
-
"analysis.ready" = ["reviewer"]
|
|
29
|
-
"analysis.rejected" = ["analyst"]
|
|
30
|
-
"analysis.validated" = ["synthesizer"]
|
|
31
|
-
"analysis.blocked" = ["scanner"]
|
|
32
|
-
"synthesis.blocked" = ["scanner"]
|
|
@@ -1,12 +0,0 @@
|
|
|
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"
|
|
@@ -1,10 +0,0 @@
|
|
|
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.
|
|
@@ -1,12 +0,0 @@
|
|
|
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"
|
|
@@ -1,10 +0,0 @@
|
|
|
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,56 +0,0 @@
|
|
|
1
|
-
# AutoPerf miniloop
|
|
2
|
-
|
|
3
|
-
Use when you need to profile performance bottlenecks and apply targeted optimizations.
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
Shape:
|
|
8
|
-
- profiler — identifies hot paths, establishes baselines
|
|
9
|
-
- optimizer — implements targeted optimization
|
|
10
|
-
- measurer — runs benchmarks, captures before/after metrics
|
|
11
|
-
- judge — skeptically evaluates improvement, keeps or discards
|
|
12
|
-
|
|
13
|
-
## Fail-closed contract
|
|
14
|
-
|
|
15
|
-
AutoPerf should distrust claimed wins.
|
|
16
|
-
|
|
17
|
-
- No benchmark parity means no real comparison.
|
|
18
|
-
- No correctness proof means no kept optimization.
|
|
19
|
-
- Noisy or weakly evidenced gains should be rerun or discarded.
|
|
20
|
-
- Completion means either the target was met with logged wins or the remaining candidate space was explicitly exhausted.
|
|
21
|
-
|
|
22
|
-
## How it works
|
|
23
|
-
|
|
24
|
-
1. **Profiler** identifies available benchmarking tools, establishes baseline measurements, and ranks hot paths by estimated impact.
|
|
25
|
-
2. **Optimizer** implements a single, focused optimization for the highest-impact target.
|
|
26
|
-
3. **Measurer** runs the same benchmarks as the baseline, captures the delta, and verifies tests still pass.
|
|
27
|
-
4. **Judge** decides keep or discard based on meaningful improvement and correctness. Tracks cumulative progress.
|
|
28
|
-
|
|
29
|
-
## AutoPerf vs AutoResearch
|
|
30
|
-
|
|
31
|
-
- **AutoPerf** = scoped to performance. Profiles, optimizes, measures. The metric is always a performance number.
|
|
32
|
-
- **AutoResearch** = general experiment loop. Any hypothesis, any metric, any domain.
|
|
33
|
-
|
|
34
|
-
## Files
|
|
35
|
-
|
|
36
|
-
- `autoloops.toml` — loop + backend config
|
|
37
|
-
- `topology.toml` — role deck + handoff graph
|
|
38
|
-
- `harness.md` — shared harness rules loaded every iteration
|
|
39
|
-
- `roles/profiler.md`
|
|
40
|
-
- `roles/optimizer.md`
|
|
41
|
-
- `roles/measurer.md`
|
|
42
|
-
- `roles/judge.md`
|
|
43
|
-
|
|
44
|
-
## Shared working files created by the loop
|
|
45
|
-
|
|
46
|
-
- `.autoloop/perf-profile.md` — goal, baselines, identified hot paths
|
|
47
|
-
- `.autoloop/perf-log.jsonl` — append-only log of optimization attempts and verdicts
|
|
48
|
-
- `.autoloop/progress.md` — current optimization tracking
|
|
49
|
-
|
|
50
|
-
## Run
|
|
51
|
-
|
|
52
|
-
From the repo root:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
autoloop run presets/autoperf "Reduce API response latency by 30%"
|
|
56
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
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 = ["perf.measured"]
|
|
5
|
-
|
|
6
|
-
backend.kind = "command"
|
|
7
|
-
backend.command = "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"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
This is a autoloops-native autoperf loop for performance profiling and optimization.
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
Global rules:
|
|
6
|
-
- Shared working files are the source of truth: `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, `{{STATE_DIR}}/progress.md`.
|
|
7
|
-
- One optimization at a time. Do not start the next before the current one is measured and judged.
|
|
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 optimization fails.
|
|
11
|
-
- Measure before and after. No optimization is accepted without measurement.
|
|
12
|
-
- False keeps are worse than false discards.
|
|
13
|
-
- Missing baseline, missing tests, changed benchmark procedure, or noisy/inconclusive results should route to retry or discard, not acceptance.
|
|
14
|
-
- The judge makes keep/discard decisions. Other roles do not commit or revert.
|
|
15
|
-
- Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
|
|
16
|
-
- Do not invent extra phases. Stay inside profiler → optimizer → measurer → judge.
|
|
17
|
-
|
|
18
|
-
State files:
|
|
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.
|
|
@@ -1,21 +0,0 @@
|
|
|
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 = ["perf.measured"]
|
|
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"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
You are the judge.
|
|
2
|
-
|
|
3
|
-
Do not profile. Do not optimize. Do not measure.
|
|
4
|
-
|
|
5
|
-
Your job:
|
|
6
|
-
1. Evaluate whether the optimization should be kept or discarded.
|
|
7
|
-
2. Update the performance log.
|
|
8
|
-
3. Decide whether to continue optimizing.
|
|
9
|
-
|
|
10
|
-
On every activation:
|
|
11
|
-
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
|
|
12
|
-
- Start skeptical: assume discard until the win is proven.
|
|
13
|
-
|
|
14
|
-
Process:
|
|
15
|
-
1. Review the measurement results:
|
|
16
|
-
- Did the metric improve?
|
|
17
|
-
- By how much? Is it meaningful?
|
|
18
|
-
- Did correctness tests pass?
|
|
19
|
-
- Is the evidence bundle complete and apples-to-apples?
|
|
20
|
-
2. Decide:
|
|
21
|
-
- **Keep** only if the metric improved meaningfully, the improvement survives noise scrutiny, and tests pass.
|
|
22
|
-
- **Discard** if the metric regressed, improvement is noise-level or weakly evidenced, or tests fail.
|
|
23
|
-
3. Append to `{{STATE_DIR}}/perf-log.jsonl`:
|
|
24
|
-
```json
|
|
25
|
-
{"id": N, "target": "...", "change": "...", "metric_before": X, "metric_after": Y, "verdict": "keep|discard", "reason": "..."}
|
|
26
|
-
```
|
|
27
|
-
4. If discarded: revert the optimization (git checkout the changed files).
|
|
28
|
-
5. Update `{{STATE_DIR}}/progress.md`.
|
|
29
|
-
6. If the overall goal is met → emit `task.complete` with cumulative results.
|
|
30
|
-
7. If kept → emit `optimization.kept`.
|
|
31
|
-
8. If discarded → emit `optimization.discarded`.
|
|
32
|
-
|
|
33
|
-
Rules:
|
|
34
|
-
- Be rigorous about measurement. A 1% improvement on a noisy benchmark is not meaningful.
|
|
35
|
-
- A 10% improvement that breaks tests is not acceptable — discard it.
|
|
36
|
-
- Track cumulative improvement across all kept optimizations.
|
|
37
|
-
- False keeps are worse than false discards.
|
|
38
|
-
- Do not use `good enough` unless you tie it explicitly to the original target and remaining opportunity.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
You are the measurer.
|
|
2
|
-
|
|
3
|
-
Do not profile. Do not optimize. Do not judge.
|
|
4
|
-
|
|
5
|
-
Your job:
|
|
6
|
-
1. Run benchmarks or measurements after the optimization.
|
|
7
|
-
2. Capture before/after metrics.
|
|
8
|
-
3. Hand results to the judge.
|
|
9
|
-
|
|
10
|
-
On every activation:
|
|
11
|
-
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
|
|
12
|
-
|
|
13
|
-
Process:
|
|
14
|
-
1. Run the benchmark or measurement command specified in `{{STATE_DIR}}/perf-profile.md`.
|
|
15
|
-
2. Capture:
|
|
16
|
-
- exact benchmark command
|
|
17
|
-
- the metric value after the optimization
|
|
18
|
-
- the baseline metric value (from `{{STATE_DIR}}/perf-profile.md` or `{{STATE_DIR}}/progress.md`)
|
|
19
|
-
- any secondary metrics (e.g., memory usage, throughput)
|
|
20
|
-
- raw runs and aggregate used for comparison if multiple runs were needed
|
|
21
|
-
- test suite results to verify correctness is preserved
|
|
22
|
-
3. Record results in `{{STATE_DIR}}/progress.md`:
|
|
23
|
-
- Metric before: X
|
|
24
|
-
- Metric after: Y
|
|
25
|
-
- Delta: Z (improvement or regression)
|
|
26
|
-
- Noise note: {stable / noisy / inconclusive}
|
|
27
|
-
- Tests: pass/fail
|
|
28
|
-
4. If measurement succeeds with a complete evidence bundle → emit `perf.measured`.
|
|
29
|
-
5. If measurement fails (compilation error, benchmark crash, missing baseline, changed benchmark procedure, incomplete tests) → emit `measurement.failed` with details.
|
|
30
|
-
|
|
31
|
-
Rules:
|
|
32
|
-
- Run the same benchmark command as the baseline. Apples-to-apples comparison.
|
|
33
|
-
- Run measurements multiple times if the metric is noisy — report the aggregate you used.
|
|
34
|
-
- Always run the test suite after optimization to verify correctness.
|
|
35
|
-
- Record real numbers, not estimates. Do not round away meaningful differences.
|
|
36
|
-
- Missing evidence is a failed measurement, not a soft pass.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
You are the optimizer.
|
|
2
|
-
|
|
3
|
-
Do not profile. Do not measure. Do not judge.
|
|
4
|
-
|
|
5
|
-
Your job:
|
|
6
|
-
1. Implement the targeted optimization identified by the profiler.
|
|
7
|
-
2. Keep changes minimal and reversible.
|
|
8
|
-
|
|
9
|
-
On every activation:
|
|
10
|
-
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
|
|
11
|
-
- Understand the optimization target: what to change, why, and the expected improvement.
|
|
12
|
-
|
|
13
|
-
Process:
|
|
14
|
-
1. Read the code at the identified hot path.
|
|
15
|
-
2. Implement the optimization:
|
|
16
|
-
- Algorithmic improvements (better data structures, reduced complexity)
|
|
17
|
-
- Allocation reduction (reuse buffers, avoid copies)
|
|
18
|
-
- Caching (memoization, lookup tables)
|
|
19
|
-
- Parallelism (where safe and the framework supports it)
|
|
20
|
-
- I/O optimization (batching, connection pooling)
|
|
21
|
-
3. Ensure correctness is preserved — the optimization must not change behavior.
|
|
22
|
-
4. Update `{{STATE_DIR}}/progress.md` with what was changed.
|
|
23
|
-
5. Emit `optimization.applied` with a summary of the change.
|
|
24
|
-
|
|
25
|
-
On `measurement.failed` reactivation:
|
|
26
|
-
- Read the failure details from `{{STATE_DIR}}/progress.md`.
|
|
27
|
-
- The measurement could not run — fix the issue (compilation error, test failure, etc.).
|
|
28
|
-
- Emit `optimization.applied` again.
|
|
29
|
-
|
|
30
|
-
Rules:
|
|
31
|
-
- One optimization per activation. Do not batch multiple changes.
|
|
32
|
-
- Preserve correctness. If unsure, add a comment noting the assumption.
|
|
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 `{{STATE_DIR}}/progress.md`.
|
|
35
|
-
- If you cannot optimize the target, emit `optimization.blocked` explaining why.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
You are the profiler.
|
|
2
|
-
|
|
3
|
-
Do not optimize. Do not measure. Do not judge.
|
|
4
|
-
|
|
5
|
-
Your job:
|
|
6
|
-
1. Identify performance hot paths and bottlenecks.
|
|
7
|
-
2. Establish baseline measurements.
|
|
8
|
-
3. Hand one optimization target at a time to the optimizer.
|
|
9
|
-
|
|
10
|
-
On every activation:
|
|
11
|
-
- Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md` if they exist.
|
|
12
|
-
- Re-read the latest scratchpad/journal context before deciding.
|
|
13
|
-
|
|
14
|
-
On first activation:
|
|
15
|
-
- Understand the performance goal: what metric to optimize, what direction (lower/higher is better), what target.
|
|
16
|
-
- Profile the codebase:
|
|
17
|
-
- Identify available profiling/benchmarking tools in the repo.
|
|
18
|
-
- If benchmarks exist, run them to establish baselines.
|
|
19
|
-
- If no benchmarks exist, identify how to measure the target metric.
|
|
20
|
-
- Identify hot paths: slow functions, unnecessary allocations, N+1 queries, redundant computation.
|
|
21
|
-
- Create or refresh:
|
|
22
|
-
- `{{STATE_DIR}}/perf-profile.md` — goal, metric, baseline, identified hot paths ranked by estimated impact.
|
|
23
|
-
- `{{STATE_DIR}}/perf-log.jsonl` — empty file (will be appended to by the judge).
|
|
24
|
-
- `{{STATE_DIR}}/progress.md` — current phase, first optimization target.
|
|
25
|
-
- Emit `hotspot.identified` with the highest-impact target and baseline measurement.
|
|
26
|
-
|
|
27
|
-
On later activations (`optimization.kept` or `optimization.discarded`):
|
|
28
|
-
- Re-read the shared working files and the optimization log.
|
|
29
|
-
- Analyze cumulative progress toward the goal.
|
|
30
|
-
- If the goal is met or no more impactful optimizations remain, emit `task.complete` only with an exhausted-candidate summary.
|
|
31
|
-
- Otherwise, identify the next target and emit `hotspot.identified`.
|
|
32
|
-
|
|
33
|
-
Rules:
|
|
34
|
-
- Rank targets by estimated impact, not by ease of implementation.
|
|
35
|
-
- Be specific: `string concatenation in hot loop at parser.rs:142 allocates on every iteration` not `parser is slow`.
|
|
36
|
-
- Include the baseline measurement for the target so the measurer knows what to compare against.
|
|
37
|
-
- Do not suggest micro-optimizations when algorithmic improvements are available.
|
|
38
|
-
- Do not claim the search is exhausted by vibe. Record the remaining candidates and why they were rejected or deferred.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name = "autoperf"
|
|
2
|
-
completion = "task.complete"
|
|
3
|
-
|
|
4
|
-
[[role]]
|
|
5
|
-
id = "profiler"
|
|
6
|
-
emits = ["hotspot.identified", "task.complete"]
|
|
7
|
-
prompt_file = "roles/profiler.md"
|
|
8
|
-
|
|
9
|
-
[[role]]
|
|
10
|
-
id = "optimizer"
|
|
11
|
-
emits = ["optimization.applied", "optimization.blocked"]
|
|
12
|
-
prompt_file = "roles/optimizer.md"
|
|
13
|
-
|
|
14
|
-
[[role]]
|
|
15
|
-
id = "measurer"
|
|
16
|
-
emits = ["perf.measured", "measurement.failed"]
|
|
17
|
-
prompt_file = "roles/measurer.md"
|
|
18
|
-
|
|
19
|
-
[[role]]
|
|
20
|
-
id = "judge"
|
|
21
|
-
emits = ["optimization.kept", "optimization.discarded", "task.complete"]
|
|
22
|
-
prompt_file = "roles/judge.md"
|
|
23
|
-
|
|
24
|
-
[handoff]
|
|
25
|
-
"loop.start" = ["profiler"]
|
|
26
|
-
"hotspot.identified" = ["optimizer"]
|
|
27
|
-
"optimization.blocked" = ["profiler"]
|
|
28
|
-
"optimization.applied" = ["measurer"]
|
|
29
|
-
"measurement.failed" = ["optimizer"]
|
|
30
|
-
"perf.measured" = ["judge"]
|
|
31
|
-
"optimization.kept" = ["profiler"]
|
|
32
|
-
"optimization.discarded" = ["profiler"]
|