affaan-m/ECC · error · Error
Unable to infer ECC repo root from install-state operations
Error message
Unable to infer ECC repo root from install-state operations
What it means
The `diff` field is mandatory in the orch-review payload and must be a non-empty string containing a unified diff. This throw fires when `diff` is missing, not a string (e.g. an array of lines), or is empty/whitespace-only. Without a real diff there is nothing for any review dimension to evaluate, so the gate rejects rather than approving an empty review.
Source
Thrown at scripts/auto-update.js:80
if (typeof operation.sourceRelativePath !== 'string' || !operation.sourceRelativePath.trim()) {
continue;
}
const relativeParts = operation.sourceRelativePath.split(/[\\/]+/).filter(Boolean);
if (relativeParts.length === 0) {
continue;
}
let repoRoot = path.resolve(operation.sourcePath);
for (let index = 0; index < relativeParts.length; index += 1) {
repoRoot = path.dirname(repoRoot);
}
return repoRoot;
}
throw new Error('Unable to infer ECC repo root from install-state operations');
}
function buildInstallApplyArgs(record) {
const state = record.state;
const target = state.target.target || record.adapter.target;
const request = state.request || {};
const args = [];
if (target) {
args.push('--target', target);
}
if (request.profile) {
args.push('--profile', request.profile);
}
if (Array.isArray(request.modules) && request.modules.length > 0) {
args.push('--modules', request.modules.join(','));View on GitHub (pinned to 01e15490f0)
Solutions
- Generate the diff from real changes: const diff = execSync('git diff HEAD~1').toString(); and only call orchReview if diff.trim() is non-empty.
- If diff is stored as an array of lines, join it: diff: lines.join('\n').
- Skip the review gate entirely when there are no changes rather than passing an empty diff.
Example fix
// before
orchReview({ diff: '', changedFiles: ['a.js'] }); // empty diff
// after
const diff = execSync('git diff --cached').toString();
if (diff.trim()) orchReview({ diff, changedFiles: ['a.js'] }); Defensive patterns
Strategy: validation
Validate before calling
// Only call the gate when there is a real, non-empty diff.
const diff = execSync('git diff --cached').toString();
if (typeof diff !== 'string' || diff.trim() === '') {
console.log('No changes to review — skipping orch-review.');
} else {
orchReview({ diff, changedFiles });
} Type guard
function hasNonEmptyDiff(p) {
return p && typeof p.diff === 'string' && p.diff.trim().length > 0;
} Prevention
- Skip the review gate when the diff is empty rather than passing an empty string.
- If you store diff as an array of lines, join with '\n' before passing.
- Generate the diff from a real git command, not a hardcoded constant.
When it happens
Trigger: Omitting diff entirely ({ changedFiles: [...] }); passing diff as an array of lines; passing diff: '' or diff: ' '; passing a diff produced by `git diff` with --no-patch or when there are no staged changes.
Common situations: The migration/commit produced no diff (nothing changed) and the caller still invoked the review gate; caller stored diff as an array and forgot to .join('\n'); a stale or cached empty diff was reused.
Related errors
- ECC_PROJECT_DIR must be a child path within /workspace.
- Unknown argument: ${arg}
- Invalid ECC repo root: missing package.json at ${packageJson
- Invalid ECC repo root: missing install script at ${installAp
- Project memory .gitignore does not contain the required fail
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/ae4a6de6f29e0389.
Report an issue: GitHub.