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: 6 additions & 0 deletions src/db/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3334,6 +3334,7 @@ export async function getCachedAiReview(
pullNumber: number,
headSha: string | null | undefined,
mode: string,
expectedInputFingerprint?: string | undefined,
): Promise<{ notes: string; reviewerCount: number; findings: AdvisoryFinding[]; metadata?: Record<string, unknown> | undefined } | null> {
if (!headSha) return null;
const row = await env.DB
Expand All @@ -3342,6 +3343,11 @@ export async function getCachedAiReview(
.first<{ notes: string; reviewerCount: number; mode: string; findingsJson: string | null; metadataJson: string | null }>();
if (!row || row.mode !== mode) return null;
const metadata = parseJson<Record<string, unknown>>(row.metadataJson, {});
if (
expectedInputFingerprint !== undefined &&
metadata.inputFingerprint !== expectedInputFingerprint
)
return null;
return {
notes: row.notes,
reviewerCount: row.reviewerCount,
Expand Down
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ declare global {
REES_SHARED_SECRET?: string;
REES_TIMEOUT_MS?: string;
REES_ANALYZERS?: string;
REES_PROFILE?: string;
REES_FORWARD_GITHUB_TOKEN?: string;
/** Convergence flag: the deterministic content/registry SURFACE LANE drives the gate for registry-submission
* PRs (metagraphed surfaces[]/providers/candidates). Truthy ON *AND* the repo in GITTENSORY_REVIEW_REPOS —
Expand Down
Loading
Loading