Skip to main content

regulator-portal-service — Sync Contract

Version: 1.0 Status: Draft Owner: Regulator-facing + Legal Last Updated: 2026-04-21 Companion: DOMAIN_MODEL · API_CONTRACTS · EVENT_SCHEMAS · ADR-0004 §14 Multi-region

This document defines what other services depend on from regulator-portal-service and what it depends on from them. It is a leaf consumer in the platform data graph: read-only against upstream, write-only to its own schema, and produces events for downstream analytics + SIEM.


1. Consumers of regulator-portal-service

ConsumerInterfaceDependency typeSLA expectation
ATRA regulator users (browser + API)HTTPS REST :3082 (mTLS national PKI)Synchronous, user-facingP95 ≤ 500 ms; 99.5% availability
External auditorsHTTPS REST :3083 (mTLS auditor PKI)Synchronous, read-onlyP95 ≤ 500 ms; 99.0% availability
ATRA SIEM (Splunk / Logstash / QRadar)Outbound push (HEC, HTTP, syslog-TLS)Asynchronous, at-least-onceLag ≤ 60 s; disk-WAL ≤ 24 h on outage
admin-dashboard (EP-ADMDASH-10)HTTPS REST :3084 (Kong JWT)Synchronous management surfaceP95 ≤ 500 ms; 99.5% availability
analytics-serviceNATS regulator.* consumerAsynchronous archiveLag ≤ 60 s
notification-serviceNATS regulator.complaint.received.v1, regulator.report.ready.v1AsynchronousLag ≤ 60 s

2. Dependencies of regulator-portal-service (read-through only)

DependencyInterfaceFailure behaviour
compliance-enginegRPC /v1/compliance/audit-log + REST /v1/compliance/reportsPartial report with WARNINGS section; no silent omission
consent-ledger-serviceREST /v1/internal/consent/aggregatesSame — report annotates missing slice
sender-id-registry-serviceREST /v1/internal/registry/exportsSame
cdr-mediation-servicegRPC /v1/internal/cdr/statusDaily CDR status report displays STALE if stale
analytics-service (ClickHouse cold-tier)HTTPS queryCold-window reports tagged with data-age
auth-serviceNATS auth.events.*SIEM forwarder falls back to disk-WAL
firewall-serviceNATS firewall.audit.v1Same
fraud-intel-serviceNATS fraud.detected.*Same
cbc-serviceNATS cbc.audit.v1Same
Postgres regulator schemaConnection poolService /ready returns 503; portal degraded
RedisCache + session storeRe-auth required; reports can still be generated
NATS JetStreamEvent producer + consumerOutbox queues; disk-WAL engages for SIEM
Vault (Transit + KV + PKI)HTTPS APIHSM signing blocked; see FM-04
HSM (PKCS#11)network / softhsm2Same
S3 (ghasi-regulator bucket)HTTPSReport downloads blocked; LI delivery blocked
SFTP (ATRA drop-box)SSH-2LI delivery retry + FM-06 runbook

3. Conflict Policy per Aggregate

This service owns all writes to its own schema. There is no multi-master; multi-region strategy is active-standby (sovereign primary, DR warm standby). Conflict policies are therefore trivially defined but documented for completeness and for cases where the DR region takes over.

AggregatePolicyRationale
RegulatorUserserver_authoritative + CRL cascadeSource of truth is national PKI; DB reflects
LiRequestappend_only transitions via dual-controlMonotonic state machine; never rewinds
LiAuditEntryappend_only (Postgres rule-protected)Hash-chain makes tamper evident
Complaintserver_authoritativePlatform-owned state; regulator reads back
ScheduledReportserver_authoritative (platform admin)Configuration
ReportJob / GeneratedReportappend_only terminal stateOnce READY, immutable; signature binds contents
AttestationControlserver_authoritative (platform admin)Catalog
AttestationEvidencelww+diff on collectionLater collection wins; evidence files immutable by hash
AttestationBundleappend_only (annual)Once signed, immutable (permanent object-lock)
SiemDestinationserver_authoritative (platform admin)Configuration
SiemDeliveryLogappend_only with terminal ACKED/DEADLETTEREDDelivery attempts append forever
AuditorAccessserver_authoritative with TTL enforcementLegal sign-off + backend TTL sweep

4. Outbox / Inbox Patterns

4.1 Outbox (produced events)

  • Every state change writes regulator.outbox(event_id, subject, payload) in the same transaction as the aggregate mutation.
  • A relay pod tails outbox WHERE published_at IS NULL and publishes to NATS.
  • Published rows are pruned 7 days post-publish for low-sensitivity events; LI and attestation events are retained indefinitely mirrored to immutable S3 (s3://ghasi-regulator/outbox-archive/).

4.2 Inbox (consumed events)

  • SIEM forwarder is a durable NATS consumer with explicit ACK per delivery.
  • Complaint-ingest event consumer is idempotent on regulatorRef (ATRA's unique reference).
  • Auditor access lifecycle events (regulator.cert.revoked.v1 from auth-service or self-emitted) cascade-invalidate sessions in Redis.

5. Read-Through Semantics

regulator-portal-service never caches upstream authoritative data beyond short-lived in-request memoization (≤ 5 min). Reports are assembled at generation time and then the assembled snapshot is signed and frozen in S3. This means:

  • A re-run of the same report can return different results if upstream state changed — by design (each report is a point-in-time snapshot).
  • Once signed, the report is immutable (signature binds contents). If ATRA disputes, regeneration is a new reportJobId.

6. Multi-Region Topology

Per ADR-0004 §14:

ConcernPrimary (sovereign AF)DR (regional)
Regulator-facing endpointsMUST serve from sovereign regionDisabled (regulatory data residency)
Auditor-facing endpointsSovereign by defaultEnabled only for auditor firms with legal cross-border agreement
Postgres regulator schemaLeaderRead replica (stream replication, not multi-master)
RedisRegionalWarm standby
NATS JetStreamRegionalMirror with 3 replicas
S3 ghasi-regulatorSovereign region onlyNo cross-region replication for LI/complaint data; bundles may be cross-region replicated for disaster recovery
SIEM forwardingFrom sovereign region outboundDR also forwards during active failover only
HSMRegional (on-prem)Secondary HSM (cold standby)

Failover. Loss of the sovereign region is a declared incident. DR activation requires CISO + CTO dual-sign per ADR-0004 §14 runbook. Regulator-facing traffic redirection requires ATRA coordination (pre-negotiated CNAME flip). LI workflow is paused during failover — regulators are notified via pre-agreed out-of-band channel.


7. Schema Stability Guarantees

REST

  • /v1/* endpoints are stable within the major version.
  • Field additions with defaults are non-breaking.
  • Breaking changes ship as /v2/* with a 180-day deprecation window coordinated with ATRA.

Events

DB

  • External consumers (audit firms pulling exports) depend on the JSON-structured PDF reports, not on the Postgres schema directly. Schema changes are unobservable to consumers.

8. Versioning Policy

  • REST: semantic within /v1/.
  • Events: subject-level v1v2 migration per deprecation window.
  • Database: forward-only migrations; expand/contract pattern; additive reviewed by Security for PII fields.