@volter/supercode-orchestrator 0.4.59 → 0.4.60

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.
@@ -456,7 +456,13 @@ const ACTIONS = {
456
456
  const e = said ?? {};
457
457
  const summary = e.summary ?? null;
458
458
  run(ctx.db, 'UPDATE tasks SET result = COALESCE(?, result), completed_at = COALESCE(completed_at, ?) WHERE id = ?', e.result ?? summary ?? null, now(), ctx.id);
459
- if (ctx.runId) run(ctx.db, 'UPDATE task_runs SET summary = COALESCE(?, summary), metadata = COALESCE(?, metadata) WHERE id = ?', summary, e.metadata ? JSON.stringify(e.metadata) : null, ctx.runId);
459
+ if (!ctx.runId) return;
460
+ // the completion's metadata joins the run's; the board's record of the run's session (`supercode`) stays, so the
461
+ // session is still closed when the card is done
462
+ const was = json(one(ctx.db, 'SELECT metadata FROM task_runs WHERE id = ?', ctx.runId)?.metadata, {}) ?? {};
463
+ const given = e.metadata && typeof e.metadata === 'object' ? e.metadata : null;
464
+ run(ctx.db, 'UPDATE task_runs SET summary = COALESCE(?, summary), metadata = ? WHERE id = ?', summary,
465
+ given ? JSON.stringify({ ...was, ...given, ...(was.supercode ? { supercode: was.supercode } : {}) }) : (Object.keys(was).length ? JSON.stringify(was) : null), ctx.runId);
460
466
  },
461
467
  link(ctx, parent) {
462
468
  if (!one(ctx.db, 'SELECT id FROM tasks WHERE id = ?', parent)) throw new Error(`${parent} is no card on this board`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.59",
3
+ "version": "0.4.60",
4
4
  "type": "module",
5
5
  "description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
6
6
  "exports": {