From 3a65fb919a6e6aaed40537049b6181c5ee08ca2c Mon Sep 17 00:00:00 2001 From: "IGNY8 VPS (Salman)" Date: Sat, 17 Jan 2026 17:47:16 +0000 Subject: [PATCH] fixes and final pre launch verifcation md --- backend/igny8_core/api/unified_settings.py | 44 ++- ...09_add_stage_use_testing_and_budget_pct.py | 76 +++++ .../igny8_core/business/automation/models.py | 14 + docs/plans/LAUNCH-VERIFICATION-CHECKLIST.md | 264 ++++++++++++++++++ .../AUTOMATION-ENHANCEMENT-PLAN.md | 0 .../SETTINGS-CONSOLIDATION-PLAN.md | 0 .../FINAL-PRELAUNCH-Completed.md | 2 +- .../FINAL-PRELAUNCH-PENDING.md | 0 .../src/pages/Sites/AIAutomationSettings.tsx | 34 ++- 9 files changed, 418 insertions(+), 16 deletions(-) create mode 100644 backend/igny8_core/business/automation/migrations/0009_add_stage_use_testing_and_budget_pct.py create mode 100644 docs/plans/LAUNCH-VERIFICATION-CHECKLIST.md rename docs/plans/{ => automation}/AUTOMATION-ENHANCEMENT-PLAN.md (100%) rename docs/plans/{ => automation}/SETTINGS-CONSOLIDATION-PLAN.md (100%) rename docs/plans/{ => implemented}/FINAL-PRELAUNCH-Completed.md (99%) rename docs/plans/{ => implemented}/FINAL-PRELAUNCH-PENDING.md (100%) diff --git a/backend/igny8_core/api/unified_settings.py b/backend/igny8_core/api/unified_settings.py index 0698045a..ba3ecc2f 100644 --- a/backend/igny8_core/api/unified_settings.py +++ b/backend/igny8_core/api/unified_settings.py @@ -171,6 +171,8 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): site = get_object_or_404(Site, id=site_id, account=request.user.account) data = request.data + logger.info(f"[UnifiedSettings] Received update for site {site_id}: {data}") + try: # Get or create AutomationConfig automation_config, _ = AutomationConfig.objects.get_or_create( @@ -194,6 +196,7 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): # Update stage configuration if 'stages' in data: + logger.info(f"[UnifiedSettings] Updating stages: {data['stages']}") self._update_stage_config(automation_config, data['stages']) # Update delays @@ -205,6 +208,7 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): automation_config.between_stage_delay = delays['between_stage'] automation_config.save() + logger.info(f"[UnifiedSettings] AutomationConfig saved for site {site_id}") # Update publishing settings if 'publishing' in data: @@ -239,13 +243,15 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): 'enabled': automation_config.stage_1_enabled, 'batch_size': automation_config.stage_1_batch_size, 'per_run_limit': automation_config.max_keywords_per_run, - 'use_testing': False, # Default, can be stored in metadata later + 'use_testing': automation_config.stage_1_use_testing, + 'budget_pct': automation_config.stage_1_budget_pct, }, '2': { 'enabled': automation_config.stage_2_enabled, 'batch_size': automation_config.stage_2_batch_size, 'per_run_limit': automation_config.max_clusters_per_run, - 'use_testing': False, + 'use_testing': automation_config.stage_2_use_testing, + 'budget_pct': automation_config.stage_2_budget_pct, }, '3': { 'enabled': automation_config.stage_3_enabled, @@ -256,19 +262,22 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): 'enabled': automation_config.stage_4_enabled, 'batch_size': automation_config.stage_4_batch_size, 'per_run_limit': automation_config.max_tasks_per_run, - 'use_testing': False, + 'use_testing': automation_config.stage_4_use_testing, + 'budget_pct': automation_config.stage_4_budget_pct, }, '5': { 'enabled': automation_config.stage_5_enabled, 'batch_size': automation_config.stage_5_batch_size, 'per_run_limit': automation_config.max_content_per_run, - 'use_testing': False, + 'use_testing': automation_config.stage_5_use_testing, + 'budget_pct': automation_config.stage_5_budget_pct, }, '6': { 'enabled': automation_config.stage_6_enabled, 'batch_size': automation_config.stage_6_batch_size, 'per_run_limit': automation_config.max_images_per_run, - 'use_testing': False, + 'use_testing': automation_config.stage_6_use_testing, + 'budget_pct': automation_config.stage_6_budget_pct, }, '7': { 'enabled': automation_config.stage_7_enabled, @@ -306,8 +315,11 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): for stage in stages: num = stage.get('number') if not num: + logger.warning(f"[UnifiedSettings] Stage missing 'number': {stage}") continue + logger.info(f"[UnifiedSettings] Processing stage {num}: enabled={stage.get('enabled')}, batch_size={stage.get('batch_size')}, per_run_limit={stage.get('per_run_limit')}, use_testing={stage.get('use_testing')}, budget_pct={stage.get('budget_pct')}") + if num == 1: if 'enabled' in stage: automation_config.stage_1_enabled = stage['enabled'] @@ -315,6 +327,10 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): automation_config.stage_1_batch_size = stage['batch_size'] if 'per_run_limit' in stage: automation_config.max_keywords_per_run = stage['per_run_limit'] + if 'use_testing' in stage: + automation_config.stage_1_use_testing = stage['use_testing'] + if 'budget_pct' in stage: + automation_config.stage_1_budget_pct = stage['budget_pct'] elif num == 2: if 'enabled' in stage: automation_config.stage_2_enabled = stage['enabled'] @@ -322,6 +338,10 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): automation_config.stage_2_batch_size = stage['batch_size'] if 'per_run_limit' in stage: automation_config.max_clusters_per_run = stage['per_run_limit'] + if 'use_testing' in stage: + automation_config.stage_2_use_testing = stage['use_testing'] + if 'budget_pct' in stage: + automation_config.stage_2_budget_pct = stage['budget_pct'] elif num == 3: if 'enabled' in stage: automation_config.stage_3_enabled = stage['enabled'] @@ -336,6 +356,10 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): automation_config.stage_4_batch_size = stage['batch_size'] if 'per_run_limit' in stage: automation_config.max_tasks_per_run = stage['per_run_limit'] + if 'use_testing' in stage: + automation_config.stage_4_use_testing = stage['use_testing'] + if 'budget_pct' in stage: + automation_config.stage_4_budget_pct = stage['budget_pct'] elif num == 5: if 'enabled' in stage: automation_config.stage_5_enabled = stage['enabled'] @@ -343,6 +367,10 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): automation_config.stage_5_batch_size = stage['batch_size'] if 'per_run_limit' in stage: automation_config.max_content_per_run = stage['per_run_limit'] + if 'use_testing' in stage: + automation_config.stage_5_use_testing = stage['use_testing'] + if 'budget_pct' in stage: + automation_config.stage_5_budget_pct = stage['budget_pct'] elif num == 6: if 'enabled' in stage: automation_config.stage_6_enabled = stage['enabled'] @@ -350,8 +378,14 @@ class UnifiedSiteSettingsViewSet(viewsets.ViewSet): automation_config.stage_6_batch_size = stage['batch_size'] if 'per_run_limit' in stage: automation_config.max_images_per_run = stage['per_run_limit'] + if 'use_testing' in stage: + automation_config.stage_6_use_testing = stage['use_testing'] + if 'budget_pct' in stage: + automation_config.stage_6_budget_pct = stage['budget_pct'] elif num == 7: if 'enabled' in stage: automation_config.stage_7_enabled = stage['enabled'] if 'per_run_limit' in stage: automation_config.max_approvals_per_run = stage['per_run_limit'] + + logger.info(f"[UnifiedSettings] After update - stage_1_batch_size={automation_config.stage_1_batch_size}, max_keywords_per_run={automation_config.max_keywords_per_run}") diff --git a/backend/igny8_core/business/automation/migrations/0009_add_stage_use_testing_and_budget_pct.py b/backend/igny8_core/business/automation/migrations/0009_add_stage_use_testing_and_budget_pct.py new file mode 100644 index 00000000..14a323aa --- /dev/null +++ b/backend/igny8_core/business/automation/migrations/0009_add_stage_use_testing_and_budget_pct.py @@ -0,0 +1,76 @@ +# Generated migration for adding use_testing and budget_pct per AI stage +from django.db import migrations, models + + +class Migration(migrations.Migration): + """ + Add use_testing and budget_pct fields per AI stage to AutomationConfig. + AI stages are: 1 (Keywords→Clusters), 2 (Clusters→Ideas), 4 (Tasks→Content), + 5 (Content→Prompts), 6 (Prompts→Images) + """ + + dependencies = [ + ('automation', '0008_automationconfig_max_approvals_per_run_and_more'), + ] + + operations = [ + # Stage 1 use_testing and budget_pct + migrations.AddField( + model_name='automationconfig', + name='stage_1_use_testing', + field=models.BooleanField(default=False, help_text='Use testing model for Stage 1'), + ), + migrations.AddField( + model_name='automationconfig', + name='stage_1_budget_pct', + field=models.IntegerField(default=15, help_text='Budget percentage for Stage 1'), + ), + + # Stage 2 use_testing and budget_pct + migrations.AddField( + model_name='automationconfig', + name='stage_2_use_testing', + field=models.BooleanField(default=False, help_text='Use testing model for Stage 2'), + ), + migrations.AddField( + model_name='automationconfig', + name='stage_2_budget_pct', + field=models.IntegerField(default=10, help_text='Budget percentage for Stage 2'), + ), + + # Stage 4 use_testing and budget_pct + migrations.AddField( + model_name='automationconfig', + name='stage_4_use_testing', + field=models.BooleanField(default=False, help_text='Use testing model for Stage 4'), + ), + migrations.AddField( + model_name='automationconfig', + name='stage_4_budget_pct', + field=models.IntegerField(default=40, help_text='Budget percentage for Stage 4'), + ), + + # Stage 5 use_testing and budget_pct + migrations.AddField( + model_name='automationconfig', + name='stage_5_use_testing', + field=models.BooleanField(default=False, help_text='Use testing model for Stage 5'), + ), + migrations.AddField( + model_name='automationconfig', + name='stage_5_budget_pct', + field=models.IntegerField(default=5, help_text='Budget percentage for Stage 5'), + ), + + # Stage 6 use_testing and budget_pct + migrations.AddField( + model_name='automationconfig', + name='stage_6_use_testing', + field=models.BooleanField(default=False, help_text='Use testing model for Stage 6'), + ), + migrations.AddField( + model_name='automationconfig', + name='stage_6_budget_pct', + field=models.IntegerField(default=30, help_text='Budget percentage for Stage 6'), + ), + ] diff --git a/backend/igny8_core/business/automation/models.py b/backend/igny8_core/business/automation/models.py index b7d57d3d..49280ca3 100644 --- a/backend/igny8_core/business/automation/models.py +++ b/backend/igny8_core/business/automation/models.py @@ -40,6 +40,20 @@ class AutomationConfig(models.Model): stage_5_batch_size = models.IntegerField(default=1, help_text="Content at a time") stage_6_batch_size = models.IntegerField(default=1, help_text="Images - sequential") + # Use testing model per stage (only for AI stages: 1, 2, 4, 5, 6) + stage_1_use_testing = models.BooleanField(default=False, help_text="Use testing model for Stage 1") + stage_2_use_testing = models.BooleanField(default=False, help_text="Use testing model for Stage 2") + stage_4_use_testing = models.BooleanField(default=False, help_text="Use testing model for Stage 4") + stage_5_use_testing = models.BooleanField(default=False, help_text="Use testing model for Stage 5") + stage_6_use_testing = models.BooleanField(default=False, help_text="Use testing model for Stage 6") + + # Budget percentage per stage (only for AI stages: 1, 2, 4, 5, 6) + stage_1_budget_pct = models.IntegerField(default=15, help_text="Budget percentage for Stage 1") + stage_2_budget_pct = models.IntegerField(default=10, help_text="Budget percentage for Stage 2") + stage_4_budget_pct = models.IntegerField(default=40, help_text="Budget percentage for Stage 4") + stage_5_budget_pct = models.IntegerField(default=5, help_text="Budget percentage for Stage 5") + stage_6_budget_pct = models.IntegerField(default=30, help_text="Budget percentage for Stage 6") + # Delay configuration (in seconds) within_stage_delay = models.IntegerField(default=3, help_text="Delay between batches within a stage (seconds)") between_stage_delay = models.IntegerField(default=5, help_text="Delay between stage transitions (seconds)") diff --git a/docs/plans/LAUNCH-VERIFICATION-CHECKLIST.md b/docs/plans/LAUNCH-VERIFICATION-CHECKLIST.md new file mode 100644 index 00000000..27042293 --- /dev/null +++ b/docs/plans/LAUNCH-VERIFICATION-CHECKLIST.md @@ -0,0 +1,264 @@ +# IGNY8 v1.8.0 Launch Verification Checklist + +**Version:** 1.8.0 +**Created:** January 17, 2026 +**Purpose:** Final end-to-end verification before production launch + +--- + +## Quick Status + +| Section | Items | Status | +|---------|-------|--------| +| 1. User Journey | 12 | ⏳ | +| 2. Content Paths | 8 | ⏳ | +| 3. Settings Verification | 10 | ⏳ | +| 4. Analytics & Billing | 7 | ⏳ | +| 5. Documentation | 6 | ⏳ | +| 6. Design Standards | 5 | ⏳ | +| 7. Future Update Rules | 4 | ⏳ | + +--- + +# 1. USER JOURNEY VERIFICATION + +## 1.1 - Registration & Onboarding + +| # | Test | Expected | Pass | +|---|------|----------|------| +| 1 | Visit `/register` | Form renders, validation works | [ ] | +| 2 | Submit registration | Account created, redirects to wizard | [ ] | +| 3 | Onboarding wizard Step 1 | Welcome screen, "Get Started" works | [ ] | +| 4 | Onboarding wizard Step 2 | Add site with industry/sectors | [ ] | +| 5 | Onboarding wizard Step 3 | WordPress integration (can skip) | [ ] | +| 6 | Onboarding wizard Step 4 | Add initial keywords (can skip) | [ ] | +| 7 | Onboarding wizard Step 5 | Completion summary, go to dashboard | [ ] | + +## 1.2 - Authentication Flows + +| # | Test | Expected | Pass | +|---|------|----------|------| +| 8 | Login with email/password | JWT issued, redirects to dashboard | [ ] | +| 9 | Forgot password flow | Reset email sent, link works | [ ] | +| 10 | Change password (in-app) | Password updated, session valid | [ ] | +| 11 | Logout | Session cleared, redirect to login | [ ] | +| 12 | Token refresh | Automatic refresh before expiry | [ ] | + +--- + +# 2. CONTENT PIPELINE PATHS + +## 2.1 - Manual Pipeline (Full Path) + +| Stage | Action | Verify | Pass | +|-------|--------|--------|------| +| 1 | Add keywords manually | Keywords appear in list, status: pending | [ ] | +| 2 | Run clustering | Clusters created, keywords linked | [ ] | +| 3 | Generate ideas from cluster | Ideas created with title/brief | [ ] | +| 4 | Convert ideas to tasks | Tasks appear in Writer Queue | [ ] | +| 5 | Generate content | Full article with HTML + meta | [ ] | +| 6 | Generate image | Featured image attached to content | [ ] | +| 7 | Review content | Editor works, preview renders | [ ] | +| 8 | Publish to WordPress | Content appears on WP site | [ ] | + +## 2.2 - Automated Pipeline + +| # | Test | Expected | Pass | +|---|------|----------|------| +| 1 | Configure automation (Site Settings > Automation) | Settings save, schedule displays | [ ] | +| 2 | Run automation manually (Run Now) | All enabled stages execute in order | [ ] | +| 3 | Pause automation mid-run | Run pauses after current item | [ ] | +| 4 | Resume paused automation | Continues from saved stage | [ ] | +| 5 | Skip stage configuration | Skipped stages show 0 processed | [ ] | +| 6 | Per-run limits respected | Stages stop at configured limit | [ ] | + +## 2.3 - Publishing Paths + +| # | Test | Expected | Pass | +|---|------|----------|------| +| 1 | Manual publish (single) | Content published immediately | [ ] | +| 2 | Schedule for future | Content scheduled, shows in calendar | [ ] | +| 3 | Bulk schedule | Multiple items scheduled with stagger | [ ] | +| 4 | Auto-approval flow | Review → Approved automatically | [ ] | +| 5 | Auto-publish flow | Scheduled → Published at time | [ ] | +| 6 | Unschedule content | Content removed from schedule | [ ] | + +--- + +# 3. SETTINGS VERIFICATION + +## 3.1 - Site Settings Tabs + +| Tab | Settings to Verify | Pass | +|-----|-------------------|------| +| **General** | Site name, URL, industry, sectors, description | [ ] | +| **Automation** | Schedule, stages, batch sizes, per-run limits | [ ] | +| **Integrations** | WordPress connection status, sync settings | [ ] | + +## 3.2 - Automation Settings (Unified) + +| Setting | Verify | Pass | +|---------|--------|------| +| Enable/disable toggle | Saves and reflects in next run | [ ] | +| Frequency (hourly/daily/weekly) | Next run calculates correctly | [ ] | +| Scheduled days | Only selected days show in schedule | [ ] | +| Time slots | Run starts within selected window | [ ] | +| Stage enable/disable | Disabled stages skipped | [ ] | +| Batch sizes | Correct items per batch | [ ] | +| Per-run limits | Stage stops at limit | [ ] | +| Testing model selection | Uses correct model (is_testing) | [ ] | + +## 3.3 - Account Settings + +| Setting | Page | Verify | Pass | +|---------|------|--------|------| +| Organization name | Account tab | Saves and displays | [ ] | +| Profile info | Profile tab | Name, timezone save | [ ] | +| Password change | Profile tab | Requires old password | [ ] | +| Team members | Team tab | Can invite, list shows | [ ] | + +--- + +# 4. ANALYTICS & BILLING + +## 4.1 - Credits System + +| Test | Expected | Pass | +|------|----------|------| +| Header displays balance | Shows full number (12,000 not 12k) | [ ] | +| Clustering consumes credits | Balance decreases correctly | [ ] | +| Idea generation consumes credits | Balance decreases correctly | [ ] | +| Content generation consumes credits | Token-based calculation correct | [ ] | +| Image generation by tier | Basic=5, Quality=15, Premium=25 | [ ] | +| Zero credits blocks AI | Shows "insufficient credits" error | [ ] | +| Transaction logged | Appears in credit history | [ ] | + +## 4.2 - Billing & Payments + +| Test | Expected | Pass | +|------|----------|------| +| Current plan displays | Shows correct plan name + price | [ ] | +| Upgrade flow works | Stripe/PayPal checkout opens | [ ] | +| Payment history shows | Past invoices listed | [ ] | +| Subscription renewal date | Calculated correctly | [ ] | +| Credits reset date | Matches billing cycle | [ ] | + +--- + +# 5. DOCUMENTATION CHECK + +## 5.1 - Core Documentation + +| Document | Status | Verified | +|----------|--------|----------| +| `docs/INDEX.md` - v1.8.0 | Updated | [ ] | +| `CHANGELOG.md` - v1.8.0 | Updated | [ ] | +| `10-MODULES/AUTOMATION.md` | Reflects unified settings | [ ] | +| `10-MODULES/PUBLISHER.md` | Reflects unified settings | [ ] | +| `20-API/ENDPOINTS.md` | unified-settings endpoint added | [ ] | +| `30-FRONTEND/PAGES.md` | Removed pages documented | [ ] | + +## 5.2 - Help Content + +| Help Section | Accurate | Pass | +|--------------|----------|------| +| Getting Started | Matches current wizard flow | [ ] | +| Pipeline flow | 7-stage + publish accurate | [ ] | +| Settings descriptions | Matches current UI | [ ] | +| FAQ answers | Still accurate | [ ] | + +--- + +# 6. DESIGN STANDARDS COMPLIANCE + +## 6.1 - UI Consistency Check + +| Area | Standard | Verified | +|------|----------|----------| +| Module colors | Planner=green, Writer=yellow, Automation=blue, Publisher=purple | [ ] | +| Buttons | Using `