Skip to content

[AISOS-2160] docs: add architecture diagram#152

Closed
ekuris-redhat wants to merge 7 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2160
Closed

[AISOS-2160] docs: add architecture diagram#152
ekuris-redhat wants to merge 7 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2160

Conversation

@ekuris-redhat

Copy link
Copy Markdown
Collaborator

Summary

This pull request establishes a comprehensive, centralized global system architecture documentation foundation (docs/architecture.md) that maps the entire entry-to-merge trajectory of tickets in the Forge SDLC system. It documents the core components, the isolated containerization execution model under Podman, and provides detailed 1:1 code-aligned Mermaid.js state machine diagrams and technical summaries for both the Feature and Bug Workflows. This documentation serves as the single source of truth for developers to understand workflow orchestration, self-healing loops, parallelization mechanics, and execution environments.

Changes

Architecture Documentation Foundation & Infrastructure

  • Created docs/architecture.md outlining the Overview, Scope, global component architecture, and webhook event-driven ingestion flow.
  • Documented the global entry-to-merge trajectory using detailed ASCII diagrams and text descriptions representing webhook queuing (via Redis) up to isolated executors.
  • Documented the Podman containerization lifecycle, detailing host-to-container workspaces, volume mounts (:Z flags), credential mounting (Google Application Default Credentials), resource constraints, execution bootstrap via entrypoint.py, and teardown/cleanup preservation rules (FORGE_CONTAINER_KEEP).

Feature Workflow Mapping & Summaries

  • Extracted and mapped the complete 31-node LangGraph state machine from src/forge/workflow/feature/graph.py into a 1:1 code-aligned Mermaid.js state machine flow diagram.
  • Authored phase summaries for the Feature Workflow (Planning, Execution, and CI/CD Validation & Review), explaining multi-stage human gates, parallel execution fan-out mechanics utilizing LangGraph's Send API, and the self-healing CI loop with a rigid 5-attempt retry limit.

Bug Workflow Mapping & Summaries

  • Analyzed src/forge/workflow/bug/graph.py and src/forge/workflow/nodes/rca_analysis.py to draft a syntax-valid Mermaid.js state machine diagram mapping Triage, Analysis, Reflection, Bug Planning, Execution, and Verification states.
  • Authored detailed phase-by-phase technical summaries for the Bug Workflow, detailing trigger conditions, transition routing, and the RCA-reflection self-correction loop limit of exactly 3 attempts (_MAX_REFLECTION_COUNT = 3).
  • Unified and consolidated all bug workflow documentation directly under docs/architecture.md to ensure zero duplication and maintain formatting consistency.

Implementation Notes

  • Fidelity to Code: Every state name, gate condition, and routing path defined in the Mermaid.js diagrams matches the Python-defined LangGraph structures (src/forge/workflow/feature/graph.py and src/forge/workflow/bug/graph.py) exactly to ensure documentation does not become decoupled from behavior.
  • Single Source of Truth: Initial drafts in docs/bug-workflow-graph.md were unified directly into docs/architecture.md to keep all primary workflow orchestration documentation in a single, highly readable file, reducing maintenance overhead.
  • Visual Styling: Applied custom CSS styling and classes in the Mermaid.js definitions to visually group states across core phases (e.g., Planning, Execution, CI/CD, Human Review), making complex routing loops easy to comprehend.

Testing

  • Syntax Validation: Locally test-rendered docs/architecture.md to verify that all Markdown formatting and Mermaid.js syntax parse perfectly without errors in standard Markdown and Mermaid processors.
  • Code Alignment Review: Performed qualitative 1:1 verification of all documented transition limits (e.g., the 5-attempt CI fix cap and the 3-attempt bug reflection limit) against their respective code definitions.
  • Unit Testing: Ran python unit tests (pytest tests/unit/ -v) to confirm that documentation changes introduced no regressions or runtime errors, resulting in 100% passing test suites.

Related Tickets


Generated by Forge SDLC Orchestrator

…ation

