refactor: consolidate boundary semantics and prune redundant tests
Share parser modes and collision-free composite keys, enforce architecture guards, and consolidate redundant unit assertions into filesystem, CLI, MCP, and producer-backed workflows. Preserve concurrent upstream boundary fixes and exclude legacy Objective-C class-name bookkeeping labels. Validation: source/composition suites (3358 passing), focused canonical digest and MCP checks, typecheck/lint, Knip, formatting, architecture guards, and real Foundation archive and Apple legacy simulator CLI/MCP verification. No real Hopper, Ghidra, or IDA verification claim.
This commit is contained in:
+12
-53
@@ -24,60 +24,19 @@ import {
|
||||
type UninstallHost,
|
||||
} from "./application/Uninstall.js";
|
||||
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
||||
import { isProcessCliFailure } from "./application/process/ProcessCli.js";
|
||||
|
||||
describe("CLI operation status classification", () => {
|
||||
it.each([
|
||||
[
|
||||
"projected error",
|
||||
projectAnalysisError(new ConfigurationError("invalid setting")),
|
||||
],
|
||||
[
|
||||
"MCP-shaped projected error",
|
||||
{
|
||||
error: projectAnalysisError(new ConfigurationError("invalid setting")),
|
||||
},
|
||||
],
|
||||
["unhealthy diagnostic", { healthy: false, checks: [] }],
|
||||
])("classifies %s as failure", (_label, value) => {
|
||||
expect(isCliOperationFailure(value)).toBe(true);
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
"ordinary data with code",
|
||||
{ code: "configuration_invalid", message: "source data" },
|
||||
],
|
||||
[
|
||||
"evidence about an error",
|
||||
{
|
||||
result: projectAnalysisError(new ConfigurationError("source setting")),
|
||||
},
|
||||
],
|
||||
["requested dry run", { status: "planned" }],
|
||||
["partial analysis", { status: "partial" }],
|
||||
["unsupported facet with evidence", { status: "unsupported" }],
|
||||
["cancelled setup", { status: "cancelled" }],
|
||||
["ready setup", { status: "ready" }],
|
||||
["complete uninstall", { status: "complete" }],
|
||||
["current version", { status: "current" }],
|
||||
["completed update", { status: "updated" }],
|
||||
["healthy diagnostics", { healthy: true, checks: [] }],
|
||||
["bounded evidence", { evidence: [{ truncated: true }] }],
|
||||
])("keeps %s successful", (_label, value) => {
|
||||
expect(isCliOperationFailure(value)).toBe(false);
|
||||
});
|
||||
|
||||
it("uses the process command's typed error output", () => {
|
||||
expect(
|
||||
isProcessCliFailure({
|
||||
error: "Process command failed",
|
||||
category: "invalid_input",
|
||||
message: "The capture input is invalid.",
|
||||
}),
|
||||
).toBe(true);
|
||||
expect(isProcessCliFailure({ error: "data about an error" })).toBe(false);
|
||||
});
|
||||
it("does not treat ordinary error-looking data or nested Evidence as command failure", () => {
|
||||
expect(
|
||||
isCliOperationFailure({
|
||||
code: "configuration_invalid",
|
||||
message: "source data",
|
||||
}),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isCliOperationFailure({
|
||||
result: projectAnalysisError(new ConfigurationError("source setting")),
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
describe("CLI command outcome classification", () => {
|
||||
|
||||
Reference in New Issue
Block a user