{"record":{"id":"d9402624fc831ee4","repo":"paperclipai/paperclip","slug":"pass-exactly-one-of-approve-reject-or-requ","errorCode":null,"errorMessage":"Pass exactly one of --approve, --reject, or --request-changes.","messagePattern":"Pass exactly one of --approve, --reject, or --request-changes\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/pipelines.ts","lineNumber":741,"sourceCode":"}\n\nfunction looksLikeUuid(value: string): boolean {\n  return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);\n}\n\nfunction exactlyOneFlag(first: boolean | undefined, second: boolean | undefined, firstName: string, secondName: string): string {\n  if (Boolean(first) === Boolean(second)) throw new Error(`Pass exactly one of ${firstName} or ${secondName}.`);\n  return first ? firstName : secondName;\n}\n\nfunction reviewDecisionFromOptions(opts: ReviewOptions): \"approve\" | \"reject\" | \"request_changes\" {\n  const selected = [\n    opts.approve ? { flag: \"--approve\", decision: \"approve\" as const } : null,\n    opts.reject ? { flag: \"--reject\", decision: \"reject\" as const } : null,\n    opts.requestChanges ? { flag: \"--request-changes\", decision: \"request_changes\" as const } : null,\n  ].filter((item): item is NonNullable<typeof item> => item !== null);\n  if (selected.length !== 1) {\n    throw new Error(\"Pass exactly one of --approve, --reject, or --request-changes.\");\n  }\n  return selected[0]!.decision;\n}\n\nfunction printPipeline(row: PipelineDetail | PipelineSummary | null, ctx: ResolvedClientContext): void {\n  if (!row) return printOutput(null, { json: ctx.json });\n  if (ctx.json) return printOutput(row, { json: true });\n  console.log(formatPipeline(row));\n  if (\"stages\" in row && row.stages?.length) {\n    console.log(pc.bold(\"Stages\"));\n    row.stages.forEach((stage) => {\n      console.log(`  ${formatInlineRecord({\n        id: stage.id,\n        key: stage.key,\n        name: stage.name,\n        kind: stage.kind,\n        position: stage.position,\n      })}`);","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/pipelines.ts#L723-L759","documentation":"reviewDecisionFromOptions counted the decision flags and found zero or more than one of --approve/--reject/--request-changes; a review must carry exactly one decision.","triggerScenarios":"Thrown at cli/src/commands/pipelines.ts:741 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass exactly one of --approve, --reject, or --request-changes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}