> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Operating Lerian SPI

> Around-the-clock settlement, certificate rotation, contingency handling, and the reconciliation model behind Lerian SPI.

Lerian SPI is built around two operational realities of Pix: it settles in real time, 24 hours a day, and every settlement is confirmed asynchronously. The rail persists everything before it dispatches, so no message is ever sent unrecorded.

## Around-the-clock settlement

***

Pix settles individually and instantly, around the clock — there is no daily operating window to open or close. Two adjacent surfaces are windowed against their own reference periods: **Pix Automático** scheduling (agendamento) carries settlement windows for each scheduled instruction, and **Conta PI** reports are windowed to a balance or extract reference period.

## Certificate rotation

***

The Pix signing certificate is managed by its lifecycle. You upload the public `.cer` and deactivate a certificate you are retiring; an uploaded **private key is rejected, fail-closed**. Only SHA-256 fingerprints and public metadata are stored, so no key material is ever exposed in a response. Certificate warnings surface before expiry becomes a problem.

## Contingency and recovery

***

When a payment gets stuck, the rail exposes only the actions it can actually perform:

* A **stuck-operations** view lists items that need attention.
* **Recovery-eligibility** evaluation decides whether an operation can be recovered.
* A **recovery action** or **manual resolution** clears an eligible operation.
* A **manual-authorization approvals** workflow gates operations that require an explicit sign-off before they proceed.
* **Evidence-export** jobs package the record of an operation for audit or dispute.

## Reconciliation

***

Reconciliation runs at several grains so the rail's state never drifts from BACEN's:

* **DICT reconciliation** runs, both full and driven by BACEN's event list, keep the key directory in step.
* **Orphaned-key cleanup** removes keys left behind by an interrupted flow.
* **Claim-deadline processing** advances or closes claims against their BACEN windows.
* **Per-settlement reconcile** aligns each payment's settlement state with the ledger.

## Settlement invariants

***

Two invariants hold throughout:

* **A submit is dispatch, not confirmation.** An accepted submit means dispatch was accepted. Only the inbound `pacs.002` status reply yields `settled` or `rejected`, with BACEN's fields projected verbatim.
* **The rail is money-neutral.** It forwards declared amounts exactly and computes no position or balance — every accounting position lives in Midaz.
