Versioned licensing policy declaration

Phase 218 W1 declares Bazaar’s commercial policy dimensions in architecture/licensing/policy-registry.json. Its strict schema is architecture/licensing/policy-registry.schema.json. This is a design and compatibility declaration, not an entitlement decision service or a claim that new policies are implemented. Every entry currently has enabled=false and runtimeState=UNIMPLEMENTED; the W1 schema prohibits enabling any entry.

Approved scope and evidence boundary

The user adopted D1–D6 through the coordinator. The durable authority is planning commit f6ae1ef7039a102d54dd705fe930b825581b72e3, phases/218-generic-licensing-policies/218-DECISIONS-2026-11-26.md:

  • Explicit selected-member organization allocation only; membership grants nothing.

  • No new seat-transfer commercial entitlement; retain historical unassignment and separately authorized new assignment.

  • Product/service or exact immutable coverage; no version-range/upgrade inference.

  • No concurrent leases or new offline allowance; existing certificate validity and verification contracts remain intact.

  • Mandatory planned acceptance: device software, device services without installation, account pools, explicit organization allocation, SITE and USER.

  • No observed-usage metering in the first slice. Fixed issuance increments remain fixed increments, not observed usage.

These decisions approve scope, not a running implementation. The registry also retains an unavailable ARTIFACT_COUNT scenario to preserve the separate phase acceptance for counting artifacts without redefining PRODUCT coverage. It is not silently included in first-slice enablement.

Dimensions and mandatory scenarios

Legal holder ACCOUNT/ORGANIZATION is separate from a consuming DEVICE/USER/SITE, an organization’s beneficiary/acquirer, its management-account representation, its payer and its acquiring actor. The existing license_holder=DEVICE|ACCOUNT field is an allocation/entitlement mode, not the legal holder’s identity kind. An unassigned account pool has allocationStage=HOLDER_POOL, an empty consumingTargetKinds list and no target (targetKind=null) or robot identity. Its separate eligibleSeatKinds lists future DEVICE/USER/SITE allocation choices, not proof that any seat exists. Concrete DEVICE seats use DEVICE_SOFTWARE or DEVICE_SERVICE at SEAT_CONSUMPTION, with verified identity/provenance required; USER/SITE use their own typed scenarios. Pool eligibility never skips those contracts. These are allocation stages, not new canonical resource kinds. Organization procurement uses explicit member ACCOUNT allocations, then each member’s separate typed seats.

The registry records licensed object, coverage, allocation mode, measurement, counting basis, identity resolver, capacity evaluator, validity, offline posture, consumer role, device evidence applicability and billing mapping separately. DIRECT/POOL is not a lease or usage meter. MEMBER_ALLOCATION names the organization-to-member ACCOUNT relation separately from later seat consumption. Every new configuration schema is closed and currently empty: a seller cannot insert arbitrary ignored terms. Quantity/validity and accounting implementation remain the owning waves’ work.

The two DEVICE scenarios have distinct registered type/version pairs because installable validation and service access have different evidence requirements: PER_DEVICE for software and PER_DEVICE_SERVICE for a service. Both count DEVICE rights, independently from coverage. These names are registry contract labels, not claims of an enabled runtime mode.

DEVICE_SERVICE requires a verified DEVICE relationship. Its installable pin, certificate and installation observation are explicitly NOT_APPLICABLE. An application cannot deny such a service merely because no binary or installation exists, or manufacture a certificate to fill a field. Non-device holders and consumers receive no fabricated Thing identity, robot certificate or installation claim. Applicable-but-unknown evidence is different from NOT_APPLICABLE.

Consumers are named as required roles. The current registry has no implementation reference for those roles. The WHITE roster and grant-evidence reads are evidence readers and do not grant runtime permission. W5 must supply a real allow/deny adapter for each enabled combination; W7 proves deployed behaviour.

Validation and truthful verdicts

Run from the Bazaar repository root, with Python standard library only:

