This repository enforces a continuous-improvement license hygiene policy.
- Zero UNKNOWN license metadata in the dependency graph (baseline locked at 0).
- Deterministic & reproducible reporting (compressed multiline license fields, overrides only for gaps).
- Fast regression detection (trend gating + absolute max == 0).
requirements.lockprovides the enumerated dependency set.tools/license_report.pyextracts license classifiers / metadata.license_overrides.ymlsupplies temporary SPDX-style expressions only when upstream metadata is absent or malformed.
- Generate license report (with overrides applied).
- If report has zero UNKNOWN entries and no explicit ceiling is provided, auto-set
LICENSE_UNKNOWN_ABS_MAX=0. - Run
enforce_license_policy.pywhich tracks trend history (licenses_unknown_history.json). - Fail gate if:
- UNKNOWN count exceeds
LICENSE_UNKNOWN_ABS_MAX(default 0 after baseline attainment), or - UNKNOWN delta upward >
LICENSE_UNKNOWN_TOLERANCE(default 0) whenLICENSE_UNKNOWN_TREND_FAIL=1(default enforced).
- UNKNOWN count exceeds
- Optional defense-in-depth: re-run report with
--fail-on-unknownwhen ABS_MAX=0.
| Variable | Default | Description |
|---|---|---|
| LICENSE_UNKNOWN_TREND_FAIL | 1 | Enable trend delta enforcement. |
| LICENSE_UNKNOWN_TOLERANCE | 0 | Allowed increase in UNKNOWN count before failure. |
| LICENSE_UNKNOWN_ABS_MAX | Auto 0 | Absolute maximum UNKNOWN count (auto-set to 0 once clean). |
| LICENSE_COMPRESS_MULTILINE | 1 (CI) | Collapse multiline license strings for stable diffs. |
| LICENSE_FAIL_ON_UNKNOWN | (derived) | Adds --fail-on-unknown to report when explicitly set. |
- Add only for packages that would otherwise be UNKNOWN and where the SPDX identifier is well established.
- Weekly task: run
license_report.pyafter temporarily renaminglicense_overrides.ymlto surface resolved metadata. - Use
tools/prune_license_overrides.pyto comment out stale overrides no longer needed. - Remove commented stale entries after verification in a follow-up PR for audit clarity.
Some upstream packages omit License metadata but provide classifier(s). Where classifiers are missing or ambiguous, a manual override ensures continuous zero-UNKNOWN baseline without blocking releases.
Trend and current UNKNOWN counts are emitted with [LICENSE_ENFORCE] prefix for log scraping and dashboards.
Example line:
[LICENSE_ENFORCE] unknown_current=0 prev=0 trend_delta=0 history_len=42
- Automatic SBOM license reconciliation.
- SPDX validity canonicalization (normalize dual expressions).
- Alerting / Slack notification on first regression event.
Maintained as part of governance transparency commitments.