Skip to content

PRD: License lifecycle, activation & runtime validation

ModuleLicensingPRD IDPRD-ACT-001
StatusReady to devFEATACT
EpicPlaneBANA-1545
Date2026-06-15Versionv1.0
Packages@nx/licensingURDACT
SurfaceBackend
OwnerPhát Nguyễn

What lifecycle, activation & runtime validation are

PRD-PLN-001 established the plan spine - reusable plans with typed feature flags. It defines what a license is; it does not specify the operational runtime path a license travels once issued: how each lifecycle transition is guarded, how devices take and release seats, and exactly what a validation call returns under every license state.

This PRD pins down the issue → activate → validate path as one trustworthy contract: a status-guarded lifecycle state machine, fingerprint-based device activation with seat enforcement, and a validation pipeline whose outcome codes, lazy-expiry behaviour, resolved features, seat handling, and signed certificate are all specified - so every service gates features and seats offline against one definition. This increment turns an issued license into something any running service can trust offline, without calling licensing on every request.

One license, from issuance to validation

An operator issues a subscription license for a merchant. The merchant's POS devices activate by fingerprint, each taking one seat up to the plan's limit; re-activating the same device reuses its existing seat, so no device ever burns two seats. On every launch, a consuming service validates the key once and receives a valid result with the resolved features, seat usage, and a signed certificate it caches and verifies offline. When the license passes its grace window, the next validation flips it to expired and returns an expired result; renewing it restores it to active with a fresh validity window and re-signs the certificate.

Where it's easy to get wrong

Revoke is terminal; expiry is caught lazily, never swept eagerly

The system refuses every nonsensical transition: renewing a perpetual license, reinstating one that was never suspended, and renewing or reinstating a revoked one. A revoked license never comes back to life.

A license past its grace window is caught lazily: it flips to expired on the very next validation, with no background sweeper running eagerly. Before that call, the status still reads active even though it is technically past due.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.