@@ -46,9 +46,14 @@ export async function writeContacts(
4646 await tx . result (
4747 // COALESCE preserves previously stored values when a run doesn't (re)discover a field —
4848 // a partial/failed extractor pass must not wipe still-valid policy URLs or the PVR flag.
49+ // vulnerability_reporting_url is PVR-derived, so when PVR is authoritatively resolved we
50+ // overwrite it (clearing it once PVR is disabled); otherwise it is preserved.
4951 `UPDATE repos SET
5052 security_policy_url = COALESCE($(securityPolicyUrl), security_policy_url),
51- vulnerability_reporting_url = COALESCE($(vulnerabilityReportingUrl), vulnerability_reporting_url),
53+ vulnerability_reporting_url = CASE WHEN $(pvrResolved)
54+ THEN $(vulnerabilityReportingUrl)
55+ ELSE COALESCE($(vulnerabilityReportingUrl), vulnerability_reporting_url)
56+ END,
5257 bug_bounty_url = COALESCE($(bugBountyUrl), bug_bounty_url),
5358 security_txt_url = COALESCE($(securityTxtUrl), security_txt_url),
5459 pvr_enabled = COALESCE($(pvrEnabled), pvr_enabled),
@@ -58,6 +63,7 @@ export async function writeContacts(
5863 repoId,
5964 securityPolicyUrl : policies . securityPolicyUrl ?? null ,
6065 vulnerabilityReportingUrl : policies . vulnerabilityReportingUrl ?? null ,
66+ pvrResolved : policies . pvrEnabled !== undefined ,
6167 bugBountyUrl : policies . bugBountyUrl ?? null ,
6268 securityTxtUrl : policies . securityTxtUrl ?? null ,
6369 pvrEnabled : policies . pvrEnabled ?? null ,
0 commit comments