---
id: JNY-PFM-OPS-005
title: Commercial contract changes update stored application coverage
feature: FEAT-PFM-OPS-03
product_area: platform
module: operations
revision: 1
status: draft
product_intent: confirmed
implementation_evidence: partially-observed
supersedes: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
actor: ACT-PFM-043
goal: Keep commercial coverage aligned with recognized contract terms and renewals.
capabilities:
  - CAP-PFM-OPS-012
  - CAP-PFM-OPS-014
screens: []
steps:
  - 'n': 1
    surface: receiveHubspotWebhook
    action: Receive a HubSpot contract-change delivery.
    capability: CAP-PFM-OPS-012
    expected: Verified delivery resolves the known company and requests its synchronization.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/e2e/hubspot-licensing.e2e.spec.js#accepts a correctly signed
      delivery and enqueues the company its contract belongs to
  - 'n': 2
    surface: job
    action: Process that company’s queued contract read.
    capability: CAP-PFM-OPS-012
    expected: 'A complete read stores the commercial copy, derived windows and success health together.'
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#writes
      the snapshot, the windows and the health row in one go
  - 'n': 3
    surface: job
    action: Request invalidation for changed coverage.
    capability: CAP-PFM-OPS-012
    expected: The stored commercial change requests a flush but still needs operational readiness for usable access.
    provenance: observed
    source: 'services-platform:modules/licensing/services/sync/sync-company-licences.ts:syncCompanyLicences'
  - 'n': 4
    surface: job
    action: Reconcile linked commercial companies overnight.
    capability: CAP-PFM-OPS-012
    expected: Resolved adjacent renewal terms extend continuous coverage.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#extends
      the licence to the end of the new term, as one window
  - 'n': 5
    surface: job
    action: Resolve availability after an unrenewed term.
    capability: CAP-PFM-OPS-014
    expected: Finite coverage passes through its grace before becoming expired.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/unit/availability/application-availability.spec.ts#answers
      expired the day after the grace ends, which is when a licence really runs out
alternates:
  - from_step: 2
    condition: A term is unreadable or a line has no recognized product mapping.
    path: Retain a resolution flag and omit the unsupported coverage.
    outcome: Other recognized commercial lines can still grant coverage.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#flags
      a SKU the product map does not know, and licenses everything the others do
failures:
  - from_step: 1
    condition: The delivered signature does not match the request.
    path: Reject verification without queue publication.
    outcome: A later nightly pass remains an independent opportunity to read linked companies.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/e2e/hubspot-licensing.e2e.spec.js#refuses a delivery whose
      signature was made for another body
  - from_step: 2
    condition: The provider cannot finish reading the company.
    path: Record the failed read without replacing commercial data.
    outcome: Stored windows remain and their known expiry dates still apply.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#licenses
      the company again, unchanged, when the next read works
  - from_step: 2
    condition: Provider token configuration is absent.
    path: Record an unconfigured read outcome.
    outcome: Existing coverage remains and no provider-failure alarm is raised.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#records
      that there was nothing to read, and does not fail
rules_in_play:
  - BR-CAP-PFM-OPS-012-05
  - BR-CAP-PFM-OPS-012-06
  - BR-CAP-PFM-OPS-012-08
  - BR-CAP-PFM-OPS-012-12
  - BR-CAP-PFM-OPS-014-03
assertions:
  - id: AS-JNY-PFM-OPS-005-01
    statement: Provider-read failure leaves stored windows intact while their existing term and grace still govern.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#changes
      no snapshot, no window and no last success
  - id: AS-JNY-PFM-OPS-005-02
    statement: >-
      Cancellation requests invalidation when it changes windows, using the same changed-window path as
      additional coverage.
    provenance: test
    source: >-
      services-platform:modules/licensing/tests/integration/services/sync/sync-company-licences.integration.spec.js#asks
      for a flush when a licence is taken away, as fast as when one is given
e2e_policy: none
e2e_reason: >-
  This commercial integration has no browser flow, and existing provider evidence is stubbed; real source
  activation requires separate verification.
proved_by: []
---

# Commercial contract changes update stored application coverage

## Story

A verified commercial delivery requests a read of the known company’s terms. Complete synchronization replaces stored coverage and requests authorization invalidation when the result differs. Renewals, grace and known expiry remain time-based decisions even during an outage. The pinned operating record still requires real-provider activation, and new commercial coverage does not currently initialize missing application readiness.
