Call Analyst β Engineering Hub
One place for everything, Pablo. The refactor is shipped to prod and the AWS/auth plan is ready for your input. Five deep-dives below; the short version is right here.
Refactor live on callanalyst.app
Auth/AWS plan ready for your call
Updated 2026-06-19
The five pages
All behind the Daxos gate (password daxos2027 β one entry unlocks all of them for a year).
πBuild Docs
How the product works today: consumer vs internal builds, tech stack, the serverless functions, data flows, integrations. Onboarding cold.
referenceopen β
πRefactor Progress
What the refactor did, commit by commit, and how each step was verified. The detailed log behind the summary below. (Written pre-ship; now merged β see below.)
shippedopen β
π οΈRefactor Plan
The original 5-workstream plan: segregation, stop main=prod, CI, split the file, cleanup. WS4 (split) is now done; the rest is the roadmap.
planopen β
ποΈYour AWS Proposal
Your POCβproduction proposal written up: CDK, VPC-isolated Lambdas, CloudFront, containers, plus the compliance framing. Your direction, captured.
proposalopen β
πAuth / AWS Plan
Cognito (us-east-2, 100k users) + CDK + SES/SNS + Stripe-linked + US geofence, with 6 sequence diagrams & timings. Answers your AβD. Needs your decisions.
for Saturdayopen β
πThe Refactor (shipped)
Explained right here on this page β what shipped to prod, how it was verified, and the two bugs caught on the way. Jump down β
this pageread β
Start here (suggested order)
- The refactor summary β (this page) β what just changed in the codebase and why it matters for your work.
- Build Docs β how the product is wired today (the thing the AWS work plugs into).
- Auth / AWS Plan β the concrete Cognito/CDK/Stripe plan; the 5 open questions at the bottom are what we decide Saturday.
- Reference as needed: your AWS proposal, the refactor plan, the progress log.
π The refactor β what just shipped
Live on callanalyst.app right now (commit f371406), verified four independent ways, zero behavior change. Same product, much cleaner code. One command rolls it back if it ever misbehaves.
Before β after
| Aspect | Before | After |
| App shell | 1 file, 20,513 lines, all HTML+CSS+JS inline | index.html 1,187 lines + ordered refs |
| Modules | everything tangled in one block | 27 named js/NN-*.js files + 2 CSS |
| Core engine | one atomic 5,810-line block | 7 logical parts (11aβ11g), biggest 1,263 |
| Build segregation | IS_CONSUMER ? x : y scattered everywhere | one FLAVOR_PROFILES.{consumer,internal} |
| Build step | none | still none β plain ordered <script> tags |
| Secrets / dead code | a live key in a comment + cruft | removed |
Why it's safe (verified 4 ways)
- Byte-for-byte identical β the split files re-concatenate to the original monolith exactly (reconstruction proof). It's the same code, reorganized into files.
- Pre-flight agent: GO β syntax, change-scope, no secret literals, asset refs resolve (7/7).
- Staged on the real consumer-testing host first β live check PASS, 27/27 assets.
- Prod verified live + an adversarial 39-click sweep β zero JS errors, all cross-module globals present, every surface opens.
The core split β the one genuinely risky part
The 20kβmodules split was mechanical because each piece was already its own <script>. But the 5,810-line core was one atomic block β cutting it creates new boundaries. We ran an AST dependency analysis first and proved the core has zero load-time forward references, which is what made splitting it at section seams safe. We didn't guess; we proved it, then re-verified at runtime.
Two bugs caught before shipping
Worth knowing because it explains a gap: (1) the working clone was in a detached-HEAD state, so earlier "pushes" never actually reached GitHub β the branch was empty on origin. (2) the push was also rejected because the token lacks workflow scope and a commit added a GitHub Actions file. Both fixed: work secured to backups, CI parked at ci/smoke.yml, consolidated to one clean verified commit, pushed for real. This is the first time the refactor truly landed on main.
What this means for your work
The frontend is now reviewable and modular, and the serverless functions are untouched and isolated β they're the exact seam where your Cognito JWT-verify swaps in (replacing the Supabase token check). The module split is the foundation the AWS migration builds on. call-analyst-pwa/ARCHITECTURE.md is the map.
Decided vs open
β
Done / decided
- Monolith split + core split + flavor profiles β shipped to prod
- Both-flavor smoke test + (parked) CI workflow
- Leaked secret removed; dead code deleted
- Region
us-east-2, auth = Cognito custom UI, IaC = CDK
- US-only geofence at the CDN; TOS + cookie consent at registration; GDPR parked
- Identityβbilling join = Cognito
sub; entitlement in DynamoDB; TOTP MFA
π΅ Open β for Saturday
- Backend: stay on Netlify functions (swap JWT verify only) or move to Lambda behind CloudFront?
- Data: keep Supabase Postgres for projects/transcripts, or migrate to DynamoDB?
- Cognito SRP vs
USER_PASSWORD_AUTH for the custom UI
- Cognito Essentials vs Plus (adaptive auth +$650/mo at 100k?)
- Migration: lazy user-migration Lambda vs greenfield + force-reset
- Kill the
internal-branch drift β FLAVOR env (the segregation end-state)
Two small follow-ups
- Activate CI β move
ci/smoke.yml β .github/workflows/ via the GitHub web UI (30s; the token can't push workflow files), or send a workflow-scoped token.
- Rotate the Resend key β it was caught in a comment and removed before merge, but it's in git history, so swap it for a fresh one when convenient. Nothing waits on this.
- Internal builds (analyst.daxos.us) untouched β still on the stale
internal branch; they work, but main is now ahead. Collapsing that drift is the segregation end-state above.
Quick reference
Prod callanalyst.app Β· commit f371406 Β· auto-deploys from main
Repo cus-commits/call-analyst (private)
Architecture call-analyst-pwa/ARCHITECTURE.md (module map + load-order rules)
Run it npm i -D puppeteer && npm run smoke (boots both flavors, asserts clean)
Rollback one Netlify API call restores the pre-refactor build instantly (runbook saved; no rebuild)
Internal build analyst.daxos.us (Daxos tools, password-gated, separate branch)
Gate all daxos.us pages: password daxos2027