Files
memind/goal-run-policy.mjs
T
john 666db0b939 feat(goal-run): add multi-checkpoint goal orchestration with H5 and admin surfaces.
Persist goal runs in MySQL, bind agent runs to checkpoints, expose awaiting-approval
UX in chat, and add admin inspection routes with local verify scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 17:03:16 +08:00

15 lines
455 B
JavaScript

function envFlag(value, fallback = false) {
const raw = String(value ?? '').trim().toLowerCase();
if (!raw) return fallback;
return ['1', 'true', 'yes', 'on'].includes(raw);
}
export function shouldRequireCheckpointApproval({
env = process.env,
pendingCheckpointCount = 0,
totalCheckpointCount = 1,
} = {}) {
if (envFlag(env.GOAL_RUN_REQUIRE_APPROVAL, false)) return true;
return pendingCheckpointCount > 0 && totalCheckpointCount > 1;
}