affaan-m/ECC · error · Error
orch-review: args.diff must be a non-empty unified diff
Error message
orch-review: args.diff must be a non-empty unified diff
What it means
Error "orch-review: args.diff must be a non-empty unified diff" thrown in affaan-m/ECC.
Source
Thrown at workflows/orch-review.workflow.js:162
}
// --- main -----------------------------------------------------------------
// `args` arrives verbatim. Accept a JSON-encoded string too, so the workflow
// works whether the caller passes an object or a stringified payload.
// Fail CLOSED on invalid input: a review gate must never silently APPROVE a
// payload it could not actually review.
let input;
try {
input = typeof args === 'string' ? JSON.parse(args) : (args ?? {});
} catch {
throw new Error('orch-review: args must be an object or valid JSON');
}
if (typeof input !== 'object' || input === null) {
throw new Error('orch-review: args must be an object');
}
if (typeof input.diff !== 'string' || input.diff.trim() === '') {
throw new Error('orch-review: args.diff must be a non-empty unified diff');
}
if (input.changedFiles != null && !Array.isArray(input.changedFiles)) {
throw new Error('orch-review: args.changedFiles must be an array of paths');
}
// Every entry must be a string path. A non-string (e.g. { path: '...' }) would
// stringify to "[object Object]" and silently poison the security-trigger
// haystack — fail closed on malformed input instead.
if (Array.isArray(input.changedFiles) && !input.changedFiles.every(f => typeof f === 'string')) {
throw new Error('orch-review: args.changedFiles must contain only string paths');
}
const diff = input.diff;
const haystack = `${diff}\n${(input.changedFiles || []).join('\n')}`;
// Build the review dimensions immutably. Quality always runs; language +
// security are conditional, spread in rather than pushed onto a shared array.
const langReviewer = input.language && LANGUAGE_REVIEWER[String(input.language).toLowerCase()];
const securityNeeded = SECURITY_TRIGGER.test(haystack);View on GitHub (pinned to 01e15490f0)
Solutions
- Provide args.diff as a non-empty unified diff string; the review gate fails closed when there is nothing to review.
- Generate the diff first (e.g. git diff) and pass its full output; do not pass an empty or whitespace-only string.
Example fix
args = { diff: require('child_process').execSync('git diff', {encoding:'utf8'}), changedFiles: ['src/a.js'] } When it happens
Trigger: Thrown at workflows/orch-review.workflow.js:162 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/c3a79a1b9fa7f0ba.
Report an issue: GitHub.