Fibretrace Monet docs/Knowledge base/Implementation state

Implementation state — what is real where

Four columns of reality: the Lovable MVP (Supabase-backed, the demo everyone sees), monet’s apps/dashboard (the production port), the real Fibretrace Laravel REST API, and the QC script’s assumptions. Grounded in M:src/lib/apiAdapter.ts, the integration audit (2026-06-04), the fibre-program collection (2026-08-03) and the 2026-08-19 port-plan. All VERIFIED unless marked.

The adapter ground truth

apiAdapter.ts registers 50 tables in ALL_TABLES (M:109-128). Exactly 12 have real mappers: company_modules (142), company_api_access (154), app_settings (161), company_users (263), company_partners (304), company_details (367), scanners (440), audits (462), facilities (533), invoices (577), companies (614), collections (647). The other 38 fall through to a no-op stub returning []. Every write through the fake client throws MutationNotImplementedError (M:835-858); real writes happen only where a page bypasses the adapter for an RTK Query mutation (facilities, scanners, partners, team, account). The 2026-08-19 sync’s API resolution over the newest Lovable window found EXISTS = 0, GAP = 9, PARTIAL = 3 — nothing data-bearing in the current design wave can be wired today.

Domain matrix

Domain area Lovable MVP Monet port Real backend Net: demonstrable today?
Auth / account / team Demo-grade login (any password, on-screen 2FA) Real JWT login + refresh, account, team invitations /api/monet/v1 auth, account, team — BE-confirmed contract YES in monet (the real thing); Lovable is a simulation
Company profile + modules Working Wired (GET/POST /company; modules mapper) /company real; company_type single string vs canvas types[] divergence YES
Partners Working; moving out of Settings into main nav upstream Wired at /settings/partners (old path); /partners route not yet ported /partners CRUD + pending-invitations real; no requests-to-join YES (at the old path)
Facilities + licences Working; count-based licence gate Facilities fully wired (CRUD, export, OS-Hub lookup); licence UI reads a stubbed facility_licenses Facilities real; license-summary + license-enquiries real (different shape from Lovable’s count model) YES for facilities; licence view partial
Scanners Working admin CRUD (Supabase fiction) Reads/PATCH wired; activate/deactivate/ping/export real Real but auditor-centric: no delete, no facility-assignment endpoint READS yes; assignment model diverges
Scan History / verifications / sessions Working, with server-side masking views Shell — sessions/verifications/session_shares are permanent no-op stubs; session_id faked from audit id No sessions resource at all; sat-audits GET/POST real NO — the core traceability list is empty in monet
SAT scanning (field) n/a (simulator modals instead) apps/sat fully working: BLE scan, tau match, offline queue, POST sat-audit sat-audit + sat-audits deployed YES — the physical origination layer is real
Supply-chain map Working (BFS chain walk, partner masking) UI shell ported; all 5 backing tables stubbed Nothing (partners + own facilities only) NO (renders empty)
Fibre programmes + capacity funnel Working end-to-end incl. 18-month expiry, negative releases, reservation requests Shell — fibre_programmes/programme_reservations stubs; ClaimPosition renders empty GET /fibre-programs(+id), GET /claim-positions(+funnel) deployed 2026-08-03 but UNWIRED in monet; no row-level reservation GET; no expires_at concept; enquiry POST is a sales email NO in monet today; partial wiring is the next big port (port-plan unit 6)
Reservation requests / admin queue Working Absent (route + table both missing) Admin-only session-authed approve/reject routes exist; no /monet/v1 queue NO
Product categories / CU rates Working admin CRUD Absent Nothing NO
Nominations (purchase orders) + lines Working, mid-HIG-rewrite (.legacy.tsx rollback snapshots) Shell — all PO tables stubbed; writes throw Nothing — no PO resource anywhere; real /orders is Collections NO
Linking + claim proposals Working (3-step modal, DB triggers) Shell — toast-guarded stubs (“backend pending”) Nothing for propose/confirm; POST /api/monet/v1/claims is a different single-step model; /claims/validate 404 on DEV NO — and the model conflict is unresolved (06-open-questions Q1)
Ready to Claim / bulk approval Working Shell Nothing NO
Claims list / verification records Working Shell (production_claims stub) POST /claims only; no list endpoint NO
Evidence packs (8 types) + public pages Working; public tokens; QR; revoked banners UI shells ported (16 of 19 backing tables stubbed); public routes render not-found No public read surface at all in the real API NO
Certificates (programme + company) Working Shells; certificates-module tracked known_unported /certificate-types staff-only; certificates[] read-only on programme detail NO
Program owner surfaces Working (5 pages) /owner NOT routed (dead import); 4 sub-pages are shells Nothing writable NO
Production / fibre creation / EWR Working incl. simulators; EWR is explicitly a dummy integration Shells (production_records, pigment_orders stubs) Nothing NO
SDU Working admin + company pages Shell for the table; real read-only device telemetry wired via sduApi 4 read-only GET endpoints, no writes PARTIAL — live device status reads are real
Notifications Client-insert pattern (Lovable-only) Server-driven list wired; monet’s richer pagination deliberately kept (T49 decision-gated) GET /user/notifications real, read-only + mark-read YES for reading
Insights (QC A-08/R-13) ABSENT ABSENT ABSENT NO — exists nowhere
Admin console Working (30 or so routes) Stale 13-page early port, mostly stubbed; OUT of MVP scope by project decision Only session-authed web admin routes for programme rosters Demo-only in Lovable

What this means in one paragraph

The business logic in this knowledge base is real and demonstrable in exactly one place: the Lovable MVP. Monet today can genuinely demonstrate identity, company, team, partners, facilities, scanners, invoices, collections and SAT scanning — the operational rim — while the entire commercial core (programmes, capacity, nominations, claims, evidence) renders as intentional empty shells behind the adapter convention. The real backend has started closing the gap from the aggregate end (funnel reads, single-step claim create, reservation enquiry) but has not modelled the PO-centric propose/confirm machine that the Lovable UI and the QC script both assume. Anyone demoing “the product” is demoing Lovable; anyone testing monet against the QC script will produce false bug reports on roughly 47 of 50 cases (everything except facility creation and read-only scanner/facility checks).

Route-level status vs the QC script

The QC analysis’s route census (2026-08-19) tallies the 31 QC-referenced routes as: Lovable has 30 of 31 (missing only /insights); monet has 7 routed with at least partially wired data (/, /admin/companies, /admin/facilities, /admin/scanners, /facilities, /facilities/add, /scanners), 14 routed but empty shells, and 10 absent entirely (/signup + status, /admin/programs-as-named, /admin/reservation-requests, /admin/signup-requests, /admin/overrides, /admin/claim-verifications, /admin/settings, /owner, /partners, /insights). VERIFIED (.local/qc-test-script/analysis.md section b).

Porting pipeline state (2026-08-19)

Cursor: last_fetched f0d02a28, last_ported 2b52a608; 10 known_unported units. Ready to port now (no BE dependency): the button/tabs/table-pagination design-system rebrands, the Partners nav move, SDU page polish, supply-chain copy alignment. Everything else in the window is GAP/PARTIAL or sequenced behind those. One real defect found in the sync run itself: the index.css tier0-quiet typography drift (pre-baseline, tracked in no list — at risk of silent loss). VERIFIED (.local/lovable/state.json; sync-20260819/RUN-SUMMARY.md gaps 1-3).