Platform update
Release notes for this version.
Fixed
19- The system-design masterclass now passes an automated axe WCAG 2.0/2.1 A+AA pass on
/learn, the module and all 41 topics at 390/1440 in light and dark: lesson code blocks and wide tables are keyboard-focusable, the lesson step-number and dark "down" node contrast meet 4.5:1, lesson diagrams sit in a deliberate light figure panel in dark mode, and thesystemvisual uses a two-column tier grid on phones instead of horizontal scrolling. - Scaled judge workers now heartbeat per process (
hostname:pid) instead of per hostname, so two Compose replicas cannot collapse into one worker count. The srv deploy also verifies the running worker-container count after scaling. - Registration no longer caps one address at 5 attempts per 15 minutes. The per-egress budget is now 1,500/15 min (100/min) with a 6,000/15 min global backstop, enough for a 1,200-contestant campus onboarding burst without opening the door to unlimited signup/email spam.
- The public announcement drawer is cached in-process for 30s and its limits are now 12,000/min per IP plus 30,000/min global, so 10k guests behind one NAT can open the bell without exhausting a 60/min bucket; the feed still keeps its 60s public HTTP cache.
- A lost verdict pub/sub event is now detected by a jittered 5–7s Redis version check instead of waiting for the 15s (now 30s) DB fallback. The version key lives for an hour, so a long judge queue does not degrade pending streams.
sse-soak.mjssupports--insecurefor a staging self-signed TLS endpoint; certificate verification stays on by default.- Sign-in no longer applies a 20-per-15-minute cap to every attempt from one address. Only failed passwords are counted against the shared egress IP (50 per 15 minutes), so a campus or carrier NAT can sign a whole contest in while password spraying is still throttled.
- The admin **Payments & access** badge now refreshes with the existing 45s dashboard counts poll;
/api/v1/social/countsreturnsaccessfor admins and0for everyone else, and the sidebar updates without a navigation. - Admin premium-order notifications are capped at 10 per admin per rolling hour; additional orders send one hourly digest while the queue badge and
/admincallout keep showing the true pending count. - The Study plan E2E Chrome launch now captures stderr, waits up to 30s for DevTools (with the stderr WebSocket fallback) and retries once with a fresh profile, so the CI "no DevTools port" flake is diagnosable and self-healing.
srv deploynow runs adeploy/srv/deploy.shhook: the pre-hook rebuilds the judge sandbox image whenjudge/changes or the image is missing, and the post-hook seeds the curriculum. This prevents the judge worker from crash-looping after an app-only deploy.- Admins are now notified in-app when a premium payment or free-access request arrives; the admin sidebar links to **Payments & access** with a pending-count badge and
/adminshows a review callout, so free-access requests no longer sit unseen. - Custom-test runs no longer report a green “AC”. A clean run is now
EXECUTED, the result card shows “Ran” (or a sample comparison when the input matches an official sample) and never presents an unjudged run as correct. Empty output on a sample now shows “Your output” with a(no output)placeholder, the expected sample output and “Differs from sample” instead of a misleading AC. Run results cached before this change are normalized toEXECUTEDon read, andEXECUTEDrenders with neutral “Ran” metadata instead of a judge-error fallback. - The dashboard sidebar navigation no longer shows a native scrollbar. It keeps
overflow-y-autofor short viewports but hides the bar (scrollbar-width: none+ WebKit rule), so the workspace menu stays clean at every height. - Learning badges no longer render locked placeholders. The profile section is hidden until at least one module checkpoint is completed, then shows only the earned badges with their completion dates.
- Tied players with equal ratings keep equal rounded Elo deltas (the rounding remainder no longer splits a tie group when another group can absorb it).
- Rate-limit buckets now set their TTL in one atomic Redis script, so a connection drop cannot leave a permanent 429 key; a bounded per-process fallback covers Redis outages.
- A block that races a follow/open/send transaction is serialized with a per-pair advisory lock, so a concurrent block cannot be bypassed.
- Banned counterparts are hidden from message inboxes, unread counts and threads (direct links 404); the header badge uses a 15-second invalidated cache;
/messagesSSR pages are rate limited; and JSON bodies over 1 MiB are rejected with 413.
Changed
13/healthnow reportsjudgeQueue: { waiting, active, prioritized, delayed, failed },judgeSlots(workers × concurrency), andmemory: { rssMb, heapUsedMb, limitMb }so operators can see judge saturation and the container memory ceiling; backlog never changes the health status, and the queue probe degrades to zeros on a Redis or BullMQ error.- The srv deploy hook now targets the **1,200-contestant profile**: 1 worker ×
JUDGE_CONCURRENCY=4= 4 judge slots, preserved across deploys, withJUDGE_WORKER_REPLICAS=1; the registration limit is 1,500/15 min per IP. - The edge budget is now 2 GB for
srv-caddy(measured ~1.1 GB with 10k TLS streams), the deploy hook raises/verifies it, and the host healthcheck fails if the edge is downgraded below 2 GB. The cron healthcheck publishes the effective edge limit topauoj:edge:caddy:memory(EX 900), and production smoke checks the newnetwork/edgefields numerically. - Submission SSE checks a per-submission Redis version every 5–7s; a DB poll happens only after a version change, with a 30s fallback for Redis outages. Contest/assessment jobs still outrank practice work.
- Live standings scale to 10k participants: the board is cached per app process for 5s (30s after the contest), paginated at 50 rows, and served with an ETag/304; the page polls the API every 20s instead of re-rendering the whole route. In-viewport prefetch is disabled on contest tabs, problem links, profile links, pagination and the main nav so viewers do not fan out background RSC renders.
- Submission verdicts are pushed over Redis pub/sub instead of every open SSE stream polling Postgres once per second; the stream keeps a 15s fallback poll and heartbeat. Live contest and assessment submissions now outrank practice, virtual-contest, rejudge and custom-run jobs in the judge queue.
- Postgres pools and query timeouts are configurable (
DATABASE_POOL_MAX,WORKER_DATABASE_POOL_MAX,DATABASE_STATEMENT_TIMEOUT_MS,DATABASE_CONNECT_TIMEOUT_SECONDS), and the Compose stacks raise the file-descriptor limit for 10k long-lived SSE connections. Judge workers can be scaled on one host. /healthreports the deployedAPP_COMMIT; the srv deploy hook records it, the server compose passes it to web/worker, and CI/CD only accepts a deploy when the live commit matches the queued short SHA. The first judge image build is documented as a one-time ~10 minute, ~3.2 GB step that is cached.- CI/CD now deploys
mainautomatically after a green **CI** run (and on manual dispatch) through the srv deploy hook. The job waits for the server queue and verifies/health, the production smoke suite and the 5 MiB upload probe. Requires the one-timeDEPLOY_TOKENActions secret; without it the deploy is skipped with a warning. - Conversation info now uses three tabs (Media, Documents, Links), shows each detail as a label/value row, binds the profile link to “Name (@username)”, and removes the duplicate Actions block (mute/report stay in the thread header).
- The thread header shows a single presence indicator; the duplicate avatar overlay dot is removed so “Online now” is not shown twice.
- Profile hero refresh: the identity card now has an ambient glow, a larger avatar, compact metadata chips and a tighter two-line work/skills block. The follow, message, share, block and report actions are 36px on desktop (44px on mobile), share/block/report collapse to an icon toolbar, and blocking uses a focused confirmation dialog instead of an inline form. Stat tiles moved to a light four-tile strip with icon accents; light and dark themes both use the same token palette.
- Contest ratings finalize one hour after a contest ends instead of on the first contest page view. The hour is a review/rejudge window; the Redis-locked worker sweep waits for pending verdicts, finalizes in
(end_at, id)order, and defers while an earlier contest is unfinalized. A throttled ordered page fallback andpnpm ratings:finalizekeep ratings moving without the worker. Finalization uses competition ranks, exact zero-sum integer deltas (floor-aware), locks participant rows, excludes banned/virtual participants, and locks contest submissions/problems/schedule afterrated_at. Profile/standings show the review/finalized state. A dry-run-firstpnpm ratings:recomputereplays stored history with the current engine; the local history was repaired (two old −1 sums → 0, sadia 1570→1572) and a second apply is idempotent.pnpm ratings:auditnow passes withwarnings: 0. The shared footer/empty-state heading order and GROUP format-badge contrast were also fixed.
Added
28- A free **System Design Masterclass** (
/learn/system-design, track 12): nine chapters and 41 topics, from request lifecycle and napkin math through scaling, data/storage, communication, reliability, architecture, security and shipping to URL-shortener, news-feed and chat designs. It adds a new animatedsystemvisual with role/tier architecture diagrams, a nine-chapter map, six static deep-dive SVGs, labs, a topic-specific design-practice exercise with a rubric in every lesson, and a 45-minute three-problem capstone checkpoint with the Scale Architect badge. The 21 code drills remain in the problem archive but are not shown as course practice. The track is free, has no sequential lock, and its lessons follow নুসরাত at the fictional Dhaka ride-sharing startup চলো. /healthnow reportsnetwork: { somaxconn, tcpMaxSynBacklog }from the app's namespace andedge: { caddyMemoryLimitMb }from apauoj:edge:caddy:memoryRedis bridge written by the host healthcheck, so the effective backlog and shared-edge budget are visible remotely.- CI now starts the built
pauoj/app:ciimage against Postgres/Redis, runs migrations inside the image, and polls/healthfor database, Redis and migration readiness, proving the customserver.jsboots on every build. - A production HTTP server (
scripts/production-server.cjs, shipped asserver.js) with an 8192 listen backlog, 20k connection cap and 65s/66s keep-alive/header timeouts, pluspnpm start:standalone. The Docker image now uses it instead of Node's 511-backlog default. - Per-container
sysctlsfornet.core.somaxconn/net.ipv4.tcp_max_syn_backlog(16384) on the app and edge Compose services, with host-level instructions for the srv-managed stack. scripts/sse-soak.mjs, a dependency-free SSE soak harness for up to 10k connections (opened/failed/initial+subsequent updates/done/errors/RSS) with deploy docs for running it against a staging contest and scaling judge workers whenjudgeQueue.waitinggrows.scripts/capacity-load.mjs, a dependency-free GET load check for a seeded contest (p50/p95/p99, RPS, status/error counts, exit on 5xx or a p95 budget), and a capacity/sizing section indeploy/README.mdcovering the pool formula, file descriptors, SSE streams and judge worker scale-out.- Notification bell and drawer in the public navbar: signed-in users get an unread-count badge that refreshes while the tab is visible, an accessible right-side drawer with All / Unread / Notices tabs, per-item and mark-all read, load-more pagination, loading/empty/error states and links to the full notification center and preferences. Notices, announcements, new-contest and contest-update rows carry visible category chips. Guests can open the same bell to read public announcements and live/upcoming contests. The coder, teacher and admin dashboard headers render the same bell and reuse the shell's existing 45-second counts poll instead of starting a second one. Adds
PATCH /api/v1/notifications/:id/read, afilteron the notification list, and the publicGET /api/v1/announcementsendpoint (completed fan-out only, baseline rows excluded, same-origin hrefs, rate limited and cacheable)./healthnow reportsbroadcastQueue.pendingandoldestPendingSeconds, the 5-minute healthcheck alerts when a broadcast row has waited over 10 minutes, and production smoke covers the guest bell, the announcements endpoint and both queue fields, so a stuck fan-out is visible instead of silently hiding public notices. - Offline admin recovery:
pnpm admin:reset -- --confirm(also built asdist/reset-admin.jsfor the production image) creates or resets the seeded admin fromSEED_ADMIN_*, verifies the email, clears a ban, revokes sessions and pending auth tokens, and writes anadmin.recoveryaudit row. It refuses the default password, anything under 12 characters, identifiers that belong to two accounts, and silently promoting a non-admin match unless--promoteis explicit. The production seed now refuses the default admin password outright. The production smoke also accepts optional non-adminSMOKE_USER/SMOKE_PASSWORDto verify the signed-in bell, dashboard, notification API and logout; it skips cleanly when unset. - Custom-test expected output: for a practice problem with a stored reference solution, a non-sample custom run now also runs the reference on the same stdin and shows **Your output** beside **Expected output (reference)**. “Matches expected” / “Differs from expected” uses the problem's
EXACT,TOKENorFLOATchecker (CUSTOMshows the reference output without a pass/fail claim). Official samples skip the extra run and keep the existing sample comparison; contest/assessment runs and problems without a reference show an explicit unavailable note. Reference sources are never returned to the client. Adds migration 0053 (problem_reference_solutions) and seeds 471 non-SQL references. - SQL and author-created reference coverage: migration 0054 adds the
problem_reference_solutions.scriptflag, the seed stores all 136 SQL reference queries (132 normal + 4 script labs), and reviewer approvals now inherit their solution as the problem reference. SQL expected output is generated with the SQLite fixture; MySQL/PostgreSQL runs show it without a pass/fail claim and with a dialect note. Successful reference output is cached for one hour per reference source + stdin. - Message document sharing and live conversation info: PDF/TXT/CSV/ZIP/DOCX/ XLSX/PPTX files up to 5 MiB now upload from the composer (magic-byte validated, opaque participant-only downloads), render as document bubbles and appear under Documents in the sender panel alongside document links. The panel refetches on reopen and polls every 20s while open, older active conversations are pinned into the rail, and the panel is an in-flow column at 1024px (rail hidden while open) with the phone drawer unchanged. Adds migration 0052 (
message_attachments.kind/file_name/size_bytes) and keeps one shared 50-file/24h + 250 MiB sender quota for images and documents. - Messages workspace:
/dashboard/messagesand/dashboard/messages/[id]now share a three-pane, WhatsApp-style layout with a searchable All/Unread conversation rail, grouped day dividers, a pinned sender header and a contact panel that stays closed until the sender's name is clicked. The panel shows public profile/about/details, a name-linked profile URL, Media/Documents/Links tabs, and lazily loaded shared media, document links and external links (participant-only, no-store, with blocked/banned gates). Existing text/image sending, emoji and entity suggestions, read receipts, deletion, muting, reporting, pagination and rate-limit states are unchanged. No migration. - Notification and email expansion: welcome, contest registration/30-minute reminder/final result+rating, study-plan and module enrollment, payment submitted/approved/rejected/revoked, 7/21-day course inactivity, badges and solved milestones (1/100/250/500/700/1000), announcements, new contest/module marketing, direct messages and problem/lesson discussion replies now create in-app notices and opt-out email copies. Adds 8 preference switches, 12 notification types, 12 unsubscribe scopes, exact-threshold achievement rules, a
broadcastsledger with automatic contest/module marketing and pending retries, and an admin announcement composer at/admin/announcements(migrations 0047-0049). - Notification email reliability: notification mail now goes through a durable
email_outboxqueue withFOR UPDATE SKIP LOCKEDclaiming, five-attempt backoff, terminalFAILEDrows for operators and 30/90-day retention. Announcements and marketing are queued and fanned out by the worker instead of blocking the admin request; in-app and email marketing are independent, so in-app-off users can still receive email-only marketing. Follow notices gained anemailFollowsswitch, and contest results now reach every registered non-banned participant with a fallback final-standings notice for GROUP/unrated contests. - Browser push and notification grouping: users can enable standards-based VAPID Web Push per device from Settings (service worker, same-origin clicks, privacy-redacted message/reply bodies, 404/410 pruning, DB-backed subscription storage in
push_subscriptions). The notification center groups rows by type and UTC day with expandable counts. Notification emails now start an immediate outbox flush after enqueue, so normal messages deliver in under a second while the worker retry sweep remains the safety net. Broadcast publishing also starts an immediate fan-out; the 30-second sweep retries anything left. - Profile avatars: every account can upload a PNG/JPG/WebP photo or pick one of twelve preset avatars (cat, dog, bird, fish, rabbit, squirrel, turtle, panda, ghost, rocket, bot, gamepad) from Settings → Profile picture. The browser crops to a square and resizes to 512×512 before upload; the server validates the bytes and dimensions and stores the image in
user_avatar_images. The chosen avatar appears on profiles, the header, rank/rating boards, comments, messages, contest rosters and scoreboards, and admin pages. Choosing a preset replaces an uploaded photo; removing a photo falls back to the selected preset or the existing initials avatar. Avatars are served from a versioned, immutable/api/v1/users/:username/avatarURL. - Social graph v2: follows are now approval-based (
PENDING/ACCEPTED, withacceptedAt) instead of instant. A profile shows Follow → Requested → Following, incoming requests can be accepted or declined from/connections/requests, mutual requests auto-accept, and request/acceptance produce deduped in-app notices. Existing accepted follows are preserved by migration 0043. - Direct messages: two-person conversations unlocked by an accepted follow in either direction, with an inbox, paged threads, header unread badge, read receipts, soft delete (notification previews are cleared), in-app notices for the first unread message of a burst, and participant-only
404semantics. Rate limits: open 20/h, send 30/min, read 120/min, delete 60/min. - Blocking: one transaction inserts
user_blocks, severs both follow edges (pending or accepted) and hides presence; blocked users cannot follow, re-request, open a conversation or send. The conversation disappears from both inboxes and direct links return 404 until unblock; block checks are serialized per user pair to close check-then-write races. - Ranking board:
/ranknow supports text search over name, username and institution, exact institution/country filters, solved brackets, sorting by points/solved/name and 10/20/50 page sizes. Global ranks are computed before filtering, so a filtered row keeps its real rank. The page adds a top-3 podium, active-filter chips, mobile cards, range/first/last pagination and a "your standing" card;GET /api/v1/rankaccepts the same filters. - Dual leaderboards on
/rank: a Points board and a Contest rating board (?board=rating). The rating board only admits non-banned coders with finalized rated solo contests, and shows current rating, peak, contest count, last delta and last contest; global ranks use rating → peak → contests → username and are computed before filters. It adds rating-tier filters, rating/peak/contests/name sorting, tab switching that preserves shared filters, and Codeforces-style tier-coloured names and handles. Profile rating rank uses the same board order.GET /api/v1/ratingsmirrors the board with the same validation, and the points board now excludes banned users too. - Learning content navigation: every lesson ends with a previous/next pager (first lesson → track overview, last → module checkpoint); module pages offer previous/next track navigation, and the SQL industry-project delivery board lists all 23 tickets in curriculum order. Topic/track order comes from the existing module/topic arrays;
#checkpointlinks now scroll correctly after the streamed module card lands. The sequence helper and pagers are covered by unit/render tests. - ShopSphere industry-project dossier at
/learn/sql/project: seven feature squads, 23 work tickets mapped one-to-one to the SQL lesson topics, a 19-table data dictionary with keys and seeded row counts, ten metric definitions, a twelve-item handover checklist with judge-problem proofs, staff-engineer defense questions, and a downloadable SQLite fixture. Every SQL topic renders its work ticket; the SQL hub and both track overviews link to the dossier.sql-project.test.tskeeps the dictionary, epics, tickets and fixture aligned. - Submission analysis on
/submissions/:id: runtime and memory percentile ("beats") against accepted runs on the same problem (same language, widening to all languages for small samples), a runtime-distribution histogram with the submitting run marked, fastest/median/sample stats, a collapsible source panel (View more), related-practice pills and a private per-submission note. Analysis is hidden for assessment submissions and live contests. Migration0042_submission_notes;GET /submissions/:id/analysisandPUT/DELETE /submissions/:id/notes. - Presence is now explicit on every social surface: profiles, follower/following and request lists, message inbox/threads and both rank boards show "Online now" or
Last active 7m/3h/2d/3w/4mo/1y ago("No recent activity" when cleared), subject to Everyone/Followers/Nobody visibility. Migration 0044 backfills existing users from account/session/submission history. - Conversation mute and in-app notice preferences: muted conversations keep their history but contribute zero unread and send no notices;
notifyMessagesandnotifyFollowscan be switched off in settings without affecting security or account notices. Blocking now hides the conversation from both inboxes, excludes it from unread counts, returns 404 on direct links and marks the blocker's related notices read. - Social reports: messages, conversations, follow requests and profiles can be reported with a reason and optional details, with a 24-hour duplicate guard and 10/hour limit. Message evidence must be authored by the reported user. Admins triage open/resolved/dismissed reports at
/admin/social-reportsand closing a report is atomic with its audit entry and notifies the reporter. Duplicate submissions are serialized, admins get one grouped digest per hour while reports are open, and retention runs daily in the worker (365/730/365, opt out withSOCIAL_RETENTION_AUTO_APPLY=false);pnpm social:retentionremains the manual dry-run/apply entry point.
