STEP 1582 — QCoDeS Instrument primitive v0.1

目的: QCoDeS (Microsoft、 量子計測 lab framework、 十年以上運用) の Instrument + Parameter + Station composition semantics を Rei stack 内 primitive として抽出。 STEP 1569 design-import register の 6 ecosystem 中 5 番目 (EPICS 続き、 STEP 1581 → 本 STEP → 1583 arc)。

QCoDeS core 3 abstraction

QCoDeS 概念役割Rei stack analog
Instrument実験装置抽象 base class + parameters 集{name, parameters: Map}
Parameter装置の値、 get/set + validator + cache{name, unit, get, set, validators, cache: {value, timestamp, stale}, maxCacheAge?}
StationInstrument 集合体 (composition){name, instruments: Map}
Snapshot全装置状態 永続記録 (実験再現性の根幹)snapshotStation() → JSON-safe StationSnapshot

D-FUMT₈ verdict

状況verdict
validators pass + get success + fresh cacheTRUE
cache stale (age > maxCacheAge) — 要更新NEITHER (STEP 1571 pattern)
never got value (cache.value === null)ZERO (STEP 1571 sensor no-data)
Station 内 duplicate parameter name — 冗長BOTH (STEP 1577 継承)

API

createParameter<T>(name, {unit, get, set, validators, maxCacheAge})
getParameter(param) → Promise<T>           // callback 実行 + cache 更新
setParameter(param, value)                  // validators 検証 + callback + cache 更新
isCacheStale(param, now?) → boolean         // maxCacheAge 経過判定
parameterVerdict(param, now?) → D8Verdict

createInstrument(name) / addParameter(inst, param)
createStation(name) / addInstrument(station, inst)
snapshotStation(station, now?) → StationSnapshot  // JSON-safe dump
verifyStation(station, now?) → StationVerdict     // 集約 verdict
emptyParameterToNoData(param) → SensorNoDataResult | null  // STEP 1571 bridge

test 結果 (28/28 PASS)

sectiontest
1. Parameter lifecyclecreate + get + set + validator fail
2. cache stalenessfresh vs expired (maxCacheAge = 100ms)
3. Instrument compositionDMM w/ voltage + current parameters
4. Station snapshot2 instruments + snapshot JSON dump
5. Station verify1 empty ZERO / 全 fresh TRUE
6. duplicate name → BOTH2 instruments 共有 param name 'shared'
7. STEP 1571 bridgeempty param → SensorNoDataResult / fresh → null

Honest scope

Prior art