@volter/supercode-orchestrator 0.5.156 → 0.5.157

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
@@ -1590,14 +1590,22 @@ async function answerVerbs(root, log) {
1590
1590
 
1591
1591
  /** One request to the owner, answered whole: the verb run in the caller's call, its output kept for the answer. A
1592
1592
  * verb that takes more than a second is a slow line of its own, with the steps that ended while it ran (its own and,
1593
- * in this one process, any other call's that held it). */
1593
+ * in this one process, any other call's that held it) and what the process used while it ran (`process`): its
1594
+ * processor time beside the line's `ms` says whether the time was computed or waited for, with the major page faults
1595
+ * and the waits (voluntary context switches) and preemptions (involuntary) the kernel counted. */
1594
1596
  async function answerOne(root, line) {
1595
1597
  const began = performance.now();
1598
+ const before = process.resourceUsage();
1596
1599
  let named = null, by = null;
1597
1600
  try { return await answerRequest(root, line, (verb, caller) => { named = verb; by = caller; }); }
1598
1601
  finally {
1599
1602
  const ms = performance.now() - began;
1600
- if (named) recordSlow({ kind: 'call', name: `owner verb ${named}`, ms, slowest: null, extra: { caller: by, steps: slowLog.stepsWithin?.(began, performance.now()) ?? null } });
1603
+ if (named && ms > slowLog.SLOW_MS) {
1604
+ const after = process.resourceUsage();
1605
+ const used = { cpu_ms: Math.round((after.userCPUTime + after.systemCPUTime - before.userCPUTime - before.systemCPUTime) / 1000), major_faults: after.majorPageFault - before.majorPageFault,
1606
+ waits: after.voluntaryContextSwitches - before.voluntaryContextSwitches, preempted: after.involuntaryContextSwitches - before.involuntaryContextSwitches };
1607
+ recordSlow({ kind: 'call', name: `owner verb ${named}`, ms, slowest: null, extra: { caller: by, steps: slowLog.stepsWithin?.(began, performance.now()) ?? null, process: used } });
1608
+ }
1601
1609
  }
1602
1610
  }
1603
1611
 
package/board/ztrack.mjs CHANGED
@@ -21,6 +21,15 @@ import * as slowLog from '@volter/supercode-harness-sdk/slow-log';
21
21
 
22
22
  /** Run `fn` as a named step of the running command (the slow log names its slowest step). */
23
23
  const timedStep = (step, fn) => { const started = performance.now(); try { return fn(); } finally { noteStep(step, performance.now() - started); } };
24
+ // One statement that takes this long is a step of its own, named by its text: a verb that only reads (`show`) runs in
25
+ // no transaction and has no other step, so a hold inside it was a slow line that named no statement (8.7 s on
26
+ // 2026-10-11, where every statement of `show` measures under 80 ms on a copy of the same store).
27
+ const SLOW_STATEMENT_MS = 100;
28
+ const timedStatement = (sql, fn) => {
29
+ const started = performance.now();
30
+ try { return fn(); }
31
+ finally { const ms = performance.now() - started; if (ms >= SLOW_STATEMENT_MS) noteStep(`board statement: ${String(sql).replace(/\s+/g, ' ').trim().slice(0, 120)}`, ms); }
32
+ };
24
33
  import { fire, workflowFor } from './workflow.mjs';
25
34
 
26
35
  const require = createRequire(import.meta.url);
@@ -128,10 +137,10 @@ class ZtrackBoard {
128
137
  boardErrors: self.errors,
129
138
  prepare(sql) {
130
139
  return {
131
- get: (...args) => self.read(() => self.statement(sql).get(...args)),
132
- all: (...args) => self.read(() => self.statement(sql).all(...args)),
133
- iterate: (...args) => self.read(() => self.statement(sql).all(...args))[Symbol.iterator](),
134
- run: (...args) => self.active ? self.noting(() => self.statement(sql).run(...args)) : self.tx(() => self.statement(sql).run(...args)),
140
+ get: (...args) => self.read(() => timedStatement(sql, () => self.statement(sql).get(...args))),
141
+ all: (...args) => self.read(() => timedStatement(sql, () => self.statement(sql).all(...args))),
142
+ iterate: (...args) => self.read(() => timedStatement(sql, () => self.statement(sql).all(...args)))[Symbol.iterator](),
143
+ run: (...args) => self.active ? self.noting(() => timedStatement(sql, () => self.statement(sql).run(...args))) : self.tx(() => timedStatement(sql, () => self.statement(sql).run(...args))),
135
144
  };
136
145
  },
137
146
  exec(sql) { return self.active ? self.noting(() => self.conn.exec(sql)) : self.tx(() => self.conn.exec(sql)); },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.156",
3
+ "version": "0.5.157",
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": {