@volter/supercode-orchestrator 0.4.40 → 0.4.41

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.
@@ -595,10 +595,10 @@ function launchPane(board, task, runId, lane, fleet, { input = null, slot = 'wor
595
595
  tx(board, (db) => {
596
596
  setRunSession(db, runId, session);
597
597
  event(db, task.id, kind, { session_id: session.session_id, machine, pane: session.pane, address: session.address, mode: session.mode, ...(replaced ? { replaced } : {}) }, runId);
598
- // the working session hears updates to its card; a session no longer working it does not
599
- for (const s of subscriptions(db, task.id)) {
600
- if (s.delivery_metadata?.role === 'worker' && s.chat_id !== session.address) db.prepare("DELETE FROM kanban_notify_subs WHERE task_id = ? AND platform = 'supercode' AND chat_id = ?").run(task.id, s.chat_id);
601
- }
598
+ // the working session hears updates to its card; the slot's previous session no longer does (a reviewer starting
599
+ // leaves the implementer's, and a subtask's arc session's, subscription alone)
600
+ const before = prev ? prev.address ?? `sc:${prev.machine}:claude-code:${prev.session_id}` : null;
601
+ if (before && before !== session.address) db.prepare("DELETE FROM kanban_notify_subs WHERE task_id = ? AND platform = 'supercode' AND chat_id = ?").run(task.id, before);
602
602
  subscribeIn(db, task.id, session.address, 'worker');
603
603
  // it sees the cards its own depends on change, and works its subtasks
604
604
  for (const p of db.prepare('SELECT parent_id FROM task_links WHERE child_id = ?').all(task.id)) subscribeIn(db, p.parent_id, session.address, 'dependency');
@@ -783,11 +783,10 @@ async function notify(board, fleet, report, entry) {
783
783
  // each subscription's notices go in order; different subscribers are told side by side
784
784
  await pool(subscriptions(board.db).filter((sub) => sub.platform === 'supercode'), SEND_CONCURRENCY, async (sub) => {
785
785
  const role = ['worker', 'dependency'].includes(sub.delivery_metadata?.role) ? sub.delivery_metadata.role : 'creator';
786
- // a session that worked or watched a card and is gone hears nothing more; a creator is retried until it is back
787
- if (role !== 'creator' && fleet.ok && !fleet.alive.has(sub.chat_id)) {
788
- tx(board, (db) => db.prepare("DELETE FROM kanban_notify_subs WHERE task_id = ? AND platform = 'supercode' AND chat_id = ?").run(sub.task_id, sub.chat_id));
789
- return;
790
- }
786
+ // a session the fleet does not list this tick is told next tick: one reading is not a loss (a loaded box drops
787
+ // sessions from a read, and a dropped subscription never came back), and a session that is replaced on its card
788
+ // has its subscription moved when the new one starts
789
+ if (role !== 'creator' && fleet.ok && !fleet.alive.has(sub.chat_id)) return;
791
790
  const kinds = heardBy(entry, role);
792
791
  if (!kinds.length) return;
793
792
  const events = board.db.prepare(`SELECT id, kind, payload, created_at FROM task_events WHERE task_id = ? AND id > ? AND kind IN (${kinds.map(() => '?').join(', ')}) ORDER BY id`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.40",
3
+ "version": "0.4.41",
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": {