{"record":{"id":"bf05b8284ea170cc","repo":"rohitg00/ai-engineering-from-scratch","slug":"no-branch-crossed-the-paper-threshold","errorCode":null,"errorMessage":"no branch crossed the paper threshold","messagePattern":"no branch crossed the paper threshold","errorType":"exception","errorClass":"NoTriggerError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/57-end-to-end-research-demo/code/main.py","lineNumber":129,"sourceCode":"        }\n\n\ndef make_seed_hypotheses() -> list[Hypothesis]:\n    \"\"\"Three seed hypotheses, one per research branch. Stand-in for lessons 50-53.\"\"\"\n    return [\n        Hypothesis(id=\"h-alpha-1\", branch=\"alpha\", payload={\"q\": \"method-x\"}),\n        Hypothesis(id=\"h-beta-1\", branch=\"beta\", payload={\"q\": \"method-y\"}),\n        Hypothesis(id=\"h-gamma-1\", branch=\"gamma\", payload={\"q\": \"method-z\"}),\n    ]\n\n\ndef pick_best_branch(scheduler_report: SchedulerReport) -> tuple[str, float]:\n    \"\"\"Pick the branch with the highest mean reward among triggered branches.\n\n    Ties break alphabetically by branch id (deterministic).\n    \"\"\"\n    if not scheduler_report.paper_triggers:\n        raise NoTriggerError(\"no branch crossed the paper threshold\")\n    by_branch = {b.branch: b for b in scheduler_report.branches}\n    triggered = [by_branch[name] for name in scheduler_report.paper_triggers if name in by_branch]\n    if not triggered:\n        raise BestResultError(\"trigger list empty after lookup\")\n    triggered.sort(key=lambda b: (-b.mean, b.branch))\n    best = triggered[0]\n    return best.branch, best.mean\n\n\ndef _originality_for_reward(reward: float) -> str:\n    if reward >= 0.8:\n        return \"high\"\n    if reward >= 0.6:\n        return \"medium\"\n    return \"low\"\n\n\ndef build_mini_paper(branch: str, reward: float) -> MiniPaper:","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/57-end-to-end-research-demo/code/main.py#L111-L147","documentation":"Error \"no branch crossed the paper threshold\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/57-end-to-end-research-demo/code/main.py:129 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"}