{"record":{"id":"9a490c214563a2d8","repo":"affaan-m/ECC","slug":"missing-required-field-e-at-line-i","errorCode":null,"errorMessage":"Missing required field {e} at line {i}","messagePattern":"Missing required field (.+?) at line (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/skill-comply/scripts/parser.py","lineNumber":72,"sourceCode":"        return []\n\n    events: list[ObservationEvent] = []\n    for i, line in enumerate(text.splitlines(), 1):\n        try:\n            raw = json.loads(line)\n        except json.JSONDecodeError as e:\n            raise ValueError(f\"Invalid JSON at line {i}: {e}\") from e\n        try:\n            events.append(ObservationEvent(\n                timestamp=raw[\"timestamp\"],\n                event=raw[\"event\"],\n                tool=raw[\"tool\"],\n                session=raw[\"session\"],\n                input=raw.get(\"input\", \"\"),\n                output=raw.get(\"output\", \"\"),\n            ))\n        except KeyError as e:\n            raise ValueError(f\"Missing required field {e} at line {i}\") from e\n\n    return sorted(events, key=lambda e: e.timestamp)\n\n\ndef parse_spec(path: Path) -> ComplianceSpec:\n    \"\"\"Parse a YAML compliance spec file.\"\"\"\n    if not path.is_file():\n        raise FileNotFoundError(f\"Spec file not found: {path}\")\n    raw = yaml.safe_load(path.read_text())\n\n    steps: list[Step] = []\n    for s in raw[\"steps\"]:\n        d = s[\"detector\"]\n        steps.append(Step(\n            id=s[\"id\"],\n            description=s[\"description\"],\n            required=s[\"required\"],\n            detector=Detector(","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/skill-comply/scripts/parser.py#L54-L90","documentation":"KeyError guard in parse_trace: an event line parsed as JSON but is missing one of the required fields (timestamp, event, tool, or session). The missing field name and line number are included in the message.","triggerScenarios":"Thrown at skills/skill-comply/scripts/parser.py:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the named required field to the event object on the reported line","Check the observation schema docs for the full required-field list","Regenerate the trace with a recorder version that emits all required fields"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}