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

Function buildPostApprovalRunbook

scripts/stack-plan.js:205–245  ·  view source on GitHub ↗
(status, ordered)

Source from the content-addressed store, hash-verified

203}
204
205function buildPostApprovalRunbook(status, ordered) {
206 if (status === 'no-stack') {
207 return [
208 {
209 step: 'Generate PR readiness reports',
210 gate: 'At least one report exists in .planning/pr-readiness.',
211 action: 'Run node scripts/pr-ready.js --pr <pull-request-url> --run-verification for each PR.',
212 },
213 ];
214 }
215 if (status === 'blocked') {
216 return [
217 {
218 step: 'Refresh blocked readiness reports',
219 gate: 'Every report status is ready and every readiness gate passes.',
220 action: 'Fix the blocked PRs, then rerun node scripts/pr-ready.js --pr <pull-request-url> --run-verification.',
221 },
222 ];
223 }
224 const steps = [
225 {
226 step: 'Reconfirm stack state',
227 gate: 'npm run stack:plan reports approval-needed with zero blocked items.',
228 action: 'Read .planning/stack-readiness/latest.md and .planning/approval-capsules/latest.md.',
229 },
230 ];
231 for (const [index, report] of ordered.entries()) {
232 const label = report.pr || report.branch;
233 steps.push({
234 step: `Land ${index + 1}: ${label}`,
235 gate: `Readiness report ${report.path} is ready and branch head is ${report.currentHead || report.head || 'current'}.`,
236 action: 'Mark ready or merge only after the prior PR in this stack has landed cleanly.',
237 });
238 }
239 steps.push({
240 step: 'Verify landed main',
241 gate: 'Main contains the final stack head and the selected verification command passes.',
242 action: 'Run npm run test, then run npm run stack:plan to confirm no stale readiness remains.',
243 });
244 return steps;
245}
246
247function buildStackApprovalCapsule(projectRoot, stack) {
248 if (stack.status !== 'approval-needed') return null;

Callers 2

assessStackFunction · 0.85
test-stack-plan.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected