Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(workbench): hash the request contract once for compare identity
超超超超超级喜欢你的达妮娅6b5f93952fed
diff --git a/workbench/l0/measurements.wb.ts b/workbench/l0/measurements.wb.tsindex f27b853e5..93a9c3059 100644--- a/workbench/l0/measurements.wb.ts+++ b/workbench/l0/measurements.wb.ts@@ -28,6 +28,7 @@ import {import {MANDATORY_SOURCE_ANCHORS,sha256Bytes,+ sha256Canonical,sourceIdentityFromManifests,} from "../lib/provenance";import { wilson95 } from "../lib/stats";@@ -607,6 +608,18 @@ describe("measurement identity and bound baseline", () => {expect(counts.checks.find((check) => check.id === "beh.unknown")?.weight).toBe(9);});+ it("keeps the wire fingerprint independent of sample size", () => {+ const contract = { systemSha256: HASH("d"), toolsSha256: HASH("e"), toolNames: ["read"] };+ expect(sha256Canonical([contract, contract])).not.toBe(sha256Canonical(contract));+ expect(sha256Canonical(contract)).toBe(+ sha256Canonical({+ systemSha256: HASH("d"),+ toolsSha256: HASH("e"),+ toolNames: ["read"],+ }),+ );+ });+it("refuses unknown or incompatible identities and never silently compares them", () => {const base = createCandidate(root());const left = base.manifest;diff --git a/workbench/lib/measurement.ts b/workbench/lib/measurement.tsindex 95a3ac848..033ef70d5 100644--- a/workbench/lib/measurement.ts+++ b/workbench/lib/measurement.ts@@ -613,17 +613,26 @@ function unknown(value: string | null | undefined): string {function wireIdentity(results: RepetitionResult[]): MeasurementIdentity["fingerprints"] {const first = results[0]?.run.wire;+ const contract = {+ systemSha256: first?.systemSha256 ?? null,+ toolsSha256: first?.toolsSha256 ?? null,+ toolNames: first?.toolNames ?? [],+ };+ for (const result of results) {+ const next = {+ systemSha256: result.run.wire.systemSha256 ?? null,+ toolsSha256: result.run.wire.toolsSha256 ?? null,+ toolNames: result.run.wire.toolNames ?? [],+ };+ if (canonicalJson(next) !== canonicalJson(contract)) {+ fail("INCOMPATIBLE_IDENTITIES", "repetitions do not share a request-contract wire identity");+ }+ }return {promptSha256: "unknown",systemSha256: unknown(first?.systemSha256),toolsSha256: unknown(first?.toolsSha256),- wireSha256: sha256Canonical(- results.map((result) => ({- systemSha256: result.run.wire.systemSha256,- toolsSha256: result.run.wire.toolsSha256,- toolNames: result.run.wire.toolNames,- })),- ),+ wireSha256: sha256Canonical(contract),rubricSha256: "unknown",};}