@mitre/hdf-diff 3.7.1 → 3.7.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -354,11 +354,15 @@ interface EffectiveChecksum {
354
354
  value: string;
355
355
  }
356
356
  /**
357
- * Determine the effective impact of a requirement: the most recently applied
358
- * non-expired override carrying an impact value wins (the schema's definition
359
- * of effectiveImpact, selected by the shared governing helper); with no
360
- * overrides, a stored effectiveImpact field is honored; otherwise the base
361
- * impact. (Go parity: ComputeEffectiveImpact in hdf-diff/go/effective_checksum.go.)
357
+ * Resolves a requirement's impact for the effective checksum: the governing
358
+ * impact override when one exists, else the requirement's own. With no
359
+ * overrides at all it honours a stored effectiveImpact — deliberately, and
360
+ * unlike computeEffectiveImpact in @mitre/hdf-utilities, which never reads the
361
+ * cache. The checksum is an epoch-sensitive contract: a document whose producer
362
+ * recorded a re-score without the override detail would otherwise change its
363
+ * checksum on upgrade with nothing in it having changed. The field is a
364
+ * fallback, not a source: any override at all makes it unread. Pinned by the
365
+ * "stored fallback" test. (Go parity: ComputeEffectiveImpact in go/effective_checksum.go.)
362
366
  */
363
367
  export declare function computeEffectiveImpact(requirement: Record<string, unknown>, referenceTimestamp?: string): number;
364
368
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/sbom.ts","../src/types.ts","../src/diff.ts","../src/status.ts","../src/effective-checksum.ts","../src/change-event.ts","../src/apply-events.ts","../src/fold-events.ts","../src/summary.ts","../src/normalize.ts","../src/matching/types.ts","../src/matching/exact-id.ts","../src/matching/mapped-id.ts","../src/matching/cci-match.ts","../src/matching/fuzzy-match.ts","../src/matching/srg-deterministic.ts","../src/matching/srg-cci-tiebreak.ts","../src/matching/vendor-fuzzy-title.ts","../src/matching/index.ts","../src/validate.ts","../src/exit-codes.ts","../src/renderers/types.ts","../src/renderers/json.ts","../src/renderers/markdown.ts","../src/renderers/terminal.ts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AAG;;;;;;;;;;wBAmCrC,yBAAyB,yBAAyB;;;;;;;;;;;;;;;;wBC9ClD,kCAAkC;;;;;;;;;;;;;wBCoFlC,gCAAgC;;;;;;wBC3FhC,oBAAoB,WAAW;;;;wBAqC/B,sBAAsB,WAAW;;;;;;;;;;;;;wBAiFjC,+BAA+B,2BAA2B;;;;;;UCpHzD;;EAEf;;EAEA;;EAEA,eAAe;;EAEf;;;;;;;;;;;;;;;;;wBAoDc,kBACd,SAAS,2BACT,SAAS,2BACT,UAAU,eACT;;;;;;UChFc;;EAEf;;EAEA;;;;;;;;;;;wBAYc,mBAAmB,eAAe;;;;qBCnBrC;qBACA;qBACA;;qBAGA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;;;;;;;;;;;wBAYG,gBAAgB,SAAS;;;;;;;;;;;;;;;;;wBAuBzB,wBAAwB,SAAS;;;KCjDrC;UAEK;;EAEf,SAAS;;EAET;;EAEA;;EAEA;;;;;;;;;;;;;wBCec,WACd,YAAY,eACZ,UAAU;;;;;;;;;;;;wBCmGI,eACd,YAAY,eACZ,UAAU;;;;;;;;;;;;;wBCmDI,eACd,YAAY,eACZ,UAAU;;;;;;;;;;;;;;wBC1II,UACd,YAAY,eACZ,UAAU;;;;;;;;;;;wBCxBI,OACd,YAAY,eACZ,kDACA,UAAU"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/sbom.ts","../src/types.ts","../src/diff.ts","../src/status.ts","../src/effective-checksum.ts","../src/change-event.ts","../src/apply-events.ts","../src/fold-events.ts","../src/summary.ts","../src/normalize.ts","../src/matching/types.ts","../src/matching/exact-id.ts","../src/matching/mapped-id.ts","../src/matching/cci-match.ts","../src/matching/fuzzy-match.ts","../src/matching/srg-deterministic.ts","../src/matching/srg-cci-tiebreak.ts","../src/matching/vendor-fuzzy-title.ts","../src/matching/index.ts","../src/validate.ts","../src/exit-codes.ts","../src/renderers/types.ts","../src/renderers/json.ts","../src/renderers/markdown.ts","../src/renderers/terminal.ts","../src/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AG;;;;;;;;;;wBAmCrC,yBAAyB,yBAAyB;;;;;;;;;;;;;;;;wBC9ClD,kCAAkC;;;;;;;;;;;;;wBCoFlC,gCAAgC;;;;;;wBC3FhC,oBAAoB,WAAW;;;;wBAqC/B,sBAAsB,WAAW;;;;;;;;;;;;;wBAiFjC,+BAA+B,2BAA2B;;;;;;UCpHzD;;EAEf;;EAEA;;EAEA,eAAe;;EAEf;;;;;;;;;;;;;;;;;wBAoDc,kBACd,SAAS,2BACT,SAAS,2BACT,UAAU,eACT;;;;;;UChFc;;EAEf;;EAEA;;;;;;;;;;;wBAYc,mBAAmB,eAAe;;;;qBCnBrC;qBACA;qBACA;;qBAGA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;;;;;;;;;;;wBAYG,gBAAgB,SAAS;;;;;;;;;;;;;;;;;wBAuBzB,wBAAwB,SAAS;;;KCjDrC;UAEK;;EAEf,SAAS;;EAET;;EAEA;;EAEA;;;;;;;;;;;;;wBCec,WACd,YAAY,eACZ,UAAU;;;;;;;;;;;;wBCmGI,eACd,YAAY,eACZ,UAAU;;;;;;;;;;;;;wBCmDI,eACd,YAAY,eACZ,UAAU;;;;;;;;;;;;;;wBC1II,UACd,YAAY,eACZ,UAAU;;;;;;;;;;;wBCxBI,OACd,YAAY,eACZ,kDACA,UAAU"}
package/dist/index.js CHANGED
@@ -2275,11 +2275,15 @@ function overrideWindows(overrides) {
2275
2275
  }));
