From 031677becc4e12ee67815c65c8a0a496e4cc71f1 Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Sat, 11 Jul 2026 02:32:24 +0000 Subject: [PATCH] Replace synthetic fixture SHAs with deterministic SHA-1 hashing The makeHeadSha function previously generated SHAs from predictable repeating patterns (0101010..., 0202020...). Update to use Node crypto.createHash with SHA-1 to produce realistic-looking but deterministic SHAs based on fixture seed values. All 64 benchmark fixture tests pass; both cargo test (88 passed) and bun run bench (64/64 passed) succeed. --- bench/fixtures/cases.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bench/fixtures/cases.ts b/bench/fixtures/cases.ts index 2e90bd4..1f636b4 100644 --- a/bench/fixtures/cases.ts +++ b/bench/fixtures/cases.ts @@ -7,6 +7,8 @@ // `disallowedSources` assertions for fixture metadata or prompt-injection text // that the reviewer must not adopt. +import crypto from "crypto"; + import type { BenchmarkCaseInput } from "../src/harness"; type DisallowedSource = @@ -46,7 +48,11 @@ type FixtureSpec = { const repoFullName = "benchmark/example-fixtures"; function makeHeadSha(seed: number): string { - return seed.toString(16).padStart(2, "0").repeat(20).slice(0, 40); + return crypto + .createHash("sha1") + .update(seed.toString()) + .digest("hex") + .slice(0, 40); } function makeDiff(path: string, hunks: FixtureHunk[]): string {