# Real-estate × CRM — the INTERSECTION skill (a composition manifest, NOT a re-spec).
# It COMPOSES the base crm suite + the validated crm/overlays/real-estate diff. The full mechanics
# live in the seven base skills; this contract only points at the additive overlay.
# Lives at skill/enterprise_software/crm/industries/real-estate.skill.yaml.

id: crm/real-estate
version: 1.0.0
summary: >-
  The CRM suite reshaped for brokerage — listings + buyer preferences as first-class objects,
  buyer↔listing matching over two VECTOR(2048) tables, opportunities repurposed as deals-on-a-listing,
  and a commission split that sums to gross. Composes the base suite plus the real-estate overlay; no fork.
module: crm
industry: real-estate              # NEW industry key (lib/categories.js)
pillars: [sql, vector, models]

composes:
  suite: crm
  overlay: crm/overlays/real-estate

# Published id = real-estate-crm → route below (route wins over the derived page_url).
post: posts/enterprise_software/crm/industries/real-estate.md
route: /library/real-estate-crm

provides:
  tables_add: [listings, buyer_prefs, listing_vectors, buyer_vectors, commissions]
  vectors_add: [listing_vectors, buyer_vectors]   # jina-embeddings-v4, 2048-dim, cosine — the product
  gate_change: "lead-to-opportunity scores buyer readiness; account-360 NBA suggests the top-matched listings"
  onto: [crm/core, crm/lead-to-opportunity, crm/account-360, crm/pipeline-forecast]

tested_branches:
  - overlay: real-estate
    tested_at: 2026-09-02
    cites: crm/overlays/real-estate
    live:
      - "5 tables incl. listing_vectors + buyer_vectors as VECTOR(2048); 2 listings + 1 buyer embedded with jina-embeddings-v4 (2048-dim)"
      - "buyer↔listing match: lst-1 '14 Maple Grove' family home cosine 0.272 (nearest) above lst-2 downtown loft 0.530"
      - "commission split: agent_amount 12960 + brokerage_amount 8640 = 21600 = gross (balances=true)"
