@volter/supercode-orchestrator 0.5.70 → 0.5.72

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 CHANGED
@@ -75,7 +75,7 @@ const SAFE_SESSION = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/;
75
75
  const HELP = `supercode workflow <verb> [--root <home>] [--board <slug>] [--json]
76
76
 
77
77
  The board's verbs, with their flags:
78
- init [--backing sqlite|files|ztrack] [--document <arcs.md>] [--commit] [--manager <address>] [--archive-max-lines N] [--archive-period month]
78
+ init [--backing sqlite|files|ztrack] [--document <arcs.md>] [--commit] [--manager <address>] [--dispatching on|off] [--archive-max-lines N] [--archive-period month]
79
79
  migrate --backing ztrack --document <arcs.md> --status-map <json>
80
80
  boards list|create|rm|switch|show|rename|set-default-workdir|export|import
81
81
  create <title> [--body | --body-file PATH|-] [--assignee] [--parent]... [--workspace scratch|worktree:<repository>|dir:<repository>] [--branch] [--project]
@@ -414,6 +414,8 @@ export async function runVerb(argv) {
414
414
  return 0;
415
415
  }
416
416
  case 'init': {
417
+ // a malformed switch is refused before anything is made
418
+ if (args.dispatching !== undefined && !['on', 'off'].includes(args.dispatching)) throw new Error('--dispatching takes on or off; nothing was made');
417
419
  // A board on the ztrack backing is made with what its ztrack.json declares besides its document: `--commit` (the
418
420
  // documents live in a git checkout, each write committed and pushed), its manager (`--manager`, else the first one
419
421
  // the home's workflow names), whose own writes it does not commit, and the archive's rotation. A board already there
@@ -445,10 +447,13 @@ export async function runVerb(argv) {
445
447
  const own = named(fileURLToPath(new URL('../bin/orchestrator.mjs', import.meta.url)));
446
448
  writeFileSync(record, `${JSON.stringify({ package: '@volter/supercode-orchestrator', version: own?.version ?? null, entry: own?.entry ?? null, supercode: process.env.SUPERCODE_BIN ? named(process.env.SUPERCODE_BIN) : null })}\n`);
447
449
  }
450
+ // its dispatching switch, set before any owner runs (an install's first start: `init --dispatching off`); while an
451
+ // owner runs, `workflow dispatching` is its verb
452
+ const switched = args.dispatching !== undefined ? setDispatching(root, slug, args.dispatching === 'on', 'set at init') : null;
448
453
  const backing = made.backing;
449
454
  made.close();
450
455
  const { profiles } = await laneState(root).catch(() => ({ profiles: [] }));
451
- say(args, `${backing === 'sqlite' ? 'Kanban DB' : `Board (${backing} backing)`} ${kept ? 'already' : 'initialized'} at ${boardPath(root, slug)}\n\n${profiles.length ? `Profiles of this home (any can be an --assignee): ${profiles.join(', ')}` : 'No profiles in this home.'}\nThe dispatcher: \`supercode workflow serve\`, or the orchestrator while it serves the home.`, { ok: true, board: slug, path: boardPath(root, slug), backing, kept: Boolean(kept), profiles });
456
+ say(args, `${backing === 'sqlite' ? 'Kanban DB' : `Board (${backing} backing)`} ${kept ? 'already' : 'initialized'} at ${boardPath(root, slug)}\n\n${profiles.length ? `Profiles of this home (any can be an --assignee): ${profiles.join(', ')}` : 'No profiles in this home.'}\nThe dispatcher: \`supercode workflow serve\`, or the orchestrator while it serves the home.${switched ? `\nBoard ${slug}: dispatching ${switched.on ? 'on' : 'off'} (set at init).` : ''}`, { ok: true, board: slug, path: boardPath(root, slug), backing, kept: Boolean(kept), profiles, ...(switched ? { dispatching: switched } : {}) });
452
457
  return 0;
453
458
  }
454
459
 
