Domain-Specific Logic (Demo Configuration)
Domain-Specific Logic (Demo Configuration)
Version: 1.0
Date: 2026-01-14
Status: Documentation (Architecture Debt)
Overview
Jorvis contains hardcoded demo-specific logic for the Spinoloco iGaming demo. This is intentional for Phase P demo purposes and will be refactored to a config-driven approach in Phase Q.
The platform is marketed as "Universal Data Access" but currently contains domain-specific components optimized for the iGaming/Fintech vertical.
Affected Components
1. GameVendorService
Location: analytics-platform/src/data/game-vendor.service.ts
Purpose: Provides entity recognition for gaming vendors in user queries.
Hardcoded Data:
// 40+ casino/gaming vendors hardcoded
const VENDORS = [
'Pragmatic',
'Evolution',
'NetEnt',
'Microgaming',
'Playtech',
// ... etc
];
Behavior:
- Scheduled Cron job syncs with
dc_sp_fact.fact_game_vendortable - Regex-based entity detection in user questions
- Falls back to hardcoded list if database unavailable
Technical Debt:
- Hardcoded vendor names tightly couple platform to iGaming
- Should be loaded from database/config
- Pattern should be generalizable to any domain entities
2. OptimizedAiService — RuleType Enum
Location: analytics-platform/src/ai/optimized-ai.service.ts
Purpose: Injects domain-specific SQL generation rules into prompts.
Hardcoded Rules:
enum RuleType {
// iGaming Rules
GAME = 'game',
SLOTS = 'slots',
LIVE_PRODUCT = 'live_product',
BONUS = 'bonus',
// Fintech Rules
PAYMENT = 'payment',
CASHIER = 'cashier',
FRAUD = 'fraud',
// Analytics Rules
RETENTION = 'retention',
PLAYER_VALUE = 'player_value',
VIP_PLAYER = 'vip_player',
}
Behavior:
- Detects keywords in user questions
- Applies domain-specific SQL patterns
- Optimizes for Redshift-specific syntax
Technical Debt:
- Business rules embedded in code
- Should be externalized to YAML/database
- Not visible without reading source code
3. AntigravityLoaderService
Location: analytics-platform/src/ai/antigravity-loader.service.ts
Purpose: Loads testing artifacts for "Stage Policy" injection.
Status: Currently dormant (commented out in onModuleInit)
Files it loads:
drafts/data_gaps_draft.tsvdrafts/golden_subset.tsvdrafts/question_gap_crosswalk.tsv
Technical Debt:
- Hidden configuration loader
- Bypasses standard config management
- Should be replaced with proper fixture loading
Impact Assessment
| Aspect | Impact | Severity |
|---|---|---|
| New vertical (non-iGaming) | Requires code changes | 🟡 Medium |
| Enterprise sales | "Universal" claim inaccurate | 🟡 Medium |
| Maintenance | Dual location for config | 🟢 Low |
| Demo performance | Optimized for current demo | ✅ Positive |
Refactoring Plan (Phase Q)
Task Q.10: Domain Entity Abstraction
Goal: Make domain-specific logic config-driven.
Steps:
- Create
domain_entitiestable in PostgreSQL - Move GameVendorService lists to database
- Create admin UI for entity management
- Rename to
DomainEntityService
Effort: 2-3 days
Task Q.11: RuleType Externalization
Goal: Move business rules to YAML configuration.
Steps:
- Create
config/rules/{domain}.yamlstructure - Load rules at startup
- Hot-reload support
- Document rule format
Effort: 1-2 days
Current Workaround
For new demos (non-iGaming):
- Override GameVendorService with empty list
- Create domain-specific RuleType additions
- Document in brand-specific config
References
analytics-platform/src/data/game-vendor.service.tsanalytics-platform/src/ai/optimized-ai.service.tsanalytics-platform/src/ai/antigravity-loader.service.ts- UNDOCUMENTED_FEATURES_AUDIT.md
Document maintained by Architect Agent. Last updated: 2026-01-14