v2-exece-docs
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# 01F: IGNY8 Phase 1 — Existing Site Analysis (Case 1)
|
||||
|
||||
> **Version:** 1.1 (codebase-verified)
|
||||
> **Source of Truth:** Codebase at `/data/app/igny8/backend/`
|
||||
> **Last Verified:** 2025-07-14
|
||||
|
||||
**Document Type:** Build Specification
|
||||
**Phase:** Phase 1: Existing Site Analysis
|
||||
**Use Case:** Case 1 (Users with existing sites)
|
||||
@@ -176,8 +180,8 @@ def extract_site_attributes(
|
||||
|
||||
```json
|
||||
{
|
||||
"analysis_id": "uuid",
|
||||
"site_id": "uuid",
|
||||
"analysis_id": 42,
|
||||
"site_id": 7,
|
||||
"timestamp": "2026-03-23T14:30:00Z",
|
||||
"analysis_confidence": 0.82,
|
||||
"attributes": [
|
||||
@@ -298,7 +302,7 @@ from typing import List, Dict, Optional
|
||||
|
||||
@dataclass
|
||||
class Product:
|
||||
id: str
|
||||
id: int
|
||||
title: str
|
||||
description: str
|
||||
sku: str
|
||||
@@ -310,10 +314,10 @@ class Product:
|
||||
|
||||
@dataclass
|
||||
class Category:
|
||||
id: str
|
||||
id: int
|
||||
name: str
|
||||
slug: str
|
||||
parent_id: Optional[str]
|
||||
parent_id: Optional[int]
|
||||
description: str
|
||||
product_count: int
|
||||
|
||||
@@ -326,16 +330,16 @@ class Taxonomy:
|
||||
|
||||
@dataclass
|
||||
class Term:
|
||||
id: str
|
||||
id: int
|
||||
name: str
|
||||
slug: str
|
||||
parent_id: Optional[str]
|
||||
parent_id: Optional[int]
|
||||
description: str
|
||||
count: int
|
||||
|
||||
@dataclass
|
||||
class Page:
|
||||
id: str
|
||||
id: int
|
||||
title: str
|
||||
url: str
|
||||
content_summary: str
|
||||
@@ -343,7 +347,7 @@ class Page:
|
||||
|
||||
@dataclass
|
||||
class Post:
|
||||
id: str
|
||||
id: int
|
||||
title: str
|
||||
url: str
|
||||
content_summary: str
|
||||
@@ -353,15 +357,15 @@ class Post:
|
||||
|
||||
@dataclass
|
||||
class MenuItem:
|
||||
id: str
|
||||
id: int
|
||||
title: str
|
||||
url: str
|
||||
target: str
|
||||
parent_id: Optional[str]
|
||||
parent_id: Optional[int]
|
||||
|
||||
@dataclass
|
||||
class SiteMetadata:
|
||||
site_id: str
|
||||
site_id: int
|
||||
domain: str
|
||||
wordpress_version: str
|
||||
woocommerce_version: str
|
||||
@@ -425,8 +429,8 @@ class AnalysisNotes:
|
||||
|
||||
@dataclass
|
||||
class AttributeExtractionResult:
|
||||
analysis_id: str
|
||||
site_id: str
|
||||
analysis_id: int
|
||||
site_id: int
|
||||
timestamp: str
|
||||
analysis_confidence: float
|
||||
attributes: List[DiscoveredAttribute]
|
||||
@@ -483,9 +487,9 @@ class AttributeExtractionResult:
|
||||
|
||||
```json
|
||||
{
|
||||
"analysis_id": "uuid",
|
||||
"site_id": "uuid",
|
||||
"blueprint_id": "uuid",
|
||||
"analysis_id": 42,
|
||||
"site_id": 7,
|
||||
"blueprint_id": 15,
|
||||
"timestamp": "2026-03-23T14:30:00Z",
|
||||
"summary": {
|
||||
"products_current": 50,
|
||||
@@ -599,15 +603,15 @@ class AttributeExtractionResult:
|
||||
|
||||
```json
|
||||
{
|
||||
"batch_id": "uuid",
|
||||
"site_id": "uuid",
|
||||
"blueprint_id": "uuid",
|
||||
"batch_id": 23,
|
||||
"site_id": 7,
|
||||
"blueprint_id": 15,
|
||||
"timestamp": "2026-03-23T14:30:00Z",
|
||||
"total_products": 50,
|
||||
"total_suggestions": 87,
|
||||
"suggestions": [
|
||||
{
|
||||
"product_id": "woo_123",
|
||||
"product_id": 123,
|
||||
"product_title": "Nekteck Foot Massager with Heat",
|
||||
"proposed_tags": [
|
||||
{
|
||||
@@ -659,7 +663,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
{
|
||||
"include_draft_products": false,
|
||||
"product_limit": 500,
|
||||
"sector_template_id": "optional_uuid",
|
||||
"sector_template_id": null,
|
||||
"webhook_url": "optional_https_url_for_completion_notification"
|
||||
}
|
||||
```
|
||||
@@ -668,7 +672,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
```json
|
||||
{
|
||||
"task_id": "celery_task_uuid",
|
||||
"site_id": "site_uuid",
|
||||
"site_id": 7,
|
||||
"status": "queued",
|
||||
"estimated_duration_seconds": 120,
|
||||
"check_status_url": "/api/v1/sag/sites/{site_id}/analysis-status/?task_id={task_id}"
|
||||
@@ -694,7 +698,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
```json
|
||||
{
|
||||
"task_id": "celery_task_uuid",
|
||||
"site_id": "site_uuid",
|
||||
"site_id": 7,
|
||||
"status": "processing",
|
||||
"progress_percent": 45,
|
||||
"current_step": "Analyzing product attributes",
|
||||
@@ -718,8 +722,8 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
**Response:** 200 OK
|
||||
```json
|
||||
{
|
||||
"analysis_id": "uuid",
|
||||
"site_id": "site_uuid",
|
||||
"analysis_id": 42,
|
||||
"site_id": 7,
|
||||
"timestamp": "2026-03-23T14:30:00Z",
|
||||
"site_data_summary": {
|
||||
"total_products": 50,
|
||||
@@ -756,7 +760,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"analysis_id": "uuid",
|
||||
"analysis_id": 42,
|
||||
"approved_attributes": [
|
||||
{
|
||||
"name": "Target Area",
|
||||
@@ -764,16 +768,16 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
"exclude_values": []
|
||||
}
|
||||
],
|
||||
"confirmed_by_user_id": "user_uuid"
|
||||
"confirmed_by_user_id": 3
|
||||
}
|
||||
```
|
||||
|
||||
**Response:** 201 Created
|
||||
```json
|
||||
{
|
||||
"blueprint_id": "uuid",
|
||||
"site_id": "site_uuid",
|
||||
"analysis_id": "uuid",
|
||||
"blueprint_id": 15,
|
||||
"site_id": 7,
|
||||
"analysis_id": 42,
|
||||
"status": "created",
|
||||
"attributes_count": 8,
|
||||
"attribute_values_count": 45,
|
||||
@@ -800,12 +804,12 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
**Response:** 200 OK
|
||||
```json
|
||||
{
|
||||
"batch_id": "uuid",
|
||||
"blueprint_id": "blueprint_uuid",
|
||||
"batch_id": 23,
|
||||
"blueprint_id": 15,
|
||||
"total_suggestions": 87,
|
||||
"suggestions": [
|
||||
{
|
||||
"product_id": "woo_123",
|
||||
"product_id": 123,
|
||||
"product_title": "Nekteck Foot Massager",
|
||||
"proposed_tags": [
|
||||
{
|
||||
@@ -829,10 +833,10 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"blueprint_id": "uuid",
|
||||
"blueprint_id": 15,
|
||||
"approved_suggestions": [
|
||||
{
|
||||
"product_id": "woo_123",
|
||||
"product_id": 123,
|
||||
"approved_tags": [
|
||||
{
|
||||
"attribute": "Target Area",
|
||||
@@ -849,8 +853,8 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
```json
|
||||
{
|
||||
"task_id": "celery_task_uuid",
|
||||
"site_id": "site_uuid",
|
||||
"blueprint_id": "blueprint_uuid",
|
||||
"site_id": 7,
|
||||
"blueprint_id": 15,
|
||||
"status": "processing",
|
||||
"products_to_tag": 47,
|
||||
"tags_to_apply": 87,
|
||||
@@ -871,7 +875,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
```json
|
||||
{
|
||||
"task_id": "celery_task_uuid",
|
||||
"site_id": "site_uuid",
|
||||
"site_id": 7,
|
||||
"status": "processing",
|
||||
"progress_percent": 62,
|
||||
"products_tagged": 29,
|
||||
@@ -902,7 +906,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
```json
|
||||
{
|
||||
"metadata": {
|
||||
"site_id": "uuid",
|
||||
"site_id": 7,
|
||||
"domain": "example-store.com",
|
||||
"wordpress_version": "6.4.2",
|
||||
"woocommerce_version": "8.5.0",
|
||||
@@ -915,7 +919,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
},
|
||||
"products": [
|
||||
{
|
||||
"id": "woo_123",
|
||||
"id": 123,
|
||||
"title": "Nekteck Foot Massager with Heat",
|
||||
"description": "Premium foot massage device...",
|
||||
"sku": "NEKTECK-FM-001",
|
||||
@@ -932,7 +936,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
],
|
||||
"categories": [
|
||||
{
|
||||
"id": "cat_1",
|
||||
"id": 1,
|
||||
"name": "Foot Massagers",
|
||||
"slug": "foot-massagers",
|
||||
"parent_id": null,
|
||||
@@ -947,7 +951,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
"is_hierarchical": false,
|
||||
"terms": [
|
||||
{
|
||||
"id": "brand_1",
|
||||
"id": 1,
|
||||
"name": "Nekteck",
|
||||
"slug": "nekteck",
|
||||
"parent_id": null,
|
||||
@@ -959,7 +963,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"id": "page_1",
|
||||
"id": 1,
|
||||
"title": "Shop",
|
||||
"url": "/shop",
|
||||
"content_summary": "Browse our selection of massage devices",
|
||||
@@ -968,7 +972,7 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
],
|
||||
"posts": [
|
||||
{
|
||||
"id": "post_1",
|
||||
"id": 1,
|
||||
"title": "Benefits of Foot Massage",
|
||||
"url": "/blog/foot-massage-benefits",
|
||||
"content_summary": "Learn why foot massage is beneficial...",
|
||||
@@ -979,11 +983,11 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
],
|
||||
"menus": [
|
||||
{
|
||||
"id": "menu_1",
|
||||
"id": 1,
|
||||
"title": "Main Menu",
|
||||
"items": [
|
||||
{
|
||||
"id": "item_1",
|
||||
"id": 1,
|
||||
"title": "Shop",
|
||||
"url": "/shop",
|
||||
"target": "_self",
|
||||
@@ -1184,7 +1188,10 @@ All endpoints are authenticated via `Authorization: Bearer {IGNY8_API_TOKEN}` he
|
||||
|
||||
---
|
||||
|
||||
### Phase 6: Frontend Components (Week 3-4)
|
||||
### Phase 6: Frontend Components — React + TypeScript (Week 3-4)
|
||||
|
||||
> **Tech Stack:** React ^19.0.0, TypeScript ~5.7.2, Vite ^6.1.0, Zustand ^5.0.8, Tailwind ^4.0.8
|
||||
> All components are `.tsx` files in the `frontend/src/` directory.
|
||||
|
||||
**Tasks:**
|
||||
1. Implement SiteAnalysisPanel
|
||||
@@ -1455,7 +1462,7 @@ Step 6: Complete & Next Steps
|
||||
**Common Issues:**
|
||||
|
||||
**Issue:** Analysis hangs or times out
|
||||
- Check: Celery worker status (`celery -A sag inspect active`)
|
||||
- Check: Celery worker status (`celery -A igny8_core inspect active`)
|
||||
- Check: Redis/message queue status
|
||||
- Check: LLM API rate limits
|
||||
- Solution: Reduce product limit, retry analysis
|
||||
|
||||
Reference in New Issue
Block a user