STEP 1583 — SiLA 2 Feature primitive v0.1 (design-import arc 3/3 完)
目的: SiLA 2 (Standardization in Lab Automation v2、 SiLA 財団策定、 gRPC ベース ラボ機器通信標準) の Feature + Command + Property + Observable + DefinedError contract を Rei stack 内 primitive として抽出。 STEP 1569 design-import register 6 ecosystem 中 6 番目 = 最後 (EPICS + QCoDeS 続き)。 本 STEP で 藤本さん directive「EPICS/QCoDeS/SiLA 2 順番に」 arc 3/3 = 完了。
SiLA 2 core 4 concept
| SiLA 2 概念 | 役割 | Rei stack analog |
| Feature | 装置機能 group、 typed contract、 FDL 記述 | {identifier, displayName, commands: Map, properties: Map} |
| Command | 明示的 一回実行 action (Observable/Unobservable) | {name, params, returns, observable, definedErrors, execute} |
| Property | 装置 読取専用状態 (Observable なら subscribe 可) | {name, type, observable, cache, get, subscribers} |
| DefinedError | Feature 側で 事前列挙する 型付例外 | {identifier, description} |
D-FUMT₈ verdict — 5 primitive 全て使用 (arc 3 STEP で最も豊富)
| 状況 | verdict |
| Command 成功 | TRUE |
| Command 実行中 (pending / running) | FLOWING (STEP 1541 pattern) |
| defined-error 発生 (予期例外) | FALSE |
| undefined-error (実装 bug 疑い) | NEITHER (保留) |
| Property 未初期化 | ZERO (STEP 1571 sensor no-data) |
| Service 内 duplicate Feature identifier | BOTH (STEP 1577 冗長 継承) |
API
createFeature(identifier, displayName, category?) → Feature
createCommand({name, params, returns, observable, definedErrors, execute}) → Command
createProperty({name, type, observable, get}) → Property
addCommand(feature, command)
addProperty(feature, property)
invokeCommand(feature, name, args) → Promise<CommandInvocation>
readProperty(prop) → Promise<T> // cache 更新 + subscriber notify
subscribeProperty(prop, cb) → unsubscribe fn // observable のみ
invocationVerdict(inv) → D8Verdict
propertyVerdict(prop) → D8Verdict
verifyService(features) → ServiceVerdict // 集約 + duplicate detect
propertyToNoData(prop) → SensorNoDataResult | null // STEP 1571 bridge
test 結果 (30/30 PASS)
| section | test |
| 1. Feature composition | identifier + displayName + add Command + add Property |
| 2. Command succeed | Echo → TRUE |
| 3. Command defined-error | Divide by zero → FALSE + error identifier match |
| 4. Command undefined-error | unlisted exception → NEITHER (保留) |
| 5. Command not-found | 非存在 command → undefined_error |
| 6. Property + subscriber | uninitialized ZERO / read → TRUE + notify / unsubscribe |
| 7. unobservable subscribe throws | 非 observable → throws |
| 8. Service duplicate BOTH | unique TRUE / duplicate identifier BOTH / empty ZERO |
| 9. STEP 1571 bridge | uninitialized → SensorNoDataResult / initialized → null |
Honest scope
- SiLA 2 gRPC transport 層 は 非実装 (in-memory 直呼)
- FDL (Feature Definition Language、 XML) parser は 非実装
- TLS + authentication は 非実装
- Discovery / Service Manager は 非実装
- 「Feature + Command/Property + Observable + DefinedError 概念契約 借用」 に絞る、 「SiLA 2 実装」 主張なし
- Rei stack 差異点: D-FUMT₈ verdict integration (5 primitive TRUE/FLOWING/FALSE/NEITHER/ZERO/BOTH 使用 = arc 中最豊富) + STEP 1541 FLOWING first-class + STEP 1571/1577 統一
Prior art
Design-import arc 進行状況 (完)
- ✅ STEP 1571 = Ophyd NotConnectedError → Rei 二層 型化
- ✅ STEP 1572+1573 = Tango 5 → Rei D-FUMT₈ 8 mapping
- ✅ STEP 1576 = Ophyd Movable/Readable → Rei 3 shape Connector Protocols
- ✅ STEP 1579 = Bluesky RunEngine analog for Rei MCP
- ✅ STEP 1581 = EPICS Channel Access primitive (severity → D-FUMT₈)
- ✅ STEP 1582 = QCoDeS Instrument primitive (3 abstraction + snapshot)
- ✅ STEP 1583 = SiLA 2 Feature primitive (5 verdict primitive 全使用) ← 本 STEP
STEP 1569 design-import register 6 ecosystem 全て輸入完了。 chat-Claude 2026-08-30 arc 指摘 「実験室制御 mature ecosystem 10+ 年」 の Rei stack 内 完全対応達成。