qualty 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/bin/qualty.js +89 -0
  2. package/package.json +1 -1
package/bin/qualty.js CHANGED
@@ -222,6 +222,84 @@ function appendGithubJobSummaryMarkdown(markdown) {
222
222
  }
223
223
  }
224
224
 
225
+ /**
226
+ * Markdown for per-step labels, thoughts (description), actions, explanation, evaluator.
227
+ * Kept short so the job Summary stays under GitHub size limits; full text stays in step logs.
228
+ */
229
+ function buildStepDetailsSummaryMarkdown(finalStatuses, executionJobIds) {
230
+ const MAX_STEPS = 50;
231
+ const parts = [];
232
+ let any = false;
233
+
234
+ for (const executionId of executionJobIds) {
235
+ const status = finalStatuses[executionId] || {};
236
+ const combos = Array.isArray(status.combinations) ? status.combinations : [];
237
+ const episode = status.episode_name || "Run";
238
+
239
+ for (const c of combos) {
240
+ const steps = Array.isArray(c.steps_json) ? c.steps_json : [];
241
+ const device = String(c.device ?? "?");
242
+ const evaluator = c.agent_output ?? c.gpt_output;
243
+ if (
244
+ steps.length === 0 &&
245
+ !String(c.explanation || "").trim() &&
246
+ !String(evaluator || "").trim()
247
+ ) {
248
+ continue;
249
+ }
250
+ any = true;
251
+ parts.push(
252
+ `#### ${mdTableCell(episode, 72)} · ${mdTableCell(device, 36)} · \`${mdTableCell(executionId, 36)}\``
253
+ );
254
+ parts.push("");
255
+
256
+ const shown = steps.slice(0, MAX_STEPS);
257
+ for (let j = 0; j < shown.length; j += 1) {
258
+ const s = shown[j];
259
+ const label =
260
+ (s.name && String(s.name).trim()) ||
261
+ (s.description && String(s.description).trim().slice(0, 100)) ||
262
+ `Step ${j + 1}`;
263
+ const st = s.status != null ? s.status : "?";
264
+ parts.push(`${j + 1}. **${mdTableCell(st, 16)}** ${mdTableCell(label, 140)}`);
265
+ const desc = s.description && String(s.description).trim();
266
+ if (desc && desc !== String(s.name)) {
267
+ parts.push(` - *Thoughts:* ${mdTableCell(desc, 900)}`);
268
+ }
269
+ if (s.action) {
270
+ parts.push(` - *Action:* \`${mdTableCell(String(s.action), 500)}\``);
271
+ }
272
+ parts.push("");
273
+ }
274
+ if (steps.length > MAX_STEPS) {
275
+ parts.push(
276
+ `*…and ${steps.length - MAX_STEPS} more steps — expand **Qualty** groups in the job log or open the run in Qualty for the full list.*`
277
+ );
278
+ parts.push("");
279
+ }
280
+
281
+ if (c.explanation && String(c.explanation).trim()) {
282
+ parts.push("**Explanation**");
283
+ parts.push("");
284
+ parts.push(`> ${mdTableCell(c.explanation, 4500)}`);
285
+ parts.push("");
286
+ }
287
+ if (evaluator && String(evaluator).trim()) {
288
+ parts.push("**Final evaluator**");
289
+ parts.push("");
290
+ parts.push(`> ${mdTableCell(evaluator, 8000)}`);
291
+ parts.push("");
292
+ }
293
+ }
294
+ }
295
+
296
+ if (!any) return "";
297
+ parts.push(
298
+ "*Truncated for the Summary tab. Uncapped step lines and evaluator text are in the job log (expand the Qualty groups) or in the Qualty dashboard.*"
299
+ );
300
+ return parts.join("\n");
301
+ }
302
+
225
303
  function writeQualtyGithubJobSummary({ executionJobIds, finalStatuses, passed, failed }) {
226
304
  if (!isGithubActions()) return;
227
305
 
@@ -281,6 +359,17 @@ function writeQualtyGithubJobSummary({ executionJobIds, finalStatuses, passed, f
281
359
  lines.push("</details>");
282
360
  }
283
361
 
362
+ const stepDetailsMd = buildStepDetailsSummaryMarkdown(finalStatuses, executionJobIds);
363
+ if (stepDetailsMd) {
364
+ lines.push("");
365
+ lines.push("<details>");
366
+ lines.push("<summary><strong>Steps &amp; agent notes (truncated)</strong></summary>");
367
+ lines.push("");
368
+ lines.push(stepDetailsMd);
369
+ lines.push("");
370
+ lines.push("</details>");
371
+ }
372
+
284
373
  const runUrl = githubWorkflowRunUrl();
285
374
  if (runUrl) {
286
375
  lines.push("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualty",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Qualty CLI for localhost and CI test runs",
5
5
  "bin": {
6
6
  "qualty": "bin/qualty.js"