@volter/supercode-orchestrator 0.4.87 → 0.4.88

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/board/cli.mjs +5 -4
  2. package/package.json +1 -1
package/board/cli.mjs CHANGED
@@ -449,8 +449,8 @@ export async function runWorkflow(argv) {
449
449
  case 'reassign': {
450
450
  need(2, 'a card id and a profile');
451
451
  await withBoardAsync(async (b) => {
452
- const task = tx(b, (db) => engine.getTask(db, id));
453
- if (task?.status === 'running' && args.reclaim) await engine.reclaim(b, id, args.reason ?? 'reassign');
452
+ const task = engine.getTask(b.db, id);
453
+ if (task?.current_run_id != null && args.reclaim) await engine.reclaim(b, id, args.reason ?? 'reassign');
454
454
  await engine.assign(b, id, rest[1] === 'none' ? null : rest[1]);
455
455
  });
456
456
  say(args, `Reassigned ${id} to ${rest[1]}`, { ok: true }); return 0;
@@ -1102,9 +1102,10 @@ function authorize(db, verb, rest, args, own) {
1102
1102
 
1103
1103
  /** Close the live sessions of a card that is not running (its worker's and its reviewers'), freeing its machine's place. */
1104
1104
  function closeSession(board, id) {
1105
- const { task, rows } = tx(board, (db) => ({ task: engine.getTask(db, id), rows: db.prepare('SELECT id, metadata FROM task_runs WHERE task_id = ? AND metadata IS NOT NULL ORDER BY id DESC').all(id) }));
1105
+ const task = engine.getTask(board.db, id);
1106
+ const rows = board.db.prepare('SELECT id, metadata FROM task_runs WHERE task_id = ? AND metadata IS NOT NULL ORDER BY id DESC').all(id);
1106
1107
  if (!task) throw new Error(`no card ${id}`);
1107
- if (task.status === 'running') throw new Error(`${id} is running; block, complete or reclaim it before closing its session`);
1108
+ if (task.current_run_id != null) throw new Error(`${id} has an active run; pause, block or reclaim it before closing its session`);
1108
1109
  const closed = [];
1109
1110
  const seen = new Set();
1110
1111
  for (const row of rows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.87",
3
+ "version": "0.4.88",
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": {