MCPcopy Create free account
hub / github.com/SethGammon/Citadel / appendLoopRun

Function appendLoopRun

core/loops/registry.js:70–89  ·  view source on GitHub ↗
(projectRoot, id, run = {}, options = {})

Source from the content-addressed store, hash-verified

68}
69
70function appendLoopRun(projectRoot, id, run = {}, options = {}) {
71 const current = readLoop(projectRoot, id);
72 if (!current) throw new Error(`Loop not found: ${id}`);
73 const entry = {
74 attempt: Number(run.attempt || (current.runs || []).length + 1),
75 status: normalizeStatus(run.status || 'running'),
76 summary: run.summary || '',
77 command: run.command || null,
78 verifier: run.verifier || null,
79 exitCode: Number.isInteger(run.exitCode) ? run.exitCode : null,
80 startedAt: run.startedAt || nowIso(options),
81 completedAt: run.completedAt || nowIso(options),
82 evidence: run.evidence || [],
83 };
84 current.runs = [...(current.runs || []), entry];
85 current.status = entry.status;
86 current.updatedAt = nowIso(options);
87 writeJson(loopPath(projectRoot, id), current);
88 return current;
89}
90
91function stopLoop(projectRoot, id, status = 'stopped', reason = '', options = {}) {
92 return updateLoop(projectRoot, id, {

Callers 2

test-loops.jsFile · 0.85
mainFunction · 0.85

Calls 5

readLoopFunction · 0.85
loopPathFunction · 0.85
normalizeStatusFunction · 0.70
nowIsoFunction · 0.70
writeJsonFunction · 0.70

Tested by

no test coverage detected