STPA Step 2 - Model the control structure using hierarchical control-feedback diagrams in Graphviz/DOT format; After completing STPA Step 1. When you need to understand how control flows through a system. When identifying controllers, control actions, and feedback paths.
Create a hierarchical model showing:
"I'm using the STPA Step 2 skill to model the control structure. We'll identify controllers, control actions, and feedback paths."
A control structure shows the hierarchical relationships between:
Q1: Who or what makes control decisions in this system?
Q2: What is the hierarchy of control?
Software System:
Physical System:
AI System:
Q1: What commands does [Controller] send to [Controlled Process]?
Q2: When are these control actions sent?
| Controller | Control Action | Controlled Process |
|---|---|---|
| User | Submit Login | Auth Service |
| Auth Service | Issue Token | Session Manager |
| Orchestrator | Execute Task | ML Model |
| PLC | Open Valve | Pressure Vessel |
Q1: What information does [Controlled Process] send back to [Controller]?
Q2: How does the controller use this feedback?
digraph ControlStructure {
rankdir=TB;
node [shape=box];
// Controllers (top to bottom = higher to lower authority)
User [label="User"];
AuthService [label="Auth Service"];
SessionManager [label="Session Manager"];
Database [label="Database"];
// Control Actions (solid arrows pointing down)
User -> AuthService [label="Login Request"];
AuthService -> SessionManager [label="Create Session"];
SessionManager -> Database [label="Store Session"];
// Feedback (dashed arrows pointing up)
AuthService -> User [label="Auth Result", style=dashed];
SessionManager -> AuthService [label="Session ID", style=dashed];
Database -> SessionManager [label="Write Confirmation", style=dashed];
}
rankdir=TB - Top to bottom flownode [shape=box] - All nodes are rectangular boxesBefore proceeding to Step 3:
Q1: Is every controller-controlled relationship shown? Q2: Does every control action have corresponding feedback? Q3: Are there any hidden controllers we haven't identified? Q4: Are there any feedback paths that are missing or delayed?
Record in .sgai/PROJECT_MANAGEMENT.md:
### Step 2: Control Structure
#### Controllers Identified
1. [Controller 1] - [Role/Description]
2. [Controller 2] - [Role/Description]
#### Control Structure Diagram
```dot
digraph ControlStructure {
rankdir=TB;
node [shape=box];
// [Insert diagram here]
}
| Controller | Control Action | Controlled Process | Feedback |
|---|---|---|---|
| [C1] | [Action] | [C2] | [Feedback] |
## When to Proceed to Step 3
Move to Step 3 when:
- [ ] All controllers are identified and placed in hierarchy
- [ ] All control actions are documented
- [ ] All feedback paths are identified (or gaps noted)
- [ ] Human partner confirms the structure looks accurate
Load: `skills({"name":"stpa/step3-unsafe-control-actions"})`