This commit is contained in:
alorig
2025-11-24 12:55:24 +05:00
parent 2c4cf6a0f5
commit ef735eb70b
6 changed files with 1729 additions and 329 deletions

View File

@@ -22,6 +22,137 @@ Each entry follows this format:
---
## [1.0.0] - Stage 1 Backend Refactor - 2025-11-24
### 🔴 Breaking Changes - Models Refactored
#### Cluster Model - Simplified to Pure Topics
- **REMOVED:** `context_type` field (topic/attribute/service_line choices)
- **REMOVED:** `dimension_meta` JSONField
- **REMOVED:** `context_type` database index
- **RESULT:** Clusters are now pure topic clusters without dimension/role metadata
- **Files:** `backend/igny8_core/business/planning/models.py`
#### Task Model - Content Type Architecture
- **REMOVED:** `cluster_role` field (hub/supporting/attribute)
- **REMOVED:** `entity_type` field (replaced with `content_type`)
- **REMOVED:** `keywords` CharField (legacy comma-separated)
- **REMOVED:** `keyword_objects` M2M (renamed to `keywords`)
- **REMOVED:** `idea` ForeignKey to ContentIdeas
- **REMOVED:** `taxonomy` ForeignKey to SiteBlueprintTaxonomy
- **REMOVED:** STATUS CHOICES: `in_progress`, `failed`
- **ADDED:** `content_type` CharField (required, indexed) - post, page, product, service, category, tag, etc.
- **ADDED:** `content_structure` CharField (required, indexed) - article, listicle, guide, comparison, product_page, etc.
- **ADDED:** `taxonomy_term` ForeignKey to ContentTaxonomy (nullable)
- **CHANGED:** `cluster` ForeignKey now REQUIRED (blank=False)
- **CHANGED:** `keywords` M2M to planner.Keywords
- **CHANGED:** `status` choices: queued, completed only
- **Files:** `backend/igny8_core/business/content/models.py`
#### Content Model - Simplified Content Management
- **REMOVED:** `task` OneToOneField to Tasks
- **REMOVED:** `cluster_role` CharField
- **REMOVED:** `sync_status` CharField (native/imported/synced)
- **REMOVED:** `entity_type` (replaced with `content_type`)
- **REMOVED:** `content_format` (replaced with `content_structure`)
- **REMOVED:** `word_count`, `metadata`, `meta_title`, `meta_description`, `primary_keyword`, `secondary_keywords`
- **REMOVED:** `sync_metadata`, `internal_links`, `linker_version`, `optimizer_version`, `optimization_scores`
- **REMOVED:** `external_type`, `json_blocks`, `structure_data`
- **REMOVED:** `taxonomies` M2M through ContentTaxonomyRelation
- **REMOVED:** `generated_at` field
- **REMOVED:** `ContentTaxonomyRelation` through model
- **ADDED:** `title` CharField (required, indexed)
- **ADDED:** `content_html` TextField (renamed from html_content)
- **ADDED:** `content_type` CharField (required, indexed)
- **ADDED:** `content_structure` CharField (required, indexed)
- **ADDED:** `taxonomy_terms` M2M to ContentTaxonomy (direct, no through model)
- **CHANGED:** `cluster` ForeignKey now REQUIRED (blank=False)
- **CHANGED:** `external_id` now indexed
- **CHANGED:** `source` choices: igny8, wordpress only
- **CHANGED:** `status` choices: draft, published only
- **Files:** `backend/igny8_core/business/content/models.py`
#### ContentTaxonomy Model - WordPress + Cluster Taxonomies
- **REMOVED:** `sync_status` CharField (native/imported/synced)
- **REMOVED:** `description` TextField
- **REMOVED:** `parent` ForeignKey (hierarchical support)
- **REMOVED:** `count` IntegerField (WordPress count)
- **REMOVED:** `metadata` JSONField
- **REMOVED:** `clusters` M2M to planner.Clusters
- **MODIFIED:** `taxonomy_type` CHOICES updated:
- Renamed: `product_cat``product_category`
- Renamed: `product_attr``product_attribute`
- **NEW:** `cluster` - IGNY8-native cluster-mapped taxonomy
- **CHANGED:** `external_taxonomy` now nullable (null for cluster taxonomies)
- **CHANGED:** `external_id` now nullable (null for cluster taxonomies)
- **Files:** `backend/igny8_core/business/content/models.py`
### Changed - Serializers Updated
#### ClusterSerializer
- **REMOVED:** `context_type` field exposure
- **REMOVED:** `context_type_display` computed field
- **REMOVED:** `dimension_meta` field exposure
- **REMOVED:** Feature flag checks for Stage 1 fields
- **Files:** `backend/igny8_core/modules/planner/serializers.py`
### 📚 Documentation Updated
- ✅ Created `STAGE_1_REFACTOR_COMPLETE_SUMMARY.md` with complete implementation guide
- ✅ Documented all model changes with before/after comparison
- ✅ Provided migration commands and verification steps
- ✅ Added Django admin verification checklist
- ✅ Added API endpoint test examples
- ✅ Added frontend verification checklist
- ✅ Updated flow diagrams for Planner → Writer → ContentManager → WP Publish
- ✅ Documented WordPress import flow
### ⚠️ Migration Required
**Run these commands to apply model changes:**
```powershell
cd backend
python manage.py makemigrations planner --name "stage1_remove_cluster_context_fields"
python manage.py makemigrations writer --name "stage1_refactor_task_content_taxonomy"
python manage.py migrate planner
python manage.py migrate writer
```
**⚠️ WARNING:** This is a DESTRUCTIVE migration. Backup your database before running.
### 🚧 Remaining Work (In Progress)
#### Serializers (Partial)
- ⚠️ TasksSerializer needs update for new fields
- ⚠️ ContentSerializer needs update for new fields
- ⚠️ ContentTaxonomySerializer needs sync_status removed
#### API Endpoints (Not Started)
- ⚠️ Task creation endpoint requires cluster + content_type + content_structure
- ⚠️ Content creation endpoint requires new field structure
- ⚠️ Publish endpoint needs status + external_id logic update
- ⚠️ WordPress import endpoint needs source='wordpress' logic
#### Services (Not Started)
- ⚠️ Content generation service needs update for new Content structure
- ⚠️ WordPress publish service needs simplification (remove sync_status)
- ⚠️ WordPress import service needs ContentTaxonomy auto-creation
#### Frontend (Stage 2)
- ⚠️ React components need update for new API structure
- ⚠️ Forms need content_type + content_structure fields
- ⚠️ Remove cluster_role, sync_status UI elements
### 📖 References
- **Complete Summary:** `STAGE_1_REFACTOR_COMPLETE_SUMMARY.md`
- **Master Reference:** `MASTER_REFERENCE.md` (needs update)
- **Implementation Audit:** `IMPLEMENTATION_AUDIT_REPORT.md`
- **Workflow Guide:** `planner-writer-workflow.md`
---
## [1.0.1] - 2025-11-24
### Changed