DOC PROVA/ARCH/2026 REV 5 COMPILED 2026-08-12 PURPOSE technical review exhibit set

System Architecture Dossier

PROVA

Denied-Party Screening & Compliance Platform

PROVA screens counterparties — organizations, individuals, vessels, aircraft — against global sanctions and PEP lists, then carries whatever it finds through investigation, decision, and audit. The thirteen exhibits below (A–M) take the platform apart at different seams: the physical machines it runs on, the domain layers that organize its logic, the pattern enforced inside every one of its 29 microservices, the event backbone and the synchronous REST calls that connect them, the exact path one screening request takes from browser to verdict, and the safeguard that keeps an AI agent from ever acting on its own — then how that design holds up in practice: measured performance, watchlist data lineage, the technology trade-offs, the rule for choosing REST versus an event, and the map to AWS.

29
JAVA MICROSERVICES
5
PYTHON AGENTIC SERVICES
7
PROXMOX VMs
23
KAFKA TOPICS
82
EVENT SCHEMAS
31
ADRs RECORDED
140
.JAVA FILES IN THE REFERENCE SERVICE
asynchronous / event-driven — Kafka, background flow, metrics
synchronous / decision-critical — REST calls, deploy path, enforced rules
return path or forbidden edge
A

Hardware & Deployment Topology

Seven purpose-built Proxmox VMs on a home lab network — nothing runs on the laptop that writes the code.

MacBook dev workstation code + git only — no Docker engine here ci source control + CI GitLab CE container registry core compute plane GitLab Runner (shell executor) Traefik + Keycloak (edge) all 29 microservice containers + 5 Python agentic services obs observability prometheus grafana loki · tempo alertmanager git push CI trigger build jar → image → push scrapes /actuator/prometheus + agents /metrics data data plane postgres redis · opensearch one schema per service stream event streaming redpanda (Kafka-API compatible) 23 topics, 82 event schemas objstore object storage minio evidence packages, reports agent trace bodies too ml AI inference ollama — qwen2.5:7b nomic-embed-text on-prem — PII never leaves lab JDBC / RESP Kafka protocol S3 API OpenAI-compat (LiteLLM)
Exhibit A. Code is written and committed on a MacBook only — the machine never runs a container. A push to the ci VM fires a webhook to a shell-executor runner that lives on core itself, which builds the jar, builds the image, and redeploys in place. From there core is the only VM that talks to all four data-plane machines; obs talks to no one — it only pulls.

Every VM has a static address pinned in two independent places, so a reboot can't silently hand a service a new address. Public traffic reaches this same core box through DNS and a firewall NAT rule, terminating TLS at Traefik rather than at the edge.

B

Domain Layer Stack

Six layers of increasing business meaning, each one built strictly on the layer below it.

increasing business abstraction L6 AI-Assisted Compliance Python / FastAPI, off-Gradle agents propose, never decide — every call traced regulator-export-drafter case-investigation-copilot MCP servers: case-action · regulator-export · knowledge-retrieval L5 Decision & Case Workflow four-eyes approval, evidence export case-management batch-screening audit notification (+2 more) L4 Screening Pipeline real-time matching, explainable scoring screening-engine scoring-engine policy-engine matching-engine (+4 more) L3 Watchlist Content Backbone ingest, normalize, version sanctions data watchlist-ingest watchlist-content pep-adverse-media (+1 more) L2 Identity & Core Data tenants, orgs, users, RBAC identity-management (Keycloak Organizations) L1 Foundation cross-cutting libraries every service depends on shared-security shared-messaging shared-http shared-outbox + Traefik · Keycloak · Postgres · Redpanda
Exhibit B. Each layer only calls downward — screening never reaches past case-management into notification, and nothing below L6 knows the agentic tier exists. The AI layer is the odd one out on purpose: it's the only layer not written in Java, and the only one that can propose a change without the authority to make it (see Exhibit F).
C

The Hexagonal Service Pattern

One internal shape, repeated in all 29 services and enforced by ArchUnit at build time, not by convention.

forbidden — ArchUnit fails the build api/ controllers request / response DTOs Jakarta validation exception handler application/ port.in / port.out commands · results @Transactional lives here no HTTP, no DB, no Kafka domain/ aggregates · value objects domain events (records) policy rules zero framework imports. ever. infrastructure/ persistence messaging security integration clients invokes aggregate implements port.out api → application → domain ← infrastructure six ArchUnit rules, run in CI on every service — DpsArchitectureRules is the shared base class
Exhibit C. The rule that matters most: domain/ imports nothing — no Spring, no JPA, no Kafka — so business logic can be unit-tested in milliseconds and never accidentally couples to a delivery mechanism. Controllers inject authorization ports, never the concrete service, for the same reason.
D

