{"record":{"id":"1a4a4ea7f86791c3","repo":"rohitg00/ai-engineering-from-scratch","slug":"unknown-hook-topic-topic","errorCode":null,"errorMessage":"unknown hook topic: {topic}","messagePattern":"unknown hook topic: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py","lineNumber":126,"sourceCode":"    state: State\n    payload: dict\n\n\n@dataclass\nclass SessionResult:\n    state: State\n    reason: str\n    steps: list[Step]\n    events: list[Event]\n\n\nclass HookRegistry:\n    def __init__(self) -> None:\n        self._subs: dict[str, list[Callable[[dict], Any]]] = {t: [] for t in HOOK_TOPICS}\n\n    def on(self, topic: str, fn: Callable[[dict], Any]) -> None:\n        if topic not in self._subs:\n            raise ValueError(f\"unknown hook topic: {topic}\")\n        self._subs[topic].append(fn)\n\n    def fire(self, topic: str, payload: dict) -> list[Any]:\n        results = []\n        for fn in self._subs[topic]:\n            results.append(fn(payload))\n        return results\n\n\nPlanner = Callable[[str, list[Step]], list[Step]]\n\n\ndef _default_planner(goal: str, history: list[Step]) -> list[Step]:\n    \"\"\"Deterministic stand-in planner. Returns a fixed three-step plan.\"\"\"\n    if history:\n        return []\n    return [\n        Step(id=1, description=f\"interpret goal: {goal}\", requires_tool=False),","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py#L108-L144","documentation":"Error \"unknown hook topic: {topic}\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/20-agent-harness-loop-contract/code/main.py:126 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"}