A prose summary is useful to read, but a workflow needs fields it can inspect. Ask the assistant for a small JSON record: run_id, status and the cited log line. JSON syntax only establishes that a parser can read the text. A schema establishes the types and required keys. Neither proves that the cited line actually supports the diagnosis.
Layer | Example rejection | Owner |
|---|---|---|
Parsing | Unclosed quote or an explanation outside the JSON object. | A JSON parser. |
Shape and types | Unknown status, missing evidence, Boolean used where an integer is required. | A schema or explicit validator. |
Meaning | Line 12 exists but refers to another test; a count is inconsistent with the source. | Source checks, arithmetic and an engineering reviewer. |
import json
def validate(text, known_runs):
try:
rec = json.loads(text)
except (ValueError, TypeError):
return False
if type(rec) is not dict or set(rec) != {"run_id", "status", "line"}:
return False
if type(rec["run_id"]) is not str or rec["run_id"] not in known_runs:
return False
if type(rec["status"]) is not str or rec["status"] not in {"PASS", "FAIL"}:
return False
if type(rec["line"]) is not int or rec["line"] < 1:
return False
return True
known = {"run-014"}
assert validate('{"run_id":"run-014","status":"FAIL","line":12}', known)
assert not validate('{"run_id":"run-014","status":"FAIL","line":true}', known)
assert not validate('{"run_id":"unknown","status":"FAIL","line":12}', known)
print("PASS: synthetic record shape checks; source meaning must still be reviewed")This standard-library example validates a deliberately tiny contract. It accepts only three keys and does not inspect a real source file. The strict Python type check matters because bool is a subclass of int. A production workflow should use its established schema library and define the permitted fields explicitly; do not silently coerce a surprising value and then execute it.
A reply has the required keys and cites line 12. The actual error is on line 21, while line 12 contains a routine startup message. Explain why this record must not be accepted as an engineering diagnosis. Record an unresolved question in the human review note, outside this example's strict three-key JSON record. A richer schema could explicitly add an unresolved_questions field, but both producer and validator must agree before changing the format.
No. Parsing, schema compliance, factual support and permission are separate. The cited source does not support the claim. Keep the failure observation, mark the cause unconfirmed and request the relevant source context.