Files
rea/tests/conformance/providers/hopper/realHopperSemantic.test.ts
T
morluto 63bf91405c refactor!: enforce canonical evidence and provider boundaries
Deliver complete Evidence directly through MCP with required nullable analysis profiles and immutable per-server delivery settings. Bind selected environments at construction and require typed cleanup outcomes with retained retry ownership.

Remove test-only routing, duplicate session and snapshot metadata, producer-field repairs, and ambiguous provider arguments. Separate artifact byte identity from occurrence classification and retain typed source-map and partial native facts across CLI, MCP, and verifier consumers.

BREAKING CHANGE: obsolete Evidence envelopes, session aliases, incomplete snapshots, and missing normalized producer facts are no longer accepted.
2026-10-09 20:18:52 +08:00

59 lines
1.4 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
requireCurrentDocument,
resolveFixtureProcedure,
} from "../../../../scripts/lib/real-hopper-semantic.mjs";
const normalize = (value: unknown): unknown => value;
describe("Hopper verifier semantic fixture resolution", () => {
it("binds mutations to the active document, not the first listed one", async () => {
await expect(
requireCurrentDocument(
clientReturning("active"),
{},
["unrelated", "active"],
normalize,
),
).resolves.toBe("active");
await expect(
requireCurrentDocument(
clientReturning("unknown"),
{},
["unrelated", "active"],
normalize,
),
).rejects.toThrow(/current_document/u);
});
it.each([
["empty", []],
[
"duplicate",
[
{ address: "0x1000", value: "rea_entry" },
{ address: "0x2000", value: "_rea_entry" },
],
],
["wrong name", [{ address: "0x1000", value: "rea_other" }]],
])("rejects %s search evidence", async (_label, items) => {
await expect(
resolveFixtureProcedure(
clientWithItems(items),
{},
"rea_entry",
normalize,
),
).rejects.toThrow(/exactly one Hopper procedure/u);
});
});
const clientWithItems = (items: readonly unknown[]) => ({
callTool: async () => items,
});
const clientReturning = (value: unknown) => ({
callTool: async () => value,
});