<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Raghuvendra Kumar</title>
    <description>The latest articles on DEV Community by Raghuvendra Kumar (@raghuvendra34).</description>
    <link>https://dev.to/raghuvendra34</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4256384%2Faa4d9d3a-9ba9-4cdc-b54b-b0daeefcf47b.jpg</url>
      <title>DEV Community: Raghuvendra Kumar</title>
      <link>https://dev.to/raghuvendra34</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raghuvendra34"/>
    <language>en</language>
    <item>
      <title>Designing Idempotent Payment Microservices &amp; Guardrailed LangGraph Dispute Agents</title>
      <dc:creator>Raghuvendra Kumar</dc:creator>
      <pubDate>Fri, 20 Nov 2026 21:40:22 +0000</pubDate>
      <link>https://dev.to/raghuvendra34/designing-idempotent-payment-microservices-guardrailed-langgraph-dispute-agents-48j5</link>
      <guid>https://dev.to/raghuvendra34/designing-idempotent-payment-microservices-guardrailed-langgraph-dispute-agents-48j5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F42qwde3wnjva2vdvzlem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F42qwde3wnjva2vdvzlem.png" alt=" " width="800" height="520"&gt;&lt;/a&gt;&lt;em&gt;How I built **SentinelPay&lt;/em&gt;&lt;em&gt;—a fault-tolerant double-entry ledger and stateful AI dispute resolver where the LLM scores risk, and plain code decides who gets their money back.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In banking software, two failure modes destroy trust faster than anything else: &lt;strong&gt;corrupting balances under concurrent retries&lt;/strong&gt;, and &lt;strong&gt;letting a probabilistic AI model make deterministic financial decisions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Most AI fintech demos wire an LLM straight to a refund endpoint and call it a day. I built &lt;strong&gt;&lt;a href="https://github.com/raghuvendra34/sentinelpay" rel="noopener noreferrer"&gt;SentinelPay&lt;/a&gt;&lt;/strong&gt; to do the opposite—enforcing strict distributed-systems invariants at the ledger layer while keeping generative AI strictly inside an auditable, deterministic guardrail boundary.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/REPLACE_WITH_UPLOADED_CONSOLE_PNG_URL" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/REPLACE_WITH_UPLOADED_CONSOLE_PNG_URL" alt="SentinelPay console: T-account balances and the live ledger journal" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Three Non-Negotiable Guarantees
&lt;/h2&gt;

