@volter/supercode-orchestrator 0.4.157 → 0.4.158

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.
@@ -40,19 +40,19 @@ function sessionsOf(db, taskId) {
40
40
  }
41
41
 
42
42
  /**
43
- * What one board holds now, as counted things: each card with a live run (`runs`), each card in any status but
44
- * archived, once (`cards`; a cap's `where` names the statuses it counts), each live session its cards hold in any slot (`sessions`, those in a turn also
43
+ * What one board holds now, as counted things: each card with a live run (`runs`), each card (never a subtask) in any
44
+ * status but archived, once (`cards`; a cap's `where` names the statuses it counts), each live session its cards hold in any slot (`sessions`, those in a turn also
45
45
  * `turns`). `alive(session)` and `liveRecord(session)` read the fleet; `modelOf(session)` is the model the session's
46
46
  * own transcript reports it runs, or null where none can be read; `machineOf` normalises a machine name; `lanes` gives
47
47
  * a profile's harness and model.
48
48
  */
49
49
  export function holdings(board, { lanes, fleetOk, alive, liveRecord, modelOf = () => null, machineOf }) {
50
50
  const out = [];
51
- const rows = board.db.prepare("SELECT t.id, t.status, t.assignee, t.current_run_id, t.model_override, c.machine FROM tasks t LEFT JOIN supercode_cards c ON c.task_id = t.id WHERE t.status != 'archived'").all();
51
+ const rows = board.db.prepare("SELECT t.id, t.status, t.assignee, t.current_run_id, t.model_override, c.machine, c.subtask_of FROM tasks t LEFT JOIN supercode_cards c ON c.task_id = t.id WHERE t.status != 'archived'").all();
52
52
  for (const row of rows) {
53
53
  const lane = lanes[row.assignee] ?? {};
54
54
  const card = {
55
- card: row.id, board: board.slug, assignee: row.assignee ?? null, status: statusOf(board.db, row),
55
+ card: row.id, board: board.slug, assignee: row.assignee ?? null, status: statusOf(board.db, row), stored: row.status,
56
56
  machine: row.machine ? machineOf(row.machine) : null,
57
57
  model: row.model_override ?? lane.model ?? null, harness: lane.harness ?? null,
58
58
  };
@@ -81,7 +81,8 @@ export function holdings(board, { lanes, fleetOk, alive, liveRecord, modelOf = (
81
81
  out.push(...held);
82
82
  // the card itself, whatever its runs and sessions: a cap says which by its status (a started card holds its slot
83
83
  // until it is done); its model and harness are its run's session's, else its newest live session's, else its own
84
- out.push({ ...(held[0] ?? { ...card, unconfigured: !card.model }), session: undefined, slot: undefined, counts: 'cards' });
84
+ // a subtask is a task of its arc: it never runs or holds a slot of its own
85
+ if (!row.subtask_of) out.push({ ...(held[0] ?? { ...card, unconfigured: !card.model }), session: undefined, slot: undefined, counts: 'cards' });
85
86
  }
86
87
  return out;
87
88
  }
@@ -161,7 +162,7 @@ export function capacity(caps, held, evaluate) {
161
162
  for (const counts of ['runs', 'cards', 'sessions', 'turns', 'starts']) {
162
163
  const had = things.find((x) => x.card === entry.card && x.counts === counts);
163
164
  // the card is counted already: it is now in the status its start moved it to
164
- if (had) { if (counts === 'cards') Object.assign(had, { status: entry.status, model: had.model ?? entry.model, harness: had.harness ?? entry.harness }); }
165
+ if (had) { if (counts === 'cards') Object.assign(had, { status: entry.status, stored: entry.stored, model: had.model ?? entry.model, harness: had.harness ?? entry.harness }); }
165
166
  else things.push({ ...entry, counts });
166
167
  }
167
168
  },
@@ -579,7 +579,7 @@ function startCards(board, fleet, lanes, settings, report, entry, effects, { onl
579
579
  // the caps, over what the home holds now; what each candidate would be once started
580
580
  const caps = capacity(d.capacity, held, evaluate);
581
581
  const entryOf = (c) => ({ card: c.task.id, board: board.slug, machine: c.task.machine ? normalMachine(c.task.machine) : null, assignee: c.plan.profile ?? null,
582
- status: c.plan.target, model: c.task.model_override ?? c.plan.lane?.model ?? held.defaults?.[c.plan.lane?.harness] ?? null, harness: c.plan.lane?.harness ?? null });
582
+ status: c.plan.target, stored: c.plan.target, model: c.task.model_override ?? c.plan.lane?.model ?? held.defaults?.[c.plan.lane?.harness] ?? null, harness: c.plan.lane?.harness ?? null });
583
583
  const waitingEntries = candidates.map(entryOf);
584
584
  // a dry run (dispatch --dry-run) plans the same way and writes nothing: no notes, no moves, no launches
585
585
  const note = (id, why) => { if (!dry) tx(board, (db) => noteGuard(db, id, why)); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.157",
3
+ "version": "0.4.158",
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": {