Big-Link-Man/docs/architecture/workflows.md

82 lines
2.5 KiB
Markdown

# Core Workflows
## Content Generation Workflow (Story 2.2)
The simplified three-stage content generation pipeline:
```mermaid
sequenceDiagram
participant User
participant CLI
participant BatchProcessor
participant ContentGenerator
participant AIClient
participant Database
User->>CLI: generate-batch --job-file jobs/example.json
CLI->>BatchProcessor: process_job()
loop For each project/tier/article
BatchProcessor->>ContentGenerator: generate_title(project_id)
ContentGenerator->>AIClient: generate_completion(prompt)
AIClient-->>ContentGenerator: title
BatchProcessor->>ContentGenerator: generate_outline(project_id, title)
ContentGenerator->>AIClient: generate_completion(prompt, json_mode=true)
AIClient-->>ContentGenerator: outline JSON
BatchProcessor->>ContentGenerator: generate_content(project_id, title, outline)
ContentGenerator->>AIClient: generate_completion(prompt)
AIClient-->>ContentGenerator: HTML content
BatchProcessor->>ContentGenerator: validate_word_count(content)
alt Below minimum word count
BatchProcessor->>ContentGenerator: augment_content(content, target_count)
ContentGenerator->>AIClient: generate_completion(prompt)
AIClient-->>ContentGenerator: augmented HTML
end
BatchProcessor->>Database: save GeneratedContent record
end
BatchProcessor-->>CLI: Summary statistics
CLI-->>User: Job complete
```
## CORA Ingestion Workflow (Story 2.1)
```mermaid
sequenceDiagram
participant User
participant CLI
participant Parser
participant Database
User->>CLI: ingest-cora --file report.xlsx --name "Project Name"
CLI->>Parser: parse(file_path)
Parser-->>CLI: cora_data dict
CLI->>Database: create Project record
Database-->>CLI: project_id
CLI-->>User: Project created (ID: X)
```
## Deployment Workflow (Story 1.6)
```mermaid
sequenceDiagram
participant User
participant CLI
participant BunnyNetClient
participant Database
User->>CLI: provision-site --name "Site" --domain "example.com"
CLI->>BunnyNetClient: create_storage_zone()
BunnyNetClient-->>CLI: storage_zone_id
CLI->>BunnyNetClient: create_pull_zone()
BunnyNetClient-->>CLI: pull_zone_id
CLI->>BunnyNetClient: add_custom_hostname()
CLI->>Database: save SiteDeployment record
CLI-->>User: Site provisioned! Configure DNS.
```