Lint rule: block new UPDATE tasks SET status outside advanceTaskPhase (B2 Phase 1 step 5/5)

This commit is contained in:
ZacharyZhang-NY committed 2026-04-20 13:00:53 -04:00
1 parent ab4afba9c7
commit 411294afa6
4 files changed
+41

No files matched your search

+1
View File
@@ -161,6 +161,7 @@ export function buildRunMethods(
// NOT EXISTS clause is the canonical "no live owner" check.
getDb()
.prepare(
// eslint-disable-next-line no-restricted-syntax -- B2 Phase 1 grandfathered: finishRun's "runNeverStarted" rollback; trigger mirrors status→phase, shadow lease already dropped above
`UPDATE tasks
SET status = 'todo',
checkout_run_id = NULL,
+2
View File
@@ -377,6 +377,7 @@ export function buildTaskStatusMethods(
): void {
const ts = nowIso();
getDb()
// eslint-disable-next-line no-restricted-syntax -- B2 Phase 1 grandfathered: crash-recovery retry bounces task back to todo; trigger mirrors status→phase, no lease held at this point
.prepare("update tasks set status = 'todo', updated_at = ? where id = ?")
.run(ts, taskId);
getDb()
@@ -402,6 +403,7 @@ export function buildTaskStatusMethods(
markInterruptedTaskFailed(taskId: string): void {
const ts = nowIso();
getDb()
// eslint-disable-next-line no-restricted-syntax -- B2 Phase 1 grandfathered: crash-recovery terminal transition; trigger mirrors status→phase, lease was already cleared by interruptStaleRuns
.prepare("update tasks set status = 'cancelled', updated_at = ? where id = ?")
.run(ts, taskId);
},