mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
aacf740a04
Follow CLONE_THREAD edges across strace -ff files when excluding the ownership process's stat/status reads. Keep provider child processes outside the allowance and document the same-process attribution limit. Validate setup result array shapes and preserve the original failed-plan JSON instead of masking it with a diagnostic TypeError.
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { setupPlanFailureMessage } from "../../../scripts/verify-package-setup-plan.mjs";
|
|
|
|
it("preserves setup failure details when an error result has no action arrays", () => {
|
|
const result = {
|
|
status: "needs_human",
|
|
remediation: "Review the host setup requirements.",
|
|
};
|
|
const message = setupPlanFailureMessage({
|
|
planned: result,
|
|
plannedExecution: { status: 1 },
|
|
plannedClaudeConfig: "unchanged",
|
|
plannedCodexConfig: "unchanged",
|
|
plannedCursorConfig: "unchanged",
|
|
});
|
|
|
|
expect(message).toContain("packaged setup plan was not read-only");
|
|
expect(message).toContain('"status":"needs_human"');
|
|
expect(message).toContain("Review the host setup requirements.");
|
|
expect(message).not.toContain("TypeError");
|
|
});
|
|
|
|
it("still formats action kinds for a structured setup result", () => {
|
|
const message = setupPlanFailureMessage({
|
|
planned: {
|
|
status: "planned",
|
|
plannedActions: [{ kind: "configure_client" }],
|
|
appliedActions: [],
|
|
},
|
|
plannedExecution: { status: 0 },
|
|
plannedClaudeConfig: "unchanged",
|
|
plannedCodexConfig: "unchanged",
|
|
plannedCursorConfig: "unchanged",
|
|
});
|
|
|
|
expect(message).toContain('"plannedKinds":["configure_client"]');
|
|
expect(message).toContain('"appliedKinds":[]');
|
|
});
|