{"record":{"id":"5e8d35af95982837","repo":"rohitg00/ai-engineering-from-scratch","slug":"unknown-post-process-rule-rule","errorCode":null,"errorMessage":"unknown post_process rule: {rule}","messagePattern":"unknown post_process rule: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/70-task-spec-format/code/main.py","lineNumber":262,"sourceCode":"    if rule == \"strip_whitespace\":\n        return text.strip()\n    if rule == \"lower\":\n        return text.lower()\n    if rule == \"extract_letter\":\n        m = LETTER_RE.search(text)\n        if m:\n            return m.group(1)\n        m2 = LETTER_FALLBACK_RE.search(text)\n        return m2.group(0) if m2 else \"\"\n    if rule == \"extract_code_block\":\n        m = CODE_BLOCK_RE.search(text)\n        return m.group(1) if m else text\n    if rule == \"extract_first_line\":\n        for line in text.splitlines():\n            if line.strip():\n                return line.strip()\n        return \"\"\n    raise ValueError(f\"unknown post_process rule: {rule}\")\n\n\ndef fixture_tasks() -> list[dict]:\n    return [\n        {\n            \"task_id\": \"arith_001\",\n            \"category\": \"arithmetic\",\n            \"prompt\": \"Compute the result.\\nQuestion: 17 + 24\\nAnswer:\",\n            \"targets\": [\"41\"],\n            \"metric_name\": \"exact_match\",\n            \"post_process\": \"strip_whitespace\",\n            \"few_shot_examples\": [{\"prompt\": \"Question: 2 + 2\\nAnswer:\", \"completion\": \"4\"}],\n            \"metadata\": {\"difficulty\": \"easy\"},\n        },\n        {\n            \"task_id\": \"arith_002\",\n            \"category\": \"arithmetic\",\n            \"prompt\": \"Compute the result.\\nQuestion: 144 / 12\\nAnswer:\",","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/70-task-spec-format/code/main.py#L244-L280","documentation":"Error \"unknown post_process rule: {rule}\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/70-task-spec-format/code/main.py:262 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"}