Detailed description:
- Created the initial docs/architecture.md document structure.
- Drafted the Overview, Scope, and introduction to the global system architecture.
- Documented the three major workflows (Feature, Bug RCA/Fix, Task Takeover).
- Added system component architecture diagram and state checkpointing / resumability information.
- Ensured formatting adheres to standard Markdown guides in the repository.

Closes: AISOS-2165
…ment Lifecycle

Detailed description:
- Updated docs/architecture.md to add comprehensive documentation on the Isolated Podman Container and Execution Environment Lifecycle.
- Outlined host-to-container 1:1 relationship and mapping mechanics.
- Described image construction layout under Podman with deepagents and Upstash Context7 MCP.
- Detailed volume mounts, workspace isolation (:Z flag), resource constraints (memory/cpu), and network configuration (slirp4netns).
- Explained environment variable credential security and Google Application Default Credentials mounting.
- Traced task execution lifecycle managed by entrypoint.py from bootstrap to commit generation.
- Explained teardown and preservation rules (FORGE_CONTAINER_KEEP).

Closes: AISOS-2167
… Edges

Detailed description:
- Analyzed LangGraph Feature Workflow in src/forge/workflow/feature/graph.py.
- Traced all 31 state machine nodes, gates, conditional edge routing functions, feedback loops, and error recovery routes.
- Created and integrated a 1:1 code-aligned Mermaid.js state machine flow diagram into docs/architecture.md.
- Included full descriptions detailing the state transitions, entry routing, planning, execution, validation, human review, and termination phases.

Closes: AISOS-2168
…on Mechanics

Detailed description:
- Added comprehensive text summaries and ASCII architectural transition diagrams to docs/architecture.md explaining the detailed execution stages of the Feature workflow.
- Detailed the Planning Phase: initial Jira inputs triggering PRD, design spec, epic plan, and task generation, alongside the revision feedback mechanism triggered via comment commands.
- Detailed the Execution Phase: repository fan-out parallel routing mechanics utilizing LangGraph Send API to orchestrate concurrent Podman execution environments, alongside workspace setups and agent implementation routines.
- Detailed the CI/CD Validation & Review Phase: explained autonomous self-healing loops with a rigid 5-attempt retry limit for remote CI failures, transition gates, and PR merge and completion logic.

Closes: AISOS-2169
Detailed description:
- Analyzed  and  to extract all workflow nodes, conditional routes, loops, and terminal transitions.
- Created  featuring a 1:1 code-aligned Mermaid.js state machine diagram of the complete Bug Workflow.
- Formatted with visual CSS styling and classes for clarity across the five primary phases (Triage, Analysis/Reflection, RCA Option Gate, Fix Planning, and Validation/Review/Post-Merge).
- Explicitly documented the analysis-reflection self-correction loop and transition constraints.

Closes: AISOS-2171
…imits

Detailed description:
- Updated docs/bug-workflow-graph.md with comprehensive, phase-by-phase state transition summaries for the Bug Workflow.
- Detailed the transition logic, inputs, outputs, human-in-the-loop gates, and error handling for the Triage, RCA Analysis, Plan Bug Fix, Execution, and Verification phases.
- Explicitly documented the RCA analysis/reflection self-correction loop mechanics, including the loop trigger criteria and the hard limit of exactly 3 attempts (_MAX_REFLECTION_COUNT = 3).
- Ensured 1:1 code alignment of all state names, labels, and transition routing logic with src/forge/workflow/bug/graph.py.

Closes: AISOS-2172
…architecture.md

Detailed description:
- Appended the 1:1 code-aligned Bug Workflow Mermaid.js state diagram under a new section in docs/architecture.md.
- Added comprehensive phase-by-phase detailed summaries covering Triage, Analysis & Reflection, Bug Planning, Execution & Backward-Compatibility, and Validation, Review & Post-Merge Phases based on src/forge/workflow/bug/graph.py.
- Validated formatting and Markdown syntax compliance, ensuring all original sections remain intact.

Closes: AISOS-2173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant