Skip to content

Commit 58b4d3d

Browse files
add mixed-bus-dev hardware validation project (bread0 + ezo0)
1 parent f0a42ef commit 58b4d3d

12 files changed

Lines changed: 629 additions & 0 deletions

projects/mixed-bus-dev/README.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Mixed-Bus Development Profile
2+
3+
This project contains the development and validation profile for `bread0` + `ezo0` running
4+
together on a shared I2C bus. It was the hardware integration baseline developed before
5+
the bioreactor realization.
6+
7+
This is a machine realization, not a platform test. All validation scenarios require
8+
live hardware (Linux) or the mock providers (Windows).
9+
10+
## Runtime Profiles
11+
12+
1. `config/anolis-runtime.mixed.yaml`
13+
- Linux hardware validation profile.
14+
- Uses `provider-bread.yaml` + `provider-ezo.yaml`.
15+
- Address map: RLHT `0x0A`, DCMT `0x14`, DCMT `0x15`, EZO pH `0x63`, EZO DO `0x61`.
16+
- Polling interval `2500ms`.
17+
- HTTP port `8080`.
18+
- Expected inventory: 5 devices (`rlht0`, `dcmt0`, `dcmt1`, `ph0`, `do0`).
19+
20+
2. `config/anolis-runtime.mixed.win.mock.yaml`
21+
- Windows mock baseline. No hardware required.
22+
- Uses `provider-bread.mock.yaml` + `provider-ezo.mock.yaml`.
23+
- HTTP port `18080`.
24+
- Expected inventory: 6 devices (`rlht0`, `dcmt0`, `dcmt1`, `ph0`, `do0`, `ec0`).
25+
26+
3. `config/anolis-runtime.mixed.win.mock.conflict.yaml`
27+
- Windows mock ownership-conflict negative test.
28+
- Uses `provider-bread.conflict.mock.yaml` + `provider-ezo.conflict.mock.yaml`.
29+
- Intentionally duplicates ownership of `(bus_path, i2c_address)` at
30+
`mock://mixed-bus-conflict`, `0x63`.
31+
- Expected result: runtime startup fails fast with duplicate ownership error.
32+
33+
## Provider Configs
34+
35+
1. `config/provider-bread.yaml` (Linux hardware)
36+
2. `config/provider-ezo.yaml` (Linux hardware)
37+
3. `config/provider-bread.mock.yaml` (Windows mock baseline)
38+
4. `config/provider-ezo.mock.yaml` (Windows mock baseline)
39+
5. `config/provider-bread.conflict.mock.yaml` (Windows mock negative test)
40+
6. `config/provider-ezo.conflict.mock.yaml` (Windows mock negative test)
41+
42+
## Build Prerequisites (Preset-Based)
43+
44+
Build all three repos before validation so runtime command paths exist.
45+
46+
### Linux/macOS
47+
48+
```bash
49+
cd /path/to/anolis
50+
cmake --preset dev-release
51+
cmake --build --preset dev-release
52+
53+
cd /path/to/anolis-provider-bread
54+
cmake --preset dev-linux-hardware-release
55+
cmake --build --preset dev-linux-hardware-release
56+
57+
cd /path/to/anolis-provider-ezo
58+
cmake --preset dev-linux-hardware-release
59+
cmake --build --preset dev-linux-hardware-release
60+
```
61+
62+
### Windows (PowerShell)
63+
64+
```powershell
65+
Set-Location D:\repos_feast\anolis
66+
cmake --preset dev-windows-release
67+
cmake --build --preset dev-windows-release
68+
69+
Set-Location D:\repos_feast\anolis-provider-bread
70+
cmake --preset dev-windows-release
71+
cmake --build --preset dev-windows-release
72+
73+
Set-Location D:\repos_feast\anolis-provider-ezo
74+
cmake --preset dev-windows-release
75+
cmake --build --preset dev-windows-release
76+
```
77+
78+
## A) Windows Mock Baseline Validation
79+
80+
Start runtime (run from anolis root):
81+
82+
```powershell
83+
Set-Location D:\repos_feast\anolis
84+
Get-NetTCPConnection -LocalPort 18080 -ErrorAction SilentlyContinue
85+
.\build\dev-windows-release\core\Release\anolis-runtime.exe --config ..\anolis-projects\projects\mixed-bus-dev\config\anolis-runtime.mixed.win.mock.yaml
86+
```
87+
88+
Validate endpoints:
89+
90+
```powershell
91+
$base = 'http://127.0.0.1:18080'
92+
Invoke-RestMethod "$base/v0/runtime/status" | ConvertTo-Json -Depth 8
93+
Invoke-RestMethod "$base/v0/providers/health" | ConvertTo-Json -Depth 8
94+
Invoke-RestMethod "$base/v0/devices" | ConvertTo-Json -Depth 8
95+
Invoke-RestMethod "$base/v0/state" | ConvertTo-Json -Depth 8
96+
```
97+
98+
Expected:
99+
100+
1. Runtime stays up.
101+
2. `bread0` and `ezo0` are present.
102+
3. Inventory includes 6 devices.
103+
104+
## B) Windows Mock Ownership-Conflict Negative Test
105+
106+
Run conflict profile (run from anolis root):
107+
108+
```powershell
109+
Set-Location D:\repos_feast\anolis
110+
.\build\dev-windows-release\core\Release\anolis-runtime.exe --config ..\anolis-projects\projects\mixed-bus-dev\config\anolis-runtime.mixed.win.mock.conflict.yaml
111+
$LASTEXITCODE
112+
```
113+
114+
Expected:
115+
116+
1. Runtime startup fails before steady state.
117+
2. Error includes:
118+
- `I2C ownership validation failed`
119+
- `duplicate ownership for bus='mock://mixed-bus-conflict' addr='0x63'`
120+
- conflicting owners `bread0/rlht_conflict` and `ezo0/ph_conflict`
121+
3. Exit code is non-zero.
122+
123+
## C) Linux Hardware Validation
124+
125+
Start runtime (run from anolis root):
126+
127+
```bash
128+
cd /path/to/anolis
129+
./build/dev-release/core/anolis-runtime --config ../anolis-projects/projects/mixed-bus-dev/config/anolis-runtime.mixed.yaml
130+
```
131+
132+
Capture validation artifacts:
133+
134+
```bash
135+
cd /path/to/anolis
136+
./path/to/anolis-projects/projects/mixed-bus-dev/validation/check_mixed_bus_http.sh \
137+
--base-url http://127.0.0.1:8080 \
138+
--expect-providers bread0,ezo0 \
139+
--min-device-count 5 \
140+
--capture-dir artifacts/mixed-bus-validation/mixed
141+
```
142+
143+
Expected:
144+
145+
1. Runtime and both providers are `AVAILABLE`.
146+
2. Inventory includes 5 devices.
147+
3. Script exits `0` and writes artifacts.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
runtime:
2+
name: mixed-bus-win-mock-conflict
3+
shutdown_timeout_ms: 3000
4+
startup_timeout_ms: 30000
5+
6+
http:
7+
enabled: true
8+
bind: 127.0.0.1
9+
port: 18081
10+
cors_allowed_origins:
11+
- http://localhost:3000
12+
- http://127.0.0.1:3000
13+
cors_allow_credentials: false
14+
15+
providers:
16+
- id: bread0
17+
command: ..\anolis-provider-bread\build\dev-windows-release\Release\anolis-provider-bread.exe
18+
args: ["--config", "../anolis-projects/projects/mixed-bus-dev/config/provider-bread.conflict.mock.yaml"]
19+
timeout_ms: 5000
20+
hello_timeout_ms: 2000
21+
ready_timeout_ms: 10000
22+
restart_policy:
23+
enabled: true
24+
max_attempts: 3
25+
backoff_ms: [200, 500, 1000]
26+
timeout_ms: 30000
27+
28+
- id: ezo0
29+
command: ..\anolis-provider-ezo\build\dev-windows-release\Release\anolis-provider-ezo.exe
30+
args: ["--config", "../anolis-projects/projects/mixed-bus-dev/config/provider-ezo.conflict.mock.yaml"]
31+
timeout_ms: 5000
32+
hello_timeout_ms: 2000
33+
ready_timeout_ms: 10000
34+
restart_policy:
35+
enabled: true
36+
max_attempts: 3
37+
backoff_ms: [200, 500, 1000]
38+
timeout_ms: 30000
39+
40+
polling:
41+
interval_ms: 500
42+
43+
telemetry:
44+
enabled: false
45+
46+
automation:
47+
enabled: false
48+
49+
logging:
50+
level: info
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
runtime:
2+
name: mixed-bus-win-mock
3+
shutdown_timeout_ms: 3000
4+
startup_timeout_ms: 30000
5+
6+
http:
7+
enabled: true
8+
bind: 127.0.0.1
9+
port: 18080
10+
cors_allowed_origins:
11+
- http://localhost:3000
12+
- http://127.0.0.1:3000
13+
cors_allow_credentials: false
14+
15+
providers:
16+
- id: bread0
17+
command: ..\anolis-provider-bread\build\dev-windows-release\Release\anolis-provider-bread.exe
18+
args: ["--config", "../anolis-projects/projects/mixed-bus-dev/config/provider-bread.mock.yaml"]
19+
timeout_ms: 5000
20+
hello_timeout_ms: 2000
21+
ready_timeout_ms: 10000
22+
restart_policy:
23+
enabled: true
24+
max_attempts: 3
25+
backoff_ms: [200, 500, 1000]
26+
timeout_ms: 30000
27+
28+
- id: ezo0
29+
command: ..\anolis-provider-ezo\build\dev-windows-release\Release\anolis-provider-ezo.exe
30+
args: ["--config", "../anolis-projects/projects/mixed-bus-dev/config/provider-ezo.mock.yaml"]
31+
timeout_ms: 5000
32+
hello_timeout_ms: 2000
33+
ready_timeout_ms: 10000
34+
restart_policy:
35+
enabled: true
36+
max_attempts: 3
37+
backoff_ms: [200, 500, 1000]
38+
timeout_ms: 30000
39+
40+
polling:
41+
interval_ms: 500
42+
43+
telemetry:
44+
enabled: false
45+
46+
automation:
47+
enabled: false
48+
49+
logging:
50+
level: info
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
runtime:
2+
name: mixed-bus
3+
shutdown_timeout_ms: 3000
4+
startup_timeout_ms: 30000
5+
6+
http:
7+
enabled: true
8+
bind: 127.0.0.1
9+
port: 8080
10+
cors_allowed_origins:
11+
- http://localhost:3000
12+
- http://127.0.0.1:3000
13+
cors_allow_credentials: false
14+
15+
providers:
16+
- id: bread0
17+
command: ../anolis-provider-bread/build/dev-linux-hardware-release/anolis-provider-bread
18+
args: ["--config", "../anolis-projects/projects/mixed-bus-dev/config/provider-bread.yaml"]
19+
timeout_ms: 5000
20+
hello_timeout_ms: 2000
21+
ready_timeout_ms: 10000
22+
restart_policy:
23+
enabled: true
24+
max_attempts: 3
25+
backoff_ms: [200, 500, 1000]
26+
timeout_ms: 30000
27+
28+
- id: ezo0
29+
command: ../anolis-provider-ezo/build/dev-linux-hardware-release/anolis-provider-ezo
30+
args: ["--config", "../anolis-projects/projects/mixed-bus-dev/config/provider-ezo.yaml"]
31+
timeout_ms: 5000
32+
hello_timeout_ms: 5000
33+
ready_timeout_ms: 10000
34+
restart_policy:
35+
enabled: true
36+
max_attempts: 3
37+
backoff_ms: [200, 500, 1000]
38+
timeout_ms: 30000
39+
40+
polling:
41+
interval_ms: 2500
42+
43+
telemetry:
44+
enabled: false
45+
46+
automation:
47+
enabled: false
48+
49+
logging:
50+
level: info
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
provider:
2+
name: bread0
3+
4+
hardware:
5+
bus_path: mock://mixed-bus-conflict
6+
query_delay_us: 10000
7+
timeout_ms: 100
8+
retry_count: 2
9+
10+
discovery:
11+
mode: manual
12+
addresses: [0x63]
13+
14+
devices:
15+
- id: rlht_conflict
16+
type: rlht
17+
label: Conflict Ownership RLHT
18+
address: 0x63
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
provider:
2+
name: bread0
3+
4+
hardware:
5+
bus_path: mock://mixed-bus
6+
query_delay_us: 10000
7+
timeout_ms: 100
8+
retry_count: 2
9+
10+
discovery:
11+
mode: manual
12+
addresses: [0x0A, 0x14, 0x15]
13+
14+
devices:
15+
- id: rlht0
16+
type: rlht
17+
label: Reactor Left Heater 0
18+
address: 0x0A
19+
- id: dcmt0
20+
type: dcmt
21+
label: Reactor Feed Pumps
22+
address: 0x14
23+
- id: dcmt1
24+
type: dcmt
25+
label: Reactor Acid-Base Pumps
26+
address: 0x15
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
provider:
2+
name: bread0
3+
4+
hardware:
5+
bus_path: /dev/i2c-1
6+
require_live_session: true
7+
query_delay_us: 10000
8+
timeout_ms: 100
9+
retry_count: 2
10+
11+
discovery:
12+
mode: manual
13+
addresses: [0x0A, 0x14, 0x15]
14+
15+
devices:
16+
- id: rlht0
17+
type: rlht
18+
label: Reactor Left Heater
19+
address: 0x0A
20+
- id: dcmt0
21+
type: dcmt
22+
label: Reactor Feed Pumps
23+
address: 0x14
24+
- id: dcmt1
25+
type: dcmt
26+
label: Reactor Acid-Base Pumps
27+
address: 0x15
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
provider:
2+
name: ezo0
3+
4+
hardware:
5+
bus_path: mock://mixed-bus-conflict
6+
query_delay_us: 300000
7+
timeout_ms: 300
8+
retry_count: 2
9+
10+
discovery:
11+
mode: manual
12+
13+
devices:
14+
- id: ph_conflict
15+
type: ph
16+
label: Conflict Ownership pH
17+
address: 0x63

0 commit comments

Comments
 (0)