Skip to content

The Drift Log · Provenance, licensing and the paper trail

Detecting Dual‑License Ambiguity in Vendored Libraries with SHPBL

20 November 2026 · 3 min read · 651 words · established

A wax seal resting on a page of hash digests

Run SHPBL’s model‑independent extractor to generate a file‑level SPDX SBOM and catch dual‑license ambiguities before release.

The hidden liability in a permissive manifest

A recent pull request added a library that declared an MIT licence in its package.json. The code compiled, the tests passed, and the team merged it. Two weeks later the security team flagged a subdirectory that contained a copy of a utility licensed under GPL‑2.0 only. The top‑level manifest never mentioned the restriction. The project now carries a copyleft obligation it cannot satisfy.

The failure mode is trusting the root manifest as the sole source of truth. When vendored code is copied, stripped, or generated by an AI agent, licence headers are often lost. The result is a dual‑license ambiguity that silently expands the supply chain risk.

Why file‑level markers matter

Each source file is the atomic unit of provenance. A file that begins with /* SPDX‑License-Identifier: GPL-2.0-only */ carries a legal statement that cannot be overridden by a higher‑level declaration. If a downstream distributor relies only on the top‑level manifest, it may ship GPL code under an MIT banner. That breach can trigger injunctions, forced open‑sourcing, or monetary penalties.

Correct posture: scan every file that enters the repository, record its SPDX identifier, and compare the set against the declared package licence. Any mismatch is a red flag that must be resolved before the artefact leaves the build pipeline.

A minimal workflow to surface dual licences

  1. Collect the source tree – Clone the repository or fetch the vendored archive. Include hidden files; licence metadata often lives in LICENSE files beside the code.
  1. Run a file‑level licence extractor – Use a tool that reads SPDX comments, COPYING files, and known header patterns. The extractor must be model‑independent; it computes the licence from the text, it does not guess.
  1. Aggregate into a provisional SBOM – The output is a list of <path, licence> tuples. Do not sum counts; treat the engineered catalog and the discovery‑engine vault as separate reports.
  1. Apply the certification harness – Feed the provisional SBOM to the harness. It will label each artefact as CERTIFIED, PROVISIONAL, INCONCLUSIVE, or FAILED. A PROVISIONAL verdict means the artefact is reproducible but its licence correctness is not yet asserted.
  1. Gate the build – The Build Intent gate checks the harness verdict. If any file carries a licence that conflicts with the package’s declared licence, the gate rejects the write. The developer receives a clear report and can either replace the vendored code or adjust the manifest.

Running this workflow daily catches dual‑license ambiguity before it reaches production. It also creates a repeatable audit trail for software provenance, satisfying compliance auditors without manual triage.

The pipeline described above is the same approach documented in our pillar post on continuous licence attribution for vendored code. See the detailed design in /blog/continuous-license-attribution-pipeline-for-vendored-code.

How SHPBL solves the problem

SHPBL provides a model‑independent library that harvests licence metadata from any repository. The same method powers the MCP server, the HTTP API, the typed TypeScript client, and the offline tool – all gated by the same Build Intent meter. A free repository evaluation lets you run the extractor on a target codebase without cost. The certification harness records a verdict for each artefact, exposing dual‑license ambiguities early. Use the offline edition to generate repeatable SPDX SBOMs that match the published checksums in our root‑of‑trust. For a full walkthrough, start at /evaluation and follow the links to /harness and /sdk.

Monday’s concrete step

  1. Identify a recent vendored dependency in your codebase.
  2. Run the SHPBL offline tool (or call the HTTP API) to extract file‑level licences.
  3. Review the provisional SBOM for any licence that differs from the package’s top‑level declaration.
  4. If a conflict appears, either replace the vendored code or update the manifest to reflect the true licence.

Doing this before the next release removes the hidden liability and brings your supply chain into compliance.

This post supports the longer argument in Continuous License Attribution Pipeline for Vendored Code.

Keep reading

Next in the log

The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.