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

Function renderConsole

scripts/operator-console.js:314–406  ·  view source on GitHub ↗
(consoleState)

Source from the content-addressed store, hash-verified

312}
313
314function renderConsole(consoleState) {
315 const pending = consoleState.dashboard.pending;
316 const git = consoleState.dashboard.git;
317 const campaigns = consoleState.dashboard.campaigns;
318 const fleet = consoleState.dashboard.fleet;
319 const problems = consoleState.dashboard.problems;
320 const stack = consoleState.stack || { status: 'unknown', prCount: 0, blockedCount: 0 };
321 const profile = consoleState.verificationProfile;
322
323 const lines = [
324 'Citadel Operator Console',
325 '='.repeat(40),
326 `Generated: ${consoleState.generatedAt}`,
327 `Mode: ${consoleState.mode}`,
328 `Status: ${consoleState.status}`,
329 `Project: ${consoleState.projectRoot}`,
330 '',
331 'Decision',
332 ` Next: ${consoleState.nextAction.label}`,
333 ` Command: ${consoleState.nextAction.command}`,
334 ` Why: ${consoleState.nextAction.why}`,
335 ` Confidence: ${consoleState.nextAction.confidence}`,
336 ` Can run now: ${consoleState.nextAction.canRunNow ? 'yes' : 'no'}`,
337 ` Runbook: ${consoleState.nextAction.runbook || '(none)'}`,
338 '',
339 'Boundary',
340 ` Kind: ${consoleState.boundary.kind}`,
341 ` Risk: ${consoleState.boundary.risk}`,
342 ` Request: ${consoleState.boundary.request}`,
343 '',
344 'Context',
345 ` Pending: docSync=${pending.docSync}, mergeReviews=${pending.mergeReviews}, intakeItems=${pending.intakeItems}`,
346 ` Git: ${git.available ? (git.dirty ? `${git.changedFiles} changed file(s)` : 'clean') : 'unavailable'}`,
347 ` Campaigns: active=${campaigns.active}, package=${campaigns.needsReviewPackage}, complete=${campaigns.needsCompletion}, archive=${campaigns.needsArchive}`,
348 ` Fleet: active=${fleet.active}, visible=${fleet.totalVisible}`,
349 ` Stack: status=${stack.status}, prs=${stack.prCount}, blocked=${stack.blockedCount}`,
350 ` Problems: actionable=${problems.actionable}, safetyBlocks=${problems.safetyBlocks}, stale=${problems.stale}`,
351 '',
352 'Artifacts',
353 ...renderArtifact('Next report', consoleState.dashboard.artifacts.nextActionReport),
354 ...renderArtifact('Approval capsule', consoleState.dashboard.artifacts.approvalCapsule),
355 ` Stale artifacts: ${consoleState.dashboard.artifacts.staleCount}`,
356 '',
357 'Verification',
358 ` Profile: ${profile.id} (${profile.label})`,
359 ` Reason: ${profile.reason}`,
360 ` Primary: ${profile.primaryCommand}`,
361 ' Commands:',
362 ...profile.commands.map((command) => ` - ${command}`),
363 ];
364
365 if (consoleState.boundary.verification.length > 0) {
366 lines.push(' Boundary checks:');
367 for (const item of consoleState.boundary.verification) lines.push(` - ${item}`);
368 }
369
370 lines.push('');
371 lines.push('Run Result');

Callers 4

writeConsoleReportFunction · 0.85
mainFunction · 0.85

Calls 1

renderArtifactFunction · 0.85

Tested by

no test coverage detected