Project 1 of 14 · Build Your Own Redis Cache & Sliding-Window Rate Limiter (0/5) Project 2 of 14 · Build a Multi-Tenant Idempotent Payments & Double-Entry Ledger (0/5) Project 3 of 14 · Build a Zero-Leak Hybrid RAG & SSRF-Shielded MCP Agent Engine (0/5) Project 4 of 14 · Build a Crash-Safe WAL + LSM Storage Engine with Raft Fencing (0/5) Project 5 of 14 · Build a Page-Splitting B+Tree Composite Index & Selectivity Query Planner (0/5) Project 6 of 14 · Build a Zero-Downtime Reverse Proxy Keepalive Pool, Circuit Breaker & Drain (0/5) Project 7 of 14 · Build an Iceberg WAP Branching, DLQ Quarantine & ASOF Point-in-Time Engine (0/5) Project 8 of 14 · Build a JSON-RPC 2.0 MCP Policy Gateway, Budget Cap & SSRF CIDR Firewall (0/5) Project 9 of 14 · Full-Stack Keyset Cursor Pagination & Zero-N+1 Query Engine (0/5) Project 10 of 14 · HMAC-Verified Out-of-Order Stripe Webhook & Entitlement Guard (0/5) Project 11 of 14 · Zero-Leak Pre-Filter Hybrid RAG (BM25 + Cosine Vector RRF) (0/5) Project 12 of 14 · JSON-RPC 2.0 MCP Server with DNS-Rebinding IP Pin & Approval Ledger (0/5) Project 13 of 14 · Point-in-Time ASOF Feature Join & Temporal Leakage Elimination (0/5) Project 14 of 14 · Idempotent CDC Upsert, LSN Ordering & WAP Quarantine Gate (0/5) 1/14
M04 · L5 → L6 0/5 STAGES
Build Your Own Redis Cache & Sliding-Window Rate Limiter Implement RESP command routing, exact-ms TTL expiration, O(1) LRU eviction, and an atomic sliding-window limiter sustaining 5,000+ ops/sec. M01 · L5 → L6 0/5 STAGES
Build a Multi-Tenant Idempotent Payments & Double-Entry Ledger Implement immutable debit/credit journal rows, Idempotency-Key deduplication, 409 payload mismatch detection, and zero-drift reconciliation. M08 · L5 → L7 0/5 STAGES
Build a Zero-Leak Hybrid RAG & SSRF-Shielded MCP Agent Engine Implement RRF fusion, strict pre-filter JWT tenant ACLs, indirect injection quarantine, SSRF CIDR firewall, and hard agent step/dollar caps. M10 · L6 → L7 0/5 STAGES
Build a Crash-Safe WAL + LSM Storage Engine with Raft Fencing Build a CRC32-checksummed WAL surviving torn tail writes, immutable SSTable compaction with tombstones, and monotonic Raft fencing tokens. M02 · L5 → L6 0/5 STAGES
Build a Page-Splitting B+Tree Composite Index & Selectivity Query Planner Implement a real page-splitting B+Tree composite index with linked leaf pages for O(log N + K) leftmost-prefix range scans, zero-drift keyset cursor pagination, and a cost-based SeqScan vs IndexScan planner. M05 · L5 → L6 0/5 STAGES
Build a Zero-Downtime Reverse Proxy Keepalive Pool, Circuit Breaker & Drain Implement keepalive timeout ordering guards (proxy < upstream), a CLOSED/OPEN/HALF_OPEN circuit breaker, least-connections routing, and graceful SIGTERM preStop draining. M07 · L5 → L7 0/5 STAGES
Build an Iceberg WAP Branching, DLQ Quarantine & ASOF Point-in-Time Engine Build an atomic Write-Audit-Publish table engine with DLQ quarantine thresholds, event_id deduplication, zero-leakage ASOF point-in-time joins, and instant snapshot rollbacks. M09 · L6 → L7 0/5 STAGES
Build a JSON-RPC 2.0 MCP Policy Gateway, Budget Cap & SSRF CIDR Firewall Construct a fail-closed MCP tool policy gateway enforcing explicit allowlists, human-approval write gates, IPv4/IPv6 SSRF CIDR blocking, deterministic USD/step circuit breakers, and immutable audit logs. A03 · L3 → L5 0/5 STAGES
Full-Stack Keyset Cursor Pagination & Zero-N+1 Query Engine Eliminate OFFSET drift and N+1 SQL storms with opaque (created_at, id) keyset cursors, batched JOINs, and strict tenant scoping. A03 · L4 → L5 0/5 STAGES
HMAC-Verified Out-of-Order Stripe Webhook & Entitlement Guard Verify raw-byte HMAC signatures in constant time, block >300s replays, deduplicate retries, and apply monotonic out-of-order state transitions. A05 · L4 → L6 0/5 STAGES
Zero-Leak Pre-Filter Hybrid RAG (BM25 + Cosine Vector RRF) Eliminate post-filter small-tenant starvation and cross-tenant vector leaks by fusing pre-filtered BM25 + cosine rankings with RRF (k=60). A05 · L5 → L6 0/5 STAGES
JSON-RPC 2.0 MCP Server with DNS-Rebinding IP Pin & Approval Ledger Build a hardened JSON-RPC 2.0 MCP tool router enforcing static tool allowlists, single-lookup SSRF IP pinning, write approvals, and USD/step caps. A06 · L4 → L6 0/5 STAGES
Point-in-Time ASOF Feature Join & Temporal Leakage Elimination Join ML training labels strictly to latest pre-decision feature events (event_ts <= label_ts) eliminating silent temporal target leakage. A07 · L5 → L6 0/5 STAGES
Idempotent CDC Upsert, LSN Ordering & WAP Quarantine Gate Enforce schema contracts, reject stale out-of-order CDC LSNs, preserve delete tombstones, and block poisoned snapshots atomically via WAP. CACHE & RATE LIMITER · RESP + O(1) LRU 5,000+ ops/s · Exact Cap
In-Memory RESP Router, TTL Clock, O(1) LRU & Sliding-Window Guard Trace every request from RESP parsing through exact-ms expiration, bounded eviction, and atomic burst throttling.
Broken: Naive Dict Cache Fixed: Bounded Stage 1–5 Engine
STAGE 1 RESP Router PING · SET · GET · DEL Typed Command Dispatch STAGE 2 TTL Clock Lazy + Active Expiry Exact-ms Expiry Evict STAGE 3 O(1) LRU Ring Bounded max_keys Head Promote · Tail Pop STAGE 4 Sliding Window Atomic ALLOW Check Rolling Window Lock EVICTED / THROTTLED 429 Rejected · Cold Tail Dropped 1. RESP Router 2. TTL Clock 3. O(1) LRU Ring 4. Sliding Window
SELECTED NODE · Stage 1 · RESP Command Router
Parses incoming commands deterministically and routes read, write, and delete operations without mutating unrelated keys.
WHY THIS INVARIANT HOLDS
Lazy + active TTL cleanup, an O(1) doubly-linked LRU ring, and an atomic sliding-window log hold memory flat and block boundary bursts.
build/redis_limiter.py · ⌘+ENTER TO RUN Socratic Coach Load Reference Reset
1
Loading Obsidian Monograph editor…
▶ Run Stage 1–5 (Instant WASM) Run in Live Firecracker KVM
INCREMENTAL STAGE VERIFIER · 0 / 5 PASSED
○ Stage 1 · RESP Command Router (PING / SET / GET / DEL)
○ Stage 2 · Lazy & Active TTL Expiration (EX seconds)
○ Stage 3 · Bounded O(1) LRU Eviction under max_keys
○ Stage 4 · Atomic Sliding-Window Rate Limiter (ALLOW)
○ Stage 5 · 5,000-Op Throughput & Burst Stress Benchmark