From 507a3e1804f188a271c5bc8b2a68059190f7a08e Mon Sep 17 00:00:00 2001 From: Facundo Rodriguez Date: Tue, 29 Sep 2026 11:36:47 -0300 Subject: [PATCH] fix(eol): declare the federation key on the catalog remediation type NesRemediation omitted the target the scan service emits and every gateway client can select, so it disagreed with the schema and the service model. Add target as optional, since a GraphQL client receives it only when it selects it, and document that the scan service emits only the key while the catalog subgraph owns and resolves the remediations. A type-level spec pins the shape. --- src/types/eol-scan.test.ts | 14 +++++++++++++- src/types/eol-scan.ts | 8 ++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/types/eol-scan.test.ts b/src/types/eol-scan.test.ts index 6c4c375..a4c3d8d 100644 --- a/src/types/eol-scan.test.ts +++ b/src/types/eol-scan.test.ts @@ -1,4 +1,8 @@ -import type { DependencySummary, EolScanComponent } from './eol-scan.js'; +import type { + DependencySummary, + EolScanComponent, + NesRemediation, +} from './eol-scan.js'; type Equal = (() => Value extends Left ? 1 : 2) extends < @@ -32,3 +36,11 @@ export type ComponentDependencySummaryIsRequired = Assert< false > >; + +export type NesRemediationCarriesTheFederationKey = Assert< + Equal +>; + +export type ComponentNesRemediationIsTheCatalogStub = Assert< + Equal +>; diff --git a/src/types/eol-scan.ts b/src/types/eol-scan.ts index 6245baf..8a4a0db 100644 --- a/src/types/eol-scan.ts +++ b/src/types/eol-scan.ts @@ -47,7 +47,15 @@ export function isUnknownReason(v: unknown): v is UnknownReason { ); } +/** + * The catalog remediation attached to a scan component as clients see it through + * the gateway. The scan service only emits the federation key (`target`, the + * component purl it was given); the catalog subgraph owns and resolves + * `remediations`. A GraphQL client receives only the fields it selects, so + * `target` is optional: clients that select only `remediations` never see it. + */ export interface NesRemediation { + target?: string; remediations: { purls: { nes: string; oss: string }; urls: { main: string };