ggen 1.2.0

ggen is a deterministic, language-agnostic code generation framework that treats software artifacts as projections of knowledge graphs.
Documentation
# Ggen Production Lifecycle Configuration
# Eating our own dog food - using ggen's lifecycle system to build ggen

[lifecycle]
name = "ggen"
version = "1.2.0"

# ============================================================================
# Phase 1: Validation & Safety
# ============================================================================

[phases.validate-safety]
description = "Validate code safety (no panic points)"
commands = [
    "./scripts/check-no-panic-points.sh",
]
error_handling = "stop"
required = true
timeout = 60

[phases.lint]
description = "Run clippy with strict warnings"
commands = [
    "cargo clippy --all-targets --all-features -- -D warnings",
]
error_handling = "stop"
required = true

[phases.format-check]
description = "Check code formatting"
commands = [
    "cargo fmt --all -- --check",
]
error_handling = "stop"

# ============================================================================
# Phase 2: Building
# ============================================================================

[phases.build]
description = "Build optimized release"
commands = [
    "cargo build --release --all-features",
]
parallel = false
timeout = 600

[phases.build-debug]
description = "Build debug version"
commands = [
    "cargo build --all-features",
]
parallel = false

# ============================================================================
# Phase 3: Testing
# ============================================================================

[phases.test]
description = "Run comprehensive test suite"
commands = [
    "cargo test --all-features --no-fail-fast",
    "cargo test --doc",
]
parallel = false
timeout = 600
coverage_threshold = 80

[phases.test-release]
description = "Run tests in release mode"
commands = [
    "cargo test --release --all-features",
]
parallel = false

# ============================================================================
# Phase 4: Security & Compliance
# ============================================================================

[phases.security-audit]
description = "Run security audit"
commands = [
    "cargo audit",
]
error_handling = "warn"
required = false

[phases.dependency-check]
description = "Check dependencies"
commands = [
    "cargo deny check advisories",
]
error_handling = "warn"

# ============================================================================
# Phase 5: Dogfooding - Use ggen to fix ggen
# ============================================================================

[phases.fix-panic-points]
description = "Auto-fix panic points using ggen's own tools"
commands = [
    "cargo script scripts/fix-panic-points.rs --dry-run",
]
error_handling = "continue"

[phases.generate-safe-patterns]
description = "Generate safe error handling patterns"
commands = [
    "ggen template generate templates/safe-error-handling.tmpl",
]
error_handling = "continue"

# ============================================================================
# Phase 6: Production Readiness
# ============================================================================

[phases.readiness]
description = "Check production readiness"
commands = [
    "./scripts/check-no-panic-points.sh",
    "cargo clippy -- -D warnings",
    "cargo test --all-features",
]
error_handling = "stop"
required = true

[phases.production-validate]
description = "Full production validation"
commands = [
    "ggen lifecycle run validate-safety",
    "ggen lifecycle run lint",
    "ggen lifecycle run format-check",
    "ggen lifecycle run test",
    "ggen lifecycle run security-audit",
]
error_handling = "stop"
required = true

# ============================================================================
# Phase 7: Documentation
# ============================================================================

[phases.docs]
description = "Generate documentation"
commands = [
    "cargo doc --no-deps --all-features",
]

# ============================================================================
# Phase 8: Installation & Deployment
# ============================================================================

[phases.install]
description = "Install ggen locally"
commands = [
    "cargo install --path cli --force",
]

[phases.deploy]
description = "Deploy to production"
commands = [
    "ggen lifecycle run production-validate",
    "cargo build --release --all-features",
    "cargo install --path cli --force",
]
error_handling = "stop"
requires = ["production-validate"]

# ============================================================================
# Hooks - Automated Dogfooding
# ============================================================================

[hooks]
# Before any build, ensure code is safe
before_build = ["validate-safety", "lint", "format-check"]

# After build, run tests
after_build = ["test"]

# Before deploy, full validation
before_deploy = ["production-validate"]

# Setup git hooks
on_init = ["setup-git-hooks"]

[phases.setup-git-hooks]
description = "Install git hooks for panic point prevention"
commands = [
    "mkdir -p .git/hooks",
    "cp .githooks/pre-commit .git/hooks/pre-commit",
    "chmod +x .git/hooks/pre-commit",
]

# ============================================================================
# Environment-Specific Configuration
# ============================================================================

[env.development]
logging.level = "debug"
performance.optimize = false
security.strict = false

[env.production]
logging.level = "warn"
performance.optimize = true
security.strict = true
monitoring.enabled = true

# ============================================================================
# Workspace Configuration
# ============================================================================

[workspace.cli]
path = "cli"

[workspace.core]
path = "ggen-core"

[workspace.ai]
path = "ggen-ai"

# ============================================================================
# Performance Optimization
# ============================================================================

[performance]
parallel_execution = true
max_workers = 8
cache_enabled = true
cache_dir = "target/ggen-cache"

# ============================================================================
# Complete Pipelines
# ============================================================================

[pipelines]
# Full development pipeline
dev = ["lint", "build-debug", "test"]

# Full production pipeline (80/20 rule applied)
production = [
    "validate-safety",      # 40% of value - prevent crashes
    "lint",                 # 20% of value - catch bugs early
    "format-check",         # 5% of value - consistency
    "build",                # 10% of value - compilable
    "test",                 # 20% of value - correctness
    "security-audit",       # 5% of value - vulnerabilities
]

# Quick validation (most important 20%)
quick = ["validate-safety", "lint"]

# Dogfooding pipeline - use ggen to improve ggen
dogfood = [
    "fix-panic-points",
    "generate-safe-patterns",
    "validate-safety",
]