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

Function createAgentPr

scripts/live-github-steward-proof.js:193–226  ·  view source on GitHub ↗
(workDir, owner, repoName, number)

Source from the content-addressed store, hash-verified

191}
192
193function createAgentPr(workDir, owner, repoName, number) {
194 const branch = `agent/${number}`;
195 git(['checkout', 'main'], workDir);
196 git(['checkout', '-B', branch], workDir);
197 writeFile(path.join(workDir, 'features', `agent-${String(number).padStart(2, '0')}.txt`), `agent ${number}\n`);
198 git(['add', 'features'], workDir);
199 git(['commit', '-m', `agent ${number} change`], workDir);
200 const head = git(['rev-parse', 'HEAD'], workDir);
201 git(['push', '-u', 'origin', branch], workDir);
202 const prUrl = gh([
203 'pr',
204 'create',
205 '--repo',
206 `${owner}/${repoName}`,
207 '--head',
208 branch,
209 '--base',
210 'main',
211 '--title',
212 `Agent ${number} proof PR`,
213 '--body',
214 `Agent ${number} PR for live deploy steward proof.`,
215 ], { cwd: workDir });
216 writeJson(path.join(workDir, '.agent-steward', 'ready', `pr-${number}.json`), {
217 id: `pr-${number}`,
218 pr: prUrl,
219 branch,
220 head,
221 ready: true,
222 verification: 'GitHub Actions ci',
223 createdAt: new Date().toISOString(),
224 });
225 return { number, branch, head, prUrl };
226}
227
228function runStewardCycle(workDir, cycle) {
229 const stdout = run(process.execPath, [

Callers 1

mainFunction · 0.85

Calls 4

ghFunction · 0.85
gitFunction · 0.70
writeFileFunction · 0.70
writeJsonFunction · 0.70

Tested by

no test coverage detected