"""Two real loopback streams, one synthetic B2, no physical commands or state.""" import asyncio import json import struct import tempfile import time import uuid from datetime import UTC, datetime from pathlib import Path from ndc_vps import VERSION from qualify_faults import Harness async def qualify(): result = { "session_id": uuid.uuid4().hex, "version": VERSION, "started_utc": datetime.now(UTC).isoformat(), "monotonic": time.monotonic(), "physical_devices_used": False, "production_state_used": False, } with tempfile.TemporaryDirectory(prefix="ndc-vps-receipts-") as name: harness = Harness(Path(name)) alternate = None await harness.start() try: await harness.connect() alternate = harness.peer harness.peer = None # Keep the first monitoring stream open. await harness.connect() body = harness.body() await harness.submit(body) wire = await harness.frame() # Most recently active stream wins dispatch. async def reply(code): data = struct.pack("