mirror of
https://github.com/morluto/rea.git
synced 2026-12-02 11:33:10 +00:00
* fix(artifacts)!: report reader admission limits as resource_constraint An artifact read refused by a reader limit (artifact_limits.*) or a release-fixed allowance was code partial, which the error contract reserves for a result cut short by a delivery or decode limit. The read was refused at admission, so it is now resource_constraint, like every other admission limit. The retry class is unchanged: change_first when the limit can be raised, never when it cannot. A limit without admission facts, such as a parser budget, stays partial. The reader's own recovery, which names the parameter, its supported range and the next step, and the reader_limit fact are unchanged. Refs #15323 BREAKING CHANGE: artifact refusals with details.reason "limit" and a details.reader_limit or fixed allowance report code and category resource_constraint instead of partial. Match resource_constraint, or read details.reason and details.reader_limit, which are unchanged. * fix(errors): catalogue each artifact admission limit with the retry it returns The catalogue listed one row for reader limits and fixed allowances with change_first, though a fixed allowance and a reader limit already at its maximum return never, and the release-fixed row still said partial. List the raisable reader limit, the reader limit at its maximum and the release-fixed allowance as separate rows, and test each row against the error it projects.
26 lines
990 B
TypeScript
26 lines
990 B
TypeScript
import { readFile, writeFile } from "node:fs/promises";
|
|
import { join } from "node:path";
|
|
import { expect } from "vitest";
|
|
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
|
import { nodeSeaOverlappingMachO } from "../../fixtures/nodeSeaOverlapping.js";
|
|
import { cliTest } from "../../support/cli/cliFixture.js";
|
|
|
|
cliTest(
|
|
"reports excessive SEA duplicate verification through the public CLI",
|
|
async ({ cli }) => {
|
|
const root = await createTestTempDirectory("rea-sea-hash-work-cli-");
|
|
const path = join(root, "carrier");
|
|
const { bytes } = nodeSeaOverlappingMachO();
|
|
await writeFile(path, bytes);
|
|
const result = await cli.run({
|
|
arguments: ["inspect-artifact", path, "--json"],
|
|
});
|
|
expect(result.exitCode).toBe(1);
|
|
expect(result.json).toMatchObject({
|
|
code: "resource_constraint",
|
|
details: { reason: "limit", boundary: "capacity" },
|
|
});
|
|
expect((await readFile(path)).equals(bytes)).toBe(true);
|
|
},
|
|
);
|