@mobrienv/autoloop 0.4.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 +40 -14
- 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 +30 -23
- 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 -293
- 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 -19
- package/dist/backend/kiro-bridge.js +0 -114
- 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 -96
- 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/cli/color.d.ts +0 -6
- package/dist/cli/color.js +0 -40
- package/dist/cli/color.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 -243
- 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 -186
- 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 -16
- 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 -1062
- 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 -27
- package/dist/events/types.js +0 -2
- package/dist/events/types.js.map +0 -1
- package/dist/harness/artifacts.d.ts +0 -50
- package/dist/harness/artifacts.js +0 -333
- package/dist/harness/artifacts.js.map +0 -1
- package/dist/harness/config-helpers.d.ts +0 -35
- package/dist/harness/config-helpers.js +0 -409
- 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 -20
- package/dist/harness/index.js +0 -311
- 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-format.d.ts +0 -25
- package/dist/harness/journal-format.js +0 -153
- package/dist/harness/journal-format.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 -17
- 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 -160
- 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 -113
- 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/autodebug/README.md +0 -50
- package/presets/autodebug/autoloops.toml +0 -18
- package/presets/autodebug/harness.md +0 -31
- package/presets/autodebug/roles/fixer.md +0 -58
- package/presets/autodebug/roles/investigator.md +0 -52
- package/presets/autodebug/roles/strategist.md +0 -45
- package/presets/autodebug/roles/verifier.md +0 -66
- package/presets/autodebug/topology.toml +0 -34
- 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/autopreset/README.md +0 -35
- package/presets/autopreset/autoloops.toml +0 -18
- package/presets/autopreset/harness.md +0 -38
- package/presets/autopreset/roles/designer.md +0 -33
- package/presets/autopreset/roles/finalizer.md +0 -23
- package/presets/autopreset/roles/generator.md +0 -34
- package/presets/autopreset/roles/validator.md +0 -31
- package/presets/autopreset/topology.toml +0 -32
- package/presets/autoqa/README.md +0 -105
- package/presets/autoqa/autoloops.toml +0 -21
- package/presets/autoqa/harness.md +0 -52
- package/presets/autoqa/miniloops.toml +0 -21
- package/presets/autoqa/roles/executor.md +0 -96
- package/presets/autoqa/roles/inspector.md +0 -100
- package/presets/autoqa/roles/planner.md +0 -87
- package/presets/autoqa/roles/reporter.md +0 -117
- 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
package/dist/worktree/merge.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
2
|
-
import { shellQuote } from "../utils.js";
|
|
3
|
-
import { readMeta, updateStatus } from "./meta.js";
|
|
4
|
-
const DEFAULT_GIT_NAME = "autoloop";
|
|
5
|
-
const DEFAULT_GIT_EMAIL = "autoloop@local";
|
|
6
|
-
export function mergeWorktree(opts) {
|
|
7
|
-
const { mainProjectDir, metaDir, strategy = "squash" } = opts;
|
|
8
|
-
const meta = readMeta(metaDir);
|
|
9
|
-
if (!meta)
|
|
10
|
-
throw new Error(`no worktree meta found in ${metaDir}`);
|
|
11
|
-
validateMergeStatus(meta);
|
|
12
|
-
const baseBranch = meta.base_branch;
|
|
13
|
-
const branch = meta.branch;
|
|
14
|
-
const gitEnv = resolveGitEnv(mainProjectDir);
|
|
15
|
-
// Checkout base branch
|
|
16
|
-
exec(mainProjectDir, `git checkout ${shellQuote(baseBranch)}`, gitEnv);
|
|
17
|
-
try {
|
|
18
|
-
if (strategy === "squash") {
|
|
19
|
-
exec(mainProjectDir, `git merge --squash ${shellQuote(branch)}`, gitEnv);
|
|
20
|
-
exec(mainProjectDir, `git commit --no-edit -m ${shellQuote(`merge worktree ${meta.run_id} (squash)`)}`, gitEnv);
|
|
21
|
-
}
|
|
22
|
-
else if (strategy === "rebase") {
|
|
23
|
-
exec(mainProjectDir, `git rebase ${shellQuote(branch)}`, gitEnv);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
exec(mainProjectDir, `git merge --no-ff ${shellQuote(branch)} -m ${shellQuote(`merge worktree ${meta.run_id}`)}`, gitEnv);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
// Attempt to detect conflicts and abort
|
|
31
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
32
|
-
const conflicts = detectConflicts(mainProjectDir);
|
|
33
|
-
try {
|
|
34
|
-
if (strategy === "rebase") {
|
|
35
|
-
exec(mainProjectDir, "git rebase --abort", gitEnv);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
exec(mainProjectDir, "git merge --abort", gitEnv);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
/* abort best-effort */
|
|
43
|
-
}
|
|
44
|
-
if (conflicts.length > 0) {
|
|
45
|
-
return {
|
|
46
|
-
success: false,
|
|
47
|
-
conflicts,
|
|
48
|
-
recoveryHint: `Resolve conflicts manually, then run: git merge ${branch}`,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
throw new Error(`merge failed: ${msg}`);
|
|
52
|
-
}
|
|
53
|
-
updateStatus(metaDir, "merged");
|
|
54
|
-
return { success: true };
|
|
55
|
-
}
|
|
56
|
-
function validateMergeStatus(meta) {
|
|
57
|
-
if (meta.status === "running") {
|
|
58
|
-
throw new Error(`cannot merge worktree ${meta.run_id}: still running`);
|
|
59
|
-
}
|
|
60
|
-
if (meta.status === "merged") {
|
|
61
|
-
throw new Error(`worktree ${meta.run_id} is already merged`);
|
|
62
|
-
}
|
|
63
|
-
if (meta.status === "removed") {
|
|
64
|
-
throw new Error(`worktree ${meta.run_id} has been removed`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function detectConflicts(cwd) {
|
|
68
|
-
try {
|
|
69
|
-
const out = execSync("git diff --name-only --diff-filter=U", {
|
|
70
|
-
cwd,
|
|
71
|
-
encoding: "utf-8",
|
|
72
|
-
stdio: "pipe",
|
|
73
|
-
}).trim();
|
|
74
|
-
return out ? out.split("\n") : [];
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function resolveGitEnv(cwd) {
|
|
81
|
-
const configuredName = readGitConfig(cwd, "user.name");
|
|
82
|
-
const configuredEmail = readGitConfig(cwd, "user.email");
|
|
83
|
-
const hasIdentityEnv = hasText(process.env.GIT_AUTHOR_NAME) ||
|
|
84
|
-
hasText(process.env.GIT_AUTHOR_EMAIL) ||
|
|
85
|
-
hasText(process.env.GIT_COMMITTER_NAME) ||
|
|
86
|
-
hasText(process.env.GIT_COMMITTER_EMAIL);
|
|
87
|
-
if (!hasIdentityEnv && configuredName && configuredEmail) {
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
const fallbackName = textOr(process.env.AUTOLOOP_GIT_NAME, DEFAULT_GIT_NAME);
|
|
91
|
-
const fallbackEmail = textOr(process.env.AUTOLOOP_GIT_EMAIL, DEFAULT_GIT_EMAIL);
|
|
92
|
-
const authorName = textOr(process.env.GIT_AUTHOR_NAME) ?? configuredName ?? fallbackName;
|
|
93
|
-
const authorEmail = textOr(process.env.GIT_AUTHOR_EMAIL) ?? configuredEmail ?? fallbackEmail;
|
|
94
|
-
const committerName = textOr(process.env.GIT_COMMITTER_NAME) ?? configuredName ?? authorName;
|
|
95
|
-
const committerEmail = textOr(process.env.GIT_COMMITTER_EMAIL) ?? configuredEmail ?? authorEmail;
|
|
96
|
-
return {
|
|
97
|
-
...process.env,
|
|
98
|
-
GIT_AUTHOR_NAME: authorName,
|
|
99
|
-
GIT_AUTHOR_EMAIL: authorEmail,
|
|
100
|
-
GIT_COMMITTER_NAME: committerName,
|
|
101
|
-
GIT_COMMITTER_EMAIL: committerEmail,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function readGitConfig(cwd, key) {
|
|
105
|
-
try {
|
|
106
|
-
const value = execSync(`git config --get ${shellQuote(key)}`, {
|
|
107
|
-
cwd,
|
|
108
|
-
encoding: "utf-8",
|
|
109
|
-
stdio: "pipe",
|
|
110
|
-
}).trim();
|
|
111
|
-
return value === "" ? undefined : value;
|
|
112
|
-
}
|
|
113
|
-
catch {
|
|
114
|
-
return undefined;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function hasText(value) {
|
|
118
|
-
return value !== undefined && value.trim() !== "";
|
|
119
|
-
}
|
|
120
|
-
function textOr(value, fallback) {
|
|
121
|
-
if (value === undefined)
|
|
122
|
-
return fallback;
|
|
123
|
-
const trimmed = value.trim();
|
|
124
|
-
return trimmed === "" ? fallback : trimmed;
|
|
125
|
-
}
|
|
126
|
-
function exec(cwd, cmd, env) {
|
|
127
|
-
return execSync(cmd, { cwd, encoding: "utf-8", env, stdio: "pipe" });
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=merge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/worktree/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAc3C,MAAM,UAAU,aAAa,CAAC,IAAe;IAC3C,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE9D,MAAM,IAAI,GAA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,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/worktree/meta.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type WorktreeStatus = "running" | "completed" | "failed" | "merged" | "removed";
|
|
2
|
-
export interface WorktreeMeta {
|
|
3
|
-
run_id: string;
|
|
4
|
-
branch: string;
|
|
5
|
-
worktree_path: string;
|
|
6
|
-
base_branch: string;
|
|
7
|
-
status: WorktreeStatus;
|
|
8
|
-
merge_strategy: string;
|
|
9
|
-
created_at: string;
|
|
10
|
-
merged_at: string | null;
|
|
11
|
-
removed_at: string | null;
|
|
12
|
-
}
|
|
13
|
-
export declare function metaDirForRun(mainStateDir: string, runId: string): string;
|
|
14
|
-
export declare function writeMeta(metaDir: string, meta: WorktreeMeta): void;
|
|
15
|
-
export declare function readMeta(metaDir: string): WorktreeMeta | null;
|
|
16
|
-
export declare function isOrphanWorktree(meta: WorktreeMeta): boolean;
|
|
17
|
-
export declare function updateStatus(metaDir: string, status: WorktreeStatus): void;
|
package/dist/worktree/meta.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
const META_FILE = "meta.json";
|
|
4
|
-
export function metaDirForRun(mainStateDir, runId) {
|
|
5
|
-
return join(mainStateDir, "worktrees", runId);
|
|
6
|
-
}
|
|
7
|
-
export function writeMeta(metaDir, meta) {
|
|
8
|
-
mkdirSync(metaDir, { recursive: true });
|
|
9
|
-
const target = join(metaDir, META_FILE);
|
|
10
|
-
const tmp = `${target}.tmp`;
|
|
11
|
-
writeFileSync(tmp, `${JSON.stringify(meta, null, 2)}\n`);
|
|
12
|
-
renameSync(tmp, target);
|
|
13
|
-
}
|
|
14
|
-
export function readMeta(metaDir) {
|
|
15
|
-
const target = join(metaDir, META_FILE);
|
|
16
|
-
if (!existsSync(target))
|
|
17
|
-
return null;
|
|
18
|
-
return JSON.parse(readFileSync(target, "utf-8"));
|
|
19
|
-
}
|
|
20
|
-
export function isOrphanWorktree(meta) {
|
|
21
|
-
return meta.status !== "removed" && !existsSync(meta.worktree_path);
|
|
22
|
-
}
|
|
23
|
-
export function updateStatus(metaDir, status) {
|
|
24
|
-
const meta = readMeta(metaDir);
|
|
25
|
-
if (!meta)
|
|
26
|
-
throw new Error(`no worktree meta found in ${metaDir}`);
|
|
27
|
-
meta.status = status;
|
|
28
|
-
if (status === "merged")
|
|
29
|
-
meta.merged_at = new Date().toISOString();
|
|
30
|
-
if (status === "removed")
|
|
31
|
-
meta.removed_at = new Date().toISOString();
|
|
32
|
-
writeMeta(metaDir, meta);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/worktree/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,UAAU,aAAa,CAAC,YAAoB,EAAE,KAAa;IAC/D,OAAO,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,IAAkB;IAC3D,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,GAAG,MAAM,MAAM,CAAC;IAC5B,aAAa,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzD,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAiB,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAkB;IACjD,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,MAAsB;IAClE,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,MAAM,KAAK,QAAQ;QAAE,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnE,IAAI,MAAM,KAAK,SAAS;QAAE,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrE,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Autocode miniloop
|
|
2
|
-
|
|
3
|
-
Use when you need to implement a feature, refactor code, or make structured changes across a codebase.
|
|
4
|
-
|
|
5
|
-
Shape:
|
|
6
|
-
- planner
|
|
7
|
-
- builder
|
|
8
|
-
- critic
|
|
9
|
-
- finalizer
|
|
10
|
-
|
|
11
|
-
Shared state lives in project files plus the autoloops journal. One active step is tracked in `.autoloop/progress.md`.
|
|
12
|
-
|
|
13
|
-
## Fail-closed contract
|
|
14
|
-
|
|
15
|
-
Autocode is not an approval machine.
|
|
16
|
-
|
|
17
|
-
- Planner decomposes work into the next smallest slice.
|
|
18
|
-
- Builder implements and proves the slice.
|
|
19
|
-
- Critic tries to break the slice, including independently running a manual smoke test that exercises the builder's changed code path whenever a practical manual surface is available, and rejects on missing evidence.
|
|
20
|
-
- Finalizer tries to prove the whole task is still incomplete before allowing completion.
|
|
21
|
-
|
|
22
|
-
Success is evidence-based, not prose-based. Only the finalizer may emit `task.complete`.
|
|
23
|
-
|
|
24
|
-
## Files
|
|
25
|
-
|
|
26
|
-
- `autoloops.toml` — loop + backend config
|
|
27
|
-
- `topology.toml` — role deck + handoff graph
|
|
28
|
-
- `harness.md` — shared harness rules loaded every iteration
|
|
29
|
-
- `roles/planner.md`
|
|
30
|
-
- `roles/build.md`
|
|
31
|
-
- `roles/critic.md`
|
|
32
|
-
- `roles/finalizer.md`
|
|
33
|
-
|
|
34
|
-
## Shared working files created by the loop
|
|
35
|
-
|
|
36
|
-
The planner is expected to create and maintain:
|
|
37
|
-
- `.autoloop/context.md`
|
|
38
|
-
- `.autoloop/plan.md`
|
|
39
|
-
- `.autoloop/progress.md`
|
|
40
|
-
- `.autoloop/logs/`
|
|
41
|
-
|
|
42
|
-
## Backend
|
|
43
|
-
|
|
44
|
-
This preset assumes the built-in Pi adapter:
|
|
45
|
-
|
|
46
|
-
```toml
|
|
47
|
-
backend.kind = "pi"
|
|
48
|
-
backend.command = "pi"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Pi is the only supported real adapter path here.
|
|
52
|
-
|
|
53
|
-
For deterministic local harness debugging only, switch to the repo mock backend:
|
|
54
|
-
|
|
55
|
-
```toml
|
|
56
|
-
backend.kind = "command"
|
|
57
|
-
backend.command = "../../examples/mock-backend.sh"
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Run
|
|
61
|
-
|
|
62
|
-
From this repo root:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
autoloop run autocode "Add a --verbose flag to the CLI"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
For a one-off Claude dogfood run without editing config:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
autoloop -b claude -p autocode "Add a --verbose flag to the CLI"
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Intended input styles
|
|
75
|
-
|
|
76
|
-
The planner prompt supports the same three broad entry modes as Ralph's code-assist preset:
|
|
77
|
-
- a rough implementation request
|
|
78
|
-
- a single `.code-task.md` file path
|
|
79
|
-
- an existing implementation/spec directory
|
|
80
|
-
|
|
81
|
-
The planner must normalize that into the shared working files and then hand off one concrete next slice.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
event_loop.max_iterations = 100
|
|
2
|
-
event_loop.completion_event = "task.complete"
|
|
3
|
-
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
-
# Require the critic and finalizer gates before completion is considered valid.
|
|
5
|
-
event_loop.required_events = ["review.passed"]
|
|
6
|
-
|
|
7
|
-
backend.kind = "command"
|
|
8
|
-
backend.command = "claude"
|
|
9
|
-
backend.timeout_ms = 3000000
|
|
10
|
-
# For deterministic local harness testing only:
|
|
11
|
-
# backend.kind = "command"
|
|
12
|
-
# backend.command = "../../examples/mock-backend.sh"
|
|
13
|
-
|
|
14
|
-
review.enabled = true
|
|
15
|
-
review.timeout_ms = 300000
|
|
16
|
-
|
|
17
|
-
memory.prompt_budget_chars = 8000
|
|
18
|
-
harness.instructions_file = "harness.md"
|
|
19
|
-
|
|
20
|
-
core.state_dir = ".autoloop"
|
|
21
|
-
core.journal_file = ".autoloop/journal.jsonl"
|
|
22
|
-
core.memory_file = ".autoloop/memory.jsonl"
|
|
23
|
-
|
|
24
|
-
# Kiro backend (persistent ACP session):
|
|
25
|
-
# backend.kind = "kiro"
|
|
26
|
-
# backend.command = "kiro-cli"
|
|
27
|
-
# backend.args = ["acp"]
|
|
28
|
-
# backend.trust_all_tools = true
|
|
29
|
-
# backend.agent = ""
|
|
30
|
-
# backend.model = ""
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
This project is a autoloops-native port of Ralph's code-assist/autocode preset.
|
|
2
|
-
|
|
3
|
-
Global rules:
|
|
4
|
-
- Shared working files are the source of truth: `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, `{{STATE_DIR}}/progress.md`, and `{{STATE_DIR}}/logs/`.
|
|
5
|
-
- Keep only one concrete slice active at a time.
|
|
6
|
-
- Use the event tool instead of prose-only handoffs.
|
|
7
|
-
- Fresh context every iteration: re-read the shared working files and the relevant source before acting.
|
|
8
|
-
- Prefer small, verifiable changes.
|
|
9
|
-
- Verification is mandatory before `review.ready`, `review.passed`, or `task.complete`.
|
|
10
|
-
- The critic should independently run a manual smoke test that exercises the builder's changed code path whenever the repo exposes a practical manual surface; otherwise the critic should say why no such smoke path exists.
|
|
11
|
-
- Missing evidence means no success. No role may treat another role's assertion as proof.
|
|
12
|
-
- Every success handoff should cite exact files changed, exact verification command(s), and commit hash when applicable.
|
|
13
|
-
- After a slice is implemented and verified, commit it before `review.ready` or any later handoff. Every completed slice should land as its own commit. Avoid carrying verified but uncommitted work into the next iteration.
|
|
14
|
-
- Do not dismiss a relevant issue as merely pre-existing. If it matters to the current objective, touched surface, or verification path, you must fix it now, make it the next slice, explicitly defer it with rationale in `{{STATE_DIR}}/progress.md`, or prove it is out of scope.
|
|
15
|
-
- Maintain a `Relevant Issues` section in `{{STATE_DIR}}/progress.md`. Every relevant issue must have an explicit disposition: `fix-now`, `fix-next`, `deferred`, or `out-of-scope`.
|
|
16
|
-
- Use `{{TOOL_PATH}} memory add learning ...` for durable repo/process learnings.
|
|
17
|
-
- Do not invent extra phases. Stay inside planner → builder → critic → finalizer.
|
|
18
|
-
- Only the finalizer may emit `task.complete`.
|
|
19
|
-
- If the prompt is a path to a `.code-task.md` file or an existing implementation directory, use that as source material instead of treating it like plain prose.
|
|
20
|
-
|
|
21
|
-
Role boundaries (strict):
|
|
22
|
-
- The planner MUST NOT implement code, run tests, or make commits. It writes shared working files and emits `tasks.ready`.
|
|
23
|
-
- The builder implements the active slice, verifies it, commits it, and emits `review.ready`. It does not plan or review.
|
|
24
|
-
- The critic independently verifies the builder's work and emits `review.passed` or `review.rejected`. It does not build.
|
|
25
|
-
- The finalizer checks whole-task completeness and emits `queue.advance` or `task.complete`.
|
|
26
|
-
- If the routing topology says your next event is X, emit X — do not attempt completion or skip-ahead events.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
event_loop.max_iterations = 100
|
|
2
|
-
event_loop.completion_event = "task.complete"
|
|
3
|
-
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
-
# Require the critic and finalizer gates before completion is considered valid.
|
|
5
|
-
event_loop.required_events = ["review.passed"]
|
|
6
|
-
|
|
7
|
-
backend.kind = "pi"
|
|
8
|
-
backend.command = "pi"
|
|
9
|
-
backend.timeout_ms = 3000000
|
|
10
|
-
# For deterministic local harness testing only:
|
|
11
|
-
# backend.kind = "command"
|
|
12
|
-
# backend.command = "../../examples/mock-backend.sh"
|
|
13
|
-
|
|
14
|
-
review.enabled = true
|
|
15
|
-
review.timeout_ms = 300000
|
|
16
|
-
|
|
17
|
-
memory.prompt_budget_chars = 8000
|
|
18
|
-
harness.instructions_file = "harness.md"
|
|
19
|
-
|
|
20
|
-
core.state_dir = ".miniloop"
|
|
21
|
-
core.journal_file = ".miniloop/journal.jsonl"
|
|
22
|
-
core.memory_file = ".miniloop/memory.jsonl"
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
You are the builder.
|
|
2
|
-
|
|
3
|
-
Implement exactly the active slice from the latest `tasks.ready` handoff.
|
|
4
|
-
|
|
5
|
-
On every activation:
|
|
6
|
-
- Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
|
|
7
|
-
- Re-read the source files named in the current slice.
|
|
8
|
-
- Update `{{STATE_DIR}}/progress.md` with what you are doing and how you will verify it.
|
|
9
|
-
|
|
10
|
-
Process:
|
|
11
|
-
1. Understand the active slice and its acceptance criteria.
|
|
12
|
-
2. Prefer test-first work when the repo has a test harness for the area.
|
|
13
|
-
3. Make the smallest code change that satisfies the slice.
|
|
14
|
-
4. Run the strongest focused verification you can for that slice.
|
|
15
|
-
5. Commit the completed slice before handoff. Each completed slice should land as its own commit.
|
|
16
|
-
6. Record concise evidence in `{{STATE_DIR}}/progress.md` and longer output in `{{STATE_DIR}}/logs/` when useful, including the commit hash when available.
|
|
17
|
-
7. Emit `review.ready` with:
|
|
18
|
-
- what changed
|
|
19
|
-
- what was verified
|
|
20
|
-
- the slice commit hash
|
|
21
|
-
- any known risk or uncertainty
|
|
22
|
-
|
|
23
|
-
If blocked:
|
|
24
|
-
- Record the reason in `{{STATE_DIR}}/progress.md`.
|
|
25
|
-
- Emit `build.blocked` with a concrete blocker and the safest next planning move.
|
|
26
|
-
|
|
27
|
-
Rules:
|
|
28
|
-
- One slice per turn.
|
|
29
|
-
- No opportunistic side quests.
|
|
30
|
-
- No final completion decisions.
|
|
31
|
-
- No fake verification.
|
|
32
|
-
- Do not emit `review.ready` for an uncommitted completed slice.
|
|
33
|
-
- If confidence is shaky, choose the narrower, more reversible change and document why.
|
|
34
|
-
- You MUST emit `review.ready` (or `build.blocked`) — never `review.passed`, `task.complete`, or any other event. The critic reviews your work; you do not self-approve.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
You are the critic.
|
|
2
|
-
|
|
3
|
-
You are not the builder. Fresh eyes matter.
|
|
4
|
-
|
|
5
|
-
Your job is to challenge the latest increment and try to prove it is not ready.
|
|
6
|
-
|
|
7
|
-
On activation:
|
|
8
|
-
- Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
|
|
9
|
-
- Inspect the changed files and the builder's stated verification.
|
|
10
|
-
- Re-run the strongest relevant checks yourself when possible.
|
|
11
|
-
- Run at least one manual smoke test that actually exercises the builder's changed code path whenever the repo exposes a practical manual surface (for example an existing smoke script, CLI invocation, dev server flow, or reproducible app path). Run it yourself instead of relying only on the builder's checks. If no practical manual smoke path exists, say that explicitly.
|
|
12
|
-
- Treat the builder's summary as a hint, not proof.
|
|
13
|
-
|
|
14
|
-
Review checklist:
|
|
15
|
-
- Did the builder actually satisfy the active slice?
|
|
16
|
-
- Did they silently skip an obvious edge case or acceptance criterion?
|
|
17
|
-
- Is there needless complexity or speculative work?
|
|
18
|
-
- Does the code fit the surrounding repo style?
|
|
19
|
-
- Did the claimed verification really cover the change?
|
|
20
|
-
- Did you run your own manual smoke test that exercised the builder's changed code path when a practical manual path existed?
|
|
21
|
-
- Can you independently validate the claim from code plus evidence?
|
|
22
|
-
- Is the verified slice committed, with `git status --short` clean except for intentional unrelated files?
|
|
23
|
-
- Were all relevant issues discovered during the slice given an explicit disposition in `{{STATE_DIR}}/progress.md`?
|
|
24
|
-
- Did anyone try to dismiss a relevant issue just because it was pre-existing?
|
|
25
|
-
|
|
26
|
-
Emit (only these two events — never emit builder events like `review.ready` or `build.blocked`):
|
|
27
|
-
- `review.rejected` when there is a concrete miss, bug, regression risk, failed verification, untested acceptance criterion, overbuilt solution worth fixing now, verified-but-uncommitted work that should be committed before handoff, or any relevant issue that was left unowned / untracked / ambiguously deferred.
|
|
28
|
-
- `review.passed` only when the current slice survives skeptical review, the verified slice is committed, and all relevant issues have explicit ownership or disposition.
|
|
29
|
-
|
|
30
|
-
Rules:
|
|
31
|
-
- Default to rejection when evidence is incomplete.
|
|
32
|
-
- Be concrete, not vague.
|
|
33
|
-
- Prefer one strong objection over a pile of weak ones.
|
|
34
|
-
- Do not rewrite the whole solution unless the current slice is fundamentally wrong.
|
|
35
|
-
- Do not approve with "fix later" caveats.
|
|
36
|
-
- If checks passed but the builder left the repo dirty, require a commit before `review.passed`.
|
|
37
|
-
- Reject any slice that mentions or reveals a relevant issue without recording whether it is `fix-now`, `fix-next`, `deferred`, or `out-of-scope`.
|
|
38
|
-
- `pre-existing` is never by itself a valid reason to ignore a relevant issue.
|
|
39
|
-
- If you cannot independently validate the builder's claim from code plus evidence, reject.
|
|
40
|
-
- If the changed code had a practical manual execution path and you did not run it yourself, treat the evidence as incomplete and reject. If no such path existed, say that explicitly.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
You are the finalizer.
|
|
2
|
-
|
|
3
|
-
You are the last gate before loop completion.
|
|
4
|
-
|
|
5
|
-
Your job is not just to ask whether the latest diff is okay.
|
|
6
|
-
Your job is to decide whether the whole requested outcome is complete or whether the loop should continue.
|
|
7
|
-
|
|
8
|
-
On activation:
|
|
9
|
-
- Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
|
|
10
|
-
- Reconcile the latest reviewed slice against the whole request.
|
|
11
|
-
- Check whether the numbered plan still has unfinished steps.
|
|
12
|
-
- Check whether the current step is truly exhausted.
|
|
13
|
-
- Run the strongest end-to-end verification you can for the whole visible outcome.
|
|
14
|
-
- Build an explicit completion checklist before deciding.
|
|
15
|
-
|
|
16
|
-
Emit (only these three events — never emit critic events like `review.passed` or `review.rejected`):
|
|
17
|
-
- `queue.advance` if the latest slice passed review but more planned work remains or whole-task proof is still incomplete.
|
|
18
|
-
- `finalization.failed` if the latest slice is not good enough or whole-task consistency is still broken.
|
|
19
|
-
- `task.complete` only when:
|
|
20
|
-
- the requested outcome is satisfied,
|
|
21
|
-
- the numbered plan is complete,
|
|
22
|
-
- no obvious missing slice remains,
|
|
23
|
-
- the strongest available verification passed,
|
|
24
|
-
- the repo is in a clean committed state for the accepted work,
|
|
25
|
-
- and no relevant issue remains unowned, ambiguously deferred, or hand-waved as pre-existing.
|
|
26
|
-
|
|
27
|
-
Required completion checklist:
|
|
28
|
-
- requested outcome satisfied
|
|
29
|
-
- numbered plan complete
|
|
30
|
-
- end-to-end verification recorded
|
|
31
|
-
- accepted work committed
|
|
32
|
-
- repo clean
|
|
33
|
-
- remaining issues all explicitly dispositioned
|
|
34
|
-
|
|
35
|
-
Rules:
|
|
36
|
-
- Be stricter than the critic about whole-task completeness.
|
|
37
|
-
- Prefer one more loop over premature completion.
|
|
38
|
-
- Do not invent new requirements.
|
|
39
|
-
- Do not use `task.complete` just because one small slice passed review.
|
|
40
|
-
- If the work is done but the accepted changes are still uncommitted, commit them before `task.complete`.
|
|
41
|
-
- Do not allow `task.complete` while `{{STATE_DIR}}/progress.md` still contains a relevant issue with no clear disposition or owner.
|
|
42
|
-
- `pre-existing` is not a valid completion rationale for a relevant issue.
|
|
43
|
-
- Missing evidence means no completion.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
You are the planner.
|
|
2
|
-
|
|
3
|
-
Do not implement. Do not review.
|
|
4
|
-
|
|
5
|
-
Your job:
|
|
6
|
-
1. Normalize the user's request into shared working files.
|
|
7
|
-
2. Decide the next smallest meaningful slice.
|
|
8
|
-
3. Hand exactly one concrete slice to the builder.
|
|
9
|
-
|
|
10
|
-
On every activation:
|
|
11
|
-
- Read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md` if they exist.
|
|
12
|
-
- If the objective text points at a `.code-task.md` file, read it.
|
|
13
|
-
- If the objective text points at an existing implementation/spec directory, inspect that directory.
|
|
14
|
-
- Re-read the latest scratchpad/journal context before deciding the next slice.
|
|
15
|
-
|
|
16
|
-
On first activation:
|
|
17
|
-
- Overwrite (not append) these files to clear any stale state from prior runs:
|
|
18
|
-
- `{{STATE_DIR}}/context.md` — request summary, source type, constraints, repo patterns, acceptance criteria
|
|
19
|
-
- `{{STATE_DIR}}/plan.md` — numbered high-level steps, not a blob checklist
|
|
20
|
-
- `{{STATE_DIR}}/progress.md` — current step, active slice, verification notes, completed steps
|
|
21
|
-
- `{{STATE_DIR}}/logs/` directory if useful
|
|
22
|
-
- Choose only Step 1's current slice.
|
|
23
|
-
- Emit `tasks.ready` with a payload that includes:
|
|
24
|
-
- current step
|
|
25
|
-
- active slice
|
|
26
|
-
- files likely to change
|
|
27
|
-
- verification target
|
|
28
|
-
|
|
29
|
-
On later activations (`queue.advance` or `build.blocked`):
|
|
30
|
-
- Re-read the shared working files.
|
|
31
|
-
- If the current step still has unfinished work, hand the next smallest slice in the same step.
|
|
32
|
-
- If the current step is complete, mark it complete in `{{STATE_DIR}}/progress.md`, advance to the next numbered step, and emit the next `tasks.ready`.
|
|
33
|
-
- Planner never emits completion. If the plan appears done, leave that proof to the critic/finalizer path instead of self-certifying success.
|
|
34
|
-
|
|
35
|
-
Rules:
|
|
36
|
-
- One active slice only.
|
|
37
|
-
- Be specific enough that the builder can act without guessing.
|
|
38
|
-
- Prefer vertical slices over broad refactors.
|
|
39
|
-
- Do not create future-step work early just because you can imagine it.
|
|
40
|
-
- Do not treat another role's summary as proof. The slice should be defined so later roles can reject it from concrete evidence.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name = "autocode"
|
|
2
|
-
completion = "task.complete"
|
|
3
|
-
|
|
4
|
-
[[role]]
|
|
5
|
-
id = "planner"
|
|
6
|
-
emits = ["tasks.ready"]
|
|
7
|
-
prompt_file = "roles/planner.md"
|
|
8
|
-
|
|
9
|
-
[[role]]
|
|
10
|
-
id = "builder"
|
|
11
|
-
emits = ["review.ready", "build.blocked"]
|
|
12
|
-
prompt_file = "roles/build.md"
|
|
13
|
-
|
|
14
|
-
[[role]]
|
|
15
|
-
id = "critic"
|
|
16
|
-
emits = ["review.passed", "review.rejected"]
|
|
17
|
-
prompt_file = "roles/critic.md"
|
|
18
|
-
|
|
19
|
-
[[role]]
|
|
20
|
-
id = "finalizer"
|
|
21
|
-
emits = ["queue.advance", "finalization.failed", "task.complete"]
|
|
22
|
-
prompt_file = "roles/finalizer.md"
|
|
23
|
-
|
|
24
|
-
[handoff]
|
|
25
|
-
"loop.start" = ["planner"]
|
|
26
|
-
"queue.advance" = ["planner"]
|
|
27
|
-
"build.blocked" = ["planner"]
|
|
28
|
-
"tasks.ready" = ["builder"]
|
|
29
|
-
"review.ready" = ["critic"]
|
|
30
|
-
"review.rejected" = ["builder"]
|
|
31
|
-
"review.passed" = ["finalizer"]
|
|
32
|
-
"finalization.failed" = ["builder"]
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Autodebug
|
|
2
|
-
|
|
3
|
-
Systematic debugging loop based on the [superpowers systematic-debugging skill](https://github.com/obra/superpowers/tree/main/skills/systematic-debugging).
|
|
4
|
-
|
|
5
|
-
Core philosophy: **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.**
|
|
6
|
-
|
|
7
|
-
## Roles
|
|
8
|
-
|
|
9
|
-
- **investigator** — Phase 1 (Root Cause Investigation) + Phase 2 (Pattern Analysis): gathers evidence, traces data flow backward, compares working vs broken code
|
|
10
|
-
- **strategist** — Phase 3 (Hypothesis & Testing): forms single testable hypothesis, designs minimal test and fix approach with defense-in-depth layers
|
|
11
|
-
- **fixer** — Phase 4 (Implementation): creates failing test FIRST, implements single fix at root cause, adds defense-in-depth validation
|
|
12
|
-
- **verifier** — Quality gate: independently verifies root cause understanding, rejects symptom fixes, handles 3+ failure escalations, emits task.complete
|
|
13
|
-
|
|
14
|
-
## Event Flow
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
loop.start → investigator → rootcause.ready → strategist → hypothesis.ready → fixer → fix.ready → verifier
|
|
18
|
-
↓ (rejection at any stage routes back to investigator with new evidence)
|
|
19
|
-
→ fix.verified → task.complete
|
|
20
|
-
→ fix.escalate → verifier (architecture assessment)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Key Techniques
|
|
24
|
-
|
|
25
|
-
- **Root cause tracing**: trace backward through call stack to original trigger
|
|
26
|
-
- **Defense-in-depth**: validate at 4 layers (entry, business logic, environment, debug)
|
|
27
|
-
- **Condition-based waiting**: replace timeouts with condition polling
|
|
28
|
-
- **Test pollution bisection**: find-polluter pattern for test state leaks
|
|
29
|
-
- **3-strike escalation**: 3+ failed fixes triggers architecture review
|
|
30
|
-
|
|
31
|
-
## Red Flags (auto-reject)
|
|
32
|
-
|
|
33
|
-
- Proposing fixes before investigation
|
|
34
|
-
- Fixing at symptom point instead of root cause
|
|
35
|
-
- No failing test before fix
|
|
36
|
-
- "Quick fix for now"
|
|
37
|
-
- 3+ fix attempts without questioning architecture
|
|
38
|
-
|
|
39
|
-
## Run
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
autoloop run autodebug "describe the bug, error message, or test failure here"
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Output
|
|
46
|
-
|
|
47
|
-
- `investigation.md` — evidence, reproduction, data flow trace, root cause
|
|
48
|
-
- `hypothesis.md` — testable hypothesis with fix approach
|
|
49
|
-
- `fix-log.md` — ordered log of all fix attempts
|
|
50
|
-
- `progress.md` — current phase and decisions
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
event_loop.max_iterations = 50
|
|
2
|
-
event_loop.completion_event = "task.complete"
|
|
3
|
-
event_loop.completion_promise = "LOOP_COMPLETE"
|
|
4
|
-
event_loop.required_events = ["fix.verified"]
|
|
5
|
-
|
|
6
|
-
backend.kind = "command"
|
|
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 = ".autoloop"
|
|
17
|
-
core.journal_file = ".autoloop/journal.jsonl"
|
|
18
|
-
core.memory_file = ".autoloop/memory.jsonl"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
This is an autoloops-native systematic debugging loop.
|
|
2
|
-
|
|
3
|
-
The loop enforces a four-phase debugging process: Root Cause Investigation → Pattern Analysis → Hypothesis Testing → Implementation. NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
|
|
4
|
-
|
|
5
|
-
Global rules:
|
|
6
|
-
- Shared working files are the source of truth: `{{STATE_DIR}}/investigation.md`, `{{STATE_DIR}}/hypothesis.md`, `{{STATE_DIR}}/fix-log.md`, and `{{STATE_DIR}}/progress.md`.
|
|
7
|
-
- The Iron Law: no fix may be proposed until root cause investigation is complete and documented in `investigation.md`.
|
|
8
|
-
- Use the event tool instead of prose-only handoffs.
|
|
9
|
-
- Fresh context every iteration: re-read the shared working files and relevant source code before acting.
|
|
10
|
-
- Missing evidence means no success. No role may treat another role's assertion as proof.
|
|
11
|
-
- Only the verifier may emit `task.complete`.
|
|
12
|
-
- If 3+ fix attempts fail, the fixer MUST emit `fix.escalate` instead of attempting another fix. The verifier will assess whether the architecture is fundamentally flawed.
|
|
13
|
-
|
|
14
|
-
Red flags that MUST trigger return to Phase 1 (investigator):
|
|
15
|
-
- "Quick fix for now, investigate later"
|
|
16
|
-
- "Just try changing X and see if it works"
|
|
17
|
-
- Proposing solutions before tracing data flow
|
|
18
|
-
- 3+ failed fix attempts without questioning architecture
|
|
19
|
-
- Fixing at the symptom point instead of the root cause
|
|
20
|
-
|
|
21
|
-
State files:
|
|
22
|
-
- `{{STATE_DIR}}/investigation.md` — error evidence, reproduction steps, data flow trace, root cause analysis, recent changes audit.
|
|
23
|
-
- `{{STATE_DIR}}/hypothesis.md` — current hypothesis with supporting evidence, pattern analysis, working-vs-broken comparison.
|
|
24
|
-
- `{{STATE_DIR}}/fix-log.md` — ordered log of all fix attempts with results. Tracks attempt count for the escalation rule.
|
|
25
|
-
- `{{STATE_DIR}}/progress.md` — current phase, decisions, evidence gathered, notes for the next role.
|
|
26
|
-
|
|
27
|
-
Debugging techniques available (embed in investigation):
|
|
28
|
-
- Root cause tracing: trace backward through call stack to find original trigger, never fix at symptom point.
|
|
29
|
-
- Defense-in-depth: after finding root cause, add validation at 4 layers (entry point, business logic, environment guards, debug instrumentation).
|
|
30
|
-
- Condition-based waiting: replace arbitrary timeouts with condition polling for flaky tests.
|
|
31
|
-
- Test pollution bisection: use find-polluter pattern to identify which test creates unwanted state.
|