---
id: WF-PFM-OPS-015
title: Re-read every linked company each night
product_area: platform
module: operations
revision: 1
status: draft
design_intent: confirmed
implementation_evidence: partially-observed
inference: []
origin: >-
  services-platform:docs/proposals/application-access-and-entitlements.md#4.4 (built and accepted by Andrew
  2026-10-15)
trigger: 'The daily schedule invokes licence reconciliation at 03:10 UTC.'
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
implements:
  - CAP-PFM-OPS-012
moves:
  - STATE-PFM-OPS-005
crosses:
  - SVC-PFM-OPS-licensing
idempotency: >-
  A repeated pass republishes company reads. Sequential identical reads preserve coverage, while costs and
  health bookkeeping can repeat.
concurrency: >-
  The scheduled function reserves one invocation; published company work is consumed under its separate
  bounded concurrency.
hops:
  - 'n': 1
    actor_or_service: Licence reconcile
    action: 'When configured, read and replace product display data; continue after a catalogue failure.'
    anchor: 'services-platform:modules/licensing/services/sync/reconcile-licences.ts:reconcileLicences'
    seam: schedule
    on_failure: Log the catalogue error and retain earlier product data.
    left_inconsistent: Staff product labels can remain stale.
    observer: Log is the observation surface.
    provenance: observed
    source: 'services-platform:modules/licensing/services/sync/reconcile-licences.ts:reconcileLicences'
  - 'n': 2
    actor_or_service: Licence reconcile
    action: List linked companies and publish one read request each only when provider configuration is available.
    anchor: 'services-platform:modules/licensing/services/sync/reconcile-licences.ts:reconcileLicences'
    seam: queue
    on_failure: Count rejected publications and await a later trigger.
    left_inconsistent: Affected company coverage remains based on earlier reads.
    observer: Pass-result logs and the alarm for missing daily invocations.
    provenance: observed
    source: 'services-platform:modules/licensing/services/sync/reconcile-licences.ts:reconcileLicences'
  - 'n': 3
    actor_or_service: Licensing sync consumer
    action: Process published companies through the shared complete-read and replacement function.
    anchor: 'services-platform:modules/licensing/aws/lambda/LICENCE_SYNC.handler.ts:processLicenceSyncBatch'
    seam: queue
    on_failure: Acknowledge recorded provider outcomes; return thrown processing errors for redelivery.
    left_inconsistent: Failed company reads retain their preceding coverage.
    observer: Sync health read is the observation surface.
    provenance: observed
    source: 'services-platform:modules/licensing/aws/lambda/LICENCE_SYNC.handler.ts:processLicenceSyncBatch'
branches:
  - condition: No provider token
    path: An unconfigured pass publishes no messages and reports the eligible company count.
waits: []
evidence:
  - >-
    services-platform at ad3f6a6: modules/licensing/services/sync/reconcile-licences.ts,
    aws/lambda/LICENCE_RECONCILE.handler.ts, aws/logic/licensing-sync.lambda.ts, licensing.settings.ts;
    docs/licensing.md §12.
  - >-
    codex examination 2026-10-23: checked the pinned source anchors, planning references and enforcement
    boundaries; unresolved limits are recorded in module findings.
controls: [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-003, 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]
---

# Re-read every linked company each night

## What It Does

Nightly reconciliation refreshes the display catalogue and requests a complete read for every linked company when configured. It provides recurring recovery for missed notifications. Calendar expiry of stored terms is evaluated independently by the availability resolver.

## The Flow

```mermaid
flowchart TD
  H0["When configured, read and replace product display data; continue after a catalogue failure."]
  H1["List linked companies and publish one read request each only when provider configuration is available."]
  H0 --> H1
  H2["Process published companies through the shared complete-read and replacement function."]
  H1 --> H2
```

## When Something Fails

Catalogue failure does not stop company publication. Publication refusal is counted but not durably retried by the producer, and repeated failure can extend staleness beyond a day. Invocation absence triggers the silence alarm; provider failures need their own outcome evidence. No token means the pass publishes nothing.
