> ## 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 SPB

> Operating Lerian SPB: BACEN STR operating windows (GEN0021), ICP-Brasil signing certificate rotation, contingency, and per-case settlement reconciliation.

Lerian SPB works within two operational realities of the STR. The STR opens only inside BACEN's operating windows. Settlement is always asynchronous. The rail persists every message before it dispatches, so it never sends an unrecorded message.

## Operating windows

***

BACEN announces the STR operating-window grades through GEN0021. The rail persists them, and you query the current grades with STR0001. A live schedule view lists the opening and closing times per reference date. The last announcement for a reference date wins. The rail does not impose a generic rejection of every submit outside an operating window. Its explicit schedule-related admission rule is RLPI0007: during the additional-aporte window, it rejects an aporte to a foreign Conta PI. Aportes to the institution's own Conta PI and resgates remain allowed.

## Certificate rotation

***

The rail hot-reloads the ICP-Brasil signing certificate pair with no restart. A rotation swaps the in-memory signing pointer and writes audit evidence. An activation announces the new certificate to BACEN through GEN0006. Responses never expose the private key path or any key material. Certificate warnings surface in the readiness and summary views before the certificate expires.

## Contingency and durability

***

* **Persist-before-send** guarantees the rail dispatches no unrecorded message.
* A **dispatch sweep** retries stuck outbound work.
* An operator retries a **failed event delivery** manually. A delivery that exhausts its retries moves to the `EXHAUSTED` state.

## Reconciliation

***

Reconciliation opens one case per operation-level settlement discrepancy. An operator resolves a case by recording an action against it. The rail locks a terminal case. No one can reopen it or record a new action against it.

## Settlement invariants

***

Two invariants hold throughout:

* **A submit is dispatch, not confirmation.** `SUBMITTED` or `PENDING` means the rail accepted the dispatch. Only the inbound R-leg produces `CONFIRMED` or `REJECTED`. That R-leg carries BACEN's settlement fields — for example `numCtrlSTR` and `sitLancSTR` — projected verbatim.
* **The rail is money-neutral.** It forwards declared amounts exactly and computes no position or balance. Your ledger consumer records any accounting position.
