Fixes review findings before Slice 5. Resolver: resolveOutcome + WORK_STATUS_FOR_OUTCOME + lifecycle fixes. Execution: bounded finishAttempt retry, terminal Work status preservation, slice validation, bounded reconciliation with 30s cron. Planning: revision guards, durable submitQuestion, design-approval invalidation. Primitives 69 (+4), backend 22 (+10) tests; root typecheck/build/Ultracite pass.
20 lines
525 B
TypeScript
20 lines
525 B
TypeScript
import { cronJobs, makeFunctionReference } from "convex/server";
|
|
|
|
// Reconciles attempts whose worker lease expired (crash/restart). The target
|
|
// is referenced by string so this file does not depend on regenerated codegen.
|
|
const reconcileRef = makeFunctionReference<
|
|
"mutation",
|
|
Record<string, never>,
|
|
{ reconciled: number } | null
|
|
>("workExecution:reconcileExpiredAttempts");
|
|
|
|
const crons = cronJobs();
|
|
|
|
crons.interval(
|
|
"reconcile expired work attempts",
|
|
{ seconds: 30 },
|
|
reconcileRef
|
|
);
|
|
|
|
export default crons;
|