Overview
Loop simulates a restaurant-ops backend in the shape of a real production system. Orders land through an idempotent outbox pipeline, loyalty balances update transactionally, and an LLM-backed retention agent decides who to re-engage — bounded by send caps, an approval queue, and a full audit log — alongside a storefront-audit agent that reuses the same job and agent infrastructure.

Approach
A Fastify/Node.js API writes orders into MongoDB via an outbox transaction, tailed by Change Streams (not polling) for exactly-once delivery with a DLQ and a replay endpoint. BullMQ schedules a retention-agent worker that produces structured, guardrailed decisions — send caps, a human-approval queue, a full reasoning log — against real order history, validated against a hand-written golden-set eval rather than schema conformance alone. A storefront-audit agent reuses the same tenant/queue/decision-log plumbing to score page speed and completeness via Lighthouse. A Next.js dashboard renders a live order/ledger feed over WebSocket and the eval scorecard, deployed on AWS.
Features
- Idempotent multi-channel order ingestion with outbox, DLQ, and replay
- Auditable, transactionally-correct loyalty ledger
- Guardrailed AI retention agent: send caps, approval queue, full decision audit log
- Published golden-set eval scoring the retention agent's decision quality, not just schema conformance
- Storefront-audit agent reusing the retention agent's job/queue infrastructure
- Live WebSocket dashboard with an eval scorecard


