feat: add task records and verified engineering check jobs

This commit is contained in:
Agent Workbench Dev
2026-10-29 14:03:50 +08:00
parent 93f4d90ccb
commit 2ea34850c4
26 changed files with 2703 additions and 56 deletions
+6 -1
View File
@@ -15,7 +15,12 @@ export class ArtifactStore {
const file = path.join(this.root, relative);
fs.mkdirSync(path.dirname(file), { recursive: true });
if (fs.lstatSync(path.dirname(file)).isSymbolicLink() || fs.existsSync(file) && fs.lstatSync(file).isSymbolicLink()) throw new Error('执行工件不能通过链接写入。');
if (!fs.existsSync(file)) {
if (fs.existsSync(file)) {
const existing = fs.readFileSync(file);
if (existing.length !== bytes.length || createHash('sha256').update(existing).digest('hex') !== sha256) {
throw new Error('已有执行工件校验失败,实际结果需要核对。');
}
} else {
const temporary = file + '.' + randomUUID() + '.tmp';
const handle = fs.openSync(temporary, 'wx', 0o600);
try { fs.writeFileSync(handle, bytes); fs.fsyncSync(handle); } finally { fs.closeSync(handle); }