CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

feat: AI Triage page, fix Inbox Agent, cache fix, Vapron-only docs #4042

Merged⚡ AI-generatedXSccantynz wants to mergeclaude/ecstatic-hopper-77iamvmainopened Jun 20, 20260/5 tasks
ccantynzcommented Jun 20, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/AlecRae.com/pull/89


Summary

This PR rolls up four independent pieces of work from the current session:

1. Fix stale-page caching (broke platform after deploys)

Root cause: No Cache-Control headers meant browsers cached HTML pages indefinitely. After a deploy the new chunk hashes conflicted with cached old HTML → blank page. ipconfig/flushdns only clears DNS, not HTTP cache.

  • next.config.ts: Cache-Control: no-store for all HTML/API routes; immutable long-cache only for /_next/static/* (content-hashed chunks)
  • /api/version route: updated from Vercel env vars to NEXT_PUBLIC_COMMIT_SHA / NEXT_PUBLIC_BRANCH (Vapron-native)
  • box-deploy.sh: injects those env vars at build time

2. AI Triage page (brand-new, wires fully-built backend)

The /v1/ai/categorize/* backend (24K+ lines) had zero UI — totally invisible to users. Now wired:

  • New page at (dashboard)/ai-triage showing category distribution (Work/Personal/Newsletter/etc.) with coloured progress bars and confidence scores
  • Smart Rules tab: create, pause, delete label rules that auto-apply to matching emails
  • "Categorize Inbox Now" triggers a batch run on the backend
  • Gated at Personal+ (ai_categorization tier moved from pro → personal — triage is a core feature)
  • Added to sidebar under AI Features

3. Fix Inbox Agent broken endpoint

The agent dashboard was calling GET /v1/agent/status which didn't exist — backend only had /config. The page would fail to load agent stats on every visit.

  • Added GET /v1/agent/status endpoint that merges config + today's run aggregates (processedToday, timeSavedMinutes) — exactly what AgentStatus interface expects

4. Vapron-only docs sweep (19 infra docs total)

Craig: "update all docs — we strictly Vapron only." Removed all references to Vercel, Fly.io, and Cloudflare Pages as deployment targets across 19 docs files. Key changes:

  • fly-mta-deploy.md: replaced 280-line Fly.io runbook with short redirect to mta-box-setup.md
  • guides/deployment.md: complete rewrite for systemd/box deployment
  • 17 other infra docs: updated references, timestamps, region notes

Test plan

  • Visit mail.alecrae.com after a deploy — page should always be fresh (no blank page from stale cache)
  • Visit /api/version — should return { commit, branch, builtAt, ok: true }
  • Visit /ai-triage on a Personal+ account — category distribution chart loads; Smart Rules tab works
  • Visit /agent on a Pro account — stats panel loads without error (was crashing on /status 404)
  • Check sidebar — "AI Triage" appears under AI Features with PERSONAL badge

🤖 Generated with Claude Code

https://claude.ai/code/session_01GYakKc6rtYKmTgknsK1AiY


Generated by Claude Code

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts