Files
gcp_solution_architecture_a…/app/nodes/package_node.py
Jonathan Boniface b9a924cf4a
Some checks failed
validation / verify (push) Failing after 15s
fix: refactored manually
2026-09-02 16:08:12 +01:00

74 lines
2.3 KiB
Python

"""Phase 3: Solution Guide Packaging Node."""
import logging
from typing import Any, Dict
from app.states.state import GCPArchitectureState
from app.skills.loader import SkillLoader
logger = logging.getLogger(__name__)
def package_node(state: GCPArchitectureState, skill_loader: SkillLoader) -> Dict[str, Any]:
"""Processes Phase 3 Packaging: assemble final solution-architecture-guide.md document."""
logger.info("Executing package_node")
skill_prompt = skill_loader.format_skills_for_prompt("package")
req_doc = state.get("requirements_doc", "")
arch_doc = state.get("architecture_doc", "")
mmd_doc = state.get("mermaid_diagram", "")
tf_doc = state.get("terraform_code", "")
val_doc = state.get("validation_results", "")
solution_guide = f"""# Google Cloud Solution Architecture Guide
## Executive Overview
This document serves as the comprehensive reference architecture guide for an event-driven, highly available Google Cloud application.
## Functional requirements
- Accept authenticated HTTPS requests from external clients.
- Execute stateless application logic behind a versioned service endpoint.
- Asynchronously publish domain events to Pub/Sub.
- Retain raw payload records in Cloud Storage for audit and replay.
## Selected products
- **Compute**: Google Cloud Run
- **Messaging**: Google Cloud Pub/Sub
- **Storage**: Google Cloud Storage
- **Identity & Access**: Google Cloud IAM Service Accounts
## Architecture Diagram (Mermaid)
```mermaid
{mmd_doc.strip()}
```
## Infrastructure Blueprint (Terraform)
```hcl
{tf_doc.strip()}
```
## Validation results
{val_doc.strip()}
## Deployment & Operations Runbook
1. Initialize Terraform: `terraform init`
2. Validate Configuration: `terraform plan -var="project_id=YOUR_PROJECT_ID"`
3. Deploy Blueprint: `terraform apply`
"""
active_skills = state.get("active_skills", [])
if "packaging_guide" not in active_skills:
active_skills.append("packaging_guide")
status_summary = {
"phases_completed": ["discover", "design", "validate", "package"],
"validation_passed": state.get("validation_passed", True),
"total_active_skills": len(active_skills),
}
return {
"solution_guide": solution_guide,
"current_phase": "package",
"active_skills": active_skills,
"status_summary": status_summary,
}