Microservices & Event Backbone

Twenty-nine services in three planes. Facts that other services react to later travel as Kafka events; when a caller needs an answer before it can respond, it uses a synchronous REST call (Exhibit I).

DATA PLANE 4 services watchlist-ingest watchlist-content watchlist-management pep-adverse-media OpenSearch BMPM phonetic index OPERATIONS PLANE 16 services screening-engine scoring-engine policy-engine case-management audit notification batch-screening ad-hoc-screening reporting integration-gtwy matching-engine entity-resolution inference model-registry training-orch. training-exec. TENANT PLANE 9 services identity-mgmt admin-console analytics config billing license-entlmt data-retention data-governance support-agent schema-per-service isolation AGENTIC AI TIER Python / FastAPI · 5 deployed regulator-export-drafter case-investigation-copilot mcp-regulator-export mcp-knowledge-retrieval mcp-case-action no direct Kafka production/consumption admin-console BFF bearer propagated REDPANDA EVENT BACKBONE Kafka-compatible API · 23 topics · 82 event schemas across 20 domains dps.screening.events dps.case.events dps.watchlist.events dps.governance.events dps.ai.events dps.agent.events produce / consume produce / consume produce / consume trace only
Exhibit D. Planes are a deployment grouping (ADR-0031), not a trust boundary — every service still owns its own Postgres schema, and no service reads another's database. This diagram shows the asynchronous half: events published to the backbone. The synchronous half — the 41 REST calls made when a caller needs an immediate answer — is Exhibit I, and the AI tier reaches the platform through a bearer-propagated HTTP call to admin-console. The hard rule is that no consumer ever calls another service's REST API from inside a Kafka handler; it publishes another event instead (Exhibit L).
E

Request Lifecycle — a Screening Call

One analyst action, traced through the synchronous request and the asynchronous fan-out it triggers.

Analysttenant SPA ad-hoc-screening screening-engine policy-engine Kafkaevent bus case-management notificationalerts POST /screening/adhoc POST /v1/screening 202 Accepted + requestId GET /v1/screening/{id} — poll, ≤20× @500ms ▽ asynchronous fan-out — fire and forget publish screening.result.finalized consume → create case on hit publish case.created (via outbox) consume → dispatch alert △ synchronous continuation — analyst is still waiting POST /policy/evaluate (score, jurisdiction) BLOCK / REVIEW / ALLOW 200 { result, decision } Total analyst wait: bounded by the poll loop — steps 4–8 overlap, not stacked
Exhibit E. Amber is the part the analyst is waiting on; teal is everything that happens whether or not anyone's watching. case-management never calls notification-service directly — it publishes case.created and moves on, which is the one rule (no HTTP calls inside a Kafka consumer) that shows up most often in code review here.
F

Agent Tool Calling & Human-in-the-Loop Safety

Agents call platform tools over MCP, answer only from retrieved, cited sources, and can propose a case assignment — but cannot make one. A different human always has to say yes, and every guarantee is enforced in code, not in the prompt.

Analyst proposer admin-console stateless BFF (same service handles approve, below) copilot Python — MCP client mcp-case-action closed allow-list server → also written to durable agent trace bearer: analyst's own JWT proxied, bearer propagated assign_case tool call APPROVAL QUEUE agent_trace.agent_approvals (Postgres) · tenant-scoped · durable · status = PROPOSED · ttl 48h INSERT — nothing executes yet Supervisor ≠ proposer admin-console approve endpoint case-management real mutation happens here reads PROPOSED rows for this tenant POST .../approve assign case guard: approver_id ≠ proposer_id — else 409
Exhibit F.1. There is no path from the copilot to case-management that skips the queue — the MCP server's only side effect is an insert. admin-console is drawn twice because it genuinely is called twice, by two different people, in two different sessions; the guard on the approve call is what makes self-approval structurally impossible rather than merely discouraged.

F.2 — Every agent run, stage by stage

Two agents ship today, built from the same shared enforcement layer (agent-security, ADR-0037). Each stage defends the next, and every guarantee lives in code that runs after the model answers — none of them depends on the model following its prompt.

