@volter/supercode-orchestrator 0.5.144 → 0.5.146

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 +7 -7
  2. package/package.json +2 -2
package/board/cli.mjs CHANGED
@@ -1636,14 +1636,14 @@ async function serve(root, args = {}) {
1636
1636
  // running starts it again on the new code (a fix reaches the board with no hand relaunch)
1637
1637
  const installed = () => { try { return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version ?? null; } catch { return null; } };
1638
1638
  // The dispatcher's own health, readable from outside it: after every round in which no board failed it writes its
1639
- // heartbeat (the time, the round, what each board reported), so a watcher that finds it old knows the rounds stopped
1640
- // succeeding, whatever the dispatcher can still say. A board whose rounds keep failing is also told to the workflow's
1641
- // managers after FAILED_ROUNDS_ALERT in a row, and again each half hour while it lasts.
1639
+ // heartbeat (when the round began and ended, the round, what each board reported), so a watcher that finds it old
1640
+ // knows the rounds stopped succeeding, whatever the dispatcher can still say. A board whose rounds keep failing is
1641
+ // also told to the workflow's managers after FAILED_ROUNDS_ALERT in a row, and again each half hour while it lasts.
1642
1642
  const heartbeat = join(root, 'dispatcher-heartbeat.json');
1643
1643
  const FAILED_ROUNDS_ALERT = 5;
1644
1644
  const failing = new Map();
1645
1645
  let round = 0;
1646
- const watchRounds = async (reports) => {
1646
+ const watchRounds = async (reports, began) => {
1647
1647
  if (reports.every((r) => !r.error)) {
1648
1648
  // A publication the team refused holds this home's publishing where it is (nothing after it is skipped): a fact of
1649
1649
  // the same kind as rounds that stopped, so it goes where every board verb's error line reads it. Only a refusal
@@ -1654,7 +1654,7 @@ async function serve(root, args = {}) {
1654
1654
  const heldLine = refused ? [`publishing to the team is held: the team refused ${refused.card}'s ${refused.kind} (sequence ${refused.sequence}) with ${refused.status}${refused.code ? ` ${refused.code}` : ''}: ${String(refused.error ?? '').split('\n')[0].slice(0, 200)} (tried ${refused.attempts} time(s)); nothing of this home after it is published until the team takes it`] : [];
1655
1655
  const temporary = `${heartbeat}.${process.pid}.tmp`;
1656
1656
  try {
1657
- const beat = { at: new Date().toISOString(), round, pid: process.pid, version: installed(), boards: reports.map((r) => ({ board: r.board, started: r.started?.length ?? 0, queued: r.queued?.length ?? 0, failed: r.failed?.length ?? 0, ms: r.ms ?? null })), errors: [...heldLine, ...reports.flatMap((r) => [...(r.failed ?? []), ...(r.unsettled ?? [])].map(([t, why]) => `${r.board} ${t}: ${String(why).split('\n')[0].slice(0, 300)}`))].slice(0, 20) };
1657
+ const beat = { at: new Date().toISOString(), began: new Date(began).toISOString(), round, pid: process.pid, version: installed(), boards: reports.map((r) => ({ board: r.board, started: r.started?.length ?? 0, queued: r.queued?.length ?? 0, failed: r.failed?.length ?? 0, ms: r.ms ?? null })), errors: [...heldLine, ...reports.flatMap((r) => [...(r.failed ?? []), ...(r.unsettled ?? [])].map(([t, why]) => `${r.board} ${t}: ${String(why).split('\n')[0].slice(0, 300)}`))].slice(0, 20) };
1658
1658
  holdRound(beat.at, beat.errors);
1659
1659
  writeFileSync(temporary, `${JSON.stringify(beat)}\n`);
1660
1660
  renameSync(temporary, heartbeat);
@@ -1784,7 +1784,7 @@ async function serve(root, args = {}) {
1784
1784
  round += 1;
1785
1785
  // what the round recorded is delivered by a pass of its own, which this loop never waits for
1786
1786
  if (!stopped) startDelivery(root, { slugs: dispatching, log: (level, line) => { if (level === 'warn' || args.verbose) log(line); } });
1787
- if (!stopped) await watchRounds(reports);
1787
+ if (!stopped) await watchRounds(reports, began);
1788
1788
  }
1789
1789
  for (const r of reports) {
1790
1790
  nextMailAt = Math.min(nextMailAt, r.next_mail_at ?? Infinity);
@@ -1806,7 +1806,7 @@ async function serve(root, args = {}) {
1806
1806
  }
1807
1807
  } catch (error) {
1808
1808
  log(`tick failed: ${error.message}`);
1809
- if (!stopped) await watchRounds([{ board: '*', error: `tick failed: ${error.message}` }]);
1809
+ if (!stopped) await watchRounds([{ board: '*', error: `tick failed: ${error.message}` }], began);
1810
1810
  }
1811
1811
  // each round is a line of its own in the slow log, with the steps it spent its time on
1812
1812
  recordSlow({ kind: 'call', name: 'dispatch round', ms: Date.now() - began, slowest: null, extra: { steps: takeSteps() } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.144",
3
+ "version": "0.5.146",
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.91",
28
- "@volter/teams": "0.2.59",
28
+ "@volter/teams": "0.2.60",
29
29
  "@volter/ztrack": "^2.4.23",
30
30
  "yaml": "^2.9.0"
31
31
  },