test(filesystem): assert process input recovery and target constraints instead of guidance prose (#11000)

This commit is contained in:
morluto authored and GitHub committed 2026-11-15 17:58:39 +08:00
1 parent 4a13082efc
commit 05bbb73046
2 files changed
+7 -30

No files matched your search

@@ -80,11 +80,6 @@ describe("process CLI error projection", () => {
retryable: false,
message:
"Process command could not complete: SECRET internal failure /private/path",
remediation: {
action: expect.stringMatching(
/do not repeat.*input files.*rea doctor/iu,
),
},
details: {
operation,
provider_id: PROCESS_PROVIDER.id,
@@ -339,10 +334,10 @@ describe("process CLI input diagnostics", () => {
error: "Process command failed",
code: "invalid_request",
category: "invalid_input",
message: expect.stringContaining("Process input file could not be read:"),
retryable: false,
remediation: {
action: expect.stringContaining("Correct the listed fields"),
recovery: {
kind: "inspect_input_contract",
operation: "capture_process_scenario",
},
details: {
issues: [
@@ -369,8 +364,9 @@ describe("process CLI input diagnostics", () => {
`Process input file is not valid UTF-8 JSON: ${malformed}`,
),
retryable: false,
remediation: {
action: expect.stringContaining("Correct the listed fields"),
recovery: {
kind: "inspect_input_contract",
operation: "capture_process_scenario",
},
details: {
issues: [{ path: ["input_file"], reason: "invalid_value" }],
@@ -385,9 +381,7 @@ describe("process CLI input diagnostics", () => {
code: "invalid_request",
category: "invalid_input",
retryable: false,
message: expect.stringContaining(
`Process input file is not valid UTF-8 JSON: ${invalidUtf8}`,
),
message: expect.stringContaining(invalidUtf8),
details: { issues: [{ path: ["input_file"], reason: "invalid_value" }] },
});
expect(
@@ -418,9 +412,6 @@ describe("process CLI input diagnostics", () => {
category: "invalid_input",
message: expect.stringMatching(/input.*invalid/iu),
retryable: false,
remediation: {
action: expect.stringContaining("Correct the listed fields"),
},
recovery: {
kind: "inspect_input_contract",
operation: "capture_process_scenario",
@@ -60,11 +60,7 @@ describe("executable format refusal diagnostics", () => {
reason,
constraint: "file_format_rejected",
},
remediation: {
action: expect.stringMatching(/file.format.*supported.*target/i),
},
});
expect(projected.message).not.toContain("Check that the path");
expect(await systemDoctorHost().inspectTarget?.(path)).toMatchObject({
classification: "unsupported_target",
@@ -99,7 +95,6 @@ describe("target route diagnostics", () => {
expect(projected.remediation.action).toContain("inspect_wasm_artifact");
expect(projected.remediation.action).toContain("REA_WABT_BIN_DIRECTORY");
expect(projected.remediation.action).toContain("WABT 1.0.42");
expect(projected.remediation.action).toContain("does not execute");
expect(await systemDoctorHost().inspectTarget?.(path)).toMatchObject({
ok: false,
classification: "unsupported_target",
@@ -210,9 +205,6 @@ describe("target route diagnostics", () => {
details: { reason: expect.stringContaining("permission denied") },
message: expect.stringContaining("permission denied"),
});
expect(projected.message).toContain(
"Check that the path exists, is readable, and points to a supported file.",
);
expect(await systemDoctorHost().inspectTarget?.(path)).toMatchObject({
ok: false,
classification: "config_drift",
@@ -248,9 +240,6 @@ describe("raw-binary load rejection diagnostics", () => {
code: "invalid_request",
category: "invalid_input",
retryable: false,
message: expect.stringMatching(
/raw-binary.*arm.*entry_point.*0x1.*4.byte.*align/i,
),
details: {
reason: expect.stringMatching(
/raw-binary.*arm.*entry_point.*0x1.*4.byte.*align/i,
@@ -263,7 +252,6 @@ describe("raw-binary load rejection diagnostics", () => {
),
},
});
expect(projected.message).not.toContain("Check that the path");
});
it("projects an x86 entry beyond the address width as caller input", async () => {
@@ -278,7 +266,6 @@ describe("raw-binary load rejection diagnostics", () => {
details: { constraint: "load_selection_rejected" },
});
expect(projected.message).toContain("x86 address width");
expect(projected.message).not.toContain("Check that the path");
});
it("projects architecture and entry without raw-binary format as caller input", async () => {
@@ -294,7 +281,6 @@ describe("raw-binary load rejection diagnostics", () => {
),
details: { constraint: "load_selection_rejected" },
});
expect(projected.message).not.toContain("Check that the path");
});
it("keeps an empty raw-binary file a target refusal", async () => {