JSON Snapshot Auditor
Use this skill when a data pipeline produced a snapshot but the result is empty, suspicious, or hard to explain.
Workflow
- Preserve the raw snapshot before transforming it. Parse it as JSON and report syntax errors with the exact location when available.
- Separate three layers: collection health (did records arrive?), data quality (are required/scalar fields present?), and decision output (did records cross configured rules?). Never infer a quiet market or empty result from collection success alone.
- Flatten nested objects to dotted paths for coverage checks. Treat arrays as records when they represent events; avoid counting container nodes as scalar fields.
- Compare the current flattened snapshot with the previous run by path. Report added, removed, and changed values, including an explicit “no changes” result.
- Apply thresholds from the snapshot or caller configuration and list both passing and rejected candidates. A zero-signal result is valid output only when the raw snapshot, rule set, and rejection reason are retained.
- Return a compact audit with: parse status, collection count, scalar-field count, changed-field count, signal count, warnings, and a decision log.
Interpretation
- Valid JSON + records present + zero signals means the decision layer is quiet, not that the pipeline failed.
- Missing records or too few scalar fields is a data-quality warning and should lower confidence.
- Threshold changes can explain a changed signal count even when source records are unchanged; diff the rule paths explicitly.
- Never invent missing fields or silently coerce malformed values.
Output contract
Use stable keys: parse, collection, quality, diff, signals, warnings, decision. Keep raw input available for reproducibility and avoid sending it to external services unless the user explicitly asks.