{"record":{"id":"26a6f220efa5048e","repo":"affaan-m/ECC","slug":"orch-review-args-changedfiles-must-be-an-array-of","errorCode":null,"errorMessage":"orch-review: args.changedFiles must be an array of paths","messagePattern":"orch-review: args\\.changedFiles must be an array of paths","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"workflows/orch-review.workflow.js","lineNumber":165,"sourceCode":"\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 +\n// security are conditional, spread in rather than pushed onto a shared array.\nconst langReviewer = input.language && LANGUAGE_REVIEWER[String(input.language).toLowerCase()];\nconst securityNeeded = SECURITY_TRIGGER.test(haystack);\nconst dimensions = [\n  { key: 'quality', label: 'correctness & quality', agentType: 'ecc:code-reviewer' },\n  ...(langReviewer ? [{ key: `lang:${input.language}`, label: `${input.language} idioms & pitfalls`, agentType: langReviewer }] : []),","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/workflows/orch-review.workflow.js#L147-L183","documentation":"Error \"orch-review: args.changedFiles must be an array of paths\" thrown in affaan-m/ECC.","triggerScenarios":"Thrown at workflows/orch-review.workflow.js:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass changedFiles as an array of path strings, or omit the field entirely.","If you only have a single file, wrap it: changedFiles: ['path/to/file.js']."],"exampleFix":"// bad: changedFiles: 'src/a.js'\n// good: changedFiles: ['src/a.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"}