Eval-backed production-style fixes
SaaS billing · TypeScript · services/checkout
CI Passed
Tax rounded per line instead of invoice subtotal
Anonymous industry: SaaS billing
Language: TypeScript
Signal: invoice tax mismatch
Production error: invoice tax mismatch created one-cent reconciliation deltas.
services/checkout/src/tax.ts
- return total + Math.round(lineSubtotal * taxRateBps / 10000);
+ const subtotal = lines.reduce((total, line) =>
+ total + line.unitPriceCents * line.quantity, 0);
+ return Math.round(subtotal * taxRateBps / 10000);
Verified against Prilog evals
Retail checkout · Go · retail-api/internal/checkout
CI Passed
Multi-quantity cart total undercharged
Anonymous industry: retail checkout
Language: Go
Signal: cart total audit
Production error: baskets with quantity above one were charged for a single unit.
internal/checkout/total.go
func CartTotalCents(items []Item) int {
total := 0
for _, item := range items {
- total += item.UnitPriceCents
+ total += item.UnitPriceCents * item.Quantity
}
return total
}
Representative anonymized scenarios
B2B platform · Python · platform_gateway/cache.py
CI Passed
Tenant omitted from feature-flag cache key
Anonymous industry: B2B platform
Language: Python
Signal: feature flag trace
Production error: feature flag responses leaked across tenants after cache hits.
platform_gateway/cache.py
def feature_cache_key(flag_name, user):
- return f"{flag_name}:{user['user_id']}"
+ return f"{flag_name}:{user['tenant_id']}:{user['user_id']}"
Eval-backed production-style fixes
Identity/security · Java · auth-service
CI Passed
Token TTL seconds compared to milliseconds
Anonymous industry: identity/security
Language: Java
Signal: auth expiry alert
Production error: expired sessions were accepted because TTL units were mismatched.
auth-service/src/main/java/.../SessionToken.java
public boolean isExpired(long nowMillis) {
- return nowMillis - issuedAtMillis > ttlSeconds;
+ return nowMillis - issuedAtMillis > ttlSeconds * 1000L;
}
Verified against Prilog evals
Vendor integrations · Ruby · vendor-client
CI Passed
Upstream 500 HTML parsed as JSON
Anonymous industry: vendor integrations
Language: Ruby
Signal: upstream vendor 500
Production error: JSON parser crashed on an upstream HTML error body.
lib/vendor_client.rb
def parse_response(response)
+ if response.status >= 500
+ return { ok: false, status: response.status,
+ error: "upstream returned #{response.status}" }
+ end
payload = JSON.parse(response.body)
Representative anonymized scenarios
Logistics · Rust · fulfillment-worker
CI Passed
Over-allocation creates negative inventory
Anonymous industry: logistics
Language: Rust
Signal: inventory reservation log
Production error: reservation requests could drive available stock below zero.
fulfillment-worker/src/lib.rs
pub fn reserve_units(available: i32, requested: i32) -> Result<i32, String> {
+ if requested > available {
+ return Err("requested quantity exceeds available inventory".to_string());
+ }
Ok(available - requested)
}
Verified against Prilog evals
Commerce fulfillment · TypeScript · fulfillment-worker
CI Passed
Shared warehouse allocation crossed tenant boundaries
Anonymous industry: commerce fulfillment
Language: TypeScript
Signal: SigNoz + OTel allocation trace
Production error: tenant_blue shipment allocated tenant_red stock in a shared warehouse.
services/worker/src/allocate.ts
const stock = inventory.find(candidate =>
candidate.sku === item.sku &&
+ candidate.tenantId === event.tenantId &&
candidate.warehouseId === event.warehouseId &&
candidate.available >= item.quantity
);
Eval-backed production-style fixes
Marketplace payments · Go · checkout-api
CI Passed
Payment retry changed idempotency key after timeout
Anonymous industry: marketplace payments
Language: Go
Signal: Datadog + OTel payment trace
Production error: duplicate capture detected after provider timeout for a checkout order.
internal/orders/checkout.go
- retryKey := req.OrderID + "-retry"
charge, err = gateway.Capture(payments.ChargeRequest{
- IdempotencyKey: retryKey,
+ IdempotencyKey: key,
CustomerID: req.CustomerID,
AmountCents: req.AmountCents,
})
Representative anonymized scenarios
Ops automation · Python · workflow-reconciler
CI Passed
Workflow status regressed from timezone string ordering
Anonymous industry: ops automation
Language: Python
Signal: CloudWatch reconciliation log
Production error: offset timestamps were compared lexicographically and chose an older status.
reconciler/workflow.py
+ def _parse_updated_at(value):
+ parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
+ return parsed.astimezone(timezone.utc)
- latest = max(events, key=lambda event: event["updated_at"])
+ latest = max(events, key=lambda event: _parse_updated_at(event["updated_at"]))
Verified against Prilog evals
Service mesh · Java · edge-proxy
CI Passed
Proxy dropped tenant and authorization context
Anonymous industry: service mesh
Language: Java
Signal: AWS downstream auth log
Production error: downstream service received forwarded requests without auth or tenant headers.
ServiceProxy.java
+ if (incoming.headers.containsKey("X-Tenant-ID")) {
+ forwarded.put("X-Tenant-ID", incoming.headers.get("X-Tenant-ID"));
+ }
+ if (incoming.headers.containsKey("Authorization")) {
+ forwarded.put("Authorization", incoming.headers.get("Authorization"));
+ }
Eval-backed production-style fixes
Marketplace payouts · Ruby · payout-allocator
CI Passed
Weighted payout split dropped residual cents
Anonymous industry: marketplace payouts
Language: Ruby
Signal: Honeycomb payout audit
Production error: equal-weight merchant payouts failed to preserve the exact total cents.
lib/payout_allocator.rb
+ entries = weights.map { |merchant, weight|
+ exact = total_cents * weight / total_weight.to_f
+ [merchant, exact.floor, exact - exact.floor]
+ }
+ residual = total_cents - allocated.values.sum
+ entries.sort_by { |m, _c, r| [-r, m] }.first(residual)
Representative anonymized scenarios
Analytics streams · Rust · stream-processor
CI Passed
Stream dedupe collapsed offsets across partitions
Anonymous industry: analytics streams
Language: Rust
Signal: Datadog stream aggregate log
Production error: aggregate totals undercounted when two tenant partitions shared an offset.
stream-processor/src/lib.rs
- let mut seen_offsets = HashSet::new();
+ let mut seen_events = HashSet::new();
+ let key = format!("{}:{}:{}",
+ event.tenant_id, event.partition, event.offset);
- if seen_offsets.insert(event.offset) {
+ if seen_events.insert(key) {