Skip to content

Commit 882b245

Browse files
committed
docs: align Studio extension architecture guides
1 parent 786e85e commit 882b245

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

docs/extending/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ The LLM makes intelligent decisions—avoid hardcoded heuristics. Let Iris explo
107107

108108
Tools should be focused and composable. Each tool does one thing well. Iris orchestrates them.
109109

110-
### 3. Pure Reducer Pattern (Studio)
110+
### 3. Reducer-Centric Event Flow (Studio)
111111

112-
State transitions are pure functions: `(state, event) → (state, effects)`. Side effects are data, not execution.
112+
Studio still uses a central reducer for shared workflows and explicit side effects, but it is not a
113+
fully pure reducer architecture end-to-end. Handlers and `StudioApp` also perform some direct UI
114+
and coordination updates.
113115

114116
### 4. Structured Output
115117

docs/extending/modes.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ Each mode has:
1818
2. **Handler** — Input processing logic
1919
3. **Renderer** — UI drawing code
2020

21-
## Architecture: Pure Reducer Pattern
21+
## Architecture: Reducer-Centric Event Flow
2222

23-
Studio uses a predictable state management pattern:
23+
Studio uses a predictable reducer-centered state management pattern:
2424

2525
```
2626
Input Event
2727
2828
Handler (maps input → StudioEvent)
2929
30-
Reducer (pure function: state + event → new state + side effects)
30+
Reducer (central state/event layer)
3131
3232
Side Effects (spawn agent, load data, etc.)
3333
@@ -36,7 +36,9 @@ State Updated
3636
Renderer (draw UI from state)
3737
```
3838

39-
**Key principle**: State transitions are pure functions. Side effects are returned as data, not executed directly.
39+
**Key principle**: The reducer remains the shared event-processing core, but Studio is not a fully
40+
pure reducer architecture end-to-end. Handlers and `StudioApp` still apply some immediate UI and
41+
coordination updates directly, while reducer-driven flows return explicit side effects as data.
4042

4143
## Step-by-Step: Adding a New Mode
4244

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![allow(clippy::unwrap_used)]
2+
3+
use std::fs;
4+
5+
const STUDIO_GUIDE_PATHS: &[&str] = &["docs/extending/index.md", "docs/extending/modes.md"];
6+
7+
#[test]
8+
fn studio_extension_guides_no_longer_claim_a_pure_reducer_architecture() {
9+
for path in STUDIO_GUIDE_PATHS {
10+
let doc = fs::read_to_string(path).unwrap();
11+
assert!(
12+
!doc.contains("Pure Reducer Pattern"),
13+
"{path} still teaches the old pure reducer story"
14+
);
15+
assert!(
16+
!doc.contains("State transitions are pure functions"),
17+
"{path} still claims Studio is fully pure end-to-end"
18+
);
19+
assert!(
20+
doc.contains("reducer")
21+
&& doc.contains("not a")
22+
&& doc.contains("fully")
23+
&& doc.contains("pure reducer architecture"),
24+
"{path} should describe Studio as reducer-centric but not fully pure"
25+
);
26+
}
27+
}

0 commit comments

Comments
 (0)