feat: journal reviewed multi-file changes and recover interrupted batches

This commit is contained in:
Agent Workbench Dev
2026-10-29 18:45:05 +08:00
parent c89cb2d593
commit 5d03af968c
20 changed files with 741 additions and 16 deletions
+2
View File
@@ -1,5 +1,6 @@
import fs from 'node:fs';
import path from 'node:path';
import { assertChangeSetsResolved } from '../shared/contracts/change-sets.mjs';
import { spawn } from 'node:child_process';
import { createHash, randomUUID } from 'node:crypto';
import { createTwoFilesPatch, diffLines } from 'diff';
@@ -68,6 +69,7 @@ export class GitDelivery {
return result;
}
assertTask(session) {
assertChangeSetsResolved(this.store, session.projectId, { includePrepared: true });
if (!session.taskId || !session.runId) throw conflict('先发送一个项目任务,再准备本任务的Git交付。');
const task = this.store.owned('task', session.taskId, session.id), run = this.store.owned('run', session.runId, session.id);
if (run.taskId !== task.id) throw conflict('当前Task和Run归属不一致。');