cool-workflow 0.1.79 → 0.1.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +51 -3
- package/apps/architecture-review/app.json +1 -1
- package/apps/architecture-review-fast/app.json +64 -0
- package/apps/architecture-review-fast/workflow.js +153 -0
- package/apps/end-to-end-golden-path/app.json +1 -1
- package/apps/pr-review-fix-ci/app.json +1 -1
- package/apps/release-cut/app.json +1 -1
- package/apps/research-synthesis/app.json +1 -1
- package/dist/agent-config.js +21 -7
- package/dist/candidate-scoring.js +42 -22
- package/dist/capability-core.js +132 -17
- package/dist/capability-registry.js +138 -168
- package/dist/cli.js +97 -98
- package/dist/collaboration.js +5 -6
- package/dist/commit.js +20 -6
- package/dist/compare.js +18 -0
- package/dist/coordinator/classify.js +45 -0
- package/dist/coordinator/paths.js +42 -0
- package/dist/coordinator/util.js +129 -0
- package/dist/coordinator.js +127 -300
- package/dist/dispatch.js +35 -0
- package/dist/drive.js +79 -6
- package/dist/error-feedback.js +8 -4
- package/dist/evidence-reasoning.js +3 -3
- package/dist/execution-backend/agent.js +331 -0
- package/dist/execution-backend/probes.js +96 -0
- package/dist/execution-backend/util.js +47 -0
- package/dist/execution-backend.js +73 -421
- package/dist/mcp-server.js +79 -183
- package/dist/multi-agent/graph.js +84 -0
- package/dist/multi-agent/helpers.js +145 -0
- package/dist/multi-agent/paths.js +22 -0
- package/dist/multi-agent-eval/format.js +194 -0
- package/dist/multi-agent-eval/normalize.js +51 -0
- package/dist/multi-agent-eval.js +39 -244
- package/dist/multi-agent-host.js +0 -19
- package/dist/multi-agent.js +125 -314
- package/dist/node-snapshot.js +3 -3
- package/dist/observability/format.js +61 -0
- package/dist/observability/intake.js +98 -0
- package/dist/observability.js +14 -160
- package/dist/operator-ux/format.js +364 -0
- package/dist/operator-ux.js +22 -363
- package/dist/orchestrator/lifecycle-operations.js +2 -1
- package/dist/orchestrator/report.js +8 -0
- package/dist/orchestrator.js +26 -9
- package/dist/reclamation.js +26 -21
- package/dist/run-export.js +494 -25
- package/dist/run-registry/derive.js +172 -0
- package/dist/run-registry/format.js +124 -0
- package/dist/run-registry/gc.js +251 -0
- package/dist/run-registry/policy.js +16 -0
- package/dist/run-registry/queue.js +116 -0
- package/dist/run-registry.js +89 -597
- package/dist/run-state-schema.js +1 -0
- package/dist/sandbox-profile.js +43 -2
- package/dist/state-explosion/format.js +159 -0
- package/dist/state-explosion/helpers.js +82 -0
- package/dist/state-explosion.js +165 -304
- package/dist/state-node.js +19 -4
- package/dist/telemetry-attestation.js +55 -0
- package/dist/telemetry-demo.js +15 -3
- package/dist/telemetry-ledger.js +60 -15
- package/dist/topology.js +25 -8
- package/dist/triggers.js +33 -14
- package/dist/trust-audit.js +145 -33
- package/dist/version.js +1 -1
- package/dist/worker-isolation/helpers.js +51 -0
- package/dist/worker-isolation/paths.js +46 -0
- package/dist/worker-isolation.js +39 -115
- package/docs/agent-delegation-drive.7.md +71 -0
- package/docs/canonical-workflow-apps.7.md +37 -0
- package/docs/cli-mcp-parity.7.md +16 -0
- package/docs/contract-migration-tooling.7.md +6 -0
- package/docs/control-plane-scheduling.7.md +6 -0
- package/docs/dogfood/resume-drive-real-agent-2026-06-14.md +40 -0
- package/docs/durable-state-and-locking.7.md +8 -0
- package/docs/evidence-adoption-reasoning-chain.7.md +6 -0
- package/docs/execution-backends.7.md +6 -0
- package/docs/index.md +2 -0
- package/docs/launch/demo.tape +28 -0
- package/docs/launch/launch-kit.md +96 -17
- package/docs/launch/pre-launch-checklist.md +53 -0
- package/docs/multi-agent-cli-mcp-surface.7.md +8 -0
- package/docs/multi-agent-eval-replay-harness.7.md +6 -0
- package/docs/multi-agent-operator-ux.7.md +6 -0
- package/docs/multi-agent-trust-policy-audit.7.md +27 -0
- package/docs/node-snapshot-diff-replay.7.md +6 -0
- package/docs/observability-cost-accounting.7.md +6 -0
- package/docs/project-index.md +27 -6
- package/docs/real-execution-backends.7.md +6 -0
- package/docs/release-and-migration.7.md +8 -0
- package/docs/release-tooling.7.md +6 -0
- package/docs/routines.md +23 -0
- package/docs/run-registry-control-plane.7.md +89 -2
- package/docs/run-retention-reclamation.7.md +8 -0
- package/docs/source-context-profiles.7.md +119 -0
- package/docs/state-explosion-management.7.md +13 -0
- package/docs/team-collaboration.7.md +6 -0
- package/docs/trust-model.md +267 -0
- package/docs/unix-principles.md +49 -1
- package/docs/vendor-manifest-loadability.7.md +43 -0
- package/docs/web-desktop-workbench.7.md +6 -0
- package/manifest/plugin.manifest.json +1 -1
- package/manifest/source-context-profiles.json +142 -0
- package/package.json +4 -1
- package/scripts/agents/builtin-templates.json +7 -0
- package/scripts/agents/claude-p-agent.js +129 -43
- package/scripts/architecture-review-fast.js +362 -0
- package/scripts/bump-version.js +5 -10
- package/scripts/canonical-apps-list.js +64 -0
- package/scripts/canonical-apps.js +36 -4
- package/scripts/coverage-gate.js +211 -0
- package/scripts/dogfood-release.js +1 -1
- package/scripts/golden-path.js +4 -4
- package/scripts/parity-check.js +5 -0
- package/scripts/release-check.js +5 -1
- package/scripts/source-context.js +291 -0
- package/scripts/version-sync-check.js +5 -7
- package/skills/ci-triage/SKILL.md +50 -0
- package/skills/ci-triage/agents/openai.yaml +4 -0
- package/skills/cool-workflow/SKILL.md +4 -1
- package/skills/deploy-check/SKILL.md +55 -0
- package/skills/deploy-check/agents/openai.yaml +4 -0
- package/skills/design-qa/SKILL.md +49 -0
- package/skills/design-qa/agents/openai.yaml +4 -0
- package/skills/pr-review/SKILL.md +45 -0
- package/skills/pr-review/agents/openai.yaml +4 -0
- package/dist/capability-dispatcher.js +0 -86
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatOperatorStatus = formatOperatorStatus;
|
|
4
|
+
exports.formatOperatorReport = formatOperatorReport;
|
|
5
|
+
exports.formatOperatorGraph = formatOperatorGraph;
|
|
6
|
+
exports.formatWorkerSummary = formatWorkerSummary;
|
|
7
|
+
exports.formatCandidateSummary = formatCandidateSummary;
|
|
8
|
+
exports.formatFeedbackSummary = formatFeedbackSummary;
|
|
9
|
+
exports.formatCommitSummary = formatCommitSummary;
|
|
10
|
+
exports.formatMultiAgentSummary = formatMultiAgentSummary;
|
|
11
|
+
exports.formatTopologySummary = formatTopologySummary;
|
|
12
|
+
exports.formatMultiAgentTrustAudit = formatMultiAgentTrustAudit;
|
|
13
|
+
const multi_agent_operator_ux_1 = require("../multi-agent-operator-ux");
|
|
14
|
+
function formatOperatorStatus(summary) {
|
|
15
|
+
const operator = summary.multiAgentOperator;
|
|
16
|
+
return [
|
|
17
|
+
`Run: ${summary.runId}`,
|
|
18
|
+
`Workflow: ${summary.workflowId}${summary.appId ? ` (${summary.appId}@${summary.appVersion || "unknown"})` : ""}`,
|
|
19
|
+
`Loop Stage: ${summary.loopStage}`,
|
|
20
|
+
`Active Phase: ${summary.activePhase || "none"}`,
|
|
21
|
+
`Blocked: ${summary.blocked ? summary.blockedReasons.join("; ") : "no"}`,
|
|
22
|
+
`Tasks: ${formatCounts(summary.tasks.byStatus)}; total=${summary.tasks.total}`,
|
|
23
|
+
"",
|
|
24
|
+
"Phases",
|
|
25
|
+
...summary.phases.map((phase) => ` ${phase.name}: ${phase.status} (${phase.tasks.completed}/${phase.tasks.total} completed)`),
|
|
26
|
+
"",
|
|
27
|
+
formatWorkerPanel(summary.workers),
|
|
28
|
+
"",
|
|
29
|
+
formatCandidatePanel(summary.candidates),
|
|
30
|
+
"",
|
|
31
|
+
formatFeedbackPanel(summary.feedback),
|
|
32
|
+
"",
|
|
33
|
+
formatCommitPanel(summary.commits),
|
|
34
|
+
"",
|
|
35
|
+
formatTopologyPanel(summary.topologies),
|
|
36
|
+
"",
|
|
37
|
+
formatMultiAgentPanel(summary.multiAgent),
|
|
38
|
+
"",
|
|
39
|
+
"Multi-Agent Operator UX",
|
|
40
|
+
` active=${operator.activeMultiAgentRunIds.join(", ") || "none"}; topologies=${operator.topologyRunIds.join(", ") || "none"}; blocked=${operator.blocked ? "yes" : "no"}`,
|
|
41
|
+
` dependencies=${operator.dependencies.length}; failures=${operator.failures.length}; adoptedEvidence=${operator.adoptedEvidence.length}; missingEvidence=${operator.missingEvidence.length}${operator.inspectableEvidence.length ? ` (inspectable=${operator.inspectableEvidence.length})` : ""}`,
|
|
42
|
+
` next=${operator.nextAction}`,
|
|
43
|
+
"",
|
|
44
|
+
formatBlackboardPanel(summary.blackboard),
|
|
45
|
+
"",
|
|
46
|
+
formatTrustPanel(summary.trust),
|
|
47
|
+
"",
|
|
48
|
+
formatMultiAgentTrustAudit(summary.multiAgentTrust),
|
|
49
|
+
"",
|
|
50
|
+
`Report: ${summary.reportPath}`,
|
|
51
|
+
"",
|
|
52
|
+
"Next Action",
|
|
53
|
+
...formatRecommendations(summary.nextActions)
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
function formatOperatorReport(summary) {
|
|
57
|
+
return [
|
|
58
|
+
formatOperatorStatus(summary),
|
|
59
|
+
"",
|
|
60
|
+
"Active and Pending Tasks",
|
|
61
|
+
...formatTaskList(summary.tasks),
|
|
62
|
+
"",
|
|
63
|
+
"Evidence",
|
|
64
|
+
...(summary.evidencePaths.length ? summary.evidencePaths.map((entry) => ` ${entry}`) : [" none recorded"]),
|
|
65
|
+
"",
|
|
66
|
+
(0, multi_agent_operator_ux_1.formatMultiAgentDependencies)(summary.multiAgentOperator.dependencies),
|
|
67
|
+
"",
|
|
68
|
+
(0, multi_agent_operator_ux_1.formatMultiAgentFailures)(summary.multiAgentOperator.failures),
|
|
69
|
+
"",
|
|
70
|
+
(0, multi_agent_operator_ux_1.formatMultiAgentEvidence)(summary.multiAgentOperator.evidence),
|
|
71
|
+
"",
|
|
72
|
+
"Resource Commands",
|
|
73
|
+
` node scripts/cw.js graph ${summary.runId}`,
|
|
74
|
+
` node scripts/cw.js worker summary ${summary.runId}`,
|
|
75
|
+
` node scripts/cw.js topology summary ${summary.runId}`,
|
|
76
|
+
` node scripts/cw.js topology graph ${summary.runId}`,
|
|
77
|
+
` node scripts/cw.js multi-agent summary ${summary.runId}`,
|
|
78
|
+
` node scripts/cw.js multi-agent graph ${summary.runId}`,
|
|
79
|
+
` node scripts/cw.js multi-agent dependencies ${summary.runId}`,
|
|
80
|
+
` node scripts/cw.js multi-agent failures ${summary.runId}`,
|
|
81
|
+
` node scripts/cw.js multi-agent evidence ${summary.runId}`,
|
|
82
|
+
` node scripts/cw.js blackboard summary ${summary.runId}`,
|
|
83
|
+
` node scripts/cw.js blackboard graph ${summary.runId}`,
|
|
84
|
+
` node scripts/cw.js coordinator summary ${summary.runId}`,
|
|
85
|
+
` node scripts/cw.js candidate summary ${summary.runId}`,
|
|
86
|
+
` node scripts/cw.js feedback summary ${summary.runId}`,
|
|
87
|
+
` node scripts/cw.js commit summary ${summary.runId}`,
|
|
88
|
+
` node scripts/cw.js audit summary ${summary.runId}`,
|
|
89
|
+
` node scripts/cw.js audit provenance ${summary.runId}`,
|
|
90
|
+
` node scripts/cw.js audit multi-agent ${summary.runId}`,
|
|
91
|
+
` node scripts/cw.js audit policy ${summary.runId}`,
|
|
92
|
+
` node scripts/cw.js audit blackboard ${summary.runId}`,
|
|
93
|
+
` node scripts/cw.js audit judge ${summary.runId}`
|
|
94
|
+
].join("\n");
|
|
95
|
+
}
|
|
96
|
+
function formatOperatorGraph(graph) {
|
|
97
|
+
const lines = [`Run Graph: ${graph.runId}`, "", "Nodes"];
|
|
98
|
+
const groups = groupBy(graph.nodes, (node) => node.kind);
|
|
99
|
+
for (const kind of Object.keys(groups).sort()) {
|
|
100
|
+
lines.push(` ${kind}`);
|
|
101
|
+
for (const node of groups[kind]) {
|
|
102
|
+
const suffix = node.path ? ` -> ${node.path}` : "";
|
|
103
|
+
lines.push(` [${node.status}] ${node.id} (${node.label})${suffix}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
lines.push("", "Edges");
|
|
107
|
+
if (!graph.edges.length)
|
|
108
|
+
lines.push(" none");
|
|
109
|
+
for (const edge of graph.edges) {
|
|
110
|
+
lines.push(` ${edge.from} -> ${edge.to}${edge.label ? ` (${edge.label})` : ""}`);
|
|
111
|
+
}
|
|
112
|
+
return lines.join("\n");
|
|
113
|
+
}
|
|
114
|
+
function formatWorkerSummary(summary) {
|
|
115
|
+
return formatWorkerPanel(summary);
|
|
116
|
+
}
|
|
117
|
+
function formatCandidateSummary(summary) {
|
|
118
|
+
return formatCandidatePanel(summary);
|
|
119
|
+
}
|
|
120
|
+
function formatFeedbackSummary(summary) {
|
|
121
|
+
return formatFeedbackPanel(summary);
|
|
122
|
+
}
|
|
123
|
+
function formatCommitSummary(summary) {
|
|
124
|
+
return formatCommitPanel(summary);
|
|
125
|
+
}
|
|
126
|
+
function formatTrustPanel(summary) {
|
|
127
|
+
const lines = [
|
|
128
|
+
"Trust Audit",
|
|
129
|
+
` total=${summary.eventCount}; decision=${formatCounts(summary.byDecision)}; source=${formatCounts(summary.bySource)}`,
|
|
130
|
+
` sandbox=${formatCounts(summary.bySandboxProfile)}`,
|
|
131
|
+
` multi-agent trust=${summary.multiAgentTrust ? formatCounts(summary.multiAgentTrust) : "none"}`,
|
|
132
|
+
` events=${summary.eventLogPath}`,
|
|
133
|
+
` summary=${summary.summaryPath}`
|
|
134
|
+
];
|
|
135
|
+
for (const worker of summary.workers.slice(0, 6)) {
|
|
136
|
+
lines.push(` worker ${worker.workerId}: sandbox=${worker.sandboxProfileId || "none"}, decisions=${formatCounts(worker.decisions)}, denied=${worker.denied}`);
|
|
137
|
+
}
|
|
138
|
+
return lines.join("\n");
|
|
139
|
+
}
|
|
140
|
+
function formatMultiAgentSummary(summary) {
|
|
141
|
+
return formatMultiAgentPanel(summary);
|
|
142
|
+
}
|
|
143
|
+
function formatTopologySummary(summary) {
|
|
144
|
+
return formatTopologyPanel(summary);
|
|
145
|
+
}
|
|
146
|
+
function formatMultiAgentTrustAudit(view) {
|
|
147
|
+
const rolePolicies = arrayView(view.rolePolicies);
|
|
148
|
+
const permissionDecisions = arrayView(view.permissionDecisions);
|
|
149
|
+
const blackboardWrites = arrayView(view.blackboardWrites);
|
|
150
|
+
const messageProvenance = arrayView(view.messageProvenance);
|
|
151
|
+
const judgeRationales = arrayView(view.judgeRationales);
|
|
152
|
+
const panelDecisions = arrayView(view.panelDecisions);
|
|
153
|
+
const policyViolations = arrayView(view.policyViolations);
|
|
154
|
+
return [
|
|
155
|
+
`Multi-Agent Trust: ${String(view.runId || "unknown")}`,
|
|
156
|
+
"",
|
|
157
|
+
"Role Policies",
|
|
158
|
+
...formatRolePolicyRows(rolePolicies),
|
|
159
|
+
"",
|
|
160
|
+
"Permission Decisions",
|
|
161
|
+
...formatAuditRows(permissionDecisions),
|
|
162
|
+
"",
|
|
163
|
+
"Blackboard Write Audit",
|
|
164
|
+
...formatAuditRows(blackboardWrites),
|
|
165
|
+
"",
|
|
166
|
+
"Message Provenance",
|
|
167
|
+
...formatAuditRows(messageProvenance),
|
|
168
|
+
"",
|
|
169
|
+
"Judge Rationales",
|
|
170
|
+
...formatAuditRows([...judgeRationales, ...panelDecisions]),
|
|
171
|
+
"",
|
|
172
|
+
"Policy Violations",
|
|
173
|
+
...formatAuditRows(policyViolations),
|
|
174
|
+
"",
|
|
175
|
+
"Next Action",
|
|
176
|
+
` ${String(view.nextAction || `node scripts/cw.js audit multi-agent ${String(view.runId || "<run-id>")} --json`)}`
|
|
177
|
+
].join("\n");
|
|
178
|
+
}
|
|
179
|
+
function formatTopologyPanel(summary) {
|
|
180
|
+
const lines = [
|
|
181
|
+
"Topologies",
|
|
182
|
+
` runs=${summary.totalRuns}; status=${formatCounts(summary.runsByStatus)}; official=${summary.officialTopologies.join(", ")}`
|
|
183
|
+
];
|
|
184
|
+
for (const record of summary.active.slice(0, 6)) {
|
|
185
|
+
lines.push(` ${record.id}: ${record.topologyId}, status=${record.status}, readiness=${record.readiness}`);
|
|
186
|
+
lines.push(` run=${record.multiAgentRunId} board=${record.blackboardId}`);
|
|
187
|
+
lines.push(` roles=${record.roles.join(", ") || "none"} topics=${record.topics.join(", ") || "none"}`);
|
|
188
|
+
lines.push(` fanout=${record.fanouts.join(", ") || "none"} fanin=${record.fanins.join(", ") || "none"}`);
|
|
189
|
+
for (const missing of record.missingEvidence.slice(0, 4))
|
|
190
|
+
lines.push(` missing=${missing}`);
|
|
191
|
+
for (const conflict of record.conflicts.slice(0, 4))
|
|
192
|
+
lines.push(` conflict=${conflict}`);
|
|
193
|
+
if (record.nextActions[0])
|
|
194
|
+
lines.push(` next=${record.nextActions[0]}`);
|
|
195
|
+
}
|
|
196
|
+
if (summary.nextAction)
|
|
197
|
+
lines.push(` next=${summary.nextAction}`);
|
|
198
|
+
return lines.join("\n");
|
|
199
|
+
}
|
|
200
|
+
function formatMultiAgentPanel(summary) {
|
|
201
|
+
const lines = [
|
|
202
|
+
"Multi-Agent",
|
|
203
|
+
` runs=${summary.totalRuns}; status=${formatCounts(summary.runsByStatus)}`,
|
|
204
|
+
` roles=${summary.roles}; groups=${summary.groups} (${formatCounts(summary.groupsByStatus)})`,
|
|
205
|
+
` memberships=${summary.memberships} (${formatCounts(summary.membershipsByStatus)})`,
|
|
206
|
+
` fanouts=${summary.fanouts}; fanins=${summary.fanins} (${formatCounts(summary.faninsByStatus)})`
|
|
207
|
+
];
|
|
208
|
+
for (const group of summary.groupsDetail.slice(0, 6)) {
|
|
209
|
+
lines.push(` group ${group.id}: ${group.status}, phase=${group.phase || "none"}, run=${group.multiAgentRunId}`);
|
|
210
|
+
for (const role of group.roles.slice(0, 6)) {
|
|
211
|
+
lines.push(` role ${role.roleId}: memberships=${role.memberships}, reported=${role.reported}, missing=${role.missing}`);
|
|
212
|
+
}
|
|
213
|
+
lines.push(` fanout=${group.fanouts.join(", ") || "none"} fanin=${group.fanins.join(", ") || "none"}`);
|
|
214
|
+
}
|
|
215
|
+
for (const reason of summary.blockedReasons.slice(0, 6))
|
|
216
|
+
lines.push(` blocked: ${reason}`);
|
|
217
|
+
if (summary.nextAction)
|
|
218
|
+
lines.push(` next=${summary.nextAction}`);
|
|
219
|
+
return lines.join("\n");
|
|
220
|
+
}
|
|
221
|
+
function formatBlackboardPanel(summary) {
|
|
222
|
+
const lines = [
|
|
223
|
+
"Blackboard / Coordinator",
|
|
224
|
+
` board=${summary.blackboardId || "none"}; topics=${summary.topics}; messages=${summary.messages}; contexts=${summary.contexts}; artifacts=${summary.artifacts}`,
|
|
225
|
+
` open questions=${summary.openQuestions.length}; conflicts=${summary.conflicts.length}; missing evidence=${summary.missingEvidence.length}`,
|
|
226
|
+
` ready for fanin=${summary.readyForFanin ? "yes" : "no"}`,
|
|
227
|
+
` index=${summary.indexPath || "none"}`,
|
|
228
|
+
` latest snapshot=${summary.latestSnapshotPath || "none"}`
|
|
229
|
+
];
|
|
230
|
+
for (const question of summary.openQuestions.slice(0, 5))
|
|
231
|
+
lines.push(` question ${question.id}: ${question.value}`);
|
|
232
|
+
for (const conflict of summary.conflicts.slice(0, 5))
|
|
233
|
+
lines.push(` conflict ${conflict.id}: ${conflict.key} -> ${conflict.conflictingContextIds.join(", ") || "unindexed"}`);
|
|
234
|
+
for (const missing of summary.missingEvidence.slice(0, 5))
|
|
235
|
+
lines.push(` missing: ${missing}`);
|
|
236
|
+
if (summary.nextAction)
|
|
237
|
+
lines.push(` next=${summary.nextAction}`);
|
|
238
|
+
return lines.join("\n");
|
|
239
|
+
}
|
|
240
|
+
function arrayView(value) {
|
|
241
|
+
return Array.isArray(value) ? value : [];
|
|
242
|
+
}
|
|
243
|
+
function formatRolePolicyRows(rows) {
|
|
244
|
+
if (!rows.length)
|
|
245
|
+
return [" none"];
|
|
246
|
+
return rows.slice(0, 40).map((row) => {
|
|
247
|
+
const writes = Array.isArray(row.allowedWriteOperations) ? row.allowedWriteOperations.join(",") : "none";
|
|
248
|
+
const candidates = Array.isArray(row.allowedCandidateOperations) ? row.allowedCandidateOperations.join(",") : "none";
|
|
249
|
+
const judges = Array.isArray(row.allowedJudgeOperations) ? row.allowedJudgeOperations.join(",") : "none";
|
|
250
|
+
const topics = Array.isArray(row.allowedBlackboardTopicIds) ? row.allowedBlackboardTopicIds.join(",") : "none";
|
|
251
|
+
return ` ${String(row.policyRef || row.id || row.subjectId)} subject=${String(row.subjectKind || "unknown")}:${String(row.subjectId || "unknown")} topics=${topics} writes=${writes} candidates=${candidates} judges=${judges}`;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function formatAuditRows(rows) {
|
|
255
|
+
if (!rows.length)
|
|
256
|
+
return [" none"];
|
|
257
|
+
return rows.slice(0, 60).map((row) => {
|
|
258
|
+
const metadata = row.metadata && typeof row.metadata === "object" ? row.metadata : {};
|
|
259
|
+
const ids = [
|
|
260
|
+
row.agentRoleId ? `role=${row.agentRoleId}` : "",
|
|
261
|
+
row.agentMembershipId ? `membership=${row.agentMembershipId}` : "",
|
|
262
|
+
row.blackboardMessageId ? `message=${row.blackboardMessageId}` : "",
|
|
263
|
+
row.blackboardContextId ? `context=${row.blackboardContextId}` : "",
|
|
264
|
+
row.blackboardArtifactRefId ? `artifact=${row.blackboardArtifactRefId}` : "",
|
|
265
|
+
row.coordinatorDecisionId ? `decision=${row.coordinatorDecisionId}` : "",
|
|
266
|
+
row.candidateId ? `candidate=${row.candidateId}` : "",
|
|
267
|
+
row.scoreId ? `score=${row.scoreId}` : "",
|
|
268
|
+
row.selectionId ? `selection=${row.selectionId}` : ""
|
|
269
|
+
].filter(Boolean).join(" ");
|
|
270
|
+
const reason = metadata.reason ? ` reason=${String(metadata.reason)}` : "";
|
|
271
|
+
const operation = metadata.operation ? ` operation=${String(metadata.operation)}` : "";
|
|
272
|
+
return ` [${String(row.decision || "recorded")}] ${String(row.kind || "event")} ${String(row.id || "")}${operation}${ids ? ` ${ids}` : ""}${row.policyRef ? ` policy=${String(row.policyRef)}` : ""}${reason}`;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function formatWorkerPanel(summary) {
|
|
276
|
+
const lines = [
|
|
277
|
+
"Workers",
|
|
278
|
+
` total=${summary.total}; status=${formatCounts(summary.byStatus)}; sandbox=${formatCounts(summary.bySandboxProfile)}; backend=${formatCounts(summary.byBackend)}`
|
|
279
|
+
];
|
|
280
|
+
for (const worker of summary.workers.slice(0, 8)) {
|
|
281
|
+
const attestation = worker.backendAttestationStatus ? `/${worker.backendAttestationStatus}` : "";
|
|
282
|
+
lines.push(` ${worker.id}: ${worker.status}, task=${worker.taskId}, sandbox=${worker.sandboxProfileId || "none"}, backend=${worker.backendId || "none"}${attestation}`);
|
|
283
|
+
lines.push(` manifest=${worker.manifestPath}`);
|
|
284
|
+
lines.push(` result=${worker.resultPath}`);
|
|
285
|
+
if (worker.feedbackIds.length)
|
|
286
|
+
lines.push(` feedback=${worker.feedbackIds.join(", ")}`);
|
|
287
|
+
}
|
|
288
|
+
if (summary.workers.length > 8)
|
|
289
|
+
lines.push(` ... ${summary.workers.length - 8} more worker(s)`);
|
|
290
|
+
return lines.join("\n");
|
|
291
|
+
}
|
|
292
|
+
function formatCandidatePanel(summary) {
|
|
293
|
+
const lines = [
|
|
294
|
+
"Candidates",
|
|
295
|
+
` total=${summary.total}; status=${formatCounts(summary.byStatus)}; kind=${formatCounts(summary.byKind)}`,
|
|
296
|
+
` latest ranking=${summary.latestRankingPath || "none"}`,
|
|
297
|
+
` selected=${summary.selected.map((selection) => `${selection.candidateId}/${selection.selectionId}`).join(", ") || "none"}`,
|
|
298
|
+
` ready for commit=${summary.readyForCommit.map((item) => `${item.candidateId}/${item.selectionId}`).join(", ") || "none"}`
|
|
299
|
+
];
|
|
300
|
+
for (const problem of summary.problems.slice(0, 5))
|
|
301
|
+
lines.push(` problem: ${problem}`);
|
|
302
|
+
for (const candidate of summary.candidates.slice(0, 8)) {
|
|
303
|
+
lines.push(` ${candidate.id}: ${candidate.status}, scores=${candidate.scoreCount}, selected=${candidate.selected ? "yes" : "no"}`);
|
|
304
|
+
}
|
|
305
|
+
if (summary.candidates.length > 8)
|
|
306
|
+
lines.push(` ... ${summary.candidates.length - 8} more candidate(s)`);
|
|
307
|
+
return lines.join("\n");
|
|
308
|
+
}
|
|
309
|
+
function formatFeedbackPanel(summary) {
|
|
310
|
+
const lines = [
|
|
311
|
+
"Feedback",
|
|
312
|
+
` total=${summary.total}; status=${formatCounts(summary.byStatus)}`,
|
|
313
|
+
` severity=${formatCounts(summary.bySeverity)}`,
|
|
314
|
+
` classification=${formatCounts(summary.byClassification)}`,
|
|
315
|
+
` retryable=${summary.retryable}; nonRetryable=${summary.nonRetryable}`
|
|
316
|
+
];
|
|
317
|
+
for (const record of summary.open.slice(0, 6)) {
|
|
318
|
+
lines.push(` ${record.id}: ${record.severity}/${record.classification}, retryable=${record.retryable ? "yes" : "no"}`);
|
|
319
|
+
lines.push(` ${record.message}`);
|
|
320
|
+
}
|
|
321
|
+
return lines.join("\n");
|
|
322
|
+
}
|
|
323
|
+
function formatCommitPanel(summary) {
|
|
324
|
+
const lines = [
|
|
325
|
+
"Commits",
|
|
326
|
+
` total=${summary.total}; verifier-gated=${summary.verifierGated}; checkpoints=${summary.checkpoints}`,
|
|
327
|
+
` latest=${summary.latest ? `${summary.latest.id} (${summary.latest.kind}) ${summary.latest.snapshotPath}` : "none"}`
|
|
328
|
+
];
|
|
329
|
+
for (const commit of summary.commits.slice(-8)) {
|
|
330
|
+
lines.push(` ${commit.id}: ${commit.kind}, reason=${commit.reason}`);
|
|
331
|
+
lines.push(` verifier=${commit.verifierNodeId || "none"} candidate=${commit.candidateId || "none"} selection=${commit.selectionId || "none"} evidence=${commit.evidenceCount}`);
|
|
332
|
+
lines.push(` snapshot=${commit.snapshotPath}`);
|
|
333
|
+
}
|
|
334
|
+
return lines.join("\n");
|
|
335
|
+
}
|
|
336
|
+
function formatTaskList(summary) {
|
|
337
|
+
const lines = [];
|
|
338
|
+
for (const [label, values] of [
|
|
339
|
+
["pending", summary.pending],
|
|
340
|
+
["running", summary.running],
|
|
341
|
+
["failed", summary.failed]
|
|
342
|
+
]) {
|
|
343
|
+
lines.push(` ${label}: ${values.length ? values.join(", ") : "none"}`);
|
|
344
|
+
}
|
|
345
|
+
return lines;
|
|
346
|
+
}
|
|
347
|
+
function formatRecommendations(actions) {
|
|
348
|
+
return actions.length ? actions.map((action) => ` ${action.command}\n reason: ${action.reason}`) : [" none"];
|
|
349
|
+
}
|
|
350
|
+
function formatCounts(counts) {
|
|
351
|
+
const entries = Object.entries(counts).filter(([, value]) => value > 0).sort(([left], [right]) => left.localeCompare(right));
|
|
352
|
+
if (!entries.length)
|
|
353
|
+
return "none";
|
|
354
|
+
return entries.map(([key, value]) => `${key}=${value}`).join(", ");
|
|
355
|
+
}
|
|
356
|
+
function groupBy(items, getKey) {
|
|
357
|
+
const groups = {};
|
|
358
|
+
for (const item of items) {
|
|
359
|
+
const key = getKey(item);
|
|
360
|
+
groups[key] = groups[key] || [];
|
|
361
|
+
groups[key].push(item);
|
|
362
|
+
}
|
|
363
|
+
return groups;
|
|
364
|
+
}
|