@volter/supercode-orchestrator 0.4.67 → 0.4.69
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.
- package/board/cli.mjs +2 -0
- package/board/dispatch.mjs +11 -4
- package/package.json +1 -1
package/board/cli.mjs
CHANGED
|
@@ -243,6 +243,8 @@ export async function runWorkflow(argv) {
|
|
|
243
243
|
// every verb reads the board through its workflow (a list settles cards too), so every verb loads it
|
|
244
244
|
if (verb !== 'help') await loadWorkflow(root).catch((error) => { if (verb !== 'init' && verb !== 'boards') throw error; });
|
|
245
245
|
engine.setCaller((db, cardId) => rolesFor(db, cardId, sid, workflowFor(root).params));
|
|
246
|
+
// a verb with no session behind it (a person at the CLI, the board file's sync) is the manager's, as its roles are
|
|
247
|
+
if (!sid && verb !== 'help') { try { setActor([].concat(workflowFor(root).params?.managers ?? [])[0] ?? null); } catch { /* no workflow */ } }
|
|
246
248
|
|
|
247
249
|
switch (verb) {
|
|
248
250
|
case 'init': {
|
package/board/dispatch.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import { hostname, tmpdir } from 'node:os';
|
|
|
21
21
|
import { basename, dirname, join } from 'node:path';
|
|
22
22
|
import { randomUUID } from 'node:crypto';
|
|
23
23
|
import { fileURLToPath } from 'node:url';
|
|
24
|
-
import { boardPath, claimer, event, json, listBoards, logsDir, now, openBoard, tx } from './store.mjs';
|
|
24
|
+
import { boardPath, claimer, event, json, listBoards, logsDir, now, openBoard, setActor, tx } from './store.mjs';
|
|
25
25
|
import { holdBoardTickLock } from '../hermes-locks.mjs';
|
|
26
26
|
import { doors, fire, loadWorkflow, resumeOf, scopeOf, statusOf, templateValue, workflowFor } from './workflow.mjs';
|
|
27
27
|
import { evaluate, holds, render } from './expr.mjs';
|
|
@@ -632,7 +632,12 @@ function launchPane(board, task, runId, lane, fleet, { input = null, slot = 'wor
|
|
|
632
632
|
let session = null;
|
|
633
633
|
let replaced = null;
|
|
634
634
|
if (prev?.forgotten) replaced = { session_id: prev.session_id, why: 'the workflow let it go' };
|
|
635
|
-
else if (prev && prev.
|
|
635
|
+
else if (prev && (prev.harness ?? 'claude-code') !== harness) {
|
|
636
|
+
// the card was reassigned to a lane of another harness: that harness starts it fresh (the card's text and thread
|
|
637
|
+
// are its context), and the last session, if still open, is closed so two harnesses never work one card
|
|
638
|
+
if (prev.pane && !prev.closed_at) stopSession(board, prev);
|
|
639
|
+
replaced = { session_id: prev.session_id, why: `the card's lane runs ${harness}, not ${prev.harness ?? 'claude-code'}`, letGo: true };
|
|
640
|
+
} else if (prev && prev.machine === machine) {
|
|
636
641
|
// a session the board closed, or one whose close its own command asked for (the next tick's sweep closes that
|
|
637
642
|
// run's pane), is not kept, whatever a fleet reading taken before the close still lists
|
|
638
643
|
if (!prev.closed_at && !prev.close_requested && sessionAlive(fleet, prev)) {
|
|
@@ -656,8 +661,8 @@ function launchPane(board, task, runId, lane, fleet, { input = null, slot = 'wor
|
|
|
656
661
|
} else replaced = { session_id: prev.session_id, why: 'its resume never came up' };
|
|
657
662
|
} else if (prev) replaced = { session_id: prev.session_id, why: `the card moved from ${prev.machine} to ${machine}` };
|
|
658
663
|
// a card keeps its context: a slot's session that cannot be kept or resumed stops the launch, and only a session the
|
|
659
|
-
// workflow let go (`forget_session`)
|
|
660
|
-
if (replaced && !prev?.forgotten) {
|
|
664
|
+
// workflow let go (`forget_session`) or its manager did (a reassignment to another harness's lane) is replaced
|
|
665
|
+
if (replaced && !prev?.forgotten && !replaced.letGo) {
|
|
661
666
|
const failed = new Error(`session ${replaced.session_id} (${slot}) could not be continued: ${replaced.why}. The board keeps a card's context and starts a new session only when the workflow lets this one go`);
|
|
662
667
|
failed.resumeFailed = { session_id: replaced.session_id, slot, why: replaced.why };
|
|
663
668
|
throw failed;
|
|
@@ -1224,6 +1229,8 @@ export async function tick({ root, lanes, settings, only = null, slugs = null, d
|
|
|
1224
1229
|
try {
|
|
1225
1230
|
board = openBoard(root, slug);
|
|
1226
1231
|
board.label = boardLabel(root, slug);
|
|
1232
|
+
// what the dispatcher records on its own is the board's act
|
|
1233
|
+
setActor(boardAddress(board.label));
|
|
1227
1234
|
// where the tick's time goes, phase by phase (ms), printed by `serve --verbose` and in `--json`
|
|
1228
1235
|
let mark = Date.now();
|
|
1229
1236
|
const phase = (name) => { const t = Date.now(); report.ms[name] = t - mark; mark = t; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.69",
|
|
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": {
|