License Audits Catch Copyleft Drift Before Release Builds
License obligations accumulate quietly between releases. They arrive with a dependency bump, a vendored helper, a patch file, and nobody notices until a release build is already cut. The fix is unglamorous: audit the resolved dependency graph, not the manifest, and run the check on every merge so drift never reaches a shipping binary.
Copyleft Drift Is a Build-Time Problem
Copyleft is a legal technique: the license grants freedom to use, modify, and redistribute a work, on the condition that derivative works carry the same freedoms forward. That condition attaches to distribution, not to development. A library can sit in a repository for months under a permissive license and then arrive in a release candidate under a copyleft one, and the build is the moment the obligation becomes real.
Drift rarely enters through the packages a team names explicitly. Top-level dependencies get a glance during review because someone typed them into a manifest. The transitive edges, three or four levels down, are where a permissive-looking tree quietly acquires a component whose license requires source disclosure for the combined work. A single upgrade of a mid-level library can pull that in without any diff that looks suspicious.
Once a release build is cut, the obligations are frozen into the artifact. A binary that ships with a copyleft component carries the corresponding source-offer and notice duties whether or not anyone intended it. Discovering this after the build means either reworking the dependency, shipping with an offer the team has not prepared, or holding the release. All three are expensive, and two of them are avoidable.
The asymmetry matters more than the individual incident. Reworking a dependency late in a release cycle touches the same code paths the team just finished stabilizing, so the fix arrives with its own regression risk. An offer prepared under time pressure tends to be incomplete in ways nobody checks until a recipient asks. The cost curve is steep and it bends in one direction: every day the obligation sits undiscovered, the options narrow.
Where Drift Actually Enters the Tree
Dependency upgrades are the most common vector. A library that was dual-licensed or permissively licensed at one version can change its license terms at the next major release, and package managers will happily resolve to the new version if the constraint allows it. The upgrade diff shows version numbers and checksums. It does not show the license family change unless something reads the metadata.
Vendored code is the second vector and the harder one. A helper copied into the tree with its header intact is auditable. The same helper copied without the header, reformatted, or pasted into a larger file loses the only marker that identified its origin. Nothing in the build fails. The code compiles, the tests pass, and the obligation travels with the binary unrecorded.
Generated code carries upstream obligations too. A code generator, a schema compiler, or a protobuf toolchain can emit source that includes runtime snippets derived from the generator's own licensed code. Teams tend to treat generated files as build output rather than as source with provenance, which is exactly why the obligation goes unnoticed. Forked patches round out the set: a local patch that reworks a copyleft component can create a modified work with its own disclosure expectations.
There is a fifth vector that gets less attention: the build toolchain itself. Compilers, linkers, and packaging tools sometimes ship runtime support code that gets statically linked into the output. The tool is not a dependency in the manifest sense, so no dependency scanner reports it, yet a portion of its code may end up inside the artifact. Toolchain provenance deserves its own line in the audit, separate from the application dependency graph.
Auditing the Dependency Graph, Not the Manifest
The manifest states intent. The lockfile states what actually resolved. An audit that reads declared dependencies answers the wrong question, because the package that introduces the obligation is usually not declared anywhere. Scan the resolved lockfile, then walk every transitive edge to the license metadata attached to the exact version that will be built.
Diffing license metadata across release tags is the cheapest early-warning signal available. Take the license map from the previous release and compare it to the current one; a component that moved from a permissive family to a copyleft family should surface as a review gate rather than a surprise. The same diff catches components that disappeared, which matters for notice files that still reference them.
Depth is where naive scanners fall over. A tree with a few hundred direct dependencies can resolve to several thousand packages once transitive edges are counted, and many of those are test-only, documentation-only, or platform-specific and never reach a shipped artifact. Scanning all of them produces a report nobody reads. The useful audit prunes to the edges that feed a production build target, which usually means resolving per artifact rather than per repository.
The trade-off is noise. A strict gate on every license-family change will block legitimate upgrades where the team has already decided the obligation is acceptable, and reviewers start rubber-stamping. The workable compromise is a policy file in version control that lists approved license families and names the exceptions with a reason and an owner. Exceptions get reviewed; everything else fails the build.
Keep the policy file small enough that a new engineer can read it in one sitting. A policy that has grown into a hundred exceptions with no owners is a signal that the gate is misconfigured, not that the team is unusually exposed. Prune expired exceptions on a schedule and let the list shrink.
Reading Obligations Against Build Artifacts
A license report that lists components is not an audit. The question is which of those components actually end up in a shipped binary, and what the license requires for that specific distribution. Map copyleft components to the artifacts that contain them, then read the obligation against the release channel. A component that exists only in a test harness or a build-time tool imposes nothing on the shipped product.
Source-offer requirements need to be checked against how the software is actually delivered. An offer embedded in an about screen satisfies one channel and not another. Notice files need to match the contents of the artifact, not the contents of the repository; a notice file that lists a library removed two releases ago is a small inaccuracy, and one that omits a copyleft component is the failure that matters. For patched components, confirm the modification disclosure is present and accurate.
Static linking deserves its own pass. A copyleft component linked into a single executable is a different obligation shape than the same component shipped as a separate shared library, and the distinction is invisible in a dependency list. Build flags that switch between the two change the answer, so the audit has to read the link map rather than the package metadata.
This is the same discipline that shows up elsewhere in the supply chain. A related piece on firmware maintenance obligations makes the point that provenance recorded at the source is far cheaper than provenance reconstructed later. License metadata behaves the same way: capture it when code enters the tree, and the artifact-level audit becomes a lookup instead of an investigation.
Making Audit a Gate, Not a Scramble
Quarterly audits fail because they run after the drift has compounded. The check belongs on every merge, running against the resolved graph in the same pipeline as tests. When a license-family change appears, the build fails with the component and the edge that introduced it. That is a five-minute fix at merge time and a multi-day negotiation at release time.
Record provenance at vendoring time. When code is copied into the tree, the commit that adds it should carry the origin, the version, and the license, in a file next to the code. Headers get stripped by reformatters and minifiers; a provenance file survives. The same applies to generated code, where the generator and its version belong in the build metadata.
Treat a license diff the way you treat a failing test. It blocks the merge until someone resolves it, either by changing the dependency or by adding a documented exception. The cultural shift is the hard part, since license review has historically sat with legal rather than engineering. The teams that do this well put the policy in the repository where engineers can read it, and keep legal involved in setting the policy rather than in clearing each release.
Instrument the gate so its output is legible to someone who is not a license specialist. A failure message that names the component, the version, the edge that pulled it in, and the artifact it reaches is actionable. A message that prints a license identifier and a policy rule number gets routed to a ticket queue and ignored.
What to Do Before the Next Release
Scan the resolved lockfile for every artifact you ship and diff the license map against the previous release tag, so any family change surfaces with the edge that introduced it.
Re-audit vendored code for stripped headers, and add a provenance file beside anything copied in without one.
Reconcile notice files with the components actually present in the shipped binaries, removing stale entries and adding missing ones.
Add a license-diff gate to CI that fails on unapproved license-family changes, with the approved list and exceptions kept in version control.
Document source-offer handling per release channel, so the offer matches how each artifact is delivered rather than how the repository is organized.