FleetOS BIBLE - Gap Analysis & Mapping
Date: 2026-01-09 Phase: INGEST + MAP Complete Status: Awaiting PLAN approval
π Summary
Overall Assessment: ~75% aligned with BIBLE architecture Critical Gaps: 2 (database schema + RFQ routing) Minor Gaps: 3 (contacts, event logging, notification fallback)
β
What FULLY Matches BIBLE Spec
1. Daily Access Flow β
Location: CleanLanding.tsx + AuthService.sendDailyAccessLink()
What exists:
User goes to fleetos.com
Clicks "Login" button β shows daily access form
Enters work email
Receives org-level magic link
No login, no accounts, no remembering old links
Evidence:
BIBLE Compliance: β Perfect match
2. Magic Links = Capabilities β
Location: services/shared/MagicLinkService.ts
What exists:
Time-bound (exp timestamp)
Scope-bound (companyId, rfqId)
Org-bound (companyId in payload)
NOT user accounts
Evidence:
BIBLE Compliance: β Perfect match
3. Org-First Concept β
Location: lib/domainExtraction.ts + AuthService.ts
What exists:
extractDomain(email)β company domaingetOrCreateCompany()β creates/finds org by domainCompanies identified by DNS-unique domain
Evidence:
BIBLE Compliance: β Perfect match
4. Emergency Access (Partial) β οΈ
Location: AuthService.sendDailyAccessLink()
What exists:
Any org member can enter email
Gets fresh org-level magic link
No dependency on previous logins
Missing:
"Last active org access point" fallback
Org default channel
BIBLE Compliance: β οΈ 80% - Core concept works, needs fallback logic
β οΈ What PARTIALLY Matches
5. RFQ Owned by Org (Database Issue) β
Location: database/core/schema.sql + database/fleetos/complete-setup.sql
Current Schema:
BIBLE Requires:
Impact: π΄ CRITICAL
RFQs currently owned by individual users
Team members can't see each other's work
Violates "Org-first" principle
Fix Required: Add company columns to service_requests table
6. RFQ Routing (Code Issue) β
Location: QueryService.createServiceRequest()
Current Code:
BIBLE Requires:
Impact: π΄ CRITICAL
RFQs not org-scoped
Routing logic user-based
Fix Required: Update createServiceRequest() to resolve and use company IDs
7. Notification Routing (Missing Fallback) β οΈ
Location: services/NotificationService.ts
Current:
Sends to specific email/phone
No org-level fallback
BIBLE Requires:
Impact: π‘ MEDIUM
RFQs might get "stuck" if contact unavailable
No org-level fallback
Fix Required: Add org-level notification fallback logic
β What's MISSING
8. EventLog β
Location: None
BIBLE Requires:
Table:
event_logor similarRecords every access + action
Tracks who clicked magic links
Tracks who updated RFQs
Current State: β Does not exist
Impact: π‘ MEDIUM
No audit trail
Can't track "last active org access point"
Fix Required: Create event logging system
9. Contacts Are Emergent (Philosophy) β οΈ
Location: MinimalSignup.tsx + App.tsx signup flows
Current:
Signup creates user record
Assumes "users" exist
BIBLE Says:
"FleetOS v1 does NOT have contact lists. Contacts are emergent, not pre-created. A 'contact' exists only when:
someone clicks a magic link
or receives a targeted notification"
Gap:
Signup flow creates user upfront
Not fully "emergent"
Impact: π’ LOW
Works functionally
Philosophical mismatch
Fix Required: Minimal - possibly just documentation
10. "assigned" Status β οΈ
Location: Database schema
Current Status Enum:
BIBLE Flow:
Gap:
Different status names
Missing 'acknowledged', 'declined'
Has 'confirmed', 'cancelled' instead
Impact: π‘ MEDIUM
Status lifecycle doesn't match BIBLE
Fix Required: Update status enum to match BIBLE
π Compliance Matrix
Org-first identity
β 90%
companies table exists, code uses it
Magic links = capabilities
β 100%
MagicLinkService.ts
Never block work
β οΈ 60%
Missing org fallback
Daily access flow
β 100%
CleanLanding.tsx, AuthService.ts
RFQs owned by Org
β 0%
service_requests schema
RFQ routing to Org
β 0%
QueryService.createServiceRequest
Notification fallback
β 0%
NotificationService.ts
EventLog
β 0%
Missing
Contacts emergent
β οΈ 70%
Philosophy vs reality
Status lifecycle
β οΈ 60%
Different status names
π― Critical Path to BIBLE Compliance
Priority 1: CRITICAL (Blocks BIBLE compliance)
β Add company columns to service_requests
fleet_company_id UUIDsupplier_company_id UUIDsubmitted_by_user_id UUID(optional)
β Update RFQ routing logic
Resolve Fleet Org from sender
Resolve Supplier Org from target
Create RFQ owned by orgs, not users
Priority 2: HIGH (Violates "never block work")
β οΈ Add org-level notification fallback
If contact hint exists β send to contact
Else β send to org default channel
Or β send to last active org member
β οΈ Update status lifecycle
Change to: new β acknowledged β in_progress β completed/declined
Update all status references in code
Priority 3: MEDIUM (Nice to have, improves compliance)
β Create EventLog system
Log all magic link clicks
Log all RFQ actions
Track "last active" per org
π« Documents That CONTRADICT BIBLE
Based on user request: "remove all other documents or change that contradict this architecture"
To Archive/Update:
DOMAIN_IDENTITY_ARCHITECTURE.md- Partially contradictsSays companies table exists β
Says user_profiles table needed β (BIBLE: no contact lists)
Action: Update to align with BIBLE
COMPANY_ARCHITECTURE_COMPLETE.md- Partially contradictsSays migration ready β (companies table exists but RFQ columns don't)
Says user_profiles needed β (BIBLE: contacts emergent)
Action: Archive or update
FLEETOS_TESTING_GUIDE.md- May contradictTesting assumes user-based flows β
Need to review against BIBLE
Action: Review and update
β
One Sentence Test
"A tired operator in an emergency can remember FleetOS, go to the site, and immediately see today's work without knowing who was invited or logged in"
Current State: β οΈ 70% Pass
β Can go to site
β Can enter email
β Gets magic link
β BUT: Won't see team's work (RFQs user-scoped, not org-scoped)
After Fixes: β 100% Pass
β Will see ALL company work (RFQs org-scoped)
β Any team member can access
β No dependency on previous logins
π¬ Next Step
Status: MAP phase complete Next: Create PLAN document with:
Minimal SQL migration
Code changes (files + line numbers)
Rollback strategy
Testing checklist
Awaiting: Founder review and sign-off before proceeding to PLAN
Created: 2026-01-09 Phase: INGEST + MAP Complete Next Phase: PLAN (awaiting approval)
Last updated
Was this helpful?