{"version":3,"file":"taxonomy.cjs","names":[],"sources":["../../src/ci/taxonomy.ts"],"sourcesContent":["import type { VerdictClass } from \"./verdict.ts\";\n\n// The failure taxonomy (#3498). The single deterministic hinge between \"what the\n// tool honestly knows\" (the verdict class) and \"what the CI check concludes\".\n// Keeping it a pure function of the verdict class — not scattered `if` branches\n// at each call site — is what guarantees every condition gets the *right*\n// conclusion and the same one every time.\n\n/**\n * A GitHub check-run conclusion, narrowed to the three this loop uses.\n * `neutral` reports \"we didn't/couldn't decide\" without a red X; `failure`\n * blocks; `success` is the clean pass.\n */\nexport type CiConclusion = \"success\" | \"failure\" | \"neutral\";\n\nconst CLASS_TO_CONCLUSION: Record<VerdictClass, CiConclusion> = {\n  pass: \"success\",\n  // A known coverage gap, a real finding, and a conservative \"unverified\" flag\n  // all block the PR. They differ in their *reason and framing* (carried by the\n  // verdict), not in whether they gate — an uncertain result still fails, but\n  // with honest \"we're not sure, flagging to be safe\" messaging rather than a\n  // \"your query is broken\" claim.\n  \"coverage-gap\": \"failure\",\n  finding: \"failure\",\n  \"uncertain-conservative-flag\": \"failure\",\n  // Capture isn't emitting: a setup problem the user must fix, surfaced as a\n  // failure with setup next-steps — never silently green, or it reads as safe.\n  \"setup-broken\": \"failure\",\n  // A transient infra/transport error (e.g. a dropped WebSocket to the API) is\n  // not the user's query problem, so it resolves to neutral, never a red X\n  // (adopts #3401).\n  \"infra-error\": \"neutral\",\n};\n\n/** Map one verdict class to its CI conclusion. Total and deterministic. */\nexport function conclusionForVerdictClass(\n  verdictClass: VerdictClass,\n): CiConclusion {\n  return CLASS_TO_CONCLUSION[verdictClass];\n}\n\n/** Convenience over {@link conclusionForVerdictClass} for a whole verdict. */\nexport function conclusionForVerdict(verdict: {\n  verdictClass: VerdictClass;\n}): CiConclusion {\n  return conclusionForVerdictClass(verdict.verdictClass);\n}\n\n/** True when a class blocks the PR (a red check), as opposed to passing or neutral. */\nexport function isBlocking(verdictClass: VerdictClass): boolean {\n  return conclusionForVerdictClass(verdictClass) === \"failure\";\n}\n"],"mappings":";;AAeA,MAAM,sBAA0D;CAC9D,MAAM;CAMN,gBAAgB;CAChB,SAAS;CACT,+BAA+B;CAG/B,gBAAgB;CAIhB,eAAe;CAChB;;AAGD,SAAgB,0BACd,cACc;AACd,QAAO,oBAAoB;;;AAI7B,SAAgB,qBAAqB,SAEpB;AACf,QAAO,0BAA0B,QAAQ,aAAa;;;AAIxD,SAAgB,WAAW,cAAqC;AAC9D,QAAO,0BAA0B,aAAa,KAAK"}