feat(daemon+store+api): verdict硬闸+执行期锁+conflict优先+schema

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-14 12:27:48 +08:00
parent ae9ff7a469
commit f8900de2f7
6 changed files with 83 additions and 5 deletions
+3
View File
@@ -204,6 +204,9 @@ export function buildServer(opts: ApiOptions): FastifyInstance {
// 部分更新任务(title/priority/complexitycomplexity 重置逻辑在 Store.patchTask
app.patch('/api/tasks/:id', (req) => {
const { id } = req.params as { id: string };
if (store.hasInflightRun(id)) {
throw new StoreError('任务有在途 run,执行期间禁止修改');
}
const b = (req.body ?? {}) as Record<string, unknown>;
const patch: PatchTaskInput = {};
if (b.title !== undefined) patch.title = String(b.title);