python3 scripts/licensing/check_registry.py --check
python3 -m unittest discover -s scripts/licensing -p 'test_*.py' -v

--check validates the registry’s closed schema, typed invariants, complete refusal catalogue, mandatory acceptance and readiness-reference integrity when present. It prints its measured population and explicitly says runtime enforcement is UNMEASURED and parity is NOT JUDGED. It never checks live IAM, billing, signature validation or commercial usage authorization.

The declaration compatibility fixture function is not a runtime API. It reports stable unknown-policy/version, wrong holder/target/coverage/configuration, unsupported lease/meter/inheritance/transfer/range/offline and unavailable-policy codes. Even a structurally compatible candidate remains not_enabled. Negative fixtures exercise every refusal dimension, not one generic disabled shortcut.

JSON parsing rejects duplicate keys and nonfinite numbers. Schema evaluation supports only its declared subset (types, closed properties/requiredness, constants/enums, item/string constraints and oneOf); unfamiliar keywords fail closed, including unused nullable branches. This checker does not claim to be a general-purpose JSON Schema implementation.

Readiness evidence cannot enable a policy

readiness-evidence.schema.json defines separate runtime-contract, executed-test and deployed-acceptance fact shapes. A bundle references only digest-pinned JSON under architecture/licensing/evidence/. It carries a matching scenario, policy/version, consumer, source commit and contract version. Test facts require executed>0, failed=0 and skipped=0; deployed facts require an image digest, timezone-bearing observation time, authorized-principal reference and recorded allow/deny observations. Missing files, tampered hashes or mixed source/consumer versions refuse. Credentials and secrets never belong in these files.

These are static fact and integrity checks, not verification that the stated CI run happened or the image is serving. Arbitrary documents cannot activate a policy: enabled is fixed false in W1 even if a complete bundle is supplied. Runtime enablement requires a later independently reviewed integration change, a real enforcement mechanism and the correct live proof. Synthetic readiness files exist only in temporary test directories and prove checker behaviour; they are never committed as production evidence.

API, CLI and UI integration remains explicit

python3 scripts/licensing/check_registry.py --parity

The registry lists all three real surfaces by exact path: OpenAPI, cli/op-spec.json, and browser generated operations used by publisher/buyer UI. They currently have UNWIRED bindings. --parity reads those files and exits 2, names all unwired surfaces and says W1 integration is incomplete. Missing or invalid files and a claimed BOUND binding with stale digest/advertised keys exit 1. A future reviewed binding adds x-licensing-policy-registry with the registry digest and exact enabled-key list; that checks advertised metadata, not runtime consumer enforcement or UI rendering by itself. Generated op data and real UI selectors still need their owning integration tests.

Do not put the known-unwired parity invocation into an always-red required job. The scoped registry/calibration job may judge the population it actually reads; W1 stays open until its required integration/parity evidence and independent review exist. The coordinator must record any wave-boundary interpretation rather than silently treating declaration-only success as full W1 acceptance.

CI read-set and trigger proposal

python3 scripts/licensing/check_registry.py --list-read-set

