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

> Operating Lerian SLC: Nuclea's grade horária cycles, ICP-Brasil A1 custody and rotation, contingency and retransmit endpoints, and per-NUliquid reconciliation.

Lerian SLC runs against two constraints of Nuclea's SLC: rigid daily settlement windows, and regulated ICP-Brasil credentials. The rail enforces the windows, holds the credentials in client custody, and reconciles at several grains.

## Settlement windows and grade horária

***

Nuclea's SLC settles on rigid daily windows set by its grade horária. Lerian SLC evaluates each window as **OPEN**, **PRE\_CUTOFF**, or **CLOSED**, and gates dispatch on the result. The rail holds an operation submitted outside its window in the **QUEUED** state. It dispatches the operation when the window opens. This avoids Nuclea's out-of-window rejection (**ESLC0029**). Lerian SLC raises a proactive alert as a window approaches its cutoff.

## Certificates and custody

***

Lerian SLC delegates signing to a client-controlled custody backend. The client's private key never enters the rail. The signing credential is an **ICP-Brasil A1**, **RSA-2048** certificate. You select the custody backend per deployment: a software key, a **PKCS#11 HSM**, or a **cloud KMS**.

* **SaaS deployments** lock custody to a cloud KMS. The client wraps the private key locally and imports it. The rail then stores only the public certificate and a key reference.
* **Rotation is atomic.** The client resolves the active certificate at connection time, so a rotation takes effect transparently.
* **Expiry alerts** escalate at 30, 15, 7, and 1 day before expiry. The rail emits each one as a `certificate.expiring` event.

## Contingency and recovery

***

* **Dead-letter queue.** The rail parks any inbound RSFN message it cannot process. It holds the message for review and never drops it.
* **Retransmit and recovery endpoints.** An operator can retransmit a transmitted file. The recovery endpoints re-run dispatch, forwarding, and status polling. An outbound operation is **parked** with an alert instead of retrying forever after consecutive counterpart refusals exhaust its transmit-attempt budget. The un-park endpoint is the only way out: it returns the operation to the eligible backlog so the next tick re-drives it. It resets the attempt counter, so a recovered operation receives a full budget. Without a fix for the cause, it parks again after that budget is exhausted.

## Reconciliation

***

Lerian SLC reconciles at several grains so state never drifts:

* **Per operation.** The rail tracks each operation by its NUliquid.
* **Per file.** The rail tracks each file through its lifecycle and its returns.
* **Per NUliquid.** The settlement identifier stays queryable for 30 days.
* **Per clearing cycle.** The rail tracks the clearing net position per cycle and stage. It reports a bilateral divergence. It detects a D0-versus-D+1 value divergence on the D+1 confirmation and flags it.
