Skip to content

CAP-PFM-OPS-012Derive application licences from commercial contracts

Markdown

CAP-PFM-OPS-012

Derive application licences from commercial contracts

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationPartially observed

KindCapabilityProduct areaPlatformModuleOperational RecordsRevision1

Read atservices-platform ad3f6a65

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Eligible commercial terms resolve to application coverage windows.Provider failure preserves the last commercial copy without extending its known expiry.
Surfaces
apijob
Preconditions
The workspace has a commercial company link and the deployment has a configured provider token.
Postconditions
A completed read replaces the derived commercial windows, while an unsuccessful provider read preserves them.
Constraints
HubSpot is a read-only commercial source, and the documented activation still requires property confirmation.
Intent sources
services-platform:docs/proposals/application-access-and-entitlements.md#10.1 Decided by Andrew on 2026-10-11 (D2, D3, D4)services-platform:docs/proposals/application-access-and-entitlements.md#10.1 (product list confirmed, 2026-10-12)

Controls

48 controls apply, from the corpus control catalogue.

TC-AVL-001 TC-AVL-004 TC-AVL-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-CHG-001 TC-CHG-002 TC-CHG-003 TC-CHG-004 TC-CHG-005 TC-CHG-006 TC-CRY-001 TC-CRY-002 TC-CRY-003 TC-CRY-004 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-IAM-001 TC-IAM-002 TC-IAM-003 TC-IAM-004 TC-IAM-005 TC-IAM-006 TC-LOG-001 TC-LOG-004 TC-LOG-005 TC-MON-001 TC-MON-002 TC-PI-001 TC-PI-002 TC-PI-004 TC-PI-005 TC-SEC-001 TC-SEC-002 TC-SEC-003 TC-SEC-004 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-TEN-004 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
hq.licensing.readapiglobal
hq.licensing.manageapiglobal

Business Rules

19 rules, 16 to be proved before approval. A rule's product intent is derived from its origin: 19 confirmed by a product decision, the rest inheriting this capability's confirmed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Only in-force contracts produce licences; known inactive statuses produce none, and unfamiliar statuses are flagged without granting access.
calculationservicetest
services-platform:modules/licensing/tests/unit/licences/resolve-licence-windows.spec.ts#resolves nothing for a status it has never heard of, and flags it so the vocabulary can be confirmed
02must prove
Confirmed
A contract with unreadable term dates produces no licence and a flag, while an automatic-renewal contract may have an open-ended term.
calculationservicetest
services-platform:modules/licensing/tests/unit/licences/resolve-licence-windows.spec.ts#licenses nothing and is flagged when it has no end date and does not renew automatically
03must prove
Confirmed
Each line-item term boundary independently uses its own date when supplied and otherwise inherits the corresponding contract date.
calculationservicetest
services-platform:modules/licensing/tests/unit/licences/resolve-licence-windows.spec.ts#takes each date independently, so a line may override one and inherit the other
04must prove
Confirmed
The code-held product map expands recognized products into grants, flags unmapped products and grants no applications for integration, payment, service or licence-only products.
calculationservicetest
services-platform:modules/licensing/tests/unit/licences/resolve-licence-windows.spec.ts#licenses nothing and flags the SKU when the map does not cover it
05must prove
Confirmed
Overlapping and adjacent terms for an application combine into one licence window, while genuinely separated terms remain distinct.
calculationservicetest
services-platform:modules/licensing/tests/unit/licences/resolve-licence-windows.spec.ts#leaves a real gap between two terms as two windows, because the licence did lapse
06must prove
Confirmed
Finite licence windows receive seven calendar days of grace, and open-ended windows have no grace end.
calculationservicetest
services-platform:modules/licensing/tests/unit/licences/resolve-licence-windows.spec.ts#is the seven days after the end date that decision D3 settled on
07must prove
Confirmed
The product should notify workspace administrators beginning sixty days before a contract ends; this accepted notice behavior is absent.
policyserviceunknown
08must prove
Confirmed
A complete company read replaces contracts, lines and licence windows transactionally and records success; provider failure preserves the prior commercial snapshot and records a redacted error.
policyservicetest
09must prove
Confirmed
A missing HubSpot token records an unconfigured outcome without changing existing licences or raising a provider-failure alarm.
policyservicetest
services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#leaves the licences of a company synced before the key was removed exactly as they were
10must prove
Confirmed
Changed licence windows request one post-commit authorization flush, whether access increases or decreases, while identical windows request none.
policyservicetest
services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#changes nothing and asks for no second flush when the read is the same as the last
11
Confirmed
Nightly reconciliation, verified HubSpot notifications, manual staff sync and workspace company-link changes feed the shared company-sync operation.
policyservicedocumented
services-platform:docs/licensing.md#12. The operating story
12must prove
Confirmed
Webhook acceptance requires a signature for the exact request body and address within the replay window, and missing secret configuration refuses delivery without revealing verification detail.
validationapitest
services-platform:modules/licensing/tests/e2e/hubspot-licensing.e2e.spec.js#refuses a delivery signed for a different URI, so a signature cannot be replayed at another route
13
Confirmed
Verified deliveries deduplicate company sync requests and resolve contract owners from the stored snapshot, leaving unknown contracts and unsupported events for nightly reconciliation.
policyservicetest
services-platform:modules/licensing/tests/integration/services/sync/accept-webhook-delivery.integration.spec.js#reports an event about a contract it has never seen as unresolved, for the nightly pass to pick up
14must prove
Confirmed
Staff licensing readers can inspect company commercial copies and synchronization health, while company synchronization requires management authority and customer callers are refused.
permissionapitest
services-platform:modules/licensing/tests/e2e/hubspot-licensing.e2e.spec.js#refuses a staff member holding only hq.licensing.read on the sync, with 403
15
Confirmed
Workspace deletion retains company-level commercial copies and licence windows shared by production and sandbox workspaces.
policyserviceobserved
16must prove
Confirmed
The sync worker acknowledges malformed input and recorded provider outcomes, reserving queue redelivery for thrown processing failures.
policyserviceobserved
17must prove
Confirmed
Webhook processing acknowledges failed queue publication, reports refused companies and relies on later reconciliation for recovery.
policyserviceobserved
18must prove
Confirmed
The sync queue allows five receives before dead-lettering, with four-day source retention and fourteen-day dead-letter retention.
no proof recorded yet
lifecycleserviceobserved
19must prove
Confirmed
Contract sync replaces commercial copies and licence windows without initializing a newly licensed application’s missing operational state.
no proof recorded yet
lifecycleserviceobserved

Scenarios

IdGivenWhenThenProvenance
01A renewal begins immediately after the earlier term ends.The company’s commercial snapshot is synchronized.The resolver produces a continuous window through the renewal’s final day.inferred
02HubSpot cannot complete a company contract read.Synchronization records the provider failure.The previous commercial snapshot remains and health records the redacted explanation.inferred
services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#records the reason, so an operator can see why the licences have stopped being refreshed

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.