fix(profiles): bind routing receipts and harden review paths

This commit is contained in:
haelyra
2026-09-27 18:01:40 -04:00
parent a9e3ecb77f
commit befde0d2cd
11 changed files with 99 additions and 18 deletions
+3 -1
View File
@@ -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 => {
+5 -3
View File
@@ -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;
}