Skip to main content

FORGE Stage-Gated Execution

FORGE (Factory-Optimized Release Gate Execution) is SO1’s stage-gated execution model that ensures quality, traceability, and consistency across all agent outputs.

Overview

Every agent operates within a specific FORGE stage, with explicit entry gates (prerequisites) and exit gates (deliverables).
┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐
│ STAGE 0  │──►│ STAGE 1  │──►│ STAGE 2  │──►│ STAGE 3  │──►│ STAGE 4  │──►│ STAGE 5  │
│ Planning │   │  Design  │   │  Impl    │   │   Docs   │   │ Validate │   │  Deploy  │
└──────────┘   └──────────┘   └──────────┘   └──────────┘   └──────────┘   └──────────┘
     │              │              │              │              │              │
     ▼              ▼              ▼              ▼              ▼              ▼
  Factory       TypeScript      Workflow       Multiple       Railway        Mintlify
  Orchestr.      Shared         Architect      Agents         Deployer       Author

Stage Details

Purpose

Requirement analysis, task decomposition, and agent selection.

Primary Agent

Factory Orchestrator

Entry Gate

  • User request received
  • Context sufficient for parsing

Exit Gate

  • Requirements parsed and documented
  • Tasks broken down into atomic units
  • Agents assigned to each task
  • Execution order determined

Decision Record Example

date:2024-01-15T10:00:00Z|context:[user requested GitHub-Slack integration]|decision:[assign Workflow Architect for n8n, Webhook Engineer for receiver]|rationale:[standard webhook pattern]|consequences:[2 agents, sequential execution]|status:accepted

Cross-Cutting Agents

Some agents operate across all stages:
AgentRoleTriggers
FORGE GatekeeperValidates stage transitionsEvery gate crossing
Incident CommanderOrchestrates incident responseP1/P2 incidents
Triage ResponderInitial assessmentAlert triggered

Gate Configuration

Each agent defines gates in its YAML frontmatter:
forge:
  stage: 2                          # Implementation stage
  entry_gate:
    - "Requirements documented"
    - "Schemas defined"
    - "Integration list provided"
  exit_gate:
    - "Workflow JSON generated"
    - "Error handling included"
    - "Schema validation passing"
    - "Decision record logged"

Gate Validation

The FORGE Gatekeeper validates all gate crossings:
  1. Pre-validation: Check entry gates are satisfied
  2. Execution: Agent performs work
  3. Post-validation: Verify exit gates are met
  4. VTM Update: Record in Verification & Traceability Matrix

Validation Command

./scripts/validate-agents.sh

# Output:
# ✓ FORGE gate validation: 20/20 agents compliant
# ✓ Entry gates defined: 20/20
# ✓ Exit gates defined: 20/20
# ✓ Stage assignments valid: 20/20

Decision Records

All significant decisions are logged in ADR format:
date:ISO8601|context:[situation]|decision:[choice]|rationale:[why]|consequences:[impact]|status:accepted|rejected|superseded

Example Decision Trail

# Stage 0 - Planning
date:2024-01-15T10:00:00Z|context:[user wants slack notifications]|decision:[use n8n webhook trigger]|rationale:[native Slack integration, retry support]|consequences:[requires n8n maintenance]|status:accepted

# Stage 2 - Implementation
date:2024-01-15T10:30:00Z|context:[implementing retry logic]|decision:[exponential backoff with 3 retries]|rationale:[prevents thundering herd, reasonable recovery time]|consequences:[max 15 min delay on failure]|status:accepted

# Stage 5 - Deployment
date:2024-01-15T14:00:00Z|context:[production deployment]|decision:[deploy to Railway production]|rationale:[existing infrastructure, monitoring in place]|consequences:[uses production quota]|status:accepted

VTM: Verification & Traceability Matrix

The VTM is the source of truth for agent validation:
AgentStageEntry GatesExit GatesStatus
Factory Orchestrator024✅ Pass
Workflow Architect245✅ Pass
Mintlify Author544✅ Pass
Full VTM: View VTM.md

Stage Coverage

StageNameAgent CountCoverage
0Planning1✅ Complete
1Design1✅ Complete
2Implementation4✅ Complete
3Documentation6✅ Complete
4Validation2✅ Complete
5Deployment4✅ Complete
Cross-cuttingAll3✅ Complete