From d004cae498eaef584f1a2a3b62bac19ae3c36030 Mon Sep 17 00:00:00 2001 From: jaytbarimbao-collab <300663773+jaytbarimbao-collab@users.noreply.github.com> Date: Mon, 13 Jul 2026 20:30:15 -0400 Subject: [PATCH] refactor(engine): rename worktree-allocator to worktree-plan to end the miner filename collision gittensory-engine's src/miner/worktree-allocator.ts (pure git-worktree path/branch planning + retention policy) and gittensory-miner's lib/worktree-allocator.js (SQLite-backed slot leasing + PID-liveness orphan reclaim) shared a filename while doing genuinely different jobs. Renames the engine-side PURE planner to worktree-plan.ts (its export is planWorktree), keeping the miner's allocator name since it is the one that actually allocates/leases slots (#5668). Pure rename, no behavior change: exported symbols (planWorktree, WorktreePlan, etc.) are unchanged, so every @loopover/engine consumer is unaffected; only the engine's own internal import (worktree-pool.ts) + index re-export path change, plus the two comment references. Test file renamed to match. Closes #5668 --- packages/gittensory-engine/src/index.ts | 2 +- packages/gittensory-engine/src/miner/iterate-loop.ts | 2 +- .../src/miner/{worktree-allocator.ts => worktree-plan.ts} | 0 packages/gittensory-engine/src/miner/worktree-pool.ts | 4 ++-- .../{worktree-allocator.test.ts => worktree-plan.test.ts} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename packages/gittensory-engine/src/miner/{worktree-allocator.ts => worktree-plan.ts} (100%) rename test/unit/{worktree-allocator.test.ts => worktree-plan.test.ts} (100%) diff --git a/packages/gittensory-engine/src/index.ts b/packages/gittensory-engine/src/index.ts index d5b02bdef0..d601aa0733 100644 --- a/packages/gittensory-engine/src/index.ts +++ b/packages/gittensory-engine/src/index.ts @@ -294,7 +294,7 @@ export { type WorktreeExecResult, type WorktreePlan, type WorktreeRemoveResult, -} from "./miner/worktree-allocator.js"; +} from "./miner/worktree-plan.js"; export * from "./miner/worktree-pool.js"; export { invokeCodingAgentDriver, diff --git a/packages/gittensory-engine/src/miner/iterate-loop.ts b/packages/gittensory-engine/src/miner/iterate-loop.ts index 702c573c83..97bc15873e 100644 --- a/packages/gittensory-engine/src/miner/iterate-loop.ts +++ b/packages/gittensory-engine/src/miner/iterate-loop.ts @@ -73,7 +73,7 @@ export type IterateLoopInput = { linkedIssues?: number[] | undefined; authorAssociation?: string | undefined; /** Optional branch ref for the attempt's worktree, threaded through to a passing {@link HandoffPacket} - * unchanged -- this loop does not itself manage worktrees/branches (worktree-allocator.ts's job). */ + * unchanged -- this loop does not itself manage worktrees/branches (worktree-plan.ts's job). */ branchRef?: string | undefined; /** Repo-level self-review context (manifest, repo record, issues, pull requests, ...) -- passed through to diff --git a/packages/gittensory-engine/src/miner/worktree-allocator.ts b/packages/gittensory-engine/src/miner/worktree-plan.ts similarity index 100% rename from packages/gittensory-engine/src/miner/worktree-allocator.ts rename to packages/gittensory-engine/src/miner/worktree-plan.ts diff --git a/packages/gittensory-engine/src/miner/worktree-pool.ts b/packages/gittensory-engine/src/miner/worktree-pool.ts index fd7ee18baf..8e3bdb4104 100644 --- a/packages/gittensory-engine/src/miner/worktree-pool.ts +++ b/packages/gittensory-engine/src/miner/worktree-pool.ts @@ -1,6 +1,6 @@ // Git-worktree POOL allocator (#4297): the pure, in-memory scheduling logic for a POOL of per-attempt git // worktrees across concurrent fleet attempts — acquire/release under a concurrency cap, plus orphan -// reclamation. Complementary to the isolation PRIMITIVE (worktree-allocator.ts, #4269), which plans/creates/ +// reclamation. Complementary to the isolation PRIMITIVE (worktree-plan.ts, #4269), which plans/creates/ // tears down ONE worktree; this manages the SET of them so two concurrent attempts never collide and a crash // can't leak worktree slots forever. // @@ -10,7 +10,7 @@ // calls these pure transitions, and writes the result back. No IO here: every function takes state in and // returns new state out. -import { planWorktree, type WorktreePlan } from "./worktree-allocator.js"; +import { planWorktree, type WorktreePlan } from "./worktree-plan.js"; /** One live allocation: which attempt holds which planned worktree. */ export type WorktreeAllocation = { diff --git a/test/unit/worktree-allocator.test.ts b/test/unit/worktree-plan.test.ts similarity index 100% rename from test/unit/worktree-allocator.test.ts rename to test/unit/worktree-plan.test.ts