From 030b9d092545a65a230067b275cc57ef576bc361 Mon Sep 17 00:00:00 2001 From: Chumaniac <121109854+Chumaniac@users.noreply.github.com> Date: Wed, 21 Oct 2026 17:27:30 +0800 Subject: [PATCH] fix: describe plan-only writes accurately --- src/cli/commands/fix.ts | 2 +- tests/cli/fix.test.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cli/commands/fix.ts b/src/cli/commands/fix.ts index c3cec0a..06a3aa5 100644 --- a/src/cli/commands/fix.ts +++ b/src/cli/commands/fix.ts @@ -146,7 +146,7 @@ export function renderFixPlan(plan: ActionPlan, format: string | undefined = "te } } } - lines.push("No Skill workspace files written by the plan operation."); + lines.push("Plan only; no patches applied."); return `${lines.join("\n")}\n`; } diff --git a/tests/cli/fix.test.ts b/tests/cli/fix.test.ts index e702a0f..58dc356 100644 --- a/tests/cli/fix.test.ts +++ b/tests/cli/fix.test.ts @@ -40,7 +40,7 @@ describe("skillsync fix", () => { expect(allIssues.stdout).toContain("Patches:"); expect(allIssues.stdout).toContain("scripts/check.sh (safe mode 777 -> 755)"); expect(allIssues.stdout).toContain("Manual steps:"); - expect(allIssues.stdout).toContain("No Skill workspace files written by the plan operation."); + expect(allIssues.stdout).toContain("Plan only; no patches applied."); const selected = await runCli([ "fix", @@ -70,7 +70,9 @@ describe("skillsync fix", () => { }); it("writes an explicit plan once and refuses to overwrite it", async () => { - const { root } = await createSkillRoot(); + const { root, scriptPath } = await createSkillRoot(); + const originalContent = await readFile(scriptPath, "utf8"); + const originalMode = (await stat(scriptPath)).mode & 0o777; const issueId = await issueIdFor(root, "structure.invalid-script-mode"); const outputPath = join(root, "fix-plan.json"); const first = await runCli([ @@ -84,9 +86,12 @@ describe("skillsync fix", () => { outputPath, ]); expect(first.exitCode).toBe(0); - expect(first.stdout).toContain("No Skill workspace files written by the plan operation."); + expect(first.stdout).toContain("Plan only; no patches applied."); + expect(first.stdout).not.toContain("No Skill workspace files written"); expect(first.stdout).toContain(`Plan file written: ${outputPath}`); expect(JSON.parse(await readFile(outputPath, "utf8")).issueIds).toEqual([issueId]); + expect(await readFile(scriptPath, "utf8")).toBe(originalContent); + expect((await stat(scriptPath)).mode & 0o777).toBe(originalMode); const second = await runCli([ "fix",