{"record":{"id":"b90ac40ac26e04b2","repo":"rohitg00/ai-engineering-from-scratch","slug":"unknown-direction-self-direction-r","errorCode":null,"errorMessage":"unknown direction {self.direction!r}","messagePattern":"unknown direction (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/53-result-evaluator/code/main.py","lineNumber":48,"sourceCode":"\n    The runner in lesson 52 emits the same fields. The lesson 53 tests\n    construct lightweight instances directly so the evaluator can be tested\n    in isolation.\n    \"\"\"\n    spec_id: str\n    terminal: str\n    metrics: dict\n\n\n@dataclass\nclass MetricSpec:\n    name: str\n    direction: str = HIGHER\n    scale: str = LINEAR\n\n    def validate(self) -> None:\n        if self.direction not in (HIGHER, LOWER):\n            raise ValueError(f\"unknown direction {self.direction!r}\")\n        if self.scale not in (LINEAR, LOG):\n            raise ValueError(f\"unknown scale {self.scale!r}\")\n\n\n@dataclass\nclass Verdict:\n    hypothesis_id: int\n    metric: str\n    direction: str\n    scale: str\n    candidate_mean: float\n    baseline_mean: float\n    improvement: float\n    p_value: float | None\n    significance_threshold: float\n    improvement_threshold: float\n    verdict: str\n    rationale: str","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/53-result-evaluator/code/main.py#L30-L66","documentation":"Error \"unknown direction {self.direction!r}\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/53-result-evaluator/code/main.py:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}