Read-only status sidecar for the Agilent UPLC-MS instrument (SDL2_LC1290) on this lab PC. Runs alongside the existing moses Python controller and the always-on Agilent OpenLab CDS supervisor; observes them but never opens its own session against the instrument.
Conforms to the AC Organic Self-Driving Lab status contract: see docs/STATUS_SPEC.md (v1.0).
This is a small FastAPI service that exposes:
GET /→{equipment_id, equipment_name, protocol_version}GET /health→{status: "healthy"}GET /status→ anEquipmentStatusenvelope per STATUS_SPEC v1.0GET /openapi.json→ generated by FastAPI
It is a sidecar in the strictest sense:
- It does not import or share an environment with the existing
mosesHPLC-MS controller package. - It does not open any session against the Agilent OpenLab CDS .NET SDK, named pipe, instrument, serial port, or COM port.
- It does not modify any vendor configuration.
GET /statusis side-effect-free and always returns HTTP 200 when the process is alive (requires_init,error, etc. are reported in-band per spec).
It only reads:
- OS process presence of OpenLab CDS supervisor processes (
psutil). - The newest
*.sirsltdirectory mtime underC:\CDSProjects\Installation\Results\(acquisition output is the strongest "is data being written right now" signal). - Any
python.exeunderC:\Users\sdl2\anaconda3\envs\moses*\currently running (additive busy signal — moses is launched per-batch, not as a daemon). - The trailing portion of
C:\ProgramData\Agilent\LogFiles\InstrumentService.logand the newestAcquisitionServer-*.logfor recentERROR/CRITICAL/FATALevents.
C:\SDL_Tools\uv.exe sync --extra dev
C:\SDL_Tools\uv.exe run pytest -q
C:\SDL_Tools\uv.exe run agilent-hplcms-server-serve --host 0.0.0.0 --port 8010Loopback verification:
curl http://127.0.0.1:8010/
curl http://127.0.0.1:8010/health
curl http://127.0.0.1:8010/statusTailscale verification (from another tailnet device):
curl http://sdl2-pc-06-uplc.tail6a1dd7.ts.net:8010/health
curl http://sdl2-pc-06-uplc.tail6a1dd7.ts.net:8010/status| Variable | Default | Purpose |
|---|---|---|
PORT |
8010 |
Bind port for uvicorn. |
HOST |
0.0.0.0 |
Bind host for uvicorn. |
DASHBOARD_ORIGIN |
* |
CORS allow origin. Set to dashboard origin in production. |
OPENLAB_LOG_DIR |
C:\ProgramData\Agilent\LogFiles |
Where OpenLab writes live logs. |
CDS_RESULTS_DIR |
C:\CDSProjects\Installation\Results |
Acquisition output root (*.sirslt directories). |
MOSES_ENV_GLOB |
C:\Users\sdl2\anaconda3\envs\moses* |
Glob matched against python.exe ExecutablePath. |
BUSY_THRESHOLD_S |
90 |
*.sirslt mtime within this many seconds → busy. |
ERROR_WINDOW_S |
300 |
Look-back window for tail-log error severity. |
OPENLAB_INSTRUMENT_NAME |
SDL2_LC1290 |
Surfaced in details.instrument_label. |
equipment_kind = "hplc".equipment_id = "agilent_uplc_ms".equipment_name = "Agilent UPLC-MS".- All timestamps are UTC ISO-8601 with timezone.
- Snake_case field names, identical to the spec.
- No secrets, no PII, no network identity in
/status. - Conforms to lab status spec v1.0.
equipment_status |
Trigger |
|---|---|
requires_init |
Any required OpenLab core process missing. |
error |
An ERROR / CRITICAL / FATAL event in the last ERROR_WINDOW_S of OpenLab logs. |
busy |
Newest *.sirslt mtime within BUSY_THRESHOLD_S, or a moses-env python.exe is running. |
ready |
OpenLab core processes up, no recent error event, no recent acquisition activity. |
unknown |
Probe could not stat the OpenLab log dir or the CDS results dir. |
- No SharedServices read (no live
pump_pressure/flow_rate/column_tempmetrics yet). Planned for v0.2 via subprocess into themoses_v4env, calling onlySharedServices(connstring).status— neverAgilent(...)(which grabs a control ticket). - No NSSM Windows Service install. Run interactively this session; service install is handled in a follow-up.
- No edits to
ac-organic-lab/equipment.yaml. Once this sidecar is reachable, the dashboard repo flipsagilent_uplc_msfromadapter: mocktoadapter: httpwithbase_url: http://sdl2-pc-06-uplc.tail6a1dd7.ts.net:8010.
STATUS_SPEC.md— v1.0 contract this repo implements.DEVICE_PC_SETUP.md— canonical Windows install recipe (uv atC:\SDL_Tools\uv.exe, NSSM, lab-user run, log paths).