All MicroEvals
Webhook Idempotency, Double-Entry Ledger Safety & Staging Isolation
Create MicroEval

Webhook Idempotency, Double-Entry Ledger Safety & Staging Isolation

Evaluates how candidate models design idempotent payment/ledger webhook handlers, prevent duplicate state mutations and race conditions under retries, and enforce strict staging vs. production isolation. Outputs are scored against concrete engineering and operational criteria.

Prompt

Prompt 1 ​You are reviewing a payment and ledger ingestion service that processes incoming webhook events (such as completed payments, refunds, and chargebacks) and posts double-entry balance updates to a relational database. Under production load, providers may deliver duplicate events, send out-of-order events, or retry after a slow response. ​Design a resilient webhook ingestion and ledger-posting specification that covers: ​1. Signature verification, replay/timestamp checks, and fast acknowledgment before heavy downstream work. ​2. Deterministic idempotency keys and database constraints/transactions to guarantee at-most-once balance mutation. ​3. Handling out-of-order or conflicting state transitions (e.g., refund arriving before settlement or duplicate retries). ​4. Staging vs. production environment isolation, secrets/webhook-endpoint separation, and release gating before enabling live traffic. ​Present your response with clear headings, a concise state/idempotency flow, and specific edge cases. ​Answer guidance (optional) ​Pass criteria: Explains signature verification + deduplication keyed on a deterministic event/idempotency identifier backed by a unique constraint/atomic transaction, rather than relying solely on application-layer "check-then-insert" reads. ​Failure modes to penalize: Suggesting non-atomic read-then-write checks without unique constraints, mutating balances before verifying authenticity, ignoring out-of-order/retry edge cases, or mixing staging and production webhooks/credentials. ​Strong extras: Explicitly addresses append-only ledger entries vs. mutable balance columns, explicit status/transition rules, and pre-release verification gates before live cutover. ​Prompt 2 ​A CI/CD pipeline runs unit and integration tests for a multi-service web/API codebase and deploys to staging before any production cutover. Recently, an incomplete pull request and unverified external integration configuration caused confusion about what was actually reviewed versus what was approved for release. ​Write a concise Pre-Release Evidence & Gate Checklist that an engineering team can use before promoting changes to staging or production. Include: ​1. Evidence verification rules (confirming exact repository/PR or artifact identity, required file diffs, and test/check results before making release decisions). ​2. Explicit release gate states (HOLD / INCOMPLETE EVIDENCE, NO-GO, and GO prerequisites) and who/what must sign off. ​3. Operational safeguards for external integrations, webhooks, DNS/routing, and environment variables so unverified changes cannot leak into live environments. ​Answer guidance (optional) ​Pass criteria: Establishes a clear distinction between incomplete evidence/holds, blocked releases (NO-GO), and verified release readiness, with concrete checks on artifact identity, diff completeness, and environment isolation. ​Failure modes to penalize: Treating partial or mismatched evidence as sufficient to approve changes, conflating staging validation with production authorization, or omitting environment/secret isolation checks. ​Strong extras: Keeps the checklist actionable, concise, and structured so engineers can apply it directly in PR reviews and release runbooks. ​Quick Reminders Before Saving or Publishing ​Quota Watch: Publishing new prompts or republishing edited prompts counts against your published prompt limit (1 of 100 in your earlier snapshot), so save as a draft first and polish wording before publishing. ​Public Visibility: Anything published on MicroEvals is publicly visible, so keep prompts and answer guidance free of internal URLs, secrets, credentials, or restricted project data.

Drag to resize
Drag to resize
Drag to resize