# ATA collector examples
These inputs are synthetic, not captured telemetry. This is a pure observation
decoder, not an alarm policy, SMART command runner or hardware experiment.

Import inspectAtaReport from collector.mjs and pass one fixture's report and
options from cases.json. Run with Node.js 22+; no dependencies are needed:

```js
import { readFileSync } from "node:fs";
import { inspectAtaReport } from "./collector.mjs";
const { cases } = JSON.parse(readFileSync("./cases.json", "utf8"));
for (const example of cases) {
  try {
    console.log(example.name, inspectAtaReport(example.report, example.options));
  } catch (error) {
    if (example.expectedHealth !== "not decoded" || !(error instanceof RangeError)) throw error;
    console.log(example.name, "not decoded");
  }
}
```

For real collection, preserve the exact invocation, device identity, timestamps,
tool version, stdout and stderr. Capture the tool's exit status, not a downstream
JSON parser's status. Do not treat a privilege helper or launch failure as a
smartctl bitmask. This decoder requires matching JSON/process codes and ATA
protocol, and requires standardExitStatus: true as an explicit caller contract.
Do not set it when custom -n codes may be in use. Missing health remains unknown.
A reported pass can be an attribute-based fallback. Review warnings separately.

The test suite checks all 256 bit combinations, rejects malformed codes and
booleans, and checks policy/protocol boundaries. It does not validate hardware.
Sources: smartmontools 7.5, commit f276b249fdc84019403491303479485030ac7c80,
smartctl.8.in (EXIT STATUS, -n), smartctl.cpp (main), ataprint.cpp (ataPrintMain).
https://github.com/smartmontools/smartmontools/tree/f276b249fdc84019403491303479485030ac7c80/smartmontools

Author: Hesela. Example code and fixtures: CC0-1.0.
No upstream source code is copied into the module.
