
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@mitre/hdf-diff
Advanced tools
Structured comparison of HDF evaluation results — tracks what changed, why, and by how much
Structured comparison of HDF documents — tracks what changed, why, and by how much.
Compares HDF documents (results, baselines, or system documents) and produces a structured diff:
diffHdf) — requirements added, removed, or changed between evaluations; status transitions with change reasons; field-level changes (impact, severity, disposition, effectiveImpact); per-baseline compliance summariesdiffBaselines) — track how a baseline's requirements change across versions (IDs added/removed, impact/severity/title changes)diffSystems) — compare two HDF system documents for component, data flow, and configuration changesdiffSboms) — CycloneDX/SPDX package-level diffs (added, removed, updated)amend subpackage) — merge overrides into results, verify amendment chains, compute effectiveStatus/effectiveImpact/dispositionAdditional capabilities:
| Package | Relationship |
|---|---|
| hdf-schema | Provides HDFResults, HDFBaseline, and system types that hdf-diff consumes |
| hdf-validators | Used to validate comparison output against the HDF comparison schema |
| hdf-cli | hdf diff and hdf amend commands wrap this library for CLI use |
npm install @mitre/hdf-diff
import { diffHdf, diffBaselines, diffSystems, render } from '@mitre/hdf-diff';
// Compare two evaluation results (temporal mode)
const comparison = diffHdf(oldResults, newResults);
// Compare baseline evolution (track requirement changes across versions)
const baselineDiff = diffBaselines(oldBaseline, newBaseline);
// Compare system documents (component/data-flow drift)
const systemDiff = diffSystems(oldSystem, newSystem);
// Render as markdown, JSON, CSV, or terminal
const md = render(comparison, 'markdown', { detail: 'full' });
const json = render(comparison, 'json');
// Check exit codes for CI
import { computeExitCode, EXIT_IDENTICAL } from '@mitre/hdf-diff';
const code = computeExitCode(comparison);
if (code !== EXIT_IDENTICAL) process.exit(code);
hdf-diff supports multiple strategies for matching requirements across evaluations:
import { diffHdf, createFuzzyTitleStrategy } from '@mitre/hdf-diff';
const comparison = diffHdf(oldResults, newResults, {
matchStrategy: createFuzzyTitleStrategy(0.8), // 80% similarity threshold
});
import { diffSboms } from '@mitre/hdf-diff';
const sbomDiff = diffSboms(oldSbom, newSbom);
// Shows packages added, removed, updated, or unchanged
# Results comparison
hdf diff old-results.json new-results.json
hdf diff old-results.json new-results.json --format markdown
hdf diff old-results.json new-results.json --json
# System drift detection
hdf diff old-system.json new-system.json
# SBOM comparison
hdf diff --sbom old-sbom.json new-sbom.json
# Baseline mode (golden baseline vs current scan)
hdf diff --mode baseline golden.json current.json
The diff engine is also available as a Go module:
import diff "github.com/mitre/hdf-libs/hdf-diff/go/v3"
See the hdf-diff/go directory for the Go API.
The HDF Comparison schema that hdf-diff produces is documented at https://mitre.github.io/hdf-libs/schemas/.
Apache-2.0 © MITRE Corporation
FAQs
Structured comparison of HDF evaluation results — tracks what changed, why, and by how much
We found that @mitre/hdf-diff demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.