@mobrienv/autoloop 0.1.4 → 0.2.1
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 +103 -42
- package/bin/autoloop +0 -0
- package/dist/agent-map.d.ts +10 -0
- package/dist/agent-map.js +58 -0
- package/dist/agent-map.js.map +1 -0
- package/dist/backend/acp-client.d.ts +38 -0
- package/dist/backend/acp-client.js +288 -0
- package/dist/backend/acp-client.js.map +1 -0
- package/dist/backend/index.d.ts +1 -1
- package/dist/backend/index.js +17 -5
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/kiro-bridge.d.ts +17 -0
- package/dist/backend/kiro-bridge.js +80 -0
- package/dist/backend/kiro-bridge.js.map +1 -0
- package/dist/backend/kiro-worker.d.ts +1 -0
- package/dist/backend/kiro-worker.js +83 -0
- package/dist/backend/kiro-worker.js.map +1 -0
- package/dist/backend/run-command.js +2 -2
- package/dist/backend/run-command.js.map +1 -1
- package/dist/backend/run-kiro.d.ts +3 -0
- package/dist/backend/run-kiro.js +12 -0
- package/dist/backend/run-kiro.js.map +1 -0
- package/dist/backend/run-pi.js.map +1 -1
- package/dist/chains/budget.js +16 -4
- package/dist/chains/budget.js.map +1 -1
- package/dist/chains/load.d.ts +7 -1
- package/dist/chains/load.js +58 -9
- package/dist/chains/load.js.map +1 -1
- package/dist/chains/render.js +36 -8
- package/dist/chains/render.js.map +1 -1
- package/dist/chains/run.js +129 -44
- package/dist/chains/run.js.map +1 -1
- package/dist/chains/types.d.ts +1 -0
- package/dist/chains.d.ts +5 -4
- package/dist/chains.js +3 -3
- package/dist/chains.js.map +1 -1
- package/dist/commands/chain.js +6 -4
- package/dist/commands/chain.js.map +1 -1
- package/dist/commands/config.d.ts +1 -0
- package/dist/commands/config.js +74 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dashboard.d.ts +1 -0
- package/dist/commands/dashboard.js +68 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/inspect.js +125 -17
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/list.d.ts +1 -1
- package/dist/commands/list.js +6 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/loops.js +11 -11
- package/dist/commands/loops.js.map +1 -1
- package/dist/commands/memory.js +2 -2
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/run.d.ts +1 -1
- package/dist/commands/run.js +102 -15
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/runs.d.ts +1 -0
- package/dist/commands/runs.js +50 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/task.d.ts +1 -0
- package/dist/commands/task.js +74 -0
- package/dist/commands/task.js.map +1 -0
- package/dist/commands/worktree.d.ts +1 -0
- package/dist/commands/worktree.js +162 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/config.d.ts +15 -1
- package/dist/config.js +90 -21
- package/dist/config.js.map +1 -1
- package/dist/dashboard/app.d.ts +12 -0
- package/dist/dashboard/app.js +23 -0
- package/dist/dashboard/app.js.map +1 -0
- package/dist/dashboard/routes/api.d.ts +3 -0
- package/dist/dashboard/routes/api.js +103 -0
- package/dist/dashboard/routes/api.js.map +1 -0
- package/dist/dashboard/routes/pages.d.ts +2 -0
- package/dist/dashboard/routes/pages.js +14 -0
- package/dist/dashboard/routes/pages.js.map +1 -0
- package/dist/dashboard/views/alpine-vendor.d.ts +1 -0
- package/dist/dashboard/views/alpine-vendor.js +10 -0
- package/dist/dashboard/views/alpine-vendor.js.map +1 -0
- package/dist/dashboard/views/shell.d.ts +1 -0
- package/dist/dashboard/views/shell.js +714 -0
- package/dist/dashboard/views/shell.js.map +1 -0
- package/dist/events/decode.js.map +1 -1
- package/dist/events/encode.js +2 -2
- package/dist/events/encode.js.map +1 -1
- package/dist/harness/config-helpers.d.ts +11 -0
- package/dist/harness/config-helpers.js +242 -64
- package/dist/harness/config-helpers.js.map +1 -1
- package/dist/harness/coordination.js +12 -12
- package/dist/harness/coordination.js.map +1 -1
- package/dist/harness/display.d.ts +4 -3
- package/dist/harness/display.js +57 -11
- package/dist/harness/display.js.map +1 -1
- package/dist/harness/emit.js +31 -13
- package/dist/harness/emit.js.map +1 -1
- package/dist/harness/index.d.ts +7 -7
- package/dist/harness/index.js +151 -35
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/iteration.d.ts +12 -0
- package/dist/harness/iteration.js +66 -64
- package/dist/harness/iteration.js.map +1 -1
- package/dist/harness/journal.d.ts +17 -0
- package/dist/harness/journal.js +74 -5
- package/dist/harness/journal.js.map +1 -1
- package/dist/harness/metareview.js +30 -15
- package/dist/harness/metareview.js.map +1 -1
- package/dist/harness/metrics.js +12 -12
- package/dist/harness/metrics.js.map +1 -1
- package/dist/harness/parallel.d.ts +1 -1
- package/dist/harness/parallel.js +141 -62
- package/dist/harness/parallel.js.map +1 -1
- package/dist/harness/prompt.d.ts +18 -9
- package/dist/harness/prompt.js +80 -44
- package/dist/harness/prompt.js.map +1 -1
- package/dist/harness/scratchpad.js +8 -6
- package/dist/harness/scratchpad.js.map +1 -1
- package/dist/harness/stop.js +16 -9
- package/dist/harness/stop.js.map +1 -1
- package/dist/harness/tools.js +39 -13
- package/dist/harness/tools.js.map +1 -1
- package/dist/harness/types.d.ts +29 -0
- package/dist/harness/wave/finalize-wave.d.ts +1 -1
- package/dist/harness/wave/finalize-wave.js +36 -9
- package/dist/harness/wave/finalize-wave.js.map +1 -1
- package/dist/harness/wave/launch-branches.d.ts +2 -2
- package/dist/harness/wave/launch-branches.js +147 -51
- package/dist/harness/wave/launch-branches.js.map +1 -1
- package/dist/harness/wave/parse-objectives.js +4 -1
- package/dist/harness/wave/parse-objectives.js.map +1 -1
- package/dist/harness/wave.d.ts +2 -2
- package/dist/harness/wave.js +89 -28
- package/dist/harness/wave.js.map +1 -1
- package/dist/isolation/index.d.ts +4 -0
- package/dist/isolation/index.js +3 -0
- package/dist/isolation/index.js.map +1 -0
- package/dist/isolation/resolve.d.ts +39 -0
- package/dist/isolation/resolve.js +118 -0
- package/dist/isolation/resolve.js.map +1 -0
- package/dist/isolation/run-scope.d.ts +21 -0
- package/dist/isolation/run-scope.js +50 -0
- package/dist/isolation/run-scope.js.map +1 -0
- package/dist/json.js +10 -8
- package/dist/json.js.map +1 -1
- package/dist/loops/health.d.ts +4 -2
- package/dist/loops/health.js +73 -25
- package/dist/loops/health.js.map +1 -1
- package/dist/loops/list.d.ts +2 -2
- package/dist/loops/list.js +6 -6
- package/dist/loops/list.js.map +1 -1
- package/dist/loops/policy.d.ts +6 -0
- package/dist/loops/policy.js +41 -0
- package/dist/loops/policy.js.map +1 -0
- package/dist/loops/render.d.ts +2 -1
- package/dist/loops/render.js +24 -11
- package/dist/loops/render.js.map +1 -1
- package/dist/loops/show.d.ts +2 -2
- package/dist/loops/show.js +13 -13
- package/dist/loops/show.js.map +1 -1
- package/dist/loops/watch.d.ts +7 -1
- package/dist/loops/watch.js +82 -16
- package/dist/loops/watch.js.map +1 -1
- package/dist/main.js +58 -16
- package/dist/main.js.map +1 -1
- package/dist/markdown.js +11 -11
- package/dist/markdown.js.map +1 -1
- package/dist/memory-render.js +5 -5
- package/dist/memory-render.js.map +1 -1
- package/dist/memory.d.ts +1 -2
- package/dist/memory.js +44 -40
- package/dist/memory.js.map +1 -1
- package/dist/pi-adapter.js +11 -11
- package/dist/pi-adapter.js.map +1 -1
- package/dist/profiles.d.ts +12 -0
- package/dist/profiles.js +71 -0
- package/dist/profiles.js.map +1 -0
- package/dist/registry/derive.js +10 -3
- package/dist/registry/derive.js.map +1 -1
- package/dist/registry/discover.d.ts +20 -0
- package/dist/registry/discover.js +98 -0
- package/dist/registry/discover.js.map +1 -0
- package/dist/registry/harness.js +8 -2
- package/dist/registry/harness.js.map +1 -1
- package/dist/registry/index.d.ts +4 -3
- package/dist/registry/index.js +3 -2
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/read.js.map +1 -1
- package/dist/registry/rebuild.js +7 -4
- package/dist/registry/rebuild.js.map +1 -1
- package/dist/registry/types.d.ts +9 -0
- package/dist/registry/update.js +1 -1
- package/dist/registry/update.js.map +1 -1
- package/dist/tasks-render.d.ts +2 -0
- package/dist/tasks-render.js +44 -0
- package/dist/tasks-render.js.map +1 -0
- package/dist/tasks.d.ts +24 -0
- package/dist/tasks.js +184 -0
- package/dist/tasks.js.map +1 -0
- package/dist/testing/mock-backend.js +2 -2
- package/dist/testing/mock-backend.js.map +1 -1
- package/dist/topology.d.ts +6 -0
- package/dist/topology.js +129 -8
- package/dist/topology.js.map +1 -1
- package/dist/usage.d.ts +1 -0
- package/dist/usage.js +56 -11
- package/dist/usage.js.map +1 -1
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +272 -2
- package/dist/utils.js.map +1 -1
- package/dist/worktree/clean.d.ts +12 -0
- package/dist/worktree/clean.js +98 -0
- package/dist/worktree/clean.js.map +1 -0
- package/dist/worktree/create.d.ts +14 -0
- package/dist/worktree/create.js +71 -0
- package/dist/worktree/create.js.map +1 -0
- package/dist/worktree/index.d.ts +10 -0
- package/dist/worktree/index.js +6 -0
- package/dist/worktree/index.js.map +1 -0
- package/dist/worktree/list.d.ts +9 -0
- package/dist/worktree/list.js +24 -0
- package/dist/worktree/list.js.map +1 -0
- package/dist/worktree/merge.d.ts +11 -0
- package/dist/worktree/merge.js +129 -0
- package/dist/worktree/merge.js.map +1 -0
- package/dist/worktree/meta.d.ts +17 -0
- package/dist/worktree/meta.js +34 -0
- package/dist/worktree/meta.js.map +1 -0
- package/package.json +24 -4
- package/presets/autocode/README.md +1 -1
- package/presets/autocode/autoloops.toml +9 -1
- package/presets/autocode/harness.md +12 -5
- package/presets/autocode/roles/build.md +5 -4
- package/presets/autocode/roles/critic.md +2 -2
- package/presets/autocode/roles/finalizer.md +2 -2
- package/presets/autocode/roles/planner.md +7 -7
- package/presets/autodoc/README.md +1 -1
- package/presets/autodoc/autoloops.toml +1 -1
- package/presets/autodoc/harness.md +6 -6
- package/presets/autodoc/roles/auditor.md +3 -3
- package/presets/autodoc/roles/checker.md +2 -2
- package/presets/autodoc/roles/publisher.md +3 -3
- package/presets/autodoc/roles/writer.md +4 -4
- package/presets/autofix/README.md +1 -1
- package/presets/autofix/autoloops.toml +5 -2
- package/presets/autofix/harness.md +8 -7
- package/presets/autofix/roles/closer.md +4 -4
- package/presets/autofix/roles/diagnoser.md +6 -5
- package/presets/autofix/roles/fixer.md +4 -4
- package/presets/autofix/roles/verifier.md +2 -2
- package/presets/autoideas/README.md +1 -1
- package/presets/autoideas/autoloops.toml +1 -1
- package/presets/autoideas/harness.md +11 -11
- package/presets/autoideas/roles/analyst.md +4 -4
- package/presets/autoideas/roles/reviewer.md +3 -3
- package/presets/autoideas/roles/scanner.md +3 -3
- package/presets/autoideas/roles/synthesizer.md +20 -7
- package/presets/automerge/README.md +3 -0
- package/presets/automerge/autoloops.toml +12 -0
- package/presets/automerge/harness.md +10 -0
- package/presets/automerge/miniloops.toml +12 -0
- package/presets/automerge/roles/merge.md +10 -0
- package/presets/automerge/topology.toml +10 -0
- package/presets/autoperf/README.md +1 -1
- package/presets/autoperf/autoloops.toml +1 -1
- package/presets/autoperf/harness.md +5 -5
- package/presets/autoperf/roles/judge.md +3 -3
- package/presets/autoperf/roles/measurer.md +4 -4
- package/presets/autoperf/roles/optimizer.md +4 -4
- package/presets/autoperf/roles/profiler.md +4 -4
- package/presets/autopr/README.md +99 -0
- package/presets/autopr/autoloops.toml +22 -0
- package/presets/autopr/harness.md +27 -0
- package/presets/autopr/miniloops.toml +22 -0
- package/presets/autopr/roles/collector.md +55 -0
- package/presets/autopr/roles/drafter.md +38 -0
- package/presets/autopr/roles/publisher.md +28 -0
- package/presets/autopr/roles/validator.md +31 -0
- package/presets/autopr/topology.toml +32 -0
- package/presets/autoqa/README.md +1 -1
- package/presets/autoqa/autoloops.toml +1 -1
- package/presets/autoqa/harness.md +10 -10
- package/presets/autoqa/roles/executor.md +3 -3
- package/presets/autoqa/roles/inspector.md +2 -2
- package/presets/autoqa/roles/planner.md +6 -6
- package/presets/autoqa/roles/reporter.md +9 -9
- package/presets/autoresearch/README.md +1 -1
- package/presets/autoresearch/autoloops.toml +1 -1
- package/presets/autoresearch/harness.md +5 -5
- package/presets/autoresearch/roles/benchmarker.md +3 -3
- package/presets/autoresearch/roles/evaluator.md +5 -5
- package/presets/autoresearch/roles/implementer.md +4 -4
- package/presets/autoresearch/roles/strategist.md +6 -6
- package/presets/autoreview/README.md +1 -1
- package/presets/autoreview/autoloops.toml +1 -1
- package/presets/autoreview/harness.md +5 -5
- package/presets/autoreview/roles/checker.md +4 -4
- package/presets/autoreview/roles/reader.md +5 -5
- package/presets/autoreview/roles/suggester.md +4 -4
- package/presets/autoreview/roles/summarizer.md +4 -4
- package/presets/autosec/README.md +1 -1
- package/presets/autosec/autoloops.toml +1 -1
- package/presets/autosec/harness.md +5 -5
- package/presets/autosec/roles/analyst.md +4 -4
- package/presets/autosec/roles/hardener.md +2 -2
- package/presets/autosec/roles/reporter.md +4 -4
- package/presets/autosec/roles/scanner.md +3 -3
- package/presets/autosimplify/README.md +1 -1
- package/presets/autosimplify/autoloops.toml +7 -3
- package/presets/autosimplify/harness.md +7 -7
- package/presets/autosimplify/roles/reviewer.md +3 -3
- package/presets/autosimplify/roles/scoper.md +7 -7
- package/presets/autosimplify/roles/simplifier.md +4 -4
- package/presets/autosimplify/roles/verifier.md +3 -3
- package/presets/autospec/README.md +1 -1
- package/presets/autospec/autoloops.toml +1 -1
- package/presets/autospec/harness.md +6 -6
- package/presets/autospec/roles/clarifier.md +4 -3
- package/presets/autospec/roles/critic.md +1 -1
- package/presets/autospec/roles/designer.md +3 -3
- package/presets/autospec/roles/planner.md +2 -2
- package/presets/autospec/roles/researcher.md +3 -3
- package/presets/autotest/README.md +1 -1
- package/presets/autotest/autoloops.toml +1 -1
- package/presets/autotest/harness.md +6 -6
- package/presets/autotest/roles/assessor.md +3 -3
- package/presets/autotest/roles/runner.md +2 -2
- package/presets/autotest/roles/surveyor.md +4 -4
- package/presets/autotest/roles/writer.md +4 -4
|
@@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IAAI,CAAC;YACvC,QAAQ,CAAC,cAAc,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;gBAC9D,GAAG,EAAE,cAAc;gBACnB,KAAK,EAAE,MAAM;aACd,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,gCAAgC;QAClC,CAAC;QAED,iDAAiD;QACjD,IAAI,CAAC;YACH,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,kBAAkB,CAAC,YAAoB;IAC9C,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;aACtD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;aAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CreateWorktreeOpts {
|
|
2
|
+
mainProjectDir: string;
|
|
3
|
+
mainStateDir: string;
|
|
4
|
+
runId: string;
|
|
5
|
+
branchPrefix?: string;
|
|
6
|
+
baseBranch?: string;
|
|
7
|
+
mergeStrategy?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CreateWorktreeResult {
|
|
10
|
+
worktreePath: string;
|
|
11
|
+
branch: string;
|
|
12
|
+
metaDir: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function createWorktree(opts: CreateWorktreeOpts): CreateWorktreeResult;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { rmSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { shellQuote } from "../utils.js";
|
|
5
|
+
import { metaDirForRun, writeMeta } from "./meta.js";
|
|
6
|
+
export function createWorktree(opts) {
|
|
7
|
+
const { mainProjectDir, mainStateDir, runId, branchPrefix = "autoloop", mergeStrategy = "squash", } = opts;
|
|
8
|
+
const baseBranch = opts.baseBranch ?? detectBaseBranch(mainProjectDir);
|
|
9
|
+
const branch = `${branchPrefix}/${runId}`;
|
|
10
|
+
const metaDir = metaDirForRun(mainStateDir, runId);
|
|
11
|
+
const worktreePath = join(metaDir, "tree");
|
|
12
|
+
// Fail fast if branch already exists
|
|
13
|
+
if (branchExists(mainProjectDir, branch)) {
|
|
14
|
+
throw new Error(`branch "${branch}" already exists; cannot create worktree for run ${runId}`);
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
execSync(`git worktree add ${shellQuote(worktreePath)} -b ${shellQuote(branch)}`, {
|
|
18
|
+
cwd: mainProjectDir,
|
|
19
|
+
stdio: "pipe",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
// Clean up partial state on failure
|
|
24
|
+
try {
|
|
25
|
+
rmSync(worktreePath, { recursive: true, force: true });
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
/* ignore */
|
|
29
|
+
}
|
|
30
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
31
|
+
throw new Error(`git worktree add failed: ${msg}`);
|
|
32
|
+
}
|
|
33
|
+
const meta = {
|
|
34
|
+
run_id: runId,
|
|
35
|
+
branch,
|
|
36
|
+
worktree_path: worktreePath,
|
|
37
|
+
base_branch: baseBranch,
|
|
38
|
+
status: "running",
|
|
39
|
+
merge_strategy: mergeStrategy,
|
|
40
|
+
created_at: new Date().toISOString(),
|
|
41
|
+
merged_at: null,
|
|
42
|
+
removed_at: null,
|
|
43
|
+
};
|
|
44
|
+
writeMeta(metaDir, meta);
|
|
45
|
+
return { worktreePath, branch, metaDir };
|
|
46
|
+
}
|
|
47
|
+
function detectBaseBranch(projectDir) {
|
|
48
|
+
try {
|
|
49
|
+
return execSync("git rev-parse --abbrev-ref HEAD", {
|
|
50
|
+
cwd: projectDir,
|
|
51
|
+
encoding: "utf-8",
|
|
52
|
+
stdio: "pipe",
|
|
53
|
+
}).trim();
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return "main";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function branchExists(projectDir, branch) {
|
|
60
|
+
try {
|
|
61
|
+
execSync(`git rev-parse --verify refs/heads/${shellQuote(branch)}`, {
|
|
62
|
+
cwd: projectDir,
|
|
63
|
+
stdio: "pipe",
|
|
64
|
+
});
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/worktree/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAiBrD,MAAM,UAAU,cAAc,CAAC,IAAwB;IACrD,MAAM,EACJ,cAAc,EAC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B,MAAM,EAAE,SAAS;QACjB,cAAc,EAAE,aAAa;QAC7B,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,IAAI;KACjB,CAAC;IACF,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAkB;IAC1C,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,iCAAiC,EAAE;YACjD,GAAG,EAAE,UAAU;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,MAAM;SACd,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,UAAkB,EAAE,MAAc;IACtD,IAAI,CAAC;QACH,QAAQ,CAAC,qCAAqC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE;YAClE,GAAG,EAAE,UAAU;YACf,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { CleanOpts, CleanResult } from "./clean.js";
|
|
2
|
+
export { cleanWorktrees } from "./clean.js";
|
|
3
|
+
export type { CreateWorktreeOpts, CreateWorktreeResult } from "./create.js";
|
|
4
|
+
export { createWorktree } from "./create.js";
|
|
5
|
+
export type { WorktreeListEntry } from "./list.js";
|
|
6
|
+
export { listWorktreeMetas } from "./list.js";
|
|
7
|
+
export type { MergeOpts, MergeResult } from "./merge.js";
|
|
8
|
+
export { mergeWorktree } from "./merge.js";
|
|
9
|
+
export type { WorktreeMeta, WorktreeStatus } from "./meta.js";
|
|
10
|
+
export { isOrphanWorktree, metaDirForRun, readMeta, updateStatus, writeMeta, } from "./meta.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { cleanWorktrees } from "./clean.js";
|
|
2
|
+
export { createWorktree } from "./create.js";
|
|
3
|
+
export { listWorktreeMetas } from "./list.js";
|
|
4
|
+
export { mergeWorktree } from "./merge.js";
|
|
5
|
+
export { isOrphanWorktree, metaDirForRun, readMeta, updateStatus, writeMeta, } from "./meta.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/worktree/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,SAAS,GACV,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorktreeMeta } from "./meta.js";
|
|
2
|
+
export interface WorktreeListEntry extends WorktreeMeta {
|
|
3
|
+
orphan: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* List all worktree metadata entries, flagging orphans where the
|
|
7
|
+
* worktree path no longer exists on disk but meta.json is still present.
|
|
8
|
+
*/
|
|
9
|
+
export declare function listWorktreeMetas(mainStateDir: string): WorktreeListEntry[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isOrphanWorktree, readMeta } from "./meta.js";
|
|
4
|
+
/**
|
|
5
|
+
* List all worktree metadata entries, flagging orphans where the
|
|
6
|
+
* worktree path no longer exists on disk but meta.json is still present.
|
|
7
|
+
*/
|
|
8
|
+
export function listWorktreeMetas(mainStateDir) {
|
|
9
|
+
const worktreesDir = join(mainStateDir, "worktrees");
|
|
10
|
+
if (!existsSync(worktreesDir))
|
|
11
|
+
return [];
|
|
12
|
+
const entries = [];
|
|
13
|
+
for (const dirent of readdirSync(worktreesDir, { withFileTypes: true })) {
|
|
14
|
+
if (!dirent.isDirectory())
|
|
15
|
+
continue;
|
|
16
|
+
const meta = readMeta(join(worktreesDir, dirent.name));
|
|
17
|
+
if (!meta)
|
|
18
|
+
continue;
|
|
19
|
+
const orphan = isOrphanWorktree(meta);
|
|
20
|
+
entries.push({ ...meta, orphan });
|
|
21
|
+
}
|
|
22
|
+
return entries;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/worktree/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMvD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAoB;IACpD,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IACrD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,EAAE,CAAC;IAEzC,MAAM,OAAO,GAAwB,EAAE,CAAC;IAExC,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACxE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;YAAE,SAAS;QACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI;YAAE,SAAS;QAEpB,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEtC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MergeOpts {
|
|
2
|
+
mainProjectDir: string;
|
|
3
|
+
metaDir: string;
|
|
4
|
+
strategy?: "squash" | "merge" | "rebase";
|
|
5
|
+
}
|
|
6
|
+
export interface MergeResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
conflicts?: string[];
|
|
9
|
+
recoveryHint?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function mergeWorktree(opts: MergeOpts): MergeResult;
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,QAA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E,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobrienv/autoloop",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Autonomous LLM loop harness and control plane for long-horizon autonomous work",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -38,15 +38,35 @@
|
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc",
|
|
41
|
+
"lint": "biome check src/ test/",
|
|
42
|
+
"lint:fix": "biome check --write src/ test/",
|
|
43
|
+
"format": "biome format src/ test/",
|
|
44
|
+
"format:fix": "biome format --write src/ test/",
|
|
41
45
|
"test": "node --experimental-vm-modules node_modules/.bin/vitest run",
|
|
42
|
-
"test:
|
|
46
|
+
"test:coverage": "node --experimental-vm-modules node_modules/.bin/vitest run --coverage",
|
|
47
|
+
"test:watch": "node --experimental-vm-modules node_modules/.bin/vitest",
|
|
48
|
+
"check": "biome check src/ test/ && tsc --noEmit && npm run test:coverage",
|
|
49
|
+
"prepare": "husky"
|
|
50
|
+
},
|
|
51
|
+
"lint-staged": {
|
|
52
|
+
"*.{ts,js,json}": [
|
|
53
|
+
"biome check --write --no-errors-on-unmatched"
|
|
54
|
+
]
|
|
43
55
|
},
|
|
44
56
|
"devDependencies": {
|
|
57
|
+
"@biomejs/biome": "^2.4.10",
|
|
45
58
|
"@types/node": "^25.5.2",
|
|
46
|
-
"
|
|
59
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
60
|
+
"husky": "^9.1.7",
|
|
61
|
+
"lint-staged": "^16.4.0",
|
|
62
|
+
"playwright": "^1.59.1",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
47
64
|
"vitest": "^3.0.0"
|
|
48
65
|
},
|
|
49
66
|
"dependencies": {
|
|
50
|
-
"@
|
|
67
|
+
"@agentclientprotocol/sdk": "^0.18.0",
|
|
68
|
+
"@hono/node-server": "^1.19.12",
|
|
69
|
+
"@iarna/toml": "^2.2.5",
|
|
70
|
+
"hono": "^4.12.10"
|
|
51
71
|
}
|
|
52
72
|
}
|
|
@@ -5,7 +5,7 @@ event_loop.completion_promise = "LOOP_COMPLETE"
|
|
|
5
5
|
event_loop.required_events = ["review.passed"]
|
|
6
6
|
|
|
7
7
|
backend.kind = "command"
|
|
8
|
-
backend.command = "
|
|
8
|
+
backend.command = "claude"
|
|
9
9
|
backend.timeout_ms = 3000000
|
|
10
10
|
# For deterministic local harness testing only:
|
|
11
11
|
# backend.kind = "command"
|
|
@@ -20,3 +20,11 @@ harness.instructions_file = "harness.md"
|
|
|
20
20
|
core.state_dir = ".autoloop"
|
|
21
21
|
core.journal_file = ".autoloop/journal.jsonl"
|
|
22
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,7 +1,7 @@
|
|
|
1
1
|
This project is a autoloops-native port of Ralph's code-assist/autocode preset.
|
|
2
2
|
|
|
3
3
|
Global rules:
|
|
4
|
-
- Shared working files are the source of truth:
|
|
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
5
|
- Keep only one concrete slice active at a time.
|
|
6
6
|
- Use the event tool instead of prose-only handoffs.
|
|
7
7
|
- Fresh context every iteration: re-read the shared working files and the relevant source before acting.
|
|
@@ -11,9 +11,16 @@ Global rules:
|
|
|
11
11
|
- Missing evidence means no success. No role may treat another role's assertion as proof.
|
|
12
12
|
- Every success handoff should cite exact files changed, exact verification command(s), and commit hash when applicable.
|
|
13
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
|
|
15
|
-
- Maintain a `Relevant Issues` section in
|
|
16
|
-
- Use
|
|
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
17
|
- Do not invent extra phases. Stay inside planner → builder → critic → finalizer.
|
|
18
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.
|
|
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.
|
|
@@ -3,9 +3,9 @@ You are the builder.
|
|
|
3
3
|
Implement exactly the active slice from the latest `tasks.ready` handoff.
|
|
4
4
|
|
|
5
5
|
On every activation:
|
|
6
|
-
- Re-read
|
|
6
|
+
- Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
|
|
7
7
|
- Re-read the source files named in the current slice.
|
|
8
|
-
- Update
|
|
8
|
+
- Update `{{STATE_DIR}}/progress.md` with what you are doing and how you will verify it.
|
|
9
9
|
|
|
10
10
|
Process:
|
|
11
11
|
1. Understand the active slice and its acceptance criteria.
|
|
@@ -13,7 +13,7 @@ Process:
|
|
|
13
13
|
3. Make the smallest code change that satisfies the slice.
|
|
14
14
|
4. Run the strongest focused verification you can for that slice.
|
|
15
15
|
5. Commit the completed slice before handoff. Each completed slice should land as its own commit.
|
|
16
|
-
6. Record concise evidence in
|
|
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
17
|
7. Emit `review.ready` with:
|
|
18
18
|
- what changed
|
|
19
19
|
- what was verified
|
|
@@ -21,7 +21,7 @@ Process:
|
|
|
21
21
|
- any known risk or uncertainty
|
|
22
22
|
|
|
23
23
|
If blocked:
|
|
24
|
-
- Record the reason in
|
|
24
|
+
- Record the reason in `{{STATE_DIR}}/progress.md`.
|
|
25
25
|
- Emit `build.blocked` with a concrete blocker and the safest next planning move.
|
|
26
26
|
|
|
27
27
|
Rules:
|
|
@@ -31,3 +31,4 @@ Rules:
|
|
|
31
31
|
- No fake verification.
|
|
32
32
|
- Do not emit `review.ready` for an uncommitted completed slice.
|
|
33
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.
|
|
@@ -5,7 +5,7 @@ You are not the builder. Fresh eyes matter.
|
|
|
5
5
|
Your job is to challenge the latest increment and try to prove it is not ready.
|
|
6
6
|
|
|
7
7
|
On activation:
|
|
8
|
-
- Re-read
|
|
8
|
+
- Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
|
|
9
9
|
- Inspect the changed files and the builder's stated verification.
|
|
10
10
|
- Re-run the strongest relevant checks yourself when possible.
|
|
11
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.
|
|
@@ -20,7 +20,7 @@ Review checklist:
|
|
|
20
20
|
- Did you run your own manual smoke test that exercised the builder's changed code path when a practical manual path existed?
|
|
21
21
|
- Can you independently validate the claim from code plus evidence?
|
|
22
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
|
|
23
|
+
- Were all relevant issues discovered during the slice given an explicit disposition in `{{STATE_DIR}}/progress.md`?
|
|
24
24
|
- Did anyone try to dismiss a relevant issue just because it was pre-existing?
|
|
25
25
|
|
|
26
26
|
Emit (only these two events — never emit builder events like `review.ready` or `build.blocked`):
|
|
@@ -6,7 +6,7 @@ Your job is not just to ask whether the latest diff is okay.
|
|
|
6
6
|
Your job is to decide whether the whole requested outcome is complete or whether the loop should continue.
|
|
7
7
|
|
|
8
8
|
On activation:
|
|
9
|
-
- Re-read
|
|
9
|
+
- Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
|
|
10
10
|
- Reconcile the latest reviewed slice against the whole request.
|
|
11
11
|
- Check whether the numbered plan still has unfinished steps.
|
|
12
12
|
- Check whether the current step is truly exhausted.
|
|
@@ -38,6 +38,6 @@ Rules:
|
|
|
38
38
|
- Do not invent new requirements.
|
|
39
39
|
- Do not use `task.complete` just because one small slice passed review.
|
|
40
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
|
|
41
|
+
- Do not allow `task.complete` while `{{STATE_DIR}}/progress.md` still contains a relevant issue with no clear disposition or owner.
|
|
42
42
|
- `pre-existing` is not a valid completion rationale for a relevant issue.
|
|
43
43
|
- Missing evidence means no completion.
|
|
@@ -8,17 +8,17 @@ Your job:
|
|
|
8
8
|
3. Hand exactly one concrete slice to the builder.
|
|
9
9
|
|
|
10
10
|
On every activation:
|
|
11
|
-
- Read
|
|
11
|
+
- Read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md` if they exist.
|
|
12
12
|
- If the objective text points at a `.code-task.md` file, read it.
|
|
13
13
|
- If the objective text points at an existing implementation/spec directory, inspect that directory.
|
|
14
14
|
- Re-read the latest scratchpad/journal context before deciding the next slice.
|
|
15
15
|
|
|
16
16
|
On first activation:
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
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
22
|
- Choose only Step 1's current slice.
|
|
23
23
|
- Emit `tasks.ready` with a payload that includes:
|
|
24
24
|
- current step
|
|
@@ -29,7 +29,7 @@ On first activation:
|
|
|
29
29
|
On later activations (`queue.advance` or `build.blocked`):
|
|
30
30
|
- Re-read the shared working files.
|
|
31
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
|
|
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
33
|
- Planner never emits completion. If the plan appears done, leave that proof to the critic/finalizer path instead of self-certifying success.
|
|
34
34
|
|
|
35
35
|
Rules:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AutoDoc miniloop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use when you need to generate or update documentation to match current code.
|
|
4
4
|
|
|
5
5
|
AutoDoc audits existing documentation against the codebase, identifies gaps and staleness, writes or updates docs, verifies accuracy, and tracks progress — iterating until documentation is current.
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ event_loop.completion_promise = "LOOP_COMPLETE"
|
|
|
4
4
|
event_loop.required_events = ["doc.checked"]
|
|
5
5
|
|
|
6
6
|
backend.kind = "command"
|
|
7
|
-
backend.command = "
|
|
7
|
+
backend.command = "claude"
|
|
8
8
|
backend.timeout_ms = 3000000
|
|
9
9
|
# For deterministic local harness testing only:
|
|
10
10
|
# backend.kind = "command"
|