Skip to content

Commit 53853af

Browse files
committed
docs: add Mermaid diagram catalog
1 parent 8e86990 commit 53853af

1 file changed

Lines changed: 173 additions & 0 deletions

File tree

docs/diagrams/README.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Mermaid Diagram Catalog
2+
3+
This catalog documents the AI Engineering Operating System using Mermaid diagrams.
4+
5+
## 1. Full AI-OS lifecycle
6+
7+
```mermaid
8+
flowchart TD
9+
Goal[User or Issue Goal] --> Context[Load Repository Context]
10+
Context --> Understand[Understand Goal]
11+
Understand --> Discover[Discover Existing System]
12+
Discover --> Analyze[Analyze Impact]
13+
Analyze --> Plan[Plan Small Reversible Steps]
14+
Plan --> Design[Design Simple Safe Solution]
15+
Design --> Risk[Risk Review]
16+
Risk --> Implement[Implement Increment]
17+
Implement --> Review[Self Review]
18+
Review --> Verify[Verification Gates]
19+
Verify --> Passed{All gates passed?}
20+
Passed -- No --> Diagnose[Diagnose Failure]
21+
Diagnose --> Return[Return To Earliest Failing Phase]
22+
Return --> Analyze
23+
Passed -- Yes --> Document[Update Documentation]
24+
Document --> Memory[Update Memory]
25+
Memory --> Retro[Retrospective]
26+
Retro --> Done[Done]
27+
```
28+
29+
## 2. Universal loop
30+
31+
```mermaid
32+
flowchart TD
33+
A[Goal] --> B[Analyze]
34+
B --> C[Plan]
35+
C --> D[Implement]
36+
D --> E[Verify]
37+
E --> F{Verifier passed?}
38+
F -- No --> G[Diagnose]
39+
G --> H[Fix root cause]
40+
H --> E
41+
F -- Yes --> I{Goal met?}
42+
I -- No --> C
43+
I -- Yes --> J[Complete]
44+
```
45+
46+
## 3. Fan-out and fan-in agents
47+
48+
```mermaid
49+
flowchart LR
50+
Orchestrator[Orchestrator] --> Planner[Planner]
51+
Orchestrator --> Architect[Architect]
52+
Orchestrator --> Coder[Coder]
53+
Orchestrator --> Tester[Tester]
54+
Orchestrator --> Reviewer[Reviewer]
55+
Orchestrator --> Docs[Docs]
56+
Planner --> FanIn[Fan-in Synthesis]
57+
Architect --> FanIn
58+
Coder --> FanIn
59+
Tester --> FanIn
60+
Reviewer --> FanIn
61+
Docs --> FanIn
62+
FanIn --> Gate{Decision Gate}
63+
Gate -- Continue --> Orchestrator
64+
Gate -- Done --> Done[Done]
65+
```
66+
67+
## 4. Feature development loop
68+
69+
```mermaid
70+
flowchart TD
71+
Story[Feature Goal] --> AC[Acceptance Criteria]
72+
AC --> Pattern[Find Existing Patterns]
73+
Pattern --> Design[Design Smallest Change]
74+
Design --> Tests[Create or Update Tests]
75+
Tests --> Code[Implement]
76+
Code --> Verify[Run Verifiers]
77+
Verify --> Pass{Pass?}
78+
Pass -- No --> Diagnose[Diagnose and Fix]
79+
Diagnose --> Code
80+
Pass -- Yes --> Docs[Update Docs]
81+
Docs --> PR[Ready for PR]
82+
```
83+
84+
## 5. Bug fix loop
85+
86+
```mermaid
87+
flowchart TD
88+
Bug[Bug Report] --> Repro[Reproduce]
89+
Repro --> FailingTest[Create Failing Test]
90+
FailingTest --> RootCause[Root Cause Analysis]
91+
RootCause --> Fix[Minimal Fix]
92+
Fix --> Verify[Run Regression Tests]
93+
Verify --> Pass{Fixed?}
94+
Pass -- No --> RootCause
95+
Pass -- Yes --> Done[Done]
96+
```
97+
98+
## 6. CI/CD repair loop
99+
100+
```mermaid
101+
flowchart TD
102+
Fail[CI Failure] --> Logs[Fetch Logs]
103+
Logs --> Classify[Classify Failure]
104+
Classify --> Cause[Root Cause]
105+
Cause --> Patch[Minimal Patch]
106+
Patch --> Local[Verify Locally]
107+
Local --> CI[Run CI]
108+
CI --> Pass{Green?}
109+
Pass -- No --> Logs
110+
Pass -- Yes --> Done[Done]
111+
```
112+
113+
## 7. Infrastructure loop
114+
115+
```mermaid
116+
flowchart TD
117+
Goal[Infrastructure Goal] --> Plan[Plan]
118+
Plan --> Validate[Validate IaC]
119+
Validate --> Cost[Cost and Risk Review]
120+
Cost --> Approval{Approval Required?}
121+
Approval -- Yes --> Human[Human Approval]
122+
Approval -- No --> ApplyDev[Apply to Dev or Test]
123+
Human --> ApplyDev
124+
ApplyDev --> Smoke[Smoke Test]
125+
Smoke --> Promote{Promote?}
126+
Promote -- No --> Rollback[Rollback]
127+
Promote -- Yes --> Done[Done]
128+
```
129+
130+
## 8. Security loop
131+
132+
```mermaid
133+
flowchart TD
134+
Asset[Asset] --> Boundary[Trust Boundary]
135+
Boundary --> Threat[Threat]
136+
Threat --> Control[Security Control]
137+
Control --> Abuse[Abuse Case Test]
138+
Abuse --> Pass{Blocked?}
139+
Pass -- No --> Improve[Improve Control]
140+
Improve --> Abuse
141+
Pass -- Yes --> Residual[Document Residual Risk]
142+
Residual --> Done[Done]
143+
```
144+
145+
## 9. Model routing loop
146+
147+
```mermaid
148+
flowchart TD
149+
Task[Task] --> Risk{Risk Level}
150+
Risk -- Low --> Local[Local or Small Model]
151+
Risk -- Medium --> Medium[Medium Model]
152+
Risk -- High --> Strong[Strong Model]
153+
Local --> Verify[Verifier]
154+
Medium --> Verify
155+
Strong --> Verify
156+
Verify --> Confidence{Enough Confidence?}
157+
Confidence -- No --> Escalate[Escalate Model]
158+
Escalate --> Verify
159+
Confidence -- Yes --> Done[Done]
160+
```
161+
162+
## 10. Human approval checkpoint
163+
164+
```mermaid
165+
flowchart TD
166+
Change[Proposed Change] --> Risk{Risky or irreversible?}
167+
Risk -- No --> Continue[Continue]
168+
Risk -- Yes --> Stop[Stop]
169+
Stop --> Explain[Explain Risk and Rollback]
170+
Explain --> Approve{Human Approved?}
171+
Approve -- No --> Alternative[Choose Safer Alternative]
172+
Approve -- Yes --> Continue
173+
```

0 commit comments

Comments
 (0)