StageCopilot (grounded Q&A)Export drafter (tool-calling)Enforced by
1 · authorizeDeny-by-default: the caller's profile must be explicitly allowed to use the tool, or the run stops with a 403 — never silently degraded.authz · Pillar 1
2 · fetch / retrieveHybrid vector + keyword search over OpenSearch, tenant derived from the caller's bearerCalls the regulator-export tool with the analyst's own tokenMCP · token propagation
3 · groundRetrieved text is fenced as data, not instructions (<<<LABEL:nonce>>> markers) and screened for prompt-injection patterns before it reaches the model; a chunk that matches is quarantined (kept out of the prompt, so it can't be cited) and logged in the trace.datamarking · injection
4 · generateModel-agnostic LlmPort → LiteLLM → on-prem Ollama (qwen2.5:7b). Swapping to Bedrock or a hosted model is one adapter.agent-llm
5 · validateCite-or-abstain (F.4) — fabricated or missing citations become an abstentionReject any number not present in the source packageoutput validators · Pillar 2
6 · fall backAbstain: "the knowledge base doesn't contain this" — a retrieval or model failure surfaces as an error, never as a fake abstentionDeterministic template on a rejected draft, model error or timeout — the export is never degraded by AIagent core
7 · gateBoth agents are advisory (read-only tier). The only state-changing tool goes through the propose → approve queue in F.1.hitl · Pillar 3
8 · traceOne record per run to three failure-isolated sinks: the body to object storage, an index row to Postgres, an event to Kafka that audit-service consumes. MCP calls are traced too, digested rather than dumped.trace · Pillar 4
9 · observeThe same trace record also updates Prometheus metrics in-process: runs by outcome (answered / abstained / fallback), LLM latency and tokens, injection quarantines, MCP calls and errors, plus HTTP metrics on all five agent services. A Grafana “Agent Tier” dashboard and five alerts (abstain rate, fallback rate, MCP errors, LLM p95, 5xx) watch them, and a nightly canary asks the copilot six known-answer questions. The trace proves what an agent did; the metrics show whether it is healthy, fast and affordable.metrics · ops

F.3 — Tool calling over MCP

Agents reach platform capabilities as tools on three first-party MCP servers (Streamable HTTP, internal network only; ADR-0039). MCP sits behind each agent's typed tool port, so a direct-HTTP adapter and an MCP adapter can coexist per tool.

ServerToolsSide effectsUsed by
mcp-regulator-exportregulator_exportnone — read-only proxy to the export packageexport drafter
mcp-knowledge-retrievalknowledge_retrievenone — tenant taken from the bearer server-side, not a tool parameter, so a crafted argument can't read another tenantcopilot
mcp-case-actionassign_case, list_pending_assignments, approve_assignment, reject_assignmentone insert — assign_case only proposes; approve runs the assignment under the approver's token, approver ≠ proposer, and stale proposals expire (default 48 h)copilot (via the admin-console BFF)

Two non-negotiables. (1) Token propagation — every call carries the requesting user's bearer, so a tool acts as that user and never as a privileged service account (no confused deputy). (2) A closed allow-list — the client is constructed with a fixed map of server names to URLs, and that map is the allow-list: an off-list server raises McpServerNotAllowed before any network I/O, and there is no dynamic tool discovery to poison. A red-team harness (agent-redteam) mutates tool descriptions adversarially and asserts each attack is caught by detection, containment, or the approval gate.

F.4 — Cite-or-abstain is enforced in code, not the prompt

A prompt can ask a model to cite its sources; it can't guarantee it will. So each retrieved chunk carries a source id, the model is asked to cite ids as [source-id], and a validator checks the answer against the set of ids that were actually retrieved:

cited = extract_citations(answer)            # every [source-id] token
fabricated = cited - retrieved_ids           # cited, but never retrieved
if fabricated:                       → reject  ("citation_not_retrieved")
if not cited and not explicit_abstain:  → reject  (an unsupported claim)
any rejection                        → the copilot returns an abstention,
                                       with abstained=true and its citations

This caught a real failure in testing: the 7B model invented plausible-looking source ids. The same pattern carries over the export drafter's rule — reject any number not in the package — from figures to citations.

What this check does not do: it confirms that every cited id belongs to a source that was actually retrieved. It does not check that each sentence agrees with the content of the source it cites — a model can still cite a real, retrieved source and misstate what it says. That residual risk is why the copilot's output is analyst input, not a decision: answers come with their citations so a human can check the source, and nothing the copilot says changes a screening or case outcome. Checking each claim against its source (for example an NLI or LLM-judge pass) is a possible later layer, not something built today.

G

Package Layout, Realized

Exhibit C drawn as a diagram. This is the same rule as an actual filesystem — every folder below is real, from screening-engine-service, the platform's reference implementation.

com/infopole/dps/screening/
├── ScreeningEngineApplication.java                 # @SpringBootApplication root — never in a sub-package
├── runtime/RuntimeStackValidator.java              # fails fast at boot if Postgres/Kafka/Redis aren't reachable
├── web/CorrelationIdFilter.java                    # stamps traceId before Spring Security runs
│
├── domain/                                         # PURE JAVA — zero framework imports (see Exhibit C)
│   ├── model/       9 files   ScreeningRequest · ScreeningResult · ScreeningMatch · MatchFactor …
│   ├── enums/       8 files   ScreeningOutcome · ScreeningRequestStatus · ScreeningMatchType …
│   ├── policy/      2 files   ScreeningAuthorizationPolicy · ScreeningTenantAccessDomainPolicy
│   └── service/     4 files   MatchingEngine · ExactFieldMatchingEngine · MatchScoringService
│
├── application/                                    # orchestration only — no HTTP, no JDBC, no Kafka client
│   ├── port/in/     11 files  SubmitScreeningUseCase · GetScreeningDetailsUseCase · PurgeScreeningsUseCase …
│   ├── port/out/    10 files  ScreeningPersistencePort · WatchlistLookupPort · InferenceDecisionPort …
│   ├── command/     2 files   SubmitScreeningCommand · DismissScreeningResultCommand
│   ├── query/       2 files   RecentScreeningsQuery · ListScreeningResultsQuery
│   ├── result/      8 files   SubmitScreeningResult · GetScreeningDetailsResult · PagedResult …
│   ├── exception/   5 files   QuotaExceededException · ScreeningResultNotFoundException …
│   ├── config/      2 files   MlRolloutMode · MlRolloutProperties
│   └── service/     19 files  implements every port.in above — @Transactional lives only here
│
├── infrastructure/                                 # everything domain/ refuses to know about
│   ├── persistence/  15 files entity/ (3 @Entity) · repository/ (3 Spring Data) · ScreeningPersistenceAdapter
│   ├── messaging/     8 files ScreeningEventConsumer · ScreeningResultEventPublisher · payload/ (5 DTOs)
│   ├── integration/   7 files one sub-package per outbound call — watchlist/ · license/ · identitymanagement/
│   ├── security/      3 files ScreeningAuthorizationService · SecurityConfig
│   ├── scheduler/      1 file ScreeningStuckSweepScheduler
│   └── config/          1 file ScreeningDomainBeansConfig
│
└── api/                                            # HTTP inbound adapter only
    ├── dto/          14 files SubmitScreeningRequest · ScreeningResultResponse · PagedResponse …
    ├── mapper/        1 file ScreeningApiMapper (MapStruct)
    ├── ScreeningSubmissionController.java
    ├── ScreeningQueryController.java
    ├── ScreeningResultCommandController.java
    ├── InternalScreeningController.java                # /internal/** — role-gated to internal-service callers only
    └── ScreeningApiExceptionHandler.java

140 files total in src/main — the layer a class lives in is a build-enforced fact, not a naming convention.
Exhibit G (main). The clearest evidence the rule is real: domain/enums/ScreeningOutcome.java and infrastructure/persistence/enums/ScreeningOutcome.java are two different files with the same name. One is the business meaning; the other is the JPA column mapping. Collapsing them into a single enum would let a database migration silently redefine what POTENTIAL_MATCH means to the business — so the boundary is paid for twice, on purpose.
com/infopole/dps/screening/               (test)
├── arch/        1 file    ArchitectureTest   # runs DpsArchitectureRules; fails the build on a layer violation
├── contract/    3 files   event schema round-trip # inbound watchlist candidates + outbound results
├── integration/ 2 files   Testcontainers    # real Postgres, real embedded Kafka
├── messaging/   3 files   consumer / publisher # behavior against an embedded broker
├── smoke/       4 files   ApplicationContextSmokeTest · SecurityBoundarySmokeTest …
└── unit/        21 files  mirrors src/main package-for-package # domain logic tested with zero Spring context
Exhibit G (test). arch/ArchitectureTest.java is what actually enforces everything above — it's the same DpsArchitectureRules base class in every one of the 29 services, so the six rules from Exhibit C aren't a convention anyone has to remember, they're a build step that fails red.
H

Performance & Concurrency, Measured

Three questions — pool depth, cache placement, thread behavior — answered by instrumenting the lab rather than guessing, plus an honest ledger of what's still on the default.

THROUGHPUT (req/s) — higher is better pool = 5 (kept) 19.66 RPS pool = 50 (reverted) 15.27 RPS P95 LATENCY (seconds) — lower is better pool = 5 (kept) 30.79s pool = 50 (reverted) 39.47s bigger pool → worse on both axes — the constraint was Postgres, not Hikari screening-engine-service, audit P3 D3, 2026-05-10 — reverted to DPS_DB_POOL_SIZE=5
Exhibit H.1. The pool-size knob was tried and measured, not assumed. Raising SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE from 5 to 50 made every number worse, because a wider pool just spreads the same throughput across more contention inside Postgres itself. The platform-wide default, set once via docker-compose.yml's x-common-env, stayed at 5.
BEFORE — 2026-05-09 AFTER — 2026-05-10 Analyst ad-hoc screening-engine POST /adhoc POST /v1/screening 202 + requestId ×N GET /v1/screening/{id} Thread.sleep(500ms) between polls pollUntilFinalized() — AdHocScreeningService.java:114 200 (after 5–7s) worker held: 5,000–7,000 ms Analyst ad-hoc screening-engine POST /adhoc POST /v1/screening/sync submit + match inline, one call 200 + result 200 (after ~80ms) worker held: ~80 ms
Exhibit H.2. The fix that shipped wasn't the Kafka-subscription rewrite that was scoped — it was smaller: screening-engine grew a synchronous POST /v1/screening/sync endpoint so the whole submit-and-match happens inline, in one call. Removing the poll loop didn't just make requests faster — it stopped holding a Tomcat worker hostage, which is what actually fixed throughput.
shared-identity Caffeine · per-instance instance A Caffeine · 120s TTL instance B Caffeine · 120s TTL every replica keeps its own copy — used by all 29 services policy-engine Redis · shared instance A instance B Redis — one cache, 30 min TTL any instance's write is visible to all — survives horizontal scale unchanged config-service Spring Simple · per-instance instance A simple (heap), no TTL instance B simple (heap), no TTL same shape as column 1 — but here it's the default, not a decision
Exhibit H.3. Columns one and three are drawn identically on purpose — they are the same shape. The difference is that the identity cache is local because an HTTP round-trip on every request is the thing worth avoiding; the config cache is local because spring.cache.type: simple is what you get by default when you add @EnableCaching without picking a store. The lab runs one replica per service today, so it hasn't caused an incident — it's the one pattern here that wouldn't survive horizontal scale unchanged.
Kafka listener concurrency
default
No service sets concurrency= — every @KafkaListener processes its topic's partitions on a single thread, everywhere on the platform.
@Async executor
default
reporting-service and batch-screening-service use @Async with no custom TaskExecutor bean, so both fall back to Spring's SimpleAsyncTaskExecutor — unbounded, unpooled, one raw thread per call.
Java 21 virtual threads
not adopted
spring.threads.virtual.enabled is unset platform-wide, despite every service running on Java 21.
Cross-worker outbox concurrency
deliberate
PostgresSkipLockedOutboxClaim — a FOR UPDATE SKIP LOCKED query — lets multiple outbox-relay ticks claim rows without blocking each other. The one place concurrency safety was engineered on purpose, and it's done at the Postgres layer, not the JVM.
I

Service Dependency Graph

Exhibit D drew the Kafka backbone. This is the other half — the 41 direct, synchronous REST calls between services that never touch a topic.

screening-engine admin-console support-agent identity-management case-management policy-engine license-entitlement data-retention watchlist-content ad-hoc-screening audit batch-screening analytics training-executor training-orchestrator inference billing config-service model-registry watchlist-management matching-engine screening-engine admin-console support-agent identity-management case-management policy-engine license-entitlement data-retention watchlist-content ad-hoc-screening audit batch-screening analytics training-executor training-orchestrator inference billing config-service model-registry watchlist-management matching-engine 7 8 8 0 1 2 1 4 1 3 0 2 0 0 2 1 0 0 0 1 0 calls 6 0 0 6 4 3 4 1 3 1 3 1 2 2 0 1 1 1 1 0 1 called by caller (row) → callee (column) 41 direct REST edges among 21 of 29 services — the other 8 talk only through Kafka (Exhibit D)
Exhibit I. Every dot is a real outbound HTTP client found in the source tree — most live in an infrastructure/integration/ sub-package; screening-engine's policy, shadow-ML and inference clients live in application/service/. Feature-flagged clients count: screening-engine → inference is wired but switched off in the lab, as is its remote ML-rollout config read. Two shapes stand out: identity-management and screening-engine are the platform's most-depended-upon services (6 callers each — the reason Exhibit H's Caffeine cache in front of identity-management matters as much as it does); admin-console and support-agent are the two aggregator hubs (8 outgoing calls each) — the human operator console and a second, Java-native RAG agent built independently of the Python agentic tier in Exhibits B/D/F. The empty rows — audit, analytics, config-service — never call anyone back; they're read targets or pure event consumers.
J

Watchlist Data Lineage

One sanctions-list entry, followed from a foreign government's server to a line in a regulator's PDF, weeks apart — the platform's actual time-travel-audit story.

external sources OpenSanctions + OFAC/EU/UN/UK/BIS direct watchlist-ingest fetch → archive (disk, gzip) → diff vs ingest_seen_entries port 8091 dps.watchlist.events entry.upserted / .removed ingest.run.completed address.upserted (crypto wallets) watchlist-content project → Postgres (source of truth) + OpenSearch (BMPM phonetic index) query/projection layer only screening-engine match (5-tier + Beider-Morse phonetic peer-match) finalize → stamp version HTTPS publish consume candidates GET .../versions (current) watchlist_source_versions one row per ingest run — R5.A writes on run.completed admin-console regulator-export — weeks later reconstructs the version active at the export window's end date GET .../versions?asOf=<date> — a different request, weeks later stable entryId assigned on first sighting, reused across runs — removal needs 3 consecutive misses (not 1), so a transient fetch failure never flaps an entity off the list.
Exhibit J. The same ledger row gets read twice, for two different reasons, at two different times. screening-engine reads it at finalize time to pin today's list version onto the decision it just made (R5.B). admin-console reads the identical table again, weeks later, with an asOf date instead of "current" — reconstructing exactly which sanctions-list version was active when a screening was decided, for a regulator who's asking now. That's the mechanism behind the "time-travel audit replay" claim in the README, not a slogan.
K

Technology Choices & Trade-offs

What was picked, what was turned down, and why — pulled from the platform's own ADRs rather than reconstructed after the fact.

DecisionChosenRejected alternativeWhySource
AI agent tier language Python + FastAPI, standalone services Spring AI / in-JVM Java agents "Convention over merit" — Python is the AI-mainstream ecosystem and yields a cleaner polyglot boundary than bolting agents onto the Spring monorepo. ADR-0035
Agent orchestration Hand-rolled loop + LiteLLM under a model-agnostic LlmPort LangChain A heavyweight framework "reintroduces the framework lock-in this decision exists to avoid, and obscures the learning goal." ADR-0035 §2
LLM hosting Ollama, local on ml (open-weight, 7–8B) Hosted-LLM-first (Claude / OpenAI) Rejected on cost and data residency for a compliance product handling counterparty PII; kept as a drop-in LlmPort adapter for a later premium tier. ADR-0035 §6
Multi-tenancy model Keycloak Organizations, single realm Realm-per-tenant "The operational cost of one Keycloak realm per individual-tier customer is absurd — N realms for hundreds of single-user accounts." Hard cryptographic isolation isn't what mid-market exporters ask for. ADR-0019
Service-internal structure Hexagonal/DDD, ArchUnit-enforced (Exhibit C) Convention-only layering, trusted to code review Six ArchUnit rules run in CI on every service so the boundary can't erode one unreviewed PR at a time. CLAUDE.md
Event streaming Redpanda Upstream Apache Kafka Kafka-wire-compatible — every client library, config, and topic convention carries over unchanged — with a lighter footprint appropriate to a single-VM lab deployment. A pragmatic pick, not a numbered ADR. CLAUDE.md
Fuzzy name matching OpenSearch + Beider-Morse phonetic analyzer Exact / token-overlap matching only Catches transliteration variants exact matching misses — "Wladimir" ↔ "Vladimir" — by encoding phonetic variants across all-languages, generic name-type rules. CLAUDE.md
Data ownership One Postgres schema per service, zero cross-service reads Shared database / shared schema A schema change in one service can never silently break another — the API or an event is the only contract between them. CLAUDE.md

Three of eight rows cite CLAUDE.md rather than a numbered ADR — that's an honest distinction, not a gap filled in after the fact. Formally-ADR'd decisions went through an explicit alternatives-considered process; the CLAUDE.md rows are equally deliberate but were codified directly as platform rules rather than routed through the ADR process.

L

REST vs. Events — Where the Line Falls

Not an even split, and not accidental — one rule decides which side of the line any given interaction lands on, and it's enforced the same way the hexagonal boundary is.

service A needs a fact from service B inside a @KafkaListener consumer right now? yes never call REST from in here no need this answer before I can respond to MY caller? (identity, quota, policy, candidates, BFF reads) yes no publish an event (Kafka) the fact travels async — caller doesn't wait, doesn't even know who's listening REST call synchronous — blocks until the answer comes back
Exhibit L.1. The first question is a hard override, not a preference — the same "✕" marker from Exhibit C's forbidden api↔infrastructure edge, reused here because it's the same kind of rule: not a matter of taste, a build-and-review-time guardrail. Every other question collapses to one thing: does the request in front of you have to wait for this answer? If yes, REST. If the interaction is really just "this happened, FYI" — publish and move on.
SYNCHRONOUS SURFACE — 41 direct REST edges (Exhibit I) 16 — BFF read-aggregation 25 — request-gating (admin-console + support-agent assembling one response) (identity, quota, policy, candidate lookups, ML scoring) ASYNCHRONOUS SURFACE (Exhibit D) 23 topics · 82 event schemas · 20 domains 8 of 29 services (28%) have zero direct REST dependency on any other service — pure Kafka citizens
Exhibit L.2. The sync surface is smaller than it looks and lopsided in an informative way: 39% of it is two services (Exhibits D, I) doing BFF-style read-aggregation for a UI or an agent, not domain coupling. Strip that out and the actual "service A can't proceed without service B" dependency count is 25 — small, for a platform with 29 services and 82 event schemas doing the rest of the talking. Exhibit E shows the boundary in motion on one real request; Exhibit H shows what it looks like when the boundary gets violated — a synchronous wait smuggled into what should have been an event, and the platform's one measured production bottleneck.

L.3 — Every service, by how it talks

The same rule applied service by service. Nearly every service exposes a REST API to its clients, so the useful question is the dominant style: does it orchestrate synchronously, react to events, or take a command and fan the fact out? REST counts are service-to-service edges from Exhibit I (calls out · called by); Kafka shows topic domains consumed → published (Exhibit D).

ServiceREST out · inKafka in → outWhy it sits here
Synchronous orchestrators — REST in, REST out, no domain events (4)
admin-console8 · 0—The operator BFF: assembles one response from many services and the agent tier. No database of its own.
support-agent8 · 0→ agentJava-native RAG agent: gathers context over REST; publishes only its own trace event.
ad-hoc-screening3 · 1—A person is waiting at the screen: submit, poll to FINALIZED, evaluate policy, return one answer.
training-executor0 · 2—Job runner: accepts a training job over REST and reports completion back over HTTP.
Pure event consumer — no business API (1)
notification0 · 0case, screening, policy →Reacts to what happened and sends email / Slack / Teams. Nothing waits on it.
Event-built read models — Kafka in, read-only REST out (6)
audit0 · 3all 10 domain topics →Append-only trail of every event, including agent runs. Never calls anyone.
analytics0 · 2case, screening, matching, identity →Pre-aggregated KPI tables, read by the BFF and Grafana.
watchlist-content1 · 3watchlist →Projects ingested entries into Postgres + the OpenSearch phonetic index; serves candidate lookups.
scoring-engine0 · 0screening → scoringTurns finalized matches into risk scores.
billing0 · 1screening, case, batch, identity → billingUsage counters built from the events that are billed.
entity-resolution0 · 0watchlist, pep → aiLinks records across sources that are the same entity.
Hybrid — a REST command, then the fact fans out as an event (17)
screening-engine7 · 6identity → screening, case-commandsAccepts the request and returns at once; the result arrives later as screening.result.finalized. Gates synchronously on policy, quota and candidates; calls matching-engine for shadow ML evaluation and, when enabled, inference for live ML scoring.
case-management1 · 4screening, scoring, case-commands, identity → caseOpens cases from events; decisions arrive over REST and leave through the transactional outbox.
batch-screening2 · 1screening, watchlist, identity → batchSubmits each row, completes the job as finalized events arrive; re-screens on list change.
policy-engine2 · 3identity → policySynchronous evaluate (callers wait, Redis-cached); publishes policy.evaluated.
license-entitlement1 · 4screening, billing, identity → licenseSynchronous quota check before a screening is saved; counts usage from events.
identity-management0 · 6→ identityMost-called service (cached by callers); tenant and user changes go out as events.
data-retention4 · 1governance → retentionConsumes governance decisions, then runs the purge in each owning service over REST.
data-governance0 · 0identity, retention → governanceRetention and erasure decisions, published through the outbox.
config0 · 1→ configFeature flags and rule versions, published through the outbox.
watchlist-management1 · 0→ watchlist-managementCustomer-defined lists; changes published as events.
model-registry0 · 1→ aiRegister / promote / deprecate; lifecycle events.
inference1 · 1ai → aiSynchronous ML scoring for screening (feature-flagged, off in the lab); consumes training and feedback events.
training-orchestrator2 · 0case → aiCase decisions become training labels; dispatches jobs to the executor over REST.
matching-engine0 · 1→ matchingCalled by screening-engine for shadow evaluation (live in the lab); canary and live modes; rollback and outcome-proof events.
pep-adverse-media0 · 0watchlist → pepPEP and adverse-media profiles, kept separate from sanctions lists.
reporting0 · 0identity → reportingA request starts generation; report.ready / failed comes back.
integration-gateway0 · 0→ gatewayTurns external webhooks and CSV files into internal events.
Scheduled ingest — outbound HTTPS, then events (1)
watchlist-ingest0 · 0→ watchlistFetches OpenSanctions and regulator lists on a schedule; REST is only an admin run-now trigger.

Exhibit L.3. Four services are purely synchronous, and all four exist because someone is waiting: an operator, an analyst at the ad-hoc screen, or a job dispatcher. Everything that fans out — audit, analytics, billing, notifications, re-screening — is asynchronous, so a slow consumer can never hold up a screening. Writes that must not be lost (cases, config, governance, license) leave through a transactional outbox, so a Kafka outage cannot leave the database and the event stream disagreeing. The Python agent tier (Exhibit F) sits on the synchronous side: HTTP through the BFF and MCP over HTTP, with one asynchronous output, its trace event on dps.agent.events.

M

AWS Migration Map

The lab was deliberately built as a substrate-mirror of the AWS target, so the move is a substrate swap, not a redesign — every lab workload already has its managed counterpart named.

Grounded in the live container census and ADR-0024 (AWS target architecture) plus its three-plane amendment (ADR-0031). Snapshot date: 2026-06-29.

Lab container census — what moves

VMContainersCount
coreJVM microservices, agent tier, Keycloak, Traefik, static SPAs/website, runner, exporters~41
obsprometheus, grafana, loki, promtail, alertmanager, otel-collector, tempo, blackbox-exporter, node-exporter9
datapostgres, pgadmin, redis, redisinsight, opensearch, opensearch-dashboards, postgres-exporter, node-exporter8
streamredpanda, redpanda-console, node-exporter3
objstoreminio1
cinative GitLab CE (omnibus) — no Docker0
mlnative Ollama — no Docker0

Total ≈ 62 containers (~41 on core + 21 elsewhere). ci and ml run their workloads natively, not containerized.

Mapping by purpose

PurposeLab todayAWS targetNotes
App servicesJVM microservices (~29) · coreECS Fargate — 1 task/serviceSame one-container-per-bounded-context model; per-plane tags (data / operations / tenant)
Agent tierexport-drafter, copilot, 3 MCP servers · coreECS Fargate tasksInternal-only; reached via the admin-console BFF
IdentityKeycloak · coreECS Fargate taskKC stays KC; RDS-backed
Web / staticfrontend, frontend-admin, website nginx · coreCloudFront + S3Static SPAs/site; the marketing site could alternatively stay on Cloudflare Pages
Edge / routing / TLSTraefik, Let's Encrypt · coreALB + ACM (+ optional WAF)oauth2-proxy not needed (per-service JWT validation)
Relational DBpostgres · dataRDS for PostgreSQL (Multi-AZ)Same JDBC shape; schema-per-service
Cacheredis · dataElastiCache for RedisSame Redis API
Searchopensearch · dataAmazon OpenSearch Serviceanalysis-phonetic / BMPM plugin supported
Streamingredpanda + console · streamMSK or self-host Redpanda on Fargate/EC2Kafka-API compatible either way; decide on cost vs. managed at migration
Object storageminio · objstoreS3Essentially free at this volume
AI / ML inferenceOllama, native · mlEC2 GPU (self-host Ollama) or BedrockEC2-GPU preserves the on-prem privacy model + model-agnostic LlmPort; Bedrock = fully managed (one-adapter swap)
Observabilityprometheus, grafana, loki, tempo, alertmanager · obsself-host on Fargate or AMP + AMG + CloudWatch Logs + X-RaySelf-host cheaper at this scale; managed at Tier 4
Telemetry agentsotel-collector, promtail, node/blackbox/pg exporters · obs / core / data / streamADOT collector / Fluent Bit / CloudWatch agentECS service-discovery scraping replaces static targets
Admin UIspgadmin, redisinsight, opensearch-dashboards, redpanda-console · data / streamdrop (AWS consoles / OpenSearch Dashboards)Dev convenience; not migrated
CI/CD + registryGitLab CE + Runner · ci + coreECR + CodePipeline/CodeBuild or GitHub ActionsGitLab is only the CI host; the platform doesn't depend on it. Tag convention unchanged
Secrets.env.sops · coreSSM Parameter Store → Secrets Manager at scaleSame env-var names
DNSfirewall DNS overrides / CloudflareRoute 53