The Drift Log · Provenance, licensing and the paper trail
Provenance-First Build Intent: Licensing Invariants Before Disk Writes
23 November 2026 · 6 min read · 1297 words · inference

Evaluate license compatibility and origin invariants at a build intent gate before external or agent-generated code ever writes to disk.
Most engineering teams discover licensing violations during a release audit or an acquisition due diligence. An automated scanner flags three hundred lines of copy-pasted code buried in a utility module. The code has no headers, no attribution, and an ambiguous origin tracing back to a copyleft repository or a developer’s unlicenced personal Gist.
At that point, the damage is done. The author has moved on, the context is lost, and the remediation path is painful: either perform an emergency rewrite under release pressure or stop shipment while legal counsel reviews the risk.
Scanning for licensing defects after code lands in a repository is an architectural failure. Software provenance is not an audit checklist to run before a deployment. It is an operational constraint that must be resolved before a single line is written to disk.
The Post-Merge Audit Trap
Most modern compliance pipelines treat software provenance as a post-facto discovery problem. The workflow is familiar:
- A developer or automated coding agent writes code into a branch.
- The pull request merges into
main. - A Software Composition Analysis (SCA) tool or Software Bill of Materials (SBOM) generator runs asynchronously on a schedule or during staging builds.
- The scanner flags an alert in a dashboard nobody checks until a compliance gate blocks a production deployment.
This sequence places the compliance boundary at the wrong end of the delivery pipeline. Once unlicensed or incompatible code is committed, it enters the repository history. Even if the code is rewritten in a subsequent commit, proving that the replacement is not a derivative work of the tainted original remains legally ambiguous.
The root problem is temporal. Traditional linters run at edit time, type checkers run at compile time, but provenance and license invariants are deferred to audit time. When automated agents write code, this lag becomes fatal. An agent instructed to solve a problem will pull the most statistically probable solution from its training context or vendor an external snippet without verifying whether the target repository can legally execute those terms.
If your pipeline cannot verify origin and licensing terms before the file system updates, you are running an open ingest pipeline for legal liability.
Treating Licenses as Executable Invariants
A software license is not ambient documentation. It is a precise set of permissions, obligations, and restrictions. When you vendor external logic into a proprietary system, you are not merely adding functionality; you are evaluating a set of logical invariants.
To enforce these rules automatically, your tooling must treat license invariants with the same rigor as type invariants:
- Origin Assertion: Every incoming symbol must map to an immutable, verifiable origin—such as an absolute URL, an archive hash, or an explicit first-party attribution record.
- SPDX Conformance: The license expression must parse to a valid SPDX identifier. Unlicensed code, custom "free for non-commercial use" text, or ambiguous multi-licensing must resolve to an explicit failure state unless an override is declared.
- Compatibility Matrix: The license of the incoming artifact must be algebraically compatible with the host project's target license. An AGPL-3.0 snippet cannot be vendored into an Apache-2.0 library without forcing copyleft obligations across the boundary.
- Attribution Invariants: If the license requires retaining copyright notices (such as MIT or BSD-3-Clause), the pipeline must verify that the required attribution blocks are present in the proposed file structure before the write proceeds.
When these checks run as an active gate, the concept of an "unknown origin" ceases to exist in the repository. For more on breaking down vendor constraints into actionable checks, see our note on extracting licensing invariants from vendored dependencies.
The Build Intent Gate
The correct place to evaluate software provenance is at the build intent gate.
A build intent gate sits between the entity proposing a change (a developer, a scaffolding script, or an agent) and the write operation itself. Before any modification is applied to the workspace, the proposer must register an Intent:
Intent = (Target File, Proposed Patch, Origin Reference, Declared Invariants)
The gate acts as a non-bypassable arbiter. It parses the intent, validates the patch contents, checks the origin signature, and evaluates the licensing compatibility against the project's root policy.
If the invariants hold, the gate emits a write token, and the file modification proceeds. If the invariants fail, the gate rejects the operation outright. No files are modified, no dirty commits enter git history, and the system returns a terminal error detailing the exact contract violation.
+------------------+ +-------------------+ +--------------------+
| Agent / Dev | ----> | Build Intent Gate | ----> | Workspace Files |
| (Proposes Patch) | | (Evaluates Rules) | | (Permitted Writes) |
+------------------+ +-------------------+ +--------------------+
|
v
[ Invariant Rejection ]
(No disk write occurs)
By decoupling the intent to write from the execution of the write, license enforcement shifts from a passive monitoring task to an active precondition.
A Worked Example: Rejecting a Vendored Snippet
Consider an agent or developer attempting to vendor a fast string-searching function into an Apache-2.0 repository. The proposer submits an intent payload containing a snippet harvested from an external project.
Here is the structured intent submitted to the gate:
{
"action": "vendor_snippet",
"target_path": "src/utils/search.ts",
"origin": {
"source_url": "https://github.com/example/fast-search",
"commit": "8f3b12a",
"declared_license": "GPL-3.0-only"
},
"content": "export function findPattern(text: string, pat: string): number { ... }"
}
The project enforcing the build intent gate declares a strict root policy: all vendored utilities must be compatible with Apache-2.0, must carry an explicit SPDX identifier, and must retain original author attribution.
When the build intent gate processes this payload, it evaluates the licensing compatibility graph:
- Parse Target Policy: Host repository is
Apache-2.0. - Parse Incoming Invariant: Snippet is
GPL-3.0-only. - Evaluate Compatibility:
GPL-3.0-onlylogic cannot be incorporated into anApache-2.0codebase without imposing GPL copyleft obligations on the entire downstream distribution. - Evaluate Attribution: The proposed
contentomits the original copyright banner required by Section 4 of GPL-3.0 and standard attribution invariants.
The gate terminates immediately and returns a rejection response:
{
"status": "REJECTED",
"error_code": "LICENSE_INCOMPATIBILITY",
"violations": [
{
"rule": "COMPATIBILITY_CHECK",
"host_license": "Apache-2.0",
"incoming_license": "GPL-3.0-only",
"detail": "Inbound copyleft terms violate outbound permissive repository policy."
},
{
"rule": "ATTRIBUTION_MISSING",
"detail": "Source requires copyright banner retention; payload contained bare AST."
}
],
"write_permitted": false
}
Because the gate intercepted the proposal at the intent stage, zero lines of GPL-3.0 code touched the local file tree. The developer or agent receives actionable feedback instantly and can select a cleanly licensed alternative or implement the algorithm from specification.
To understand how attribution headers should be constructed when vendoring permitted code, refer to our guide on a continuous license attribution pipeline for vendored code.
How SHPBL Solves This
SHPBL eliminates provenance ambiguity by operating a strict Build Intent gate across all write surfaces. Every component in the catalog is model-independent, computed from verified first-party pipelines, and fully owned outright.
When tools consume capabilities through our MCP server, the typed TypeScript SDK, or the HTTP API, proposals pass through an automated gate where license invariants and checksums are resolved before delivery. Every release archive is sealed by published checksums, verifiable against our root of trust.
To inspect how your current repositories handle dependencies and provenance obligations, run a free repository evaluation.
What to Do on Monday
You do not need a complete workflow overhaul to start enforcing provenance at the write boundary. You can start with three concrete technical steps:
- Define a Machine-Readable License Allowlist: Write a simple JSON or YAML file at the root of your project specifying accepted SPDX identifiers (for example:
["MIT", "Apache-2.0", "BSD-3-Clause"]). Make this file the single source of truth for CI and local tooling. - Intercept File-Drop and Vendor Scripts: If your team uses scripts or agent tools to vendor external code into a
/vendoror/third_partydirectory, wrap those scripts in a pre-write check. Require an explicit origin URL and license header in the input arguments. If the header is missing or unparseable, terminate the script before creating files. - Block Unattributed AST Ingest in Agent Prompts: If developers use coding assistants, configure system prompts or pre-commit hooks to flag code blocks that paste non-trivial algorithms (>50 lines) without an associated provenance declaration.
Every line of code you do not own and cannot trace is an unhedged balance-sheet liability. Move the check from your release audit to your build intent gate, and ensure that illegal code never crosses the boundary into your repository in the first place.
Keep reading
Next in the log
- Continuous License Attribution Pipeline for Vendored Code
Vendored code strips package manifests and breaks standard dependency scanners. Here is how to enforce license invariants continuously in CI.
- Rejecting Ambiguous SPDX Identifiers in CI Pipelines
Informal license strings like BSD-style or slash delimiters break automated SBOM tooling. Enforce strict SPDX grammar at your CI build gate.
- Validating Copyleft Boundaries in Multi-Package Repositories
Monorepo workspace links let copyleft dependencies leak into proprietary binaries across unmonitored internal package boundaries.
The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.