feat(FN-4686): complete Step 7 — docs and changeset delivery
Fusion-Task-Id: FN-4686 Fusion-Task-Lineage: a1e58bd8-fd94-471a-b164-c396c5512fea
This commit is contained in:
committed by
gsxdsm
parent
cc065f7f23
commit
c0f9ddedc0
@@ -645,7 +645,7 @@ Guardrails: this routine does **not** retry merges, does **not** apply to mixed/
|
|||||||
|
|
||||||
### Worktree and naming helpers
|
### Worktree and naming helpers
|
||||||
- `WorktreePool` (`worktree-pool.ts`) — idle worktree reuse
|
- `WorktreePool` (`worktree-pool.ts`) — idle worktree reuse
|
||||||
- `WorktreeBackend` (`worktree-backend.ts`) — abstraction for worktree lifecycle operations. `native` (default) preserves the existing `git worktree add` behavior; `resolveWorktreeBackend(settings)` switches to `worktrunk` when `settings.worktrunk?.enabled === true`. In this slice, `WorktrunkWorktreeBackend` is a typed stub that fails fast (no CLI shell-out yet); real `worktrunk` command mapping lands in FN-4623.
|
- `WorktreeBackend` (`worktree-backend.ts`) — abstraction for worktree creation routing used by `acquireTaskWorktree`. `native` (default) preserves the existing `git worktree add` + sibling-branch retry behavior; `resolveWorktreeBackend(settings)` switches to `worktrunk` when `settings.worktrunk?.enabled === true`. The current `worktrunk` path is a scaffold: it validates `binaryPath`, runs a placeholder `worktrunk switch --create <branch>` command, and emits `worktree:worktrunk-create`; FN-4623 fills in full create/sync/prune/remove/layout delegation.
|
||||||
- `WorktreeNames` (`worktree-names.ts`) — deterministic worktree/branch naming
|
- `WorktreeNames` (`worktree-names.ts`) — deterministic worktree/branch naming
|
||||||
|
|
||||||
### Observability and reflection
|
### Observability and reflection
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ describe("acquireTaskWorktree backend wiring", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("throws worktrunk_operation_failed and preserves stderr", async () => {
|
it("throws worktrunk_operation_failed and preserves stderr", async () => {
|
||||||
execMock.mockRejectedValue({ stderr: "worktrunk exploded", code: 17 });
|
execMock.mockRejectedValue({ stderr: "worktrunk exploded", status: 17 });
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
acquireTaskWorktree({
|
acquireTaskWorktree({
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ describe("WorktrunkWorktreeBackend", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("throws operation failed with stderr/exitCode", async () => {
|
it("throws operation failed with stderr/exitCode", async () => {
|
||||||
execMock.mockRejectedValue({ stderr: "bad news", code: 7 });
|
execMock.mockRejectedValue({ stderr: "bad news", status: 7 });
|
||||||
const backend = new WorktrunkWorktreeBackend({ binaryPath: "worktrunk" });
|
const backend = new WorktrunkWorktreeBackend({ binaryPath: "worktrunk" });
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
|
|||||||
@@ -133,12 +133,14 @@ export class WorktrunkWorktreeBackend implements WorktreeBackend {
|
|||||||
error && typeof error === "object" && "stderr" in error
|
error && typeof error === "object" && "stderr" in error
|
||||||
? String((error as { stderr?: unknown }).stderr ?? "")
|
? String((error as { stderr?: unknown }).stderr ?? "")
|
||||||
: "";
|
: "";
|
||||||
const exitCode =
|
const execError = error && typeof error === "object" ? (error as Record<string, unknown>) : null;
|
||||||
error && typeof error === "object" && "code" in error
|
const exitCode = execError
|
||||||
? (typeof (error as { code?: unknown }).code === "number"
|
? typeof execError.status === "number"
|
||||||
? (error as { code: number }).code
|
? execError.status
|
||||||
: null)
|
: typeof execError.code === "number"
|
||||||
: null;
|
? execError.code
|
||||||
|
: null
|
||||||
|
: null;
|
||||||
this.deps.logger?.warn?.(
|
this.deps.logger?.warn?.(
|
||||||
`[worktree-backend] worktrunk create failed: ${stderr || String(error)}`,
|
`[worktree-backend] worktrunk create failed: ${stderr || String(error)}`,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user