ai-engineering-loop 2.0.0 → 2.2.0
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/CHANGELOG.md +26 -0
- package/README.md +54 -39
- package/core/local-workflow-studio.md +44 -7
- package/docs/images/studio-hero.svg +59 -47
- package/lib/node-evidence.js +877 -0
- package/lib/run-checkout.js +8 -13
- package/lib/run-watcher.js +10 -1
- package/package.json +1 -1
- package/studio/app.js +2180 -165
- package/studio/index.html +43 -9
- package/studio/styles.css +183 -16
package/lib/run-checkout.js
CHANGED
|
@@ -5,6 +5,7 @@ const { stableEdgeId } = require('./recipe-graph.js');
|
|
|
5
5
|
const { listRunInteractions } = require('./run-interactions.js');
|
|
6
6
|
const { loadRun } = require('./run-state.js');
|
|
7
7
|
const { inspectRunArtifact } = require('./run-history.js');
|
|
8
|
+
const { inspectNodeRun } = require('./node-evidence.js');
|
|
8
9
|
const { redactHomePaths, redactSecrets } = require('./safe-context.js');
|
|
9
10
|
const { workflowStatus } = require('./workflow-runtime.js');
|
|
10
11
|
|
|
@@ -138,17 +139,7 @@ function runNodeIo(rootDir, runId, nodeId) {
|
|
|
138
139
|
event.type === 'WORKFLOW_CREATED' ||
|
|
139
140
|
(event.changes || []).some((change) => change.nodeId === nodeId)
|
|
140
141
|
).map(({ initialNodes, ...event }) => event);
|
|
141
|
-
const
|
|
142
|
-
['NODE_COMPLETED', 'NODE_FAILED'].includes(event.type)
|
|
143
|
-
);
|
|
144
|
-
const finished = relevantEvents[finishedIndex];
|
|
145
|
-
const started = finishedIndex < 0
|
|
146
|
-
? null
|
|
147
|
-
: relevantEvents.slice(0, finishedIndex).findLast((event) => event.type === 'NODE_STARTED');
|
|
148
|
-
const durationMs = runtime.status !== 'RUNNING' &&
|
|
149
|
-
started && finished && Date.parse(finished.at) >= Date.parse(started.at)
|
|
150
|
-
? Date.parse(finished.at) - Date.parse(started.at)
|
|
151
|
-
: null;
|
|
142
|
+
const inspected = inspectNodeRun(rootDir, run, node, runtime, workflow.events);
|
|
152
143
|
let agentInteractions = [];
|
|
153
144
|
let agentInteractionsAvailable = true;
|
|
154
145
|
try {
|
|
@@ -159,7 +150,8 @@ function runNodeIo(rootDir, runId, nodeId) {
|
|
|
159
150
|
return redactedValue({
|
|
160
151
|
runId,
|
|
161
152
|
node: publicNode(node, workflow.state, workflow.plan.nodes.indexOf(node)),
|
|
162
|
-
durationMs,
|
|
153
|
+
durationMs: inspected.durationMs,
|
|
154
|
+
finishedAt: inspected.finishedAt,
|
|
163
155
|
loopIteration: runtime.loopIteration || null,
|
|
164
156
|
agentInteractionScope: 'RUN',
|
|
165
157
|
agentInteractionsAvailable,
|
|
@@ -175,10 +167,13 @@ function runNodeIo(rootDir, runId, nodeId) {
|
|
|
175
167
|
reason: runtime.reason || null,
|
|
176
168
|
loopGroupId: runtime.loopGroupId || null,
|
|
177
169
|
loopIteration: runtime.loopIteration || null,
|
|
170
|
+
summary: inspected.nodeEvidence?.summary || null,
|
|
178
171
|
artifact: safeArtifact(rootDir, runId, runtime.artifact)
|
|
179
172
|
},
|
|
180
173
|
evidence: safeArtifact(rootDir, runId, runtime.artifact),
|
|
181
|
-
|
|
174
|
+
nodeEvidence: inspected.nodeEvidence,
|
|
175
|
+
timeline: relevantEvents,
|
|
176
|
+
timelineGroups: inspected.timelineGroups
|
|
182
177
|
});
|
|
183
178
|
}
|
|
184
179
|
|
package/lib/run-watcher.js
CHANGED
|
@@ -22,7 +22,8 @@ const ARTIFACT_FILES = Object.freeze({
|
|
|
22
22
|
'verification.json': { type: 'artifact.verification', summarize: summarizeVerification },
|
|
23
23
|
'findings.json': { type: 'artifact.findings', summarize: summarizeFindings },
|
|
24
24
|
'verdict.json': { type: 'artifact.verdict', summarize: summarizeVerdict },
|
|
25
|
-
'receipt.json': { type: 'artifact.receipt', summarize: summarizeReceipt }
|
|
25
|
+
'receipt.json': { type: 'artifact.receipt', summarize: summarizeReceipt },
|
|
26
|
+
'delivery.json': { type: 'artifact.delivery', summarize: summarizeDelivery }
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
function envWatchEnabled(env = process.env) {
|
|
@@ -125,6 +126,14 @@ function summarizeVerdict(value) {
|
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
128
|
|
|
129
|
+
function summarizeDelivery(value) {
|
|
130
|
+
return {
|
|
131
|
+
destination: typeof value?.destination === 'string' ? value.destination : null,
|
|
132
|
+
humanApproved: value?.humanApproved === true,
|
|
133
|
+
approvedBy: typeof value?.approvedBy === 'string' ? value.approvedBy : null
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
128
137
|
function summarizeReceipt(value, context = {}) {
|
|
129
138
|
const digest = value?.digest || null;
|
|
130
139
|
const { rootDir, runId } = context;
|
package/package.json
CHANGED