Build R-Stage — god-grade in-house Fable replacement — as pnpm/Turborepo monorepo (apps/web Next.js 16 + apps/extension WXT MV3 + apps/workers Hono+Temporal + apps/docs Nextra), with packages/capture
Decision
Build R-Stage — god-grade in-house Fable replacement — as pnpm/Turborepo monorepo (apps/web Next.js 16 + apps/extension WXT MV3 + apps/workers Hono+Temporal + apps/docs Nextra), with packages/capture as ONLY direct port from Fable (SerNode/SerDoc DOM serialization library — Apache 2.0). Modern stack: Drizzle ORM + Postgres 17 (single DB, app+analytics schemas), Better Auth (replacing paid Auth0), shadcn/Tailwind 3 (replacing Ant Design), Mastra runtime + Claude OAuth subscription (replacing API-key Anthropic), Temporal workflows (replacing SQS polling), Traefik+Caddy on-demand TLS (replacing AWS Amplify), Higgsfield+Gumlet+ElevenLabs (replacing Elastic Transcoder+OpenAI TTS), PostHog primary + Snowflake daily-rollup sink (replacing Kinesis+Athena). Deploy: web→Vercel, workers/Temporal/Postgres→Hostinger VPS Docker, assets→S3 Runwal AI AWS 292600392118 + BunnyCDN. 8-Wave Helix delivery to first viewable demo by Wave 4 (Aug 2026), Fable parity by Wave 8 (Q4 2026), then god-grade extensions (real-time collab, Salesforce/WhatsApp/Hindi/RERA overlay, AI co-pilot, soul-ID avatars). Dual-beneficiary AJ-owned platform on R-* product line.
Rationale
Decision matrix scored B (rewrite monorepo) at 4.35/5 vs C (hybrid) 3.86 vs A (lift+shift) 2.35. Lift-and-shift rejected: Spring Boot + CRA + Redux + Yarn workspaces violate AJ blessed stack (Next.js/Drizzle/pnpm), Auth0 violates fixed-cost OAuth-only mandate, AWS Amplify locks vanity domains to AWS-only deploys, MySQL+PostgreSQL split is unjustified now that Postgres 17 + Drizzle handles both workloads. Pure-rewrite B beats hybrid C on every axis EXCEPT capture engine — Fable’s SerNode/SerDoc serialization handles iframes/shadow DOM/adopted stylesheets/proxied URLs with 2+ years of hardening (1.2MB of TypeScript in workspace/packages/common + workspace/packages/ext-tour) that would take ≥3 months to rebuild from scratch. Tactical resolution: B+capture-port hybrid — port packages/capture as black-box Apache 2.0 library (only piece NOT rewritten), everything else ground-up on AJ stack. This collapses 3 repos+15.4MB source to one monorepo, replaces 5 paid SaaS dependencies (Auth0/Amplify/Elastic Transcoder/Athena/Chargebee) with AJ-owned or OSS, and unlocks AI-native features (inline Claude co-pilot, Higgsfield avatars, multi-lingual Hindi/Marathi support, RERA compliance overlay, Salesforce/WhatsApp leads) Fable cannot ship. Premortem identifies 10 risks; top mitigations: (1) port capture as black-box, snapshot-test against 50+ real sites Wave 2; (2) defer Temporal to Wave 5, use simpler queue Waves 1-4; (3) Caddy on-demand TLS instead of Let’s Encrypt direct; (4) PostHog primary + Snowflake rollup-only to control egress cost; (5) port Fable’s 7 Claude prompts VERBATIM as starting baseline.
Alternatives Rejected
Outcome
Pending