fix(setup): preserve skill files and report rollback failures
Track attempted writes, preserve original content and modes from one regular-file observation, and continue rollback after individual failures. Return tagged failure details and retained backup paths through setup. Validation: setup filesystem and recovery tests, combined compile/typecheck/lint/format/metadata/architecture checks. Filesystem fault injection covers backup, ambiguous publication, and rollback failures.
This commit is contained in:
@@ -6,6 +6,7 @@ import { ConfigurationError } from "../domain/configurationErrors.js";
|
||||
import { SUPPORTED_NODE_VERSION_PROSE } from "../domain/runtimeVersion.js";
|
||||
import { FakeSetupHost, options } from "./Setup.fixture.js";
|
||||
import { runSetup } from "./Setup.js";
|
||||
import type { SetupProgressEvent } from "./SetupTypes.js";
|
||||
|
||||
describe("setup workflow", () => {
|
||||
it("rejects Node 25 before applying setup actions", async () => {
|
||||
@@ -57,14 +58,27 @@ describe("setup workflow", () => {
|
||||
const host = new FakeSetupHost();
|
||||
host.hopper = "/Applications/Hopper";
|
||||
host.skill = "failed";
|
||||
const progress: SetupProgressEvent[] = [];
|
||||
const result = await runSetup(
|
||||
{ ...options(true), installSkill: true, clientIds: [] },
|
||||
{
|
||||
...options(true),
|
||||
installSkill: true,
|
||||
clientIds: [],
|
||||
onProgress: (event) => {
|
||||
if (event.actionId === "install_skill") progress.push(event);
|
||||
},
|
||||
},
|
||||
host,
|
||||
);
|
||||
expect(result.status).toBe("needs_human");
|
||||
expect(result.remediation).toBe(
|
||||
"REA analysis skill could not be installed or verified. Check permissions for its planned skill directories, then rerun setup.",
|
||||
);
|
||||
expect(result.code).toBe("skill_install_failed");
|
||||
expect(result.remediation).toContain("REA skill write failed at");
|
||||
expect(result.remediation).toContain("injected skill write failure");
|
||||
expect(result.remediation).toContain("Check permissions and rerun setup.");
|
||||
expect(progress.at(-1)).toMatchObject({
|
||||
state: "failed",
|
||||
detail: expect.stringContaining("injected skill write failure"),
|
||||
});
|
||||
});
|
||||
|
||||
it("delegates remaining unhealthy checks to doctor remediation", async () => {
|
||||
|
||||
Reference in New Issue
Block a user