Skip to content

/wbLicense — Exhaustive Simulation () ​

/wbLicense is the IP guardian. It scans dependency trees for compliance conflicts. The central principle: fail-closed. If a GPL dependency sneaks into a proprietary package, /wbLicense doesn't warn — it halts. The assumption is that deploying a copyleft violation is always worse than delaying a release.

Read this if you want to know what the allow-list contains and how the compliance audit classifies a dependency.


1. Role & target ​

AspectBehavior
RoleThe Open-Source Compliance & IP Guardian.
TargetSource files (headers), node_modules trees (audit), or directories (LICENSE generation).
Cell scopeNone. /wbLicense doesn't interact with plans.
Side effects allowedPrepending headers to source files. Creating LICENSE/NOTICE files.
Side effects forbiddenModifying code logic, removing dependencies, altering package.json (except license field).

--audit is read-only — it scans and reports, and never writes to a source file. A compliance audit that also mutated the tree would be unusable as a gate: it might reveal that you shouldn't have been writing to those files at all (wrong license type for the package).


2. Argument resolution ​

FormExampleWhat /wbLicense does
Specific fileCommand: /wbLicense src/WBC.jsPrepends the standardized copyright header to line 1.
Directory pathCommand: /wbLicense packages/wb-coreScans wb-core's dependency tree for compliance conflicts.
Comma-separatedCommand: /wbLicense src/app.js,src/index.cssInjects headers in both files using correct comment syntax (// ... vs /* ... */).
Workspace globCommand: /wbLicense apps/*Generates a unified Compliance Report across all consumer apps.

The comment syntax adaptation is non-trivial. /wbLicense picks the right comment format per file extension: // for .js/.ts, /* */ for .css, <!-- --> for .html, # for .py/.sh. JSON files get skipped with a warning — JSON has no comment syntax.


3. Flag matrix ​

FlagShortcutPurpose
--audit-aScans node_modules for license compliance. Read-only — no file modifications.
--dry-run-dSimulates the run without writing to disk.

The allow-list. The compliance audit checks every dependency's license against a hardcoded allow-list:

  • ✅ Allowed: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Unlicense
  • ❌ Blocked: GPL-2.0, GPL-3.0, AGPL-3.0, LGPL (when used in a proprietary package)
  • ⚠️ Review required: No license declared, custom license text, dual-licensed

The wb-labs monorepo uses the __WBC_DEV__ 3-mode gating pattern — the tier system means some packages are proprietary (enterprise tier) and some are open (free tier). /wbLicense --audit respects this distinction: a GPL dependency in a free-tier package is a warning; in an enterprise-tier package it's a halt.


4. Pipelines (the agent-native scenarios) ​

📋/wbLicense Exhaustive Simulation
Pre-release compliance gate on all apps/wbLicense apps/* -a
> /wbLicense apps/* -a
[SYSTEM] Initiating Compliance Audit for apps/*...
[CRAWL] demo.wbc-ui.com: 142 dependencies...
[CRAWL] md.wbc-ui.com: 89 dependencies...
[CRAWL] wbc-ui.com: 201 dependencies...
[REPORT]
| App | Total Deps | Allowed | Blocked | Review |
|---|---|---|---|---|
| demo.wbc-ui.com | 142 | 141 | 0 | 1 (no license) |
| md.wbc-ui.com | 89 | 89 | 0 | 0 |
| wbc-ui.com | 201 | 199 | 1 | 1 |
[ALERT] wbc-ui.com:
❌ BLOCKED: `cool-pdf-generator@2.1.0` — licensed under GNU GPL v3.
⚠️ REVIEW: `legacy-utils@0.9.0` — no license field declared.
[HALT] Deployment blocked. Remove `cool-pdf-generator` or obtain a commercial exception.
⚠️ Note: Before pushing to production, verify no developer accidentally installed a restrictive package:

💠 Pipeline Pre-release compliance gate on all apps ​

Before pushing to production, verify no developer accidentally installed a restrictive package:

💠 Pipeline Header injection after entity name change ​

The company updated its legal entity name. All wb-core source files need updated headers:

💠 Pipeline Dry-run before a mass header change ​

Before committing to 18 file changes, preview what would happen:


5. Edge cases & refusals ​

TriggerWhat /wbLicense does
Unlicensed dependency in node_modules⚠️ Package 'mystery-lib' has no license declared. Human review required.
Header injection into .json file⚠️ Cannot inject comments into JSON format. Skipping config.json.
-i="custom" but no custom template in .agents/❌ License template 'custom' not found. Available: MIT, proprietary, apache.
GPL dependency in a free-tier package⚠️ GPL detected in free-tier package. Copyleft is tolerable here but document the obligation. (Warning, not halt.)
GPL dependency in an enterprise-tier package❌ HALT. GPL in proprietary code. Remove the dependency or obtain a commercial license.

The unifying principle: /wbLicense treats IP compliance as a fail-closed gate. Uncertainty is always escalated to a human (unlicensed deps get ⚠️ review), clear violations halt execution (GPL in proprietary gets ❌), and header injection adapts to file format without the user specifying comment syntax.