&lt;p&gt;Every architectural decision in SentinelPay flows from three invariants:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Money is never created, lost, or double-charged.&lt;/strong&gt; Transfers execute inside a single PostgreSQL ACID transaction with deterministic row locks and two-layer &lt;code&gt;Idempotency-Key&lt;/code&gt; enforcement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A retry or traffic burst cannot degrade the ledger.&lt;/strong&gt; Per-account sliding-window rate limiting runs on Redis, and slow dispute analysis is decoupled via Redis Streams with retries and a dead-letter queue (&lt;code&gt;tx_dlq&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An AI model never decides a refund.&lt;/strong&gt; The LangGraph agent retrieves account history and asks the LLM for a structured risk score only. A unit-tested pure Python function makes the final credit-vs-escalation call, and the full reasoning trace is persisted in PostgreSQL &lt;code&gt;JSONB&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  System Architecture
&lt;/h2&gt;

&lt;p&gt;SentinelPay splits responsibilities across four containerized services (plus PostgreSQL 16 and Redis 7):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API Gateway (FastAPI &lt;code&gt;:8001&lt;/code&gt;):&lt;/strong&gt; Verifies HS256 JWTs, enforces per-account Redis rate limits, checks &lt;code&gt;Idempotency-Key&lt;/code&gt; replays, forwards transfers, and publishes events to Redis Streams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ledger Service (FastAPI &lt;code&gt;:8002&lt;/code&gt;):&lt;/strong&gt; The &lt;em&gt;only&lt;/em&gt; service permitted to mutate balances. Executes atomic double-entry bookkeeping (&lt;code&gt;DEBIT&lt;/code&gt; + &lt;code&gt;CREDIT&lt;/code&gt;) with row-level locks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Worker (LangGraph):&lt;/strong&gt; Consumes &lt;code&gt;DISPUTE_OPENED&lt;/code&gt; events from &lt;code&gt;tx_events&lt;/code&gt; via a Redis consumer group, runs a 3-node workflow, and persists resolutions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Console (Next.js 14 + TypeScript &lt;code&gt;:3000&lt;/code&gt;):&lt;/strong&gt; Transfer simulator, duplicate-retry tester, live ledger journal, and agent reasoning inspector.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. Preventing Deadlocks and Double-Spends in PostgreSQL
&lt;/h2&gt;

&lt;p&gt;When two concurrent transfers hit the same pair of accounts in opposite directions (Alice → Ben and Ben → Alice), naive row locking causes deadlocks. And when five simultaneous $400 withdrawals hit a $1,000 balance, naive read-then-write logic allows a double-spend.&lt;/p&gt;

&lt;p&gt;SentinelPay prevents both inside a single SQL transaction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Integer cents only:&lt;/strong&gt; Balances are stored as &lt;code&gt;BIGINT&lt;/code&gt; cents with a schema-level &lt;code&gt;CHECK (balance_cents &amp;gt;= 0)&lt;/code&gt; constraint—never floating-point numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic lock ordering:&lt;/strong&gt; Before mutating balances, the ledger locks both accounts in sorted ID order so opposite transfers always acquire locks in the exact same sequence:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;balance_cents&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;ANY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Two-Layer Idempotency
&lt;/h3&gt;

&lt;p&gt;Network timeouts mean clients &lt;em&gt;will&lt;/em&gt; retry &lt;code&gt;POST /api/v1/transfers&lt;/code&gt;. Every transfer requires an &lt;code&gt;Idempotency-Key&lt;/code&gt; header enforced at two layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;strong&gt;API Gateway&lt;/strong&gt; checks whether the key already exists and replays the original transaction with &lt;code&gt;200 OK&lt;/code&gt; (instead of &lt;code&gt;201 Created&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;If two identical requests arrive at the exact same instant and slip past the gateway check, the &lt;strong&gt;Ledger Service&lt;/strong&gt; re-checks the key &lt;em&gt;after&lt;/em&gt; acquiring row locks, backed by a &lt;code&gt;UNIQUE&lt;/code&gt; constraint on &lt;code&gt;transactions.idempotency_key&lt;/code&gt; as the final database backstop.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. The Same-Millisecond Bug in Our Redis Rate Limiter
&lt;/h2&gt;

&lt;p&gt;To stop burst traffic from hammering the ledger, each account has a Redis sorted set (&lt;code&gt;ZSET&lt;/code&gt;) implementing a 60-second sliding-window log (max 10 requests/minute, returning &lt;code&gt;429 Too Many Requests&lt;/code&gt; with &lt;code&gt;Retry-After: 60&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The bug:&lt;/strong&gt; In version 1, I used the millisecond timestamp as both the sorted-set &lt;em&gt;score&lt;/em&gt; and &lt;em&gt;member&lt;/em&gt;. Under concurrent bursts, two requests arriving within the same millisecond overwrote each other's member in the set—making &lt;code&gt;ZCARD&lt;/code&gt; undercount and silently letting excess traffic slip through.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix:&lt;/strong&gt; Appending a short random nonce to each member makes same-millisecond requests distinct while keeping the timestamp as the score:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt;
&lt;span class="n"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zremrangebyscore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now_ms&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;60_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zadd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{now_ms}:{uuid.uuid4().hex[:8]}"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now_ms&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zcard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A regression unit test using an in-memory fake Redis now proves that &lt;strong&gt;12 requests fired in the exact same millisecond&lt;/strong&gt; yield &lt;strong&gt;10 allowed and 2 blocked&lt;/strong&gt;, whereas the original implementation allowed all 12.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Decoupling Slow AI From Fast Payments
&lt;/h2&gt;

&lt;p&gt;LLM inference takes seconds; payment APIs must return in milliseconds. Whenever a user raises a dispute (or sends a transfer of $500+, which is auto-flagged), the gateway pushes an event to the Redis Stream &lt;code&gt;tx_events&lt;/code&gt; and returns immediately.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Agent Worker&lt;/strong&gt; reads via a consumer group (&lt;code&gt;XREADGROUP&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transient failures retry &lt;strong&gt;3 times with exponential backoff&lt;/strong&gt; (2s, 4s).&lt;/li&gt;
&lt;li&gt;Exhausted payloads are routed to a dead-letter stream (&lt;strong&gt;&lt;code&gt;tx_dlq&lt;/code&gt;&lt;/strong&gt;) so no customer dispute silently vanishes.&lt;/li&gt;
&lt;li&gt;Unacknowledged messages from a crashed worker are replayed on restart, and dispute resolution itself is idempotent—a redelivered event can never issue a second provisional credit.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Why the AI Never Decides a Refund
&lt;/h2&gt;

&lt;p&gt;The dispute worker runs a 3-node &lt;strong&gt;LangGraph&lt;/strong&gt; state machine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;retrieve_context&lt;/code&gt;:&lt;/strong&gt; Loads the transaction, the sender's last 10 transfers, 30-day average spend, and prior dispute count from PostgreSQL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;evaluate_policy&lt;/code&gt;:&lt;/strong&gt; Computes numeric deviation in code and passes the customer's dispute reason as &lt;em&gt;untrusted input&lt;/em&gt; to the LLM, which returns a strict Pydantic schema: &lt;code&gt;{risk_score, category, explanation}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;guardrails&lt;/code&gt; (pure deterministic code):&lt;/strong&gt; Evaluates three hard, inclusive thresholds—every check must pass for an automatic provisional credit; otherwise it escalates to human operations:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decide_dispute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount_cents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;risk_score&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prior_disputes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"AUTO_CREDIT_APPROVED"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;amount_cents&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;10_000&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;risk_score&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.35&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;prior_disputes&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"ESCALATED_TO_OPS"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/REPLACE_WITH_UPLOADED_INSPECTOR_PNG_URL" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/REPLACE_WITH_UPLOADED_INSPECTOR_PNG_URL" alt="Agent reasoning inspector showing risk score, guardrail checks, and LangGraph node traces" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-World Proof: Catching an LLM Hallucination in Action
&lt;/h3&gt;

&lt;p&gt;During live testing, I sent a $25 transfer seconds after two others—one of which was &lt;strong&gt;$499&lt;/strong&gt;—and disputed it with &lt;em&gt;"I did not authorise this payment."&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context:&lt;/strong&gt; Amount &lt;code&gt;$25.00&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; prior disputes, 30-day mean &lt;code&gt;$262.00&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM Output:&lt;/strong&gt; Risk score &lt;code&gt;0.45&lt;/code&gt;, category &lt;em&gt;velocity anomaly&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrails:&lt;/strong&gt; Amount OK (&lt;code&gt;&amp;lt;= $100&lt;/code&gt;), prior disputes OK (&lt;code&gt;0&lt;/code&gt;), &lt;strong&gt;risk &lt;code&gt;0.45 &amp;gt; 0.35&lt;/code&gt; (FAIL)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decision:&lt;/strong&gt; &lt;code&gt;ESCALATED_TO_OPS&lt;/code&gt; (&lt;code&gt;DISPUTE_ESCALATED&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I inspected the stored JSONB trace, the model's prose explanation falsely described the burst as &lt;em&gt;"three transfers of $25"&lt;/em&gt;—completely hallucinating the $499 transfer. &lt;strong&gt;Yet the final decision was 100% correct, because the rule engine reads structured numbers, never prose.&lt;/strong&gt; That single run validated the entire architecture.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Verification &amp;amp; Honest Limitations
&lt;/h2&gt;

&lt;p&gt;All core guarantees are backed by an &lt;strong&gt;11-test &lt;code&gt;pytest&lt;/code&gt; suite&lt;/strong&gt; (unit + live Docker integration):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Invariant Tested&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Concurrency double-spend:&lt;/strong&gt; 5 simultaneous $400 transfers on a $1,000 balance&lt;/td&gt;
&lt;td&gt;2 succeeded, 3 &lt;code&gt;INSUFFICIENT_FUNDS&lt;/code&gt;, final balance &lt;code&gt;$200.00&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Idempotent retry:&lt;/strong&gt; Same &lt;code&gt;Idempotency-Key&lt;/code&gt; sent twice&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;201&lt;/code&gt; then &lt;code&gt;200&lt;/code&gt; replayed; 1 transaction, 1 &lt;code&gt;DEBIT&lt;/code&gt; + 1 &lt;code&gt;CREDIT&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Burst rate limit:&lt;/strong&gt; 12 requests from one account within 60s&lt;/td&gt;
&lt;td&gt;Requests 1–10 → &lt;code&gt;201&lt;/code&gt;; 11–12 → &lt;code&gt;429&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Same-millisecond regression:&lt;/strong&gt; 12 simultaneous timestamps&lt;/td&gt;
&lt;td&gt;10 allowed, 2 blocked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Guardrail boundary matrix:&lt;/strong&gt; Inclusive limits &amp;amp; confidence bounds&lt;/td&gt;
&lt;td&gt;7/7 parameterized cases passed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  What I'd Build Next for Production
&lt;/h3&gt;

&lt;p&gt;SentinelPay is a portfolio-scale architecture with deliberate simplifications I document upfront:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bank suspense counter-entry:&lt;/strong&gt; Today, a provisional credit adds a single &lt;code&gt;CREDIT&lt;/code&gt; entry without debiting a bank suspense account. Production double-entry requires a counter-ledger entry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic velocity features:&lt;/strong&gt; Computing "transfers in the last &lt;em&gt;N&lt;/em&gt; minutes" directly in SQL/code rather than letting the LLM infer bursts from raw timestamps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dead-letter visibility in UI:&lt;/strong&gt; Surfacing &lt;code&gt;tx_dlq&lt;/code&gt; status in the console rather than leaving a failed dispute showing &lt;em&gt;Agent reviewing&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Explore the Code
&lt;/h2&gt;

&lt;p&gt;The complete Docker Compose setup, SQL schema, LangGraph worker, and &lt;code&gt;pytest&lt;/code&gt; verification logs are open source on GitHub: &lt;strong&gt;&lt;a href="https://github.com/raghuvendra34/sentinelpay" rel="noopener noreferrer"&gt;github.com/raghuvendra34/sentinelpay&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>microservices</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
