mirror of
https://github.com/morluto/rea.git
synced 2026-11-20 21:53:51 +00:00
A malformed migrated launch seed stays on the config and the operation view reports configuration_invalid unless a snapshot override is active. Kuna, regex, GDB, and Rizin keep the deadline or heap accepted when the work started, and reattributed resource errors copy the structured limit.
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import { analysisSettingLimit } from "./analysisSettingDefinitions.js";
|
|
import {
|
|
AnalysisResourceConstraintError,
|
|
reattributedResourceConstraint,
|
|
} from "./analysisErrorCore.js";
|
|
import { projectAnalysisError } from "./analysisErrorProjection.js";
|
|
|
|
it("keeps the structured limit when a resource refusal is reattributed", () => {
|
|
const limit = analysisSettingLimit(
|
|
"bridge.max_request_bytes",
|
|
8192,
|
|
"runtime",
|
|
);
|
|
const original = new AnalysisResourceConstraintError(
|
|
"cutter_command",
|
|
"transport",
|
|
"Cutter status exceeded the request ceiling.",
|
|
{ max_request_bytes: 8192 },
|
|
{
|
|
remediationAction: "Raise bridge.max_request_bytes.",
|
|
retryable: false,
|
|
limit,
|
|
},
|
|
);
|
|
const discovery = reattributedResourceConstraint(
|
|
"list_cutter_sessions",
|
|
original,
|
|
);
|
|
expect(discovery.operation).toBe("list_cutter_sessions");
|
|
expect(discovery.limit).toEqual(original.limit);
|
|
expect(discovery.recovery).toEqual(original.recovery);
|
|
expect(discovery.reportedLimits).toEqual(original.reportedLimits);
|
|
const projected = projectAnalysisError(discovery);
|
|
expect(projected).toMatchObject({
|
|
code: "resource_constraint",
|
|
details: {
|
|
limit: {
|
|
setting: "bridge.max_request_bytes",
|
|
effective_value: 8192,
|
|
source: "runtime",
|
|
},
|
|
},
|
|
});
|
|
});
|