Home/Projects/labauto
B

labauto

Project B · The laboratory as a programmable system
02 / 07

Runs a high-frequency cable laboratory as a programmable, traceable, self-validating measurement system.

4,100lines of source25tests10job states in the engine4instrument rolesSHA-256sealed archives12 pptechnical report
Problem

The problem

Most laboratory automation is a script: send SCPI commands, save whatever comes back. The script does not know whether the calibration expired yesterday, whether the operator scanned the wrong sample, whether the chamber had actually settled, or whether the data it just saved is physically plausible. Six months later, nobody can prove what the numbers in the database actually were measured under.

The question this project answers: what does it take for a laboratory to refuse a bad measurement before it happens, validate every result before accepting it, and reproduce any result from its archive alone?

System

What was built

An operating layer for the laboratory: procedures declare what a measurement is; a journalled engine executes them through gates, validation and archival.

Barcode + procedureGS1-128 or internal scheme, check digits verified · procedure TOML, SHA-256 hashed
Laboratory enginea journalled state machine — every transition recorded
VNA driverKeysight / R&S dialects
Climate chambertwo-node thermal model
DMM · scanner4-wire, barcode queue
Calibration gateage, temperature drift, kit due date, verification against a check standard
Validationgrid · passivity · reciprocity · trace noise · length vs registry · loss vs DC resistance · termination
Accepttrusted
Repeatflagged, re-measured
Quarantinerejected, kept as evidence
Sealed archiveraw data + full metadata sidecar, every file hashed into a manifest
Analysis + databasecablecheck always; zprofile and cableanalytics when installed
Takes
  • A scanned barcode and a sample registry
  • A procedure file: sweep, calibration policy, checks, downstream analysis
  • Instruments over socket, VISA — or the built-in simulators
  • A climate chamber profile, for temperature sweeps
Produces
  • A sealed job directory: raw files, sidecar, hashed manifest
  • A trusted / flagged / rejected decision with recorded reasons
  • Rows in the laboratory database, refusals included
  • Bit-exact replay of any archived job, months later
Engineering

The hard part

The hard part is measurement-aware execution: the engine has to know enough physics to distrust its own instruments. Is the trace noise consistent with the IF bandwidth? Does the electrical length match the length on the sample's registry entry? Is the high-frequency loss consistent with the DC loop resistance the ohmmeter just read? Is the far end actually terminated, or did someone forget? Each check is cheap; together they are the difference between a database and a pile of files.

The second hard part is doing all of this without a laboratory. The simulators are behavioural models with real error physics — a VNA whose residual errors depend on calibration age and temperature drift, a chamber with a two-node thermal model, cables whose defects and losses respond to temperature — so a climate sweep that would take hours on the bench runs in seconds in the test suite, and the gates can be tested by making measurements go wrong on demand.

The job state machine from created through gates, measurement, validation and archival to done.
FIG. 01  The engine: every job walks this journalled state machine; refusals and quarantines are states, not error messages.
Evidence

Checked against ground truth

The tests exercise the laboratory the way reality would — by breaking it.

What was checkedResult
Stale calibration, failed verification, wrong environmentjob refused at the gate, before measuring
Defective and mislabelled samplescaught by validation; flagged or quarantined
Sealed archive replayed months laterbit-exact reproduction of the sealed result
Manifest tamper checkany modified file named on verify
Barcode check digits (GS1 + internal mod-36)corrupt codes rejected, round trip exact
Full climate sweep in simulationseconds in the test suite, hours on a bench
Simulated chamber air and sample temperature during a sweep with settling bands.
FIG. 02  The chamber knows the sample lags the air: two-node thermal model, with settling criteria the engine actually waits for.
Calibration verification traces against the check standard's certificate bands.
FIG. 03  Trust is checked, not assumed: verification against a check standard decides whether the calibration may be used.
Declared limits

What it does not claim

From the report's own limitations section:

  • Real-hardware paths (VISA, socket SCPI) are implemented but exercised only against the simulators here.
  • The simulators are behavioural, not electromagnetic: they reproduce error structure, not any particular instrument.
  • One laboratory only — cross-site comparison is deliberately the next project's job.
Context

Where it sits in the toolchain

This is the layer that turns cablecheck from a tool you run into a laboratory that runs itself. Its sealed archives are exactly what labplatform ingests to compare sites, and a linktwin harness can name one of its job directories as a cable source — length, temperature, trust and hashes come from the sidecar, and the manifest is verified before the data is touched.

← PreviousA · cablecheck