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

Function annotateOperatorArtifacts

scripts/dashboard.js:461–488  ·  view source on GitHub ↗
(snapshot)

Source from the content-addressed store, hash-verified

459 };
460}
461
462function annotateOperatorArtifacts(snapshot) {
463 const artifacts = snapshot.operatorArtifacts || {};
464 const currentCommand = snapshot.nextAction?.command || '';
465 const hasRepairs = (snapshot.repairs || []).length > 0;
466
467 if (artifacts.nextActionReport) {
468 const staleReasons = [];
469 if (artifacts.nextActionReport.outcome === 'idle' && hasRepairs) {
470 staleReasons.push('latest report says idle but dashboard has a queued action');
471 }
472 if (artifacts.nextActionReport.finalCommand && artifacts.nextActionReport.finalCommand !== currentCommand) {
473 staleReasons.push(`latest report final command is ${artifacts.nextActionReport.finalCommand}, current command is ${currentCommand}`);
474 }
475 Object.assign(artifacts.nextActionReport, freshness('current', staleReasons));
476 }
477
478 if (artifacts.approvalCapsule) {
479 const staleReasons = [];
480 if (!hasRepairs) {
481 staleReasons.push('no current repair or approval boundary is queued');
482 } else if (artifacts.approvalCapsule.command && artifacts.approvalCapsule.command !== currentCommand) {
483 staleReasons.push(`capsule command is ${artifacts.approvalCapsule.command}, current command is ${currentCommand}`);
484 }
485 Object.assign(artifacts.approvalCapsule, freshness('current', staleReasons));
486 }
487
488 return artifacts;
489}
490
491function describeTelemetry(entry) {

Callers 1

collectDashboardFunction · 0.85

Calls 1

freshnessFunction · 0.85

Tested by

no test coverage detected