{"record":{"id":"84ad626a9ab4ec8d","repo":"affaan-m/ECC","slug":"orch-review-args-must-be-an-object","errorCode":null,"errorMessage":"orch-review: args must be an object","messagePattern":"orch-review: args must be an object","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"workflows/orch-review.workflow.js","lineNumber":159,"sourceCode":"    diff,\n    '----- END DIFF -----'\n  ].join('\\n');\n}\n\n// --- main -----------------------------------------------------------------\n\n// `args` arrives verbatim. Accept a JSON-encoded string too, so the workflow\n// works whether the caller passes an object or a stringified payload.\n// Fail CLOSED on invalid input: a review gate must never silently APPROVE a\n// payload it could not actually review.\nlet input;\ntry {\n  input = typeof args === 'string' ? JSON.parse(args) : (args ?? {});\n} catch {\n  throw new Error('orch-review: args must be an object or valid JSON');\n}\nif (typeof input !== 'object' || input === null) {\n  throw new Error('orch-review: args must be an object');\n}\nif (typeof input.diff !== 'string' || input.diff.trim() === '') {\n  throw new Error('orch-review: args.diff must be a non-empty unified diff');\n}\nif (input.changedFiles != null && !Array.isArray(input.changedFiles)) {\n  throw new Error('orch-review: args.changedFiles must be an array of paths');\n}\n// Every entry must be a string path. A non-string (e.g. { path: '...' }) would\n// stringify to \"[object Object]\" and silently poison the security-trigger\n// haystack — fail closed on malformed input instead.\nif (Array.isArray(input.changedFiles) && !input.changedFiles.every(f => typeof f === 'string')) {\n  throw new Error('orch-review: args.changedFiles must contain only string paths');\n}\n\nconst diff = input.diff;\nconst haystack = `${diff}\\n${(input.changedFiles || []).join('\\n')}`;\n\n// Build the review dimensions immutably. Quality always runs; language +","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/workflows/orch-review.workflow.js#L141-L177","documentation":"Error \"orch-review: args must be an object\" thrown in affaan-m/ECC.","triggerScenarios":"Thrown at workflows/orch-review.workflow.js:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wrap the review payload in an object; bare strings, numbers, or arrays are rejected.","Ensure the top-level JSON value is an object with a 'diff' key, not a JSON array or scalar."],"exampleFix":"// bad: '[\"file.js\"]'\n// good: '{\"diff\": \"...\", \"changedFiles\": [\"file.js\"]}'","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}