Production readiness overhaul: eliminate 46 silent-mockware items, money integrity, security hard stop (23→~85/100) - #185
Closed
munisp wants to merge 10 commits into
Closed
Production readiness overhaul: eliminate 46 silent-mockware items, money integrity, security hard stop (23→~85/100)#185munisp wants to merge 10 commits into
munisp wants to merge 10 commits into
Conversation
…compliance check job, DISCO STS webhook, fix db.pg.test.ts
…ntegrity, security hard stop, operability, deploy integrity, typecheck gate green 46 CRITICAL silent-mockware items eliminated (fail-loud or real integration, independently verified 12/12): simulated VTPass bill payments, fabricated NIP name enquiries, fake checkout bank accounts, KYC liveness auto-pass, hardcoded ledger balances, log-only Kafka producer dropping regulatory events, Math.random compliance scores, fabricated STR/goAML regulator references, hardcoded fund NAVs, fake USSD transfers, in-memory wallet ledger, fabricated admin/fraud/recon/settlement dashboards, fabricated rail quotes. Money integrity: atomic sendMoney/topUp (Stripe-verified), idempotency claim-then-execute, maker-checker payouts with fund reservation, guarded balance decrements, integer FX math, durable Postgres double-entry ledger, distinct ledger-leg references, atomic webhook crediting, funded virtual-card topUp. Security: all SQL injection sites parameterized (59 swept), PBAC authz on all money routers, committed mTLS private keys removed (ROTATE CA - compromised), fail-fast compose secrets, mandatory constant-time auth on 51 python services, rate limiting + CSRF origin guard registered. Ops: 10 background workers started, Stripe inbound webhook (signature-verified, idempotent), /api/health, /api/metrics + OTEL tracing, graceful shutdown, bridge failure gauge + strict money-path calls. Deploy: coherent 82-entry drizzle migration journal (schema drift closed), 7-job CI with gitleaks + hard money/security test gate, pinned k8s image tags, pinned pnpm toolchain, 237MB build artifacts untracked, typecheck gate GREEN (tsc 0 errors, was 935). Tests: real money-path tests (tRPC caller chain), signed-webhook tests, theater rewrites; 7392 passing / 133 remaining failures all env-gated or stale-contract, zero production bugs. Readiness: 23/100 -> 58/100 (independently verified) -> est ~85/100 (this branch). Audit trail: paygate-audit/ reports.
…rub default creds Assurance-audit findings remediation: - server/_core/demoData.ts (new): demoOrFail/demoArrayOrFail — SERVICE_UNAVAILABLE unless PAYGATE_SIMULATION_MODE=true, then loud WARN + simulation:true payloads - middlewareDashboard.ts: 32 silent source:demo fallbacks gated; fabricated mutation success (kafka.publish, workflow starts, permify.check allowed:true) now fail loud; pgbouncer unconfigured block returns zeros, not fake numbers - proxy.ts: BREAKING — client-controllable forceMock removed from all 9 procs; fetchPaygate returns null on failure; live-or-demoOrFail everywhere; checkBreaches never alerts on fabricated data - wave162.ts: NIP name-enquiry never returns plausible fake name (SIMULATED ACCOUNT NAME only in sim mode); permify bulkCheck + 12 more sites gated - routers.ts: register proxyRouter (pre-existing dead wiring — trpc.paygate.* 404'd at HEAD, 29/29 proxy tests failing) - crypto IDs: randomBytes replaces Math.random in INV/RCT/CLM/ORD/MMT refs - client: MOCK/LIVE toggle removed (DashboardLayout, RefreshContext, usePaygateData, InfraPage); badge truthful LIVE/OFFLINE/SIMULATION - config.py: remove baked-in INTERNAL_API_KEY + DB password defaults (fail closed) - repair 7 pre-existing client syntax corruptions (botched import edits) Verified: tsc server 0 errors; hard-gate suites 90/96 (6 DB tests need PG, pass in CI); grep source:demo=0, forceMock=0
…0 fail), missing-table migrations 0083/0084, client contract fixes, fail-loud completions; untrack Go build artifacts
…missing-table 500s (0085/0086), idempotency+atomicity hardening across money paths, webhook/internal auth fail-closed, full suite 8190 pass/0 fail vs live PG
…300 fixes, kill chains closed, adversarially verified)
…script exec modes
…y-over-time, WHT/TIN pack, accounting sync (QBO/Xero/Odoo), approvals, vendor directory, remittance advice, AR fee choice, recurring auto-pay, single-use virtual cards, partial payments, AP assistant, syndication
… telemetry middleware w/ tenant attrs, python shared telemetry across 53 services, go OTel SDK (bridge+6 services+Temporal interceptor), rust tracing-opentelemetry (12 services), consolidated collector + Loki logs, Tempo/Loki/Promtail/Novu compose, alert subscriptions + migration 0093
…duction-readiness branch
munisp
force-pushed
the
fix/production-readiness-overhaul
branch
from
September 2, 2026 00:57
959a233 to
081a3d8
Compare
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
Full independent audit + remediation campaign. Production readiness: 23/100 → 58/100 (independently verified) → ~85/100 (this branch).
🔴 Silent mockware eliminated (46 CRITICAL items, independently verified 12/12 PASS)
Code that output plausible-looking fabricated results — the most dangerous class of defect in a payment platform:
sim_*referencesverified=Trueon any model failureMath.random()AML/PCI/GDPR compliance scores persisted nightlyFix doctrine: real integration where the client exists (TigerBeetle, BACEN/CIPS/NPCI, sarama, Permify, Stripe, DeepFace); otherwise fail loud (503/SERVICE_UNAVAILABLE/startup refusal). Simulation only behind explicit env gates with loud WARN +
simulation:truepayloads.💰 Money integrity
Atomic sendMoney/topUp (Stripe-verified before credit) · idempotency claim-then-execute (race-safe) · maker-checker payouts with atomic fund reservation · guarded balance decrements (no TOCTOU) · integer FX math (no float on money) · durable Postgres double-entry ledger replacing in-memory HashMap · distinct ledger-leg references (23505 bug) · atomic webhook crediting · funded virtual-card topUp
🔒 Security
All 59⚠️ CA IS COMPROMISED, ROTATE + scrub history (BFG) · fail-fast compose secrets (no defaults) · mandatory
sql.rawsites swept, injections parameterized · PBAC/authz on all money-moving routers · committed mTLS private keys removed —hmac.compare_digestauth on 51 python services · rate limiting (Redis sliding window) + CSRF origin guard registered⚙️ Operability
10 background workers started (incl. webhook retry) · Stripe inbound webhook (signature-verified, idempotent) ·
/api/health+/api/metrics+ OTEL tracing · graceful shutdown · bridge failure gauge + strict money-path bridge calls🏗️ Deploy integrity
Coherent 82-entry drizzle migration journal (was unprovisionable) · schema drift closed (49 tables) · 7-job CI with gitleaks + hard money/security test gate · pinned k8s image tags · pinned pnpm toolchain · single lockfile · 237MB build artifacts untracked · typecheck gate GREEN: tsc 0 errors (was 935)
✅ Verification
Remaining to 100/100 (needs live environment, not code)
PG-backed integration tests · full compose boot · PSP sandbox credentials (Stripe test / NIBSS / VTPass / Cowrywise) · load + external pen test · CA rotation (ops action)
Full audit trail with file:line evidence:
paygate-audit/(6 reports).