LeafhavenDocs
System Architecture

Module Version Registry

Master SemVer 2.0.0 Ledger and Atomic Delegation Protocol

Module Version Registry (15 Modules & Apps)

The B2BExpo platform is strictly modularized governed by Semantic Versioning 2.0.0 (MAJOR.MINOR.PATCH). Every component can be delegated to an AI subagent or human engineer with atomic scoping.

Delegation Protocol for AI & Developers

When assigning work to an autonomous AI subagent or a software engineer, the prompt or task definition must declare:

  • Target Module ID (e.g., MOD-COMM-03 or MOD-WEB-01)
  • Current Version (e.g., 1.0.0)
  • Target Version (e.g., 1.1.0 for backward-compatible features, 2.0.0 for breaking DTO changes)
  • Permitted Package Scope (e.g., packages/commerce-core, apps/web)

Active Modules & Implementation Status

Module IDModule SlugVersionStatusUnit Tests / RoutesPackage / App Path
MOD-CORE-00kernel_corev1.0.0OPERATIONAL31 Passedpackages/types, packages/db
MOD-TRADE-01rfq_enginev1.0.0OPERATIONAL9 Passedpackages/trade-rfq
MOD-OUTBOX-02transactional_outboxv1.0.0OPERATIONAL5 Passedpackages/outbox
MOD-COMM-03commerce_corev1.0.0OPERATIONAL6 Passedpackages/commerce-core
MOD-CRM-04twenty_crm_bridgev1.0.0OPERATIONAL7 Passedpackages/twenty-bridge
MOD-DOC-05proforma_automationv1.0.0OPERATIONAL12 Passedpackages/trade-docs
MOD-TRUST-06trust_compliancev1.0.0OPERATIONAL8 Passedpackages/trade-compliance
MOD-SEC-07enterprise_securityv1.0.0OPERATIONAL12 Passedpackages/trade-security
MOD-GEO-08geo_localizationv1.0.0OPERATIONAL8 Passedpackages/trade-geo
MOD-DOM-09custom_domainv1.0.0OPERATIONAL9 Passedpackages/trade-domains
MOD-WEB-10storefront_exporterv1.0.0OPERATIONAL10 Routes (200 OK)apps/web (Port 3000)
MOD-DOCS-11fumadocs_portalv1.0.0OPERATIONALFull MDX Indexapps/docs (Port 3001)
MOD-TRADE-12sample_commercev1.0.0STABLE SPECSpec Readypackages/trade-samples
MOD-CHAT-13live_conciergev1.0.0STABLE SPECSpec Readypackages/trade-chat
MOD-TELE-14mesa_analyticsv1.0.0STABLE SPECSpec Readypackages/trade-telemetry

Verified Monorepo Test Coverage

 Turborepo Test Execution Summary (11 Packages, 107 Tests):
 ✔ @tradeos/types           (22 tests, 0 failures)
 ✔ @tradeos/db              (9 tests, 0 failures - PostgreSQL 16 RLS & Context)
 ✔ @tradeos/outbox          (5 tests, 0 failures - Atomic Poller & Relay Worker)
 ✔ @tradeos/trade-rfq       (9 tests, 0 failures - Incoterms Calculator & Container Math)
 ✔ @tradeos/trade-docs      (12 tests, 0 failures - SHA-256 HMAC Anti-Spoofing Signer)
 ✔ @tradeos/twenty-bridge   (7 tests, 0 failures - GraphQL Mutations & Webhook Guard)
 ✔ @tradeos/trade-compliance(8 tests, 0 failures - EUDR, CBAM, FDA Prior Notice)
 ✔ @tradeos/trade-security  (12 tests, 0 failures - RFC 6238 TOTP, WebAuthn & RBAC)
 ✔ @tradeos/trade-geo       (8 tests, 0 failures - 50 Markets, FX Buffer & Hreflang)
 ✔ @tradeos/trade-domains   (9 tests, 0 failures - FQDN, DNS Challenge & Hostname Resolver)
 ✔ @tradeos/commerce-core   (6 tests, 0 failures - Wholesale MOQ Tier & Escrow Orchestration)
 --------------------------------------------------------------------------------------
 Total: 107/107 Tests Passed (100% Pass Rate, 20.42s Monorepo Build Time)

Live Development Endpoints & Persona Portals

  • E-Commerce Web Platform (Light Mode): http://localhost:3000
    • / — Public B2B Storefront: Multi-commodity catalog, tiered volume pricing, instant checkout modal (30% DP / 70% Escrow), and RFQ drawer.
    • /buyer — Buyer Corporate Portal: Order tracking with 4-stage stepper, active RFQ counter-offer negotiation, and verified proforma review.
    • /seller — Tenant / Exporter Portal ("Manage Jualan"): Product catalog management, tier price editing, RFQ inbox with instant counter-offer & cryptographic Proforma generation, and Bill of Lading (B/L) upload to unlock 70% escrow balance.
    • /admin — Platform Owner Admin Panel ("Saya"): SuperAdmin authority to Approve, Postpone, Terbitkan (Publish Live), or Batalkan (Cancel/Reject) store registration requests, oversee 12 active tenants, and monitor Twenty CRM deal pipeline.
    • /rfq — Technical Incoterms 2020 & Container Equipment Optimizer
    • /proforma — Cryptographic Proforma Studio with Live MITM Tamper Simulation
    • /compliance — Sovereign Compliance Center (EUDR Hectare Polygon & CBAM Carbon Tax)
    • /geo — Sovereign 50-Country Market Registry & Multi-Currency Treasury Converter
    • /domains — Custom FQDN DNS Verification & Edge Multi-Tenant Routing
    • /security — Zero-Trust RFC 6238 TOTP 2FA, WebAuthn Challenge & 4-Tier RBAC
  • Fumadocs Documentation Portal (Dark Mode): http://localhost:3001
    • System architecture, 15 module versions, and atomic delegation specs.