Technical Documentation
Falcon Flowmira — Full Audit Report
Falcon Flowmira — Full Audit Report
Scope: All requirements from both uploaded PRDs.
- Master PRD v10 (
user-uploads://file-6) — full product blueprint.
- Excalidraw Integration PRD (
user-uploads://file-5) — evaluation & selective integration.
Method: 20 parallel read-only audit agents; one per functional area. Each cross-referenced code against the PRDs and cited file:line evidence. Statuses: BUILT-WIRED (real, works end-to-end), BUILT-STUBBED (surface exists, plumbing incomplete), MISSING (not implemented).
Date: 2026-07-20
Executive Summary
| # | Area | Wired | Stubbed | Missing | Notes |
|---|
| 1 | Auth & Account | 8 | 0 | 1 | MFA missing |
| 2 | Billing & Plans | 7 | 1 | 1 | Stripe wiring + invoices |
| 3 | BYOK LLM Vault | 8 | 0 | 0 | Complete |
| 4 | Diagram Canvas | 16 | 0 | 0 | Complete |
| 5 | Whiteboard / Excalidraw | 8 | 0 | 0 | Complete (MIT compliant) |
| 6 | Template Marketplace | 7 | 1 | 0 | Rafa tool-call bridge stub |
| 7 | Shape Packs | 10 | 0 | 0 | Complete |
| 8 | Talk to Rafa | 8 | 0 | 1 | Input redaction on chat |
| 9 | RAG & Semantic Search | 2 | 2 | 4 | Largely unbuilt |
| 10 | Realtime Collaboration | 5 | 0 | 1 | Offline reconcile |
| 11 | Sharing & Export | 8 | 0 | 1 | Iframe embed |
| 12 | Blog & Marketing SEO | 16 | 0 | 0 | Complete |
| 13 | Docs System | 5 | 0 | 1 | File-5 not hosted |
| 14 | Support Queue | 6 | 0 | 1 | Admin-view audit event |
| 15 | Admin & RBAC | 15 | 0 | 0 | Complete |
| 16 | Analytics & Audit | 9 | 0 | 1 | AI-cost/revenue analytics |
| 17 | Security Posture | 10 | 0 | 0 | Clean |
| 18 | Plugin System | 0 | 1 | 4 | Not built |
| 19 | Import / Export Formats | 6 | 0 | 2 | .vsdx + Mermaid |
| 20 | Community & Engagement | 5 | 2 | 1 | Community packs + profile bios |
Highest-priority remaining work (P0 → P2):
- P0 — Payments wiring (Stripe/Paddle checkout + webhook + invoices). Without this, ₹499/₹999 plans cannot transact.
- P0 — RAG stack (pgvector, ingestion, chunking, retrieval, real citations). Rafa currently generates placeholder citations.
- P1 — Rafa agentic tool bridge (LLM
tools= parameter to actually call searchTemplatesForAgent / instantiateTemplate). Manifest exists, execution path missing.
- P1 — Optional MFA for accounts, especially platform owner.
- P1 — Rafa chat input redaction (
redactSecrets on user input before hitting BYOK provider).
- P1 — Realtime offline reconcile (fetch missed ops on reconnect).
- P2 — Plugin system (registry, sandbox iframe, permissions, install flow).
- P2 — .vsdx + Mermaid import.
- P2 — AI-cost / revenue analytics panels on
/insights.
- P2 — Iframe embed for shared diagrams.
- P2 — Community shape-pack submission + moderation.
- P2 — Public profiles / bios, follow, community-event notifications.
- P3 — Host File-5 (Excalidraw eval PRD) under
/docs.
- P3 — Emit
ticket.viewed audit event when admins open a support ticket.
1. Auth & Account
| Feature | Status | Evidence | Gap |
|---|
| Email+Password Auth | BUILT-WIRED | src/routes/auth.tsx:92-114 | — |
| Magic Link Login | BUILT-WIRED | src/routes/auth.tsx:115-123 | — |
| Google/Apple/MS Sign-in | BUILT-WIRED | src/routes/auth.tsx:138-151, MS gated at :251 | MS disabled by default |
| Password Reset | BUILT-WIRED | src/routes/auth.tsx:124, src/routes/reset-password.tsx | — |
| Optional MFA | MISSING | PRD §3 (file-6:110) | Not implemented in auth routes or DB |
| 14-day Account Deletion | BUILT-WIRED | src/routes/_authenticated/settings.privacy.tsx:150 + migration ...005411_...sql:51 | — |
| Deletion Status Tracking | BUILT-WIRED | settings.privacy.tsx:267 StatusPanel | — |
| Role Verification Screen | BUILT-WIRED | src/routes/auth.tsx:344-432 | — |
| Permanent Platform Owner (Joseph) | BUILT-WIRED | ...075932_...sql:19-58 (trigger-protected) | — |
2. Billing & Plans
| Feature | Status | Evidence | Gap |
|---|
| Free — No AI | BUILT-WIRED | migration ai.byok_enabled=false:560 | Server-side AI gating relies on client checks |
| Free — 3 Diagrams | BUILT-WIRED | canvas.max_active_diagrams:551 + diagrams_enforce_free_limits() trigger | — |
| Free — 3-Day Auto-Delete | BUILT-WIRED | Trigger expires_at := now() + interval '3 days':387; hourly purge_expired_diagrams:464 | — |
| Pro / Pro Plus seed | BUILT-WIRED | migration :470-475 (pro=₹499, pro_plus=₹999) | — |
| Stripe / Paddle wiring | BUILT-STUBBED | src/routes/_authenticated/settings.billing.tsx:76 reads "wire up in Sprint 5" | No checkout, no webhook |
| Invoices / receipts | MISSING | — | No UI or table |
| Entitlement Enforcement (creation) | BUILT-WIRED | effective_entitlements view + trigger | AI/RAG limits client-only |
| Admin Plan Matrix | BUILT-WIRED | admin/plans.tsx | — |
| pg_cron Auto-Delete | BUILT-WIRED | cron.schedule('flowmira-purge-ephemeral-diagrams'):461 | Requires pg_cron on prod DB |
3. BYOK LLM Vault
| Component | Status | Evidence |
|---|
| Provider Support (OpenAI/Anthropic/Gemini/Groq/OpenRouter/Ollama/Mistral/Cohere/Custom) | BUILT-WIRED | src/routes/_authenticated/settings.keys.tsx:35 |
| AES-256-GCM Encryption + HMAC dedupe | BUILT-WIRED | src/lib/llm-crypto.server.ts:37 |
| dev/prod Environment Isolation | BUILT-WIRED | src/lib/llm-providers.functions.ts:203 |
| Provider Selection (default → active → any) | BUILT-WIRED | src/routes/api/rafa/chat.ts:40 |
| Connection Test (HTTP + completion) | BUILT-WIRED | llm-providers.functions.ts:254 |
| Secret Rotation (versioned masters) | BUILT-WIRED | llm-crypto.server.ts:12 (LLM_KEY_SECRET_Vn) |
Column-level REVOKE on api_key_ciphertext | BUILT-WIRED | migration ...083423.sql:4 |
| No Lovable AI Fallback | BUILT-WIRED | chat.ts:265 returns 428 if no vault key |
4. Diagram Canvas
| Feature | Status | Evidence |
|---|
| Node/Edge CRUD | BUILT-WIRED | diagram-canvas.tsx:275,303,313,330,340 |
| Waypoint Edges | BUILT-WIRED | canvas/waypoint-edge.tsx |
| Orthogonal / Bezier / Straight routing | BUILT-WIRED | diagram-canvas.tsx:41,149,174,350,427 |
| 16px Grid Snap | BUILT-WIRED | :430-431 |
| Smart Guides | BUILT-WIRED | canvas/smart-guides.tsx |
| Undo / Redo | BUILT-WIRED | :181-250 |
| Keyboard Shortcuts (Ctrl+Z/Y, Del, Esc) | BUILT-WIRED | :360-377 |
| Autosave (debounced 1.2s) | BUILT-WIRED | :216 |
| Node label editing (dbl-click) | BUILT-WIRED | :330-338 |
| Edge labels | BUILT-WIRED | :340-348, waypoint-edge.tsx:143 |
| Arrowheads | BUILT-WIRED | :143,383 |
| Minimap / Controls | BUILT-WIRED | :440-441 |
| Dark/Light Theme | BUILT-WIRED | Uses semantic Aurora tokens :72,136,382 |
5. Whiteboard / Excalidraw
| Feature | Status | Evidence |
|---|
| Lazy client-only mount | BUILT-WIRED | excalidraw-board.tsx:18,47 |
| Checkpoint / Autosave (1.5s) | BUILT-WIRED | :106,340 |
| Pro entitlement gate | BUILT-WIRED | whiteboards.tsx:32 UpgradeWall |
| Library imports (.excalidrawlib + SVG) | BUILT-WIRED | :266 |
| Custom shape rendering | BUILT-WIRED | shape-catalog.ts via convertToExcalidrawElements |
| PNG/SVG export via official helpers | BUILT-WIRED | :221 |
kind='excalidraw' routing | BUILT-WIRED | diagrams.$id.tsx:71 |
/board/$id route | BUILT-WIRED | board.$id.tsx |
| MIT attribution & no branding hijack | PASS | THIRD_PARTY_NOTICES.md:14, UI credit line |
6. Template Marketplace
| Feature | Status | Evidence |
|---|
| 54 built-in templates | BUILT-WIRED | catalog.ts + extra.ts |
| 20+ Categories | BUILT-WIRED | catalog.ts:16-39 |
| One-click Clone → canvas | BUILT-WIRED | marketplace.functions.ts:288 |
| List + Detail routes with SEO | BUILT-WIRED | templates.index.tsx, templates.$slug.tsx |
| Copy count tracking | BUILT-WIRED | :329 |
| Admin Moderation | BUILT-WIRED | :416, RLS in ...235211_...sql:53 |
| Rafa agentic selection | BUILT-STUBBED | Manifest at templates.functions.ts:87; system prompt at rafa/prompt.ts:208 — but tools= parameter is not passed in /api/rafa/chat.ts, so the LLM cannot invoke them |
| Plug-and-play | BUILT-WIRED | templates.$slug.tsx:108 routes into working editor |
7. Industry Shape Packs
| Feature | Status | Evidence |
|---|
| BPMN 2.0 / UML / C4 / AWS(2024) / GCP / Azure / K8s / Agentic AI / NIST / ERD / Network | BUILT-WIRED | registry.ts:49-229 |
| Central registry with metadata (vendor/tier/license/SPDX) | BUILT-WIRED | registry.ts:1,17 |
| Per-user enable/disable | BUILT-WIRED | prefs.functions.ts:38 |
| Install status badges | BUILT-WIRED | settings.packs.tsx:310 |
| Bulk enable/uninstall | BUILT-WIRED | prefs.functions.ts:125,148 |
| Drag-drop | BUILT-WIRED | shape-library.tsx:275 |
| Keyboard navigation | BUILT-WIRED | shape-library.tsx:110 |
| Custom import (Flowmira JSON, draw.io mxlibrary, SVG, ZIP) | BUILT-WIRED | importers.ts:290 |
| SVG sanitization | BUILT-WIRED | importers.ts:8 |
| Provenance dialog | BUILT-WIRED | — |
8. Talk to Rafa
| Feature | Status | Evidence |
|---|
| Streaming BYOK Chat | BUILT-WIRED | api/rafa/chat.ts |
| Agentic Tool Endpoint (draft_diagram/explain/cleanup) | BUILT-WIRED | api/rafa/tool.ts |
| Canvas Panel Integration | BUILT-WIRED | rafa-canvas-panel.tsx |
| SECURITY OVERRIDE prompt | BUILT-WIRED | rafa/prompt.ts |
| Secret redaction utility | BUILT-WIRED | support-redact.ts (40+ patterns) |
| Input redaction on chat/tool payload | MISSING | api/rafa/chat.ts does not run redactSecrets before sending user messages to providers |
| Support triage flow | BUILT-WIRED | support.new.tsx |
| BYOK-only UX | BUILT-WIRED | settings.keys.tsx |
| No hidden fallback | BUILT-WIRED | chat.ts:265 returns 428 |
9. RAG & Semantic Search
| Feature | Status | Evidence |
|---|
| Document Ingestion | MISSING | — |
| Embeddings (BYOK) | BUILT-STUBBED | Provider infra exists; no embedding model calls |
| pgvector schema | MISSING | No vector columns, only tsvector |
| Chunking pipeline | MISSING | — |
Semantic retrieval RPCs (match_documents) | MISSING | — |
| Citations in Rafa | BUILT-STUBBED | Schema defines citations at tool.ts:153; LLM-generated placeholders only |
| Per-user isolation | BUILT-WIRED | chat.ts:245 verifyUser — but no RAG data yet |
| Opt-in retention | BUILT-WIRED | Retention table exists (...696f5550.sql:144) — no RAG scope |
10. Realtime Collaboration
| Feature | Status | Evidence |
|---|
| Supabase Realtime channel per diagram | BUILT-WIRED | use-collab.ts:63 |
| Presence (avatars/cursors/colors) | BUILT-WIRED | collab/presence.tsx:28,69, protocol.ts:35 |
| Lamport-clock conflict handling | BUILT-WIRED | use-collab.ts:123, diagrams.$id.tsx:264 |
diagram_ops table | BUILT-WIRED | migration ...224131_...sql:5 |
| Per-user role scoping | BUILT-WIRED | RLS at :22 |
| Offline reconcile (fetch missed ops on reconnect) | MISSING | use-collab.ts lacks resync logic |
11. Sharing & Export
| Feature | Status | Evidence |
|---|
| PNG/SVG/PDF WYSIWYG export | BUILT-WIRED | diagram-export.ts (html-to-image + jspdf) |
| Filename / padding controls | BUILT-WIRED | ExportDialog.tsx:180-211 |
| Background color / orientation | BUILT-WIRED | :230-333 |
| Share tokens + RBAC (Viewer/Commenter/Editor) | BUILT-WIRED | ShareDialog.tsx:25-30,171-189 |
| Passcode protection | BUILT-WIRED | :56,204-214 |
| Access logs + Activity tab | BUILT-WIRED | :293-338 from diagram_share_access_logs |
| Filter + CSV export | BUILT-WIRED | :251-290 |
| Expiration + revoke | BUILT-WIRED | :191-202 |
| Iframe embed generator | MISSING | PRD v10 lines 122, 142 |
12. Blog & Marketing SEO
| Feature | Status | Evidence |
|---|
| Markdown editor + live preview | BUILT-WIRED | admin/blog.$id.tsx:168 |
| Cover image uploader (WebP) | BUILT-WIRED | :248 |
| Categories / Tags | BUILT-WIRED | blog.functions.ts:59,67 |
| RSS 2.0 | BUILT-WIRED | routes/rss.xml.ts:10 |
| Dynamic sitemap.xml | BUILT-WIRED | routes/sitemap.xml.ts:40 |
| Scheduled publishing | BUILT-WIRED | blog.functions.ts:54 |
| Full-text search | BUILT-WIRED | blog-search.functions.ts:29 (RPC search_blog_posts) |
| Comments moderation | BUILT-WIRED | admin/comments.tsx:12 |
| Newsletter form | BUILT-WIRED | newsletter-form.tsx:10 |
| JSON-LD (FAQ/HowTo/Article/Product/SoftwareApplication) | BUILT-WIRED | lib/seo/jsonld.ts |
| Competitor comparison pages | BUILT-WIRED | vs.drawio.tsx, vs.miro.tsx, vs.visio.tsx |
| robots.txt | BUILT-WIRED | public/robots.txt |
| Canonical URLs + og:image at leaf only | BUILT-WIRED | blog.$slug.tsx:38,65 |
13. Docs System
| Feature | Status | Evidence |
|---|
| Search + fuzzy scoring | BUILT-WIRED | lib/docs-index.ts |
| 12 Category filters | BUILT-WIRED | routes/docs.index.tsx |
| ⌘K shortcut | BUILT-WIRED | docs.index.tsx |
Master PRD (file-6) hosted at /docs/prd | BUILT-WIRED | src/content/prd/falcon-flowmira-prd-v10.md |
| Excalidraw eval PRD (file-5) | MISSING | Not in docs/ or src/content/ |
| Security / Architecture docs (11 files) | BUILT-WIRED | docs/*.md |
| Per-doc SEO metadata | BUILT-WIRED | head() in docs.tsx, docs.$slug.tsx |
14. Support Queue
| Feature | Status | Evidence |
|---|
| Privacy-first Rafa creation | BUILT-WIRED | support.functions.ts:56 |
| Server-side redaction pre-insert | BUILT-WIRED | :42-45 |
| Admin triage list + detail | BUILT-WIRED | admin/support.*.tsx |
Threaded replies (sender_role, internal notes) | BUILT-WIRED | :135-141 |
| SLA state transitions | BUILT-WIRED | :146-153 |
| RLS scoping | BUILT-WIRED | :127-129 + has_support_access RPC |
Admin-view audit event (ticket.viewed) | MISSING | Only mutations audited |
15. Admin & RBAC
| Feature | Status | Evidence |
|---|
user_roles table | BUILT-WIRED | migration ...696f5550...sql:26-33 |
has_role() SECURITY DEFINER | BUILT-WIRED | :39-43 |
| Permanent platform-owner + admin for Joseph (trigger-protected) | BUILT-WIRED | :248-264 |
| Accordion sidebar + breadcrumbs + mobile drawer | BUILT-WIRED | admin/route.tsx:108-209 |
| Subpages: Users / Plans / Marketplace / Templates / Blog / Comments / Feature Flags / Owner sign-ins / Audit | BUILT-WIRED | see admin/*.tsx |
16. Analytics & Audit
| Feature | Status | Evidence |
|---|
| /insights KPI cards | BUILT-WIRED | insights.tsx:25-32 |
| Engagement charts | BUILT-WIRED | :207-280 |
| AI-usage / Revenue / Cost analytics | MISSING | PRD-mandated |
| Audit log page | BUILT-WIRED | settings.audit.tsx |
| Search + filter + time range | BUILT-WIRED | :118-142 |
| CSV / JSON export | BUILT-WIRED | :51-61 |
| Owner sign-in log with IP/UA | BUILT-WIRED | admin/owner-signins.tsx |
| Engagement lib | BUILT-WIRED | lib/engagement.ts |
| Audit lib | BUILT-WIRED | lib/audit.ts |
| DB schema (audit_logs / engagement_events / owner_signin_logs) | BUILT-WIRED | migrations |
17. Security Posture — CLEAN ✅
| Category | Status | Evidence |
|---|
| RLS on all 48 public tables | BUILT-WIRED | migrations |
| Correct GRANT scoping (anon/authenticated/service_role) | BUILT-WIRED | migrations |
supabaseAdmin isolated to .server.ts / api/ | BUILT-WIRED | grep clean |
SUPABASE_SERVICE_ROLE_KEY never in client bundle | BUILT-WIRED | — |
| AES-256-GCM for BYOK keys (96-bit IV, versioned AAD) | BUILT-WIRED | llm-crypto.server.ts |
| Secret redaction (40+ patterns) | BUILT-WIRED | support-redact.ts |
| SVG XSS sanitizer | BUILT-WIRED | security/svg-sanitizer.ts |
| Rafa SECURITY OVERRIDE prompt | BUILT-WIRED | rafa/prompt.ts |
| Lovable AI/Gateway lockout policy in DB | BUILT-WIRED | migration ai.policy.no_lovable_ai=true |
No unsanitized dangerouslySetInnerHTML | BUILT-WIRED | — |
18. Plugin System — NOT BUILT
| Feature | Status | Notes |
|---|
Plugin registry (plugin_manifests) | MISSING | — |
| Sandboxed execution (iframe / worker) | MISSING | — |
| Install / enable flow | MISSING | plugins.enabled=false in system_settings |
| Permission model | MISSING | Prompt-level rules only |
| Marketplace plugin support | BUILT-STUBBED | Marketplace infra exists (templates only) |
| Format | Status | Evidence |
|---|
| draw.io XML (mxfile + mxlibrary) | BUILT-WIRED | importers.ts:107-180 |
| SVG import + sanitizer | BUILT-WIRED | security/svg-sanitizer.ts:29-75 |
| ZIP shape packs (fflate) | BUILT-WIRED | importers.ts:238-287 |
| Flowmira native JSON | BUILT-WIRED | importers.ts:66, excalidraw/serialize.ts:33-47 |
| Visio .vsdx | MISSING | PRD file-6:20, 2280 |
| Mermaid text import | MISSING | Sprint 3 item; not wired |
| PNG/SVG/PDF export | BUILT-WIRED | diagram-export.ts:204-291 |
| Excalidraw .excalidraw / .excalidrawlib interop | BUILT-WIRED | excalidraw-board.tsx:122 |
| Feature | Status | Evidence |
|---|
| Blog comments (moderated) | BUILT-WIRED | blog-comments.tsx, admin/comments.tsx |
| Newsletter + double opt-in + unsubscribe | BUILT-WIRED | newsletter-form.tsx:10, RPCs :43,52 |
| Engagement tracking | BUILT-WIRED | engagement.ts:19 |
| Community templates + secret scan + moderation | BUILT-WIRED | templates.submit.tsx:19, scan :275, mod :416 |
| Community shape packs | MISSING | Static curated catalog only |
| Public profiles / bios | BUILT-STUBBED | Name editable; bios/public profiles missing |
| Follow / Like on templates | BUILT-WIRED (likes) | marketplace.functions.ts:165,184; follow missing |
| Notification center | BUILT-STUBBED | notification-bell.tsx wired only to support notifications |
Proposed next build sequence
Batch A (P0, unblocks monetization + agentic AI):
- Stripe (or Paddle) checkout + webhook + invoices UI. INR pricing configured.
- RAG stack: pgvector schema, ingestion pipeline (PDF/MD/HTML), chunker, embeddings via BYOK (OpenAI
text-embedding-3-small / Cohere / local Ollama), match_documents RPC, retrieval in Rafa with real citations.
- Rafa agentic tool-call bridge — pass
tools= in /api/rafa/chat.ts, execute searchTemplatesForAgent and instantiateTemplate end-to-end, stream tool events into the UI.
Batch B (P1, security & UX polish):
4. Rafa chat input redaction (redactSecrets in /api/rafa/chat.ts + /api/rafa/tool.ts).
5. Optional MFA (TOTP via Supabase).
6. Realtime offline reconcile — replay ops since last lamport on reconnect.
Batch C (P2, PRD completeness):
7. Plugin system MVP (registry + iframe sandbox + permissions + install flow).
8. .vsdx and Mermaid importers.
9. AI-cost / revenue / infra-cost analytics on /insights.
10. Shared-diagram iframe embed generator.
11. Community shape-pack submission + moderation queue.
12. Public profiles + bio + follow + community notifications.
Batch D (P3, cleanup):
13. Host file-5 (Excalidraw eval PRD) under docs/.
14. Emit ticket.viewed audit event on admin support-ticket open.
Await approval before starting Batch A.