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

Function recordAutomationRun

core/codex/native-integrations.js:120–140  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

118}
119
120function recordAutomationRun(options = {}) {
121 const projectRoot = path.resolve(options.projectRoot || process.cwd());
122 const id = options.id;
123 if (!id) throw new Error('recordAutomationRun requires id');
124
125 const filePath = path.join(planningDir(projectRoot, 'codex-automations'), `${id}.json`);
126 const plan = fs.existsSync(filePath)
127 ? JSON.parse(fs.readFileSync(filePath, 'utf8'))
128 : createAutomationPlan({ ...options, id, write: false });
129
130 const run = {
131 status: options.status || 'recorded',
132 summary: options.summary || '',
133 evidence: options.evidence || [],
134 recordedAt: nowIso(options),
135 };
136 plan.status = run.status;
137 plan.runs = [...(plan.runs || []), run];
138 writeJson(filePath, plan);
139 return plan;
140}
141
142function createPrReviewPlan(options = {}) {
143 const projectRoot = path.resolve(options.projectRoot || process.cwd());

Callers 1

Calls 4

createAutomationPlanFunction · 0.85
planningDirFunction · 0.70
nowIsoFunction · 0.70
writeJsonFunction · 0.70

Tested by

no test coverage detected