.env
file) via pydantic-settings — see src/scheduling_bridge/config.py.
Market setup
Engrate
AREA_MARKET_IDS maps each control area to its identifiers:
Market communication
Beyond the identifiers above, the message loops have their own switches — PARTIN, Zuordnungsermächtigung and the APERAK acknowledgements:Trader sFTP
Erstkontakt mailbox (SMTP)
LLM reply classification: with a key set, every reply is read by the
Claude API, which returns a strict verdict (bestätigt / Rückfrage /
abwesend / unzustellbar / Empfangsbestätigung / Ablehnung / sonstiges)
with a verbatim Beleg quote and a confidence. The model only labels —
all actions stay in the bridge, which verifies the quote appears
literally in the mail (and is not a sentence of our own template), only
forwards to Vertreter addresses that literally occur in the mail, and
demotes anything below the confidence bar to a Wiedervorlage. On API
failure the regex classifier takes over (
classifier_degraded event);
LLM/regex disagreements are logged (classifier_disagreement).
Replies are processed, not answered: the mailbox reconciliation adopts
hand-sent Erstkontakt mails from Sent/Archive into the ledger, forwards
the original mail to a Vertreter named in an Abwesenheitsnotiz — only while
the Erstkontakt is still outstanding; a note answering a Quittungs-Nachfass
or Korrektur mail, or from a partner already past Erstkontakt, becomes a
Wiedervorlage with faellig_am read from the note (“bis einschließlich
04.09.” → due on the 5th) and nothing is forwarded — and files bounces and
vertreterlose Abwesenheiten as Wiedervorlagen. The mail body ships
with the package (data/erstkontakt_vorlage.txt), recipient addresses come
from the BDEW code list (data/nb_kontakte.json), and the attached
Kontaktdatenblatt (XLSX) is rendered from the PARTIN_COMPANY settings.
Inbound API scopes and audit
See Security for the full model — named callers,
rotation, OIDC and rate limiting.
Alerting
See Alerting for what pages and what stays quiet.
In the Azure deployment all of these are wired up by the Bicep template —
secrets as Container Apps secrets, the audit directory on an Azure Files
mount, and the orchestrator timer with the process key. See
Azure deployment.