MCPcopy Create free account
hub / github.com/EvoMap/evolver / rejectPendingRun

Function rejectPendingRun

index.js:358–378  ·  view source on GitHub ↗

* Mark a pending evolution run as rejected (state-only, no git rollback). * @param {string} statePath - Path to evolution_solidify_state.json * @returns {boolean} true if a pending run was found and rejected

(statePath)

Source from the content-addressed store, hash-verified

356 * @returns {boolean} true if a pending run was found and rejected
357 */
358function rejectPendingRun(statePath) {
359 try {
360 const state = readJsonSafe(statePath);
361 if (state && state.last_run && state.last_run.run_id) {
362 state.last_solidify = {
363 run_id: state.last_run.run_id,
364 rejected: true,
365 reason: 'loop_bridge_disabled_autoreject_no_rollback',
366 timestamp: new Date().toISOString(),
367 };
368 const tmp = `${statePath}.tmp`;
369 fs.writeFileSync(tmp, JSON.stringify(state, null, 2) + '\n', 'utf8');
370 fs.renameSync(tmp, statePath);
371 return true;
372 }
373 } catch (e) {
374 console.warn('[Loop] Failed to clear pending run state: ' + (e.message || e));
375 }
376
377 return false;
378}
379
380function isPendingSolidify(state) {
381 const lastRun = state && state.last_run ? state.last_run : null;

Callers 2

mainFunction · 0.85
loopMode.test.jsFile · 0.85

Calls 1

readJsonSafeFunction · 0.70

Tested by

no test coverage detected