feat: Mark Lane integration — FX liquidity bridge, KYC compliance passport, settlement reconciliation#4
Open
devin-ai-integration[bot] wants to merge 6 commits into
Conversation
…fixes feat: All 96 P0–P2 platform improvements — security, testing, observability, DX, business logic
…pliance, canary - k6 load tests: 10K concurrent users, soak testing, financial reconciliation - OWASP API Top 10 security scan with CI/CD integration - Smart contract audit pipeline (Slither + Mythril) - Dependency vulnerability scanning (npm, cargo, pip, govulncheck) - Chaos engineering: service kill, network delay, memory pressure, cascading failure - Disaster recovery: PG backup/restore, TigerBeetle snapshot, Redis rebuild - Regulatory compliance: CBN, FCA, FATF, PCI-DSS automated checks - Canary deployment: Argo Rollouts config with ledger integrity analysis - GitHub Actions: qa-pipeline, nightly-soak, deploy-gate workflows - Makefile for local execution (make -f qa/Makefile <target>) - All scripts reusable, self-contained, CI-friendly (exit 1 on failure) Co-Authored-By: Patrick Munis <pmunis@gmail.com>
feat: Comprehensive QA suite — load testing, security, chaos, DR, compliance, canary CI/CD
…ta retention, pentest, UAT Monitoring & Alerting: - Grafana dashboards: Transfer Operations (14 panels) + Infrastructure (11 panels) - Prometheus alerting: 20 rules across 5 groups (financial, SLA, infra, compliance, settlement) - Alertmanager config: PagerDuty (critical), Opsgenie (warning), Slack (info) - Docker Compose monitoring stack (Prometheus + Grafana + Alertmanager) SLO Definitions: - 12 SLOs: fund delivery 99.9%, API availability 99.95%, ledger integrity 100% - Settlement latency targets per rail (M-Pesa 10s, NIBSS 30s, SEPA 4h, SWIFT 48h) - Error budget policy with escalation levels (25%/50%/75%/100% consumed) Incident Response: - 6 runbooks: ledger imbalance, stuck transfers, rail provider down, slow delivery, low success rate, sanctions screening down - Incident response procedure with severity classification (SEV1-4) - On-call schedule template and communication templates Data Retention: - GDPR/NDPR/POPIA/PDPA compliant retention policy - 8 data categories with specific retention periods and deletion procedures - DSAR implementation (right to access, erasure, portability) - Automated retention jobs (weekly anonymization, monthly archival) QA Additions: - Authenticated penetration test runner (BOLA, privilege escalation, rate limiting) - UAT scenarios for 5 stakeholder journeys (diaspora worker, merchant, employer, DeFi, agent) Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Monitoring & Alerting: - Grafana dashboards: Transfer Operations (14 panels) + Infrastructure (11 panels) - Prometheus alerting: 20 rules across 5 groups (financial, SLA, infra, compliance, settlement) - Alertmanager config: PagerDuty (critical), Opsgenie (warning), Slack (info) - Docker Compose monitoring stack (Prometheus + Grafana + Alertmanager) SLO Definitions: - 12 SLOs: fund delivery 99.9%, API availability 99.95%, ledger integrity 100% - Settlement latency targets per rail (M-Pesa 10s, NIBSS 30s, SEPA 4h, SWIFT 48h) - Error budget policy with escalation levels (25%/50%/75%/100% consumed) Incident Response: - 6 runbooks: ledger imbalance, stuck transfers, rail provider down, slow delivery, low success rate, sanctions screening down - Incident response procedure with severity classification (SEV1-4) - On-call schedule template and communication templates Data Retention: - GDPR/NDPR/POPIA/PDPA compliant retention policy - 8 data categories with specific retention periods and deletion procedures - DSAR implementation (right to access, erasure, portability) - Automated retention jobs (weekly anonymization, monthly archival) QA Additions: - Authenticated penetration test runner (BOLA, privilege escalation, rate limiting) - UAT scenarios for 5 stakeholder journeys (diaspora worker, merchant, employer, DeFi, agent) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Patrick Munis <pmunis@gmail.com>
…sport, settlement reconciliation Mark Lane (marklane.io) is a FINTRAC-registered Canadian MSB for FX professionals. This integration enables CAD→Africa corridors via Mark Lane's on-ramp platform. TypeScript: - markLaneClient.ts: API client with circuit breaker for FX quotes, transfers, KYC passport, nostro balances, webhooks. Graceful mock fallback when API key unavailable. - markLaneRouter.ts: tRPC router with 18 endpoints — corridor discovery, FX quotes, transfer lifecycle, KYC passport (FINTRAC↔CBN/FCA), nostro monitoring, FX professional channel, webhook ingestion, analytics. - 31 integration tests (10 scenarios) — all passing. - 5 PostgreSQL tables for Mark Lane data persistence. - 10 Kafka event types for Mark Lane audit trail. - TigerBeetle ledger entries for all financial mutations. Go (port 8128): go-marklane-fx-bridge - Composite FX quote engine (Mark Lane CAD rates × RemitFlow African rates) - 8 corridor routes (CA-NG, CA-GH, CA-KE, CA-ZA, CA-SN, CA-TZ, CA-UG, CA-CM) - Nostro position tracking with rebalance detection - Circuit breakers on both Mark Lane and RemitFlow rate APIs - Background rate refresh loop (30s interval) - Kafka event emission via Dapr, Prometheus metrics Rust (port 8129): rust-kyc-compliance-bridge - Cross-jurisdictional KYC passport issuance & verification - 3 compliance mappings (FINTRAC↔CBN, FINTRAC↔FCA, CBN↔FINTRAC) - Document equivalence tables (Canadian passport↔international passport, etc.) - Transaction screening with amount-based risk thresholds (FINTRAC CAD 10K, CBN NGN 5M) - SAR filing endpoint for suspicious activity reports - Prometheus compliance metrics Python (port 8130): python-settlement-reconciliation - Bilateral nostro position tracking (Mark Lane ↔ RemitFlow) - Automated reconciliation with settlement instruction generation - Regulatory report generation (FINTRAC LCTR, CBN AML reports) - Daily summary endpoint - Background auto-reconciliation (6-hour cycle) - Prometheus settlement metrics Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Contributor
Author
Original prompt from Patrick
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
🧪 Test Results — Mark Lane IntegrationTested by: Devin | Method: vitest + dev server curl + code inspection (shell-only, no UI changes) Core Functionality (6 live tRPC endpoints) — All Passed
Build & Tests — All Passed
Polyglot Services (code inspection)
Escalations (pre-existing, not from this PR)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates RemitFlow with Mark Lane (FINTRAC-registered Canadian MSB) to enable CAD→Africa remittance corridors. Mark Lane provides the Canadian FX on-ramp; RemitFlow provides last-mile African delivery rails.
Architecture
TypeScript (tRPC)
New
markLanerouter onAppRouterwith 18 endpoints:getQuote→ Mark Lane API with circuit breaker, mock fallback. Quotes cached + persisted tofeature_marklane_quotesinitiateTransfercreates TigerBeetle double-entry (user:X:CAD→marklane:nostro:CAD), Kafka event, idempotency key.cancelTransferdoes reversal entry.requestKYCPassportbridges CBN↔FINTRAC document verification. 3 compliance mappings with document equivalence tables (NIN↔government_id, BVN↔financial_id, etc.)handleWebhookwith HMAC-SHA256 signature verification.transfer.completedtriggers settlement ledger entry;transfer.failedtriggers automatic reversal.registerFXProfessionalfor Mark Lane advisors to offer RemitFlow corridorsmarkLaneClient.tswraps all Mark Lane API calls behindCircuitBreaker("marklane-api")with 5-failure threshold / 30s reset. Falls back to mock responses whenMARKLANE_API_KEYis unset.5 new PostgreSQL tables + 10 Kafka event types added to
featurePersistence.ts.Go service —
go-marklane-fx-bridge(port 8128)Computes composite FX quotes:
CAD→USD(Mark Lane rate) ×USD→NGN(RemitFlow rate) = end-to-end rate. Separate circuit breakers per provider. Background rate refresh every 30s. Nostro position tracking with automatic rebalance detection when imbalance exceeds thresholds (CAD 100K, USD 75K, NGN 10M).Rust service —
rust-kyc-compliance-bridge(port 8129)Cross-jurisdictional KYC passport issuance with risk scoring. 3 regulatory mappings (FINTRAC↔CBN, FINTRAC↔FCA, CBN↔FINTRAC). Transaction screening with amount-based risk thresholds — FINTRAC STR at CAD 10K, CBN STR at NGN 5M. SAR filing endpoint.
Python service —
python-settlement-reconciliation(port 8130)Bilateral nostro position tracking between Mark Lane and RemitFlow. Automated reconciliation generates settlement instructions when positions exceed thresholds. Regulatory report generation for FINTRAC LCTR and CBN AML reports. Background auto-reconciliation every 6 hours.
Tests
31 tests across 10 scenarios — all passing. 0 TypeScript errors. Full regression suite: 1557/1559 (2 pre-existing
beneficiaries.addfailures).Link to Devin session: https://app.devin.ai/sessions/64d054ae77da41e9a2b74d8593fa635c
Requested by: @munisp