{"record":{"id":"a1a99d2f5a94f9a7","repo":"rohitg00/ai-engineering-from-scratch","slug":"threshold-must-be-an-integer-from-1-through-the-nu","errorCode":null,"errorMessage":"threshold must be an integer from 1 through the number of trigger terms","messagePattern":"threshold must be an integer from 1 through the number of trigger terms","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/13-tools-and-protocols/27-skill-evals-packaging-and-portability/outputs/skill-release-gate/scripts/evaluate_skill.py","lineNumber":544,"sourceCode":"                missing.append(\"companion-files\")\n            if requirements[\"scriptExecution\"] and not host[\"runsBundledScripts\"]:\n                missing.append(\"script-execution\")\n            unsupported = set(requirements[\"runtimeExtensions\"]) - set(host[\"supportedExtensions\"])\n            missing.extend(f\"extension:{name}\" for name in sorted(unsupported))\n            status = \"native\" if not missing else \"adapter-required\"\n        rows.append({\"host\": host[\"name\"], \"status\": status, \"missing\": missing})\n    return rows\n\n\ndef validate_configuration(\n    case_config: dict[str, object], host_config: dict[str, object]\n) -> None:\n    terms = case_config.get(\"triggerTerms\")\n    if not isinstance(terms, list) or not terms or not all(isinstance(term, str) for term in terms):\n        raise ValueError(\"triggerTerms must be a non-empty array of strings\")\n    threshold = case_config.get(\"threshold\")\n    if type(threshold) is not int or not 1 <= threshold <= len(set(terms)):\n        raise ValueError(\"threshold must be an integer from 1 through the number of trigger terms\")\n    runs = case_config.get(\"runs\")\n    if type(runs) is not int or runs < 1:\n        raise ValueError(\"runs must be a positive integer\")\n    for field in (\"minimumPrecision\", \"minimumRecall\", \"minimumRepeatRate\"):\n        value = case_config.get(field)\n        if (\n            isinstance(value, bool)\n            or not isinstance(value, (int, float))\n            or not math.isfinite(value)\n            or not 0.0 <= value <= 1.0\n        ):\n            raise ValueError(f\"{field} must be a finite number from 0 to 1\")\n    cases = case_config.get(\"cases\")\n    if not isinstance(cases, list) or not cases:\n        raise ValueError(\"cases must be a non-empty array\")\n    if not all(\n        isinstance(case, dict)\n        and isinstance(case.get(\"id\"), str)","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/13-tools-and-protocols/27-skill-evals-packaging-and-portability/outputs/skill-release-gate/scripts/evaluate_skill.py#L526-L562","documentation":"Error \"threshold must be an integer from 1 through the number of trigger terms\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/13-tools-and-protocols/27-skill-evals-packaging-and-portability/outputs/skill-release-gate/scripts/evaluate_skill.py:544 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"}