The proposed non-deploy CI job runs the two declaration/calibration commands above. Trigger on all these paths, including derived readers and fixtures:

  • architecture/licensing/** (registry, both schemas and any readiness files).

  • scripts/licensing/** (checker, tests and negative/positive fixture data).

  • docs/dev/licensing-policy-registry.md (the declared contract).

  • bazaar-api/openapi/bazaar-v1.json.

  • cli/op-spec.json.

  • gateways/browser/generated/operations.json.

Wiring belongs to the CI owner; no workflow is added by this carrier. A test reads and reports the actual current UNWIRED status so a skip cannot look like three passing runtime bindings. After integration, review/calibrate the job’s real read set and update fixtures to require bound parity. The eventual runtime change must also cover CLI generated op data and publisher/buyer selectors as actual consumers, not just duplicate this metadata.

Freeze and existing-store obligations

The registry requires frozen policy type/version/configuration/coverage plus legal holder, beneficiary, payer, allocation, measurement and counting basis. Offer edits cannot rewrite issued rights, past decisions or accounting units. Extend #207 terms revisions, #204 acquisition/allocations, #499/#500 Site seats, existing grant/capacity/reservation constraints and #209 accounting. DotID owns USER/ACCOUNT/ORG facts; TrustMint owns DEVICE verification. No parallel policy, identity, device-fact or metering store is introduced here. The DRAFT WHITE simulator is reference material, never evidence or a test oracle.

Generated human matrix and typed refusal fixtures

The complete human matrix is derived from the canonical registry, including every root declaration and every per-policy field. It is not a second editable matrix. The fixture schema is derived in the same command; stable refusal values come from the registry catalogue. Positive candidates require typed complete fields; negative mutation values may deliberately be invalid, while mutation field names and expected reason codes remain closed. All thirteen reasons must actually be exercised, and every planned scenario must have exactly one unavailable positive.

python3 scripts/licensing/render_contract.py --write
python3 scripts/licensing/render_contract.py --check
python3 scripts/licensing/check_registry.py --check

The last command now also checks generated matrix/schema byte parity and fixture behavior. This is declaration artifact parity, not the separately incomplete API/CLI/publisher/buyer integration judged by --parity. Neither command enables a consumer. An all-disabled key list alone cannot prove behavioral integration.

Required planned consumer mechanisms

These adapter requirements define the validation obligations of each consumer role. The registry records runtimeState=UNIMPLEMENTED, enabled=false and implementationRef=null; declaration checks grant no runtime authorization. An implementation reference requires reviewed owning source, tests and deployment. Each adapter must consume the frozen policy/version/configuration/coverage, grant and typed canonical subject, perform the existing scoped authorization and validity/capacity checks, and produce an explicit allow/refusal. Reading a roster or evidence book grants no permission. Unknown identity, unavailable authorization or uninterpreted terms must refuse. The matrix supplies the exact resource/unit/dedup/billing declaration for each row; a named role never substitutes for that row’s implementation.

Required consumer role

Required validation mechanism and planned work

INSTALLABLE_DEVICE_VALIDATOR

Consume verified current DEVICE identity and frozen installable pin; validate the real device-software entitlement/certificate contract. Transfer/installation/readiness/enforcement remain distinct observations.

DEVICE_SERVICE_DECISION

A real service operation must validate the verified DEVICE and policy-bound service right directly. Binary, certificate and installation are NOT_APPLICABLE and cannot be an allow prerequisite. Actual service adapter remains required planned work.

NAMED_USER_DECISION

A real application operation must resolve the canonical DotID USER and its named assignment under the frozen grant; no Thing/certificate or email-as-identity substitution. Mandatory planned first-slice work, not a fallback deferral.

ACCOUNT_POOL_DECISION

Validate the ACCOUNT-held pool and locked capacity using existing grants/reservations; a pool is not a consuming device. Subsequent DEVICE/USER/SITE assignments use their own typed adapter.

MEMBER_POLICY_DECISION

Validate canonical ORGANIZATION membership plus an explicit selected member ACCOUNT allocation in existing org acquisitions; membership alone is not a seat or entitlement.

SITEWORKS_SOLUTION_ADAPTER

Validate the existing Solution SITE seat and frozen coverage through the actual SiteWorks consuming operation; site placement is not proof of every device’s right or installation. Actual generic-policy adapter integration remains required.

ARTIFACT_POLICY_DECISION

Count distinct canonical ARTIFACT targets under frozen PRODUCT coverage; selecting exact artifact coverage does not itself create PER_ARTIFACT counting. This additional unavailable row is not silently a mandatory first-slice enablement.

All use NAMED_RESOURCE measurement and existing grant locks/capacity/accounting stores. No role implements leases or observed-usage metering merely through a reservation count. Billing mapping remains the existing #209 declared-unit integration obligation; unit names are not evidence that billing is connected. No new policy, identity, usage or device-evidence store is introduced.