SSherlock Code Review Agent
walked 5 services · ran 18 checks · 2m ago Reviewed 7 files across 5 dependent services. Non-trivial blast radius — flagging 5 issues before merge. Bumping catalogCache from 50 items → full catalog reaches into inventory-sync, pricing-svc and promo-service.
⚠ K8s memory / OOMKillblocking
Full catalog push takes checkout-service resident memory to ~680 Mi. Current limits.memory = 512 Mi — every pod OOMKills ~40 s after rollout. Required: bump to ≥ 1 Gi in charts/checkout/values.yaml.
charts/checkout/values.yaml
- memory: 512Mi
+ memory: 1Gi
⚠ HPA thrash on cold-startblocking
Cold-start with the full catalog spikes CPU to 1400m for ~90 s. Your HorizontalPodAutoscaler targets 80% CPU with minReplicas: 3 — brain sim shows a scale-up storm to 27 pods then scale-down within 2 min. Add a warmup gate or raise stabilizationWindowSeconds to 300.
⚠ Cross-service breakage · inventory-syncneeds review
/cache/invalidate is called 200 req/s by inventory-sync (owner: @inventory-team). The new 30 s TTL collides with a batch-tick every 25 s, producing ~5 s of stale reads per cycle. Downstream promo-service depends on this contract for coupon eligibility.
⚠ DB migration · exclusive lockblocking
202607_add_catalog_index.sql runs CREATE INDEX without CONCURRENTLY on products (48 M rows). Brain observed a ~9 min AccessExclusiveLock on the last similar migration — which will block orders-api writes and page @dbre.
db/migrations/202607_add_catalog_index.sql
-CREATE INDEX ix_products_sku ON products(sku);
+CREATE INDEX CONCURRENTLY ix_products_sku ON products(sku);
⚠ Secret in code + SLO burnblocking
src/cache/redis.ts:47 hardcodes a Redis password — should be process.env.REDIS_AUTH. Also: brain projects a 2.4× 30-day SLO burn on checkout.p99<300ms if the HPA thrash isn't fixed.
src/cache/redis.ts
- password: "r3d1s-prod-9x8Kk!"
+ password: process.env.REDIS_AUTH,
Risk Score
CRITICAL · 9.4 / 10
Sherlock will block this merge. Fix the 4 blockers and re-run /sherlock review — I'll re-simulate against the brain and clear it.