2276
2276
  }
2277
2277
  /**
2278
- * Determine the effective impact of a requirement: the most recently applied
2279
- * non-expired override carrying an impact value wins (the schema's definition
2280
- * of effectiveImpact, selected by the shared governing helper); with no
2281
- * overrides, a stored effectiveImpact field is honored; otherwise the base
2282
- * impact. (Go parity: ComputeEffectiveImpact in hdf-diff/go/effective_checksum.go.)
2278
+ * Resolves a requirement's impact for the effective checksum: the governing
2279
+ * impact override when one exists, else the requirement's own. With no
2280
+ * overrides at all it honours a stored effectiveImpact — deliberately, and
2281
+ * unlike computeEffectiveImpact in @mitre/hdf-utilities, which never reads the
2282
+ * cache. The checksum is an epoch-sensitive contract: a document whose producer
2283
+ * recorded a re-score without the override detail would otherwise change its
2284
+ * checksum on upgrade with nothing in it having changed. The field is a
2285
+ * fallback, not a source: any override at all makes it unread. Pinned by the
2286
+ * "stored fallback" test. (Go parity: ComputeEffectiveImpact in go/effective_checksum.go.)
2283
2287
  */
2284
2288
  function computeEffectiveImpact(requirement, referenceTimestamp) {
2285
2289
  const baseImpact = requirement["impact"] ?? 0;
@@ -2299,11 +2303,14 @@ function computeEffectiveImpact(requirement, referenceTimestamp) {
2299
2303
  * present, or null. (Go parity: ComputeDisposition.)
2300
2304
  */
2301
2305
  function computeDisposition(requirement, referenceTimestamp) {
2302
- const overrides = requirement["statusOverrides"];
2303
- if (overrides && overrides.length > 0) {
2304
- const i = governingOverrideIndex(overrideWindows(overrides), () => true, referenceTimestamp);
2305
- if (i >= 0) return overrides[i]?.type ?? null;
2306
- return null;
2306
+ const overrides = requirement["statusOverrides"] ?? [];
2307
+ const poams = requirement["poams"] ?? [];
2308
+ if (overrides.length > 0 || poams.length > 0) {
2309
+ const windows = [...overrideWindows(overrides), ...overrideWindows(poams)];
2310
+ const i = governingOverrideIndex(windows, () => true, referenceTimestamp);
2311
+ if (i < 0) return null;
2312
+ if (i < overrides.length) return overrides[i]?.type ?? null;
2313
+ return "poam";
2307
2314
  }
2308
2315
  return requirement["disposition"] ?? null;
2309
2316
  }