@@ -1538,7 +1543,7 @@ async function answerOne(root, line) {
1538
1543
  const argv = tool ? ['tool'] : Array.isArray(request?.argv) && request.argv.every((arg) => typeof arg === 'string') ? request.argv : null;
1539
1544
  if (request?.v !== 1 || !argv?.length) return { code: 1, stdout: '', stderr: 'supercode workflow: a request names a verb\n' };
1540
1545
  const verb = parse(argv)._[0];
1541
- if (BOARD_OPERATION_VERBS.has(verb) && verb !== 'dispatching') return { code: 1, stdout: '', stderr: `supercode workflow: ${verb} is run on the board's machine as its own act, not sent to the owner\n` };
1546
+ if (BOARD_OPERATION_VERBS.has(verb)) return { code: 1, stdout: '', stderr: `supercode workflow: ${verb} is run on the board's machine as its own act, not sent to the owner\n` };
1542
1547
  const session = request.session && typeof request.session.id === 'string' && ['claude-code', 'codex'].includes(request.session.harness) ? request.session : null;
1543
1548
  const caller = typeof request.caller === 'string' ? request.caller : session ? `sc:${localMachine()}:${session.harness}:${session.id}` : null;
1544
1549
  const facts = Object.fromEntries(Object.entries(request.facts ?? {}).filter(([key, value]) => CALLER_FACTS.includes(key) && typeof value === 'string'));
package/board/client.mjs CHANGED
@@ -11,8 +11,8 @@ import { processSession } from './caller-session.mjs';
11
11
  /**
12
12
  * `supercode workflow <verb>`: the CLI holds nothing. A card verb is sent to the home's board owner (`workflow serve`,
13
13
  * @volter/teams/board-owner), which answers it in its own process with the home it holds; the answer is rendered here.
14
- * The run-on-the-machine verbs (BOARD_OPERATION_VERBS: the owner itself, its init, repair and housekeeping, the
15
- * dispatching switch and the verbs that hold the call open) and help are acts of their own, run here.
14
+ * The run-on-the-machine verbs (BOARD_OPERATION_VERBS: the owner itself, its init, repair and housekeeping, and the
15
+ * verbs that hold the call open) and help are acts of their own, run here.
16
16
  */
17
17
  export async function runWorkflow(argv) {
18
18
  const args = parse(argv);
@@ -21,14 +21,13 @@ export async function runWorkflow(argv) {
21
21
  const root = help ? null : homeOf(args);
22
22
  if (help || BOARD_OPERATION_VERBS.has(verb)) {
23
23
  // The board has one writer. An operation that writes the boards (exclusive, below) takes the home's lock itself
24
- // and so is that writer, refusing while an owner holds it; the dispatching switch is the owner's to write while one
25
- // runs. The rest only read, or are the owner itself (serve), and run here as their own act.
24
+ // and so is that writer, refusing while an owner holds it. The rest only read, or are the owner itself (serve), and
25
+ // run here as their own act.
26
26
  const writes = !help && exclusive(verb, args);
27
27
  let lock = null;
28
28
  if (writes) {
29
29
  try { lock = await takeHome(root); }
30
30
  catch (error) {
31
- if (verb === 'dispatching') return sendToOwner(root, argv, args);
32
31
  process.stderr.write(`supercode workflow: ${verb} writes the boards of ${root}, which have a running owner (${error.message}); stop \`supercode workflow serve\` to run it\n`);
33
32
  return 1;
34
33
  }
@@ -45,7 +44,6 @@ const BOARDS_WRITES = new Set(['create', 'new', 'rm', 'remove', 'delete', 'renam
45
44
  function exclusive(verb, args) {
46
45
  if (EXCLUSIVE.has(verb)) return true;
47
46
  if (verb === 'dispatch') return !args['dry-run'];
48
- if (verb === 'dispatching') return ['on', 'off'].includes(args._[1]);
49
47
  if (verb === 'boards') return BOARDS_WRITES.has(args._[1] ?? 'list');
50
48
  return false;
51
49
  }
package/board/fence.mjs CHANGED
@@ -16,9 +16,6 @@ const epochFile = (root) => join(boardHome(root), 'board.epoch');
16
16
  const recorded = (root) => { try { return Number(readFileSync(epochFile(root), 'utf8').trim()) || 0; } catch { return 0; } };
17
17
  const storedIn = (db) => { db.exec(STATE); return Number(db.prepare("SELECT value FROM supercode_board_state WHERE key = 'owner_epoch'").get()?.value ?? 0) || 0; };
18
18
 
19
- /** This process's epoch: null outside the owner. */
20
- export const ownerEpoch = () => mine;
21
-
22
19
  /**
23
20
  * Take a new epoch for the home at `root` (the caller holds its lock): one above the home's record and every epoch the
24
21
  * boards opened by `boards()` store; recorded, then fenced into each board.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.70",
3
+ "version": "0.5.72",
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": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@volter/supercode-harness-sdk": "^0.3.60",
28
- "@volter/teams": "0.2.23",
28
+ "@volter/teams": "0.2.24",
29
29
  "@volter/ztrack": "^2.4.23",
30
30
  "yaml": "^2.9.0"
31
31
  },