Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/verif-view-latch-discipline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ import { resolve } from "node:path";
import { translateFunction } from "../verif/symbolic.js";
import { newCtx, smt2Of } from "../verif/terms.js";
import { solveSmt2 } from "../verif/solve.js";

const haveSolver = (() => {
try { void solveSmt2("(check-sat)", []); return true; } catch { return false; }
})();
import { applyViewLatch } from "../kernel/src/view-latch.ts";
import type { CompressionState, CoreMessage, ViewLatchEntry } from "../kernel/src/types.ts";
import type { NodeIO } from "../kernel/src/pipeline.ts";
import type { SymVal } from "../verif/symbolic.ts";

const file = resolve(import.meta.dirname, "../kernel/src/view-latch.ts");

test("view-latch discipline: quiet turns replay latched bytes verbatim (arbitrary texts)", { timeout: 240_000 }, () => {
test("view-latch discipline: quiet turns replay latched bytes verbatim (arbitrary texts)", { timeout: 240_000, skip: !haveSolver }, () => {
const ctx = newCtx();
// One already-latched message (id i1 → ref r1, latched text L1 ≠ anything
// fixed) + one fresh message (id i2 → ref r2, no latch entry). Both the
Expand Down
10 changes: 7 additions & 3 deletions tests/verif-wire-anthropic-roundtrip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import type { Term } from "../verif/terms.ts";
* negative controls via UNSAT.
*/

const KP = "/home/dog/tmp/bili-verif2/kernel/src/wire/anthropic.ts";
const KP = new URL("../kernel/src/wire/anthropic.ts", import.meta.url).pathname;

const haveSolver = (() => {
try { void solveSmt2("(check-sat)", []); return true; } catch { return false; }
})();

function makeIdPort(): (role: SymVal, ct: SymVal, text: SymVal, opts?: SymVal) => SymVal {
const memo = new Map<string, SymVal>();
Expand Down Expand Up @@ -64,7 +68,7 @@ function makeCounterPorts(): Record<string, (recv: SymVal, ...rest: SymVal[]) =>
};
}

test("wire-anthropic round-trip: block order + payload preserved (same-role pairs)", { timeout: 240_000 }, () => {
test("wire-anthropic round-trip: block order + payload preserved (same-role pairs)", { timeout: 240_000, skip: !haveSolver }, () => {
// Pin each run's block types to constants: the symbolic-type union across
// switch arms merges payloads through the tool_use arm's safeStringify
// degrade ({kind:"any"} has no term to query). ORDER+payload per pinned
Expand Down Expand Up @@ -106,7 +110,7 @@ test("wire-anthropic round-trip: block order + payload preserved (same-role pair
}
});

test("wire-anthropic round-trip: thinking keeps its own message after same-role group (cross-message order)", { timeout: 240_000 }, () => {
test("wire-anthropic round-trip: thinking keeps its own message after same-role group (cross-message order)", { timeout: 240_000, skip: !haveSolver }, () => {
const ctx = newCtx();
const strv = (t: unknown) => ({ kind: "str", t }) as SymVal;
const TYPE1 = ctx.String.val("text"); // block-1 type pinned: this test exercises
Expand Down
2 changes: 1 addition & 1 deletion tests/verif-wire-google-rebuild-stability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function coreMsg(fields: [string, SymVal][], rawParts: SymVal[]): SymVal {
/** REAL coreToGoogle over a symbolic core array. */
function runCoreToGoogle(ctx: KCtx, msgs: SymVal): { ret: SymVal; assumptions: unknown[]; degradations: string[] } {
const out = translateFunction({
file: "/home/dog/tmp/bili-verif2/kernel/src/wire/google.ts",
file: new URL("../kernel/src/wire/google.ts", import.meta.url).pathname,
function: "coreToGoogle",
params: { messages: msgs },
ctx: ctx as never,
Expand Down
Loading