Files
net/FIX_INTELLIGENCE_COLLECTIONS.md
cawcenter 2a8306bb46 feat: Complete Intelligence Library + Jumpstart Fix + Frontend Plugins
Intelligence Library:
- Add full CRUD managers for Avatar Variants, Spintax, Cartesian Patterns
- Update GeoIntelligenceManager to work with cluster/location structure
- Create reusable DataTable, CRUDModal, DeleteConfirm components
- Add TanStack Table for sorting/filtering/pagination
- Add React Hook Form + Zod for form validation
- Add export to JSON functionality
- Add real-time stats dashboards
- Update all Intelligence Library pages to use React components

Jumpstart Fix:
- Fix 'Error: undefined' when creating generation jobs
- Change from storing 1456 posts to config-only approach
- Store WordPress URL and auth instead of full inventory
- Improve error logging to show actual error messages
- Engine will fetch posts directly from WordPress

Frontend Master Upgrade:
- Install nanostores for state management
- Add enhanced Directus client with auth and realtime
- Configure PWA with offline support
- Enable auto-sitemap generation for SEO
- Add Partytown for web worker analytics
- Implement image optimization
- Add bundle visualizer and Brotli compression
- Create sidebar state management

Documentation:
- Add data structure documentation
- Add manual fix guides for Intelligence Library
- Add schema migration scripts
- Document all new features and fixes

All components tested and ready for deployment.
2025-12-13 18:27:34 -05:00

45 lines
1.4 KiB
Markdown

# Fix Intelligence Library Collections
## Problem
The Intelligence Library pages don't work on launch because the Directus collections are missing the required fields.
## Collections Affected
1. `geo_intelligence` - Missing entirely or has wrong fields
2. `avatar_variants` - Has wrong field structure
3. `spintax_dictionaries` - Missing `data` field
4. `cartesian_patterns` - Missing proper fields
## Solution
Run the field migration script to add all missing fields:
```bash
cd backend
npx ts-node scripts/add_intelligence_fields.ts
```
## What It Does
The script will:
1. Connect to your Directus instance
2. Add missing fields to each collection:
- **geo_intelligence**: location_key, city, state, county, zip_code, population, median_income, keywords, local_modifiers
- **avatar_variants**: avatar_key, variant_type, pronoun, identity, tone_modifiers
- **spintax_dictionaries**: category, data, description
- **cartesian_patterns**: pattern_key, pattern_type, formula, example_output, description
- **generation_jobs**: config field for Jumpstart fix
## After Running
1. Hard refresh your browser (Cmd+Shift+R or Ctrl+Shift+R)
2. Visit the Intelligence Library pages
3. They should now work and allow you to add data!
## Manual Alternative
If you prefer to add fields manually in Directus:
1. Go to Settings → Data Model
2. For each collection, add the fields listed above
3. Use the correct field types (string, text, json, integer, float)