Learnsignal · 2026 – present
Learnsignal LMS
Educational LMS platform providing course materials, billing, and automated exam grading for professional accounting students.
Learnsignal · 2026 – present
Educational LMS platform providing course materials, billing, and automated exam grading for professional accounting students.
Row Level Security policies performed per-row table lookups against user_roles, triggering 49k-row sequential scans and driving admin dashboard queries to 3.4–4.5 seconds. Billing had a monolithic 1,156-line Stripe webhook handler and a PayPal race condition that caused duplicate charges (~$5.3k revenue impact). Manual exam grading created operational backlogs.
Rewrote 49 RLS policies across 28 tables to extract auth.jwt() ->> 'user_role' claims directly from session tokens, removing redundant joins to user_roles.
Decomposed the Stripe webhook handler into 4 single-responsibility endpoints. Added PostgreSQL transaction advisory locks (pg_advisory_xact_lock) for gapless invoice numbering. Re-engineered PayPal dunning to parse API issue names and apply 24-hour exponential backoff retries.
Engineered an automated exam-marking pipeline using Claude 3.5 Sonnet via the Anthropic Message Batches API (~$0.01 per answer) with a 0.5-mark divergence gate for human escalation. Built a checkpointed bidirectional HubSpot reconciler patching next_payment_date sync bugs.
Replaced per-row database joins with direct JWT claim reads (auth.jwt()), converting sequential table scans into indexed reads.
Applied transactional advisory locks on invoice sequence generation to guarantee contiguous invoice numbers during concurrent checkout sessions.
Replaced generic HTTP 422 retries with issue-name parsing to distinguish terminal account errors from retryable authorization failures.
Validated Claude 3.5 Sonnet against human-graded exams (matching accuracy within 0.5 raw marks at 1/3 the cost of Opus). Implemented automated blind double-marking with human escalation triggers.
The admin dashboard loads in under 1 second, invoice sequences remain contiguous during checkout spikes, PayPal payment failures are classified with exponential backoff retries, and exam answers are graded automatically via LLM batch workers.