fonio.ai
Engineering audit · 10 Jun 2026

Engineering audit & productionization roadmap

fonio KPI monitor

An independent senior-agency review of the sales-KPI platform — covering code quality, security, legal/privacy exposure and operational readiness — with a phased plan to take it from an AI-builder-hosted MVP to a properly-operated, vendor-independent product.

≈23k LOC reviewed 4 review workstreams 0 known dependency CVEs 2 Critical · 5 High findings

Live integration status

HubSpot
Deal sync verified — 5,596 deals
LIVE
PostHog
API key ping — eu.posthog.com ok
LIVE
Slack
auth.test ok — workspace “Fonio”
LIVE

Verified 10 Jun 2026 against the production app's own connection checks and sync endpoints. HubSpot access is strictly read-only.

Posture at a glance

SecurityStrong core

Verified JWTs, enforced auth, sound RLS. Weak spot: public endpoints trust the public key.

ArchitectureLate MVP

Clean server boundary & data flow; heavy vendor coupling and an unsplit 822 KB bundle.

Legal / privacyGaps

Governance layer absent; Italian worker-monitoring & AI face-photo exposures need counsel.

OperationsCaptive

Not independently deployable: no CI, no health check, beta build server, Lovable-locked.

Prioritized findings

SevAreaFindingFixed in
CriticalSecurityPublic sync endpoints authenticate with the public anon key — anyone could trigger metered HubSpot/Slack work. No rate limiting.Phase 0→2
CriticalSecretsLive Supabase anon key committed to git; .env not ignored — a footgun for the first real secret added.Phase 0
HighOpsNot independently deployable — build, OAuth, error reporting & data plane all behind proprietary vendor packages.Phase 1–2
HighOpsBeta build server in the production path; two lockfiles resolving the same packages from different registries.Phase 1
HighLegalEmployee performance monitoring (leaderboards, streaks) with no Italian Art. 4 works-council agreement or worker notice.Phase 4
HighLegalEmployee face photos sent to US AI image models with no consent, DPIA or processing agreement.Phase 2/4
HighLegalNo data-processing agreements or record-of-processing for any third-party processor; no software licence.Phase 4
MediumOpsScheduled jobs not reproducible & hard-coded to the vendor host; no CI, no health check, no external error/log sink.Phase 0–2
MediumArchitectureIntegration logic duplicated across five files; a 530-line “god hook”; several 600–1,200-line components.Phase 2–3
MediumHardeningNo security headers; open self-signup; uncontrolled free-text fields; no data-retention policy.Phase 0,3–4
LowQualityThin test coverage (4 files / 23k LOC, none on server logic); lint broken on Windows clones.Phase 1,3

Full evidence with file/line references lives in docs/AUDIT_AND_ROADMAP.md in the repository. No personal data is reproduced here.

Productionization roadmap

Phase 0 — Quick winsShipped

Cron-secret scaffolding, secrets hygiene, security headers, health route, rebrand, signup restriction.

Phase 1 — De-couple the buildNext

Explicit Vite/Nitro config (Cloudflare preset), stable build server, single lockfile, secrets on Cloudflare, verified preview deploy.

Phase 2 — Replace vendor runtime

Direct HubSpot & Slack APIs, native Supabase Google OAuth, Sentry, rewired scheduled jobs — then retire the public-key cron trust.

Phase 3 — Hardening & quality

Rate limiting, code-splitting, de-duplication, single-tenant config extracted, real test coverage, CI/CD & monitoring.

Phase 4 — Legal & governance

Records of processing, processor agreements, DPIA, Italian worker-monitoring notice, retention & erasure, licence. (With counsel.)

Phase 5 — Decommission the builder

Remove all vendor packages, make this repo canonical, move the domain, rotate keys.

Shipped in this engagement (Phase 0)

  • Dedicated CRON_SECRET with constant-time comparison; public anon key retired at cutover.
  • FX refresh endpoint made POST-only (no browser-triggerable side effects).
  • Secured-cron migration authored — Vault-held secret, all jobs reproducible.
  • .env untracked & ignored; keys-only .env.example template added.
  • Security headers (CSP, HSTS, anti-clickjacking) on every response.
  • Unauthenticated /api/health liveness route for monitoring.
  • Rebranded from the builder's defaults to fonio; self-signup limited to fonio work emails.

Verified by a clean local production build, a passing TypeScript typecheck, and lint-clean changed files. Changes are staged in the repo and reach production at the Phase 1 cutover — the live app is never broken mid-flight.