Files
rea/tests/composition/analysis-sessions/artifactInventoryPolicy.test.ts
T
morlutoandGitHub b8a9da0c0f refactor(mcp): make analysis states unrepresentable (#468)
* refactor(config): parse capability settings into exact states

* refactor(runtime): encode replay and process outcomes exactly

* refactor: make analysis states unrepresentable

* refactor(mcp): register canonical schemas with SDK

* fix: preserve capability and catalog invariants

* fix(build): remove stale compiled modules

* fix(replay): update real verifier policy dependency

* fix(package): verify the complete MCP catalog

* fix(test): supply complete replay reload policy

* refactor(contracts): centralize output schema lookup

* refactor(mcp): delegate protocol boundaries to SDK

* fix(browser): approve real source capture

* fix(mcp): preserve catalog guidance
2026-08-10 02:28:11 +08:00

42 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
resolveArtifactIntegrityPolicy,
resolveNativeMountPolicy,
} from "../../../src/application/ArtifactInventory/policy.js";
describe("artifact inventory policy resolution", () => {
it("admits native mounting only when caller and operator both allow it", () => {
expect(resolveNativeMountPolicy(false, true)).toEqual({
status: "disabled",
});
expect(() => resolveNativeMountPolicy(true, false)).toThrow(
"disabled by operator policy",
);
expect(resolveNativeMountPolicy(true, true)).toEqual({
status: "approved",
});
});
it("projects strict integrity without dormant continuation state", () => {
expect(resolveArtifactIntegrityPolicy({ mode: "fail" }, true)).toEqual({
mode: "fail",
});
});
it("admits parsed continuation intent only under operator policy", () => {
expect(() =>
resolveArtifactIntegrityPolicy(
{ mode: "record-and-continue", maxMismatches: 10 },
false,
),
).toThrow("requires explicit approval and operator policy");
expect(
resolveArtifactIntegrityPolicy(
{ mode: "record-and-continue", maxMismatches: 10 },
true,
),
).toEqual({ mode: "record-and-continue", maxMismatches: 10 });
});
});