(options = {})
| 118 | } |
| 119 | |
| 120 | function 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 | |
| 142 | function createPrReviewPlan(options = {}) { |
| 143 | const projectRoot = path.resolve(options.projectRoot || process.cwd()); |
no test coverage detected