mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-28 12:35:13 +02:00
fix(profiles): bind routing receipts and harden review paths
This commit is contained in:
@@ -43,6 +43,10 @@ function parseFlags(argv) {
|
||||
flags[arg.slice(2).replace(/-([a-z])/g, (_, c) => c.toUpperCase())] = argv[index += 1];
|
||||
} else throw new Error(`Unknown flag: ${arg}`);
|
||||
}
|
||||
if (!/^[1-9][0-9]*$/.test(String(flags.batch)) || !Number.isSafeInteger(Number(flags.batch))) {
|
||||
throw new Error('--batch must be a positive integer');
|
||||
}
|
||||
flags.batch = Number(flags.batch);
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,9 @@ function resolveTaskContext({ repoRoot = DEFAULT_REPO_ROOT, task, profileId = 'l
|
||||
if (excluded.has(id)) throw new Error(`Context ID is excluded: ${id}`);
|
||||
});
|
||||
const taskBinding = { sessionId: task.sessionId, taskId: task.taskId, revision: task.revision, phase: task.phase };
|
||||
const bindingDigest = digestObject({ ...taskBinding, planDigest: plan.planDigest, routingPolicyVersion: ROUTING_POLICY_VERSION });
|
||||
const bindingDigest = digestObject({ ...taskBinding, planDigest: plan.planDigest,
|
||||
routingPolicyVersion: ROUTING_POLICY_VERSION, triggersDigest: digestObject(triggers),
|
||||
queryDigest: digestObject(task.query || '') });
|
||||
const reused = Boolean(previous && previous.bindingDigest === bindingDigest && !task.noWorkflow
|
||||
&& ['selected', 'none'].includes(previous.decision) && !explicitIds.length && !proposedIds.length);
|
||||
const admissible = id => {
|
||||
|
||||
@@ -195,9 +195,11 @@ function sameRepoIdentity(a, b) {
|
||||
if (!a || !b) return false;
|
||||
if (normalizeRepoPath(a) === normalizeRepoPath(b)) return true;
|
||||
try {
|
||||
const sa = fs.statSync(a);
|
||||
const sb = fs.statSync(b);
|
||||
return sa.ino !== 0 && sa.dev === sb.dev && sa.ino === sb.ino;
|
||||
// Windows file IDs can exceed Number.MAX_SAFE_INTEGER; rounded IDs may
|
||||
// otherwise make distinct files look identical.
|
||||
const sa = fs.statSync(a, { bigint: true });
|
||||
const sb = fs.statSync(b, { bigint: true });
|
||||
return sa.ino !== 0n && sa.dev === sb.dev && sa.ino === sb.ino;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user