@volter/supercode-orchestrator 0.4.99 → 0.4.101

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
@@ -833,7 +833,7 @@ export async function runWorkflow(argv) {
833
833
  // the flags its payload (the doors a session is told name these)
834
834
  const name = verb.replace(/-/g, '_');
835
835
  const { workflow } = workflowFor(root);
836
- const declared = Object.values(workflow.statuses).some((s) => s.on?.[name]) || Boolean(workflow.on?.[name]);
836
+ const declared = Object.values(workflow.statuses).some((s) => s.on?.[name]) || Boolean(workflow.on?.[name] || workflow.verbs?.[name] || workflow.run?.on?.[name]);
837
837
  if (!declared) throw new Error(`no workflow verb ${verb}; \`supercode workflow help\` lists them`);
838
838
  need(1, 'a card id');
839
839
  const { _: _words, root: _r, board: _b, json: _j, at: _a, ids: _i, ...fields } = args;
@@ -167,7 +167,7 @@ export function lanesOf(profiles = {}) {
167
167
  for (const [name, p] of Object.entries(profiles)) {
168
168
  const w = p?.worker;
169
169
  if (!w?.harness) continue;
170
- out[name] = { name, dir: p.dir, harness: w.harness, model: w.model ?? null, surface: w.surface ?? 'headless', capacity: w.capacity ?? null };
170
+ out[name] = { name, dir: p.dir, harness: w.harness, model: w.model ?? null, reasoning_effort: w.reasoning_effort ?? null, surface: w.surface ?? 'headless', capacity: w.capacity ?? null };
171
171
  }
172
172
  return out;
173
173
  }
@@ -676,9 +676,16 @@ function launchPane(board, task, runId, lane, fleet, { input = null, slot = 'wor
676
676
  }
677
677
  if (!session) {
678
678
  let sid = how.namesItself ? null : randomUUID();
679
- const r = sc([...base, '--key', `board-${task.id}-r${runId}-${(sid ?? randomUUID()).slice(0, 8)}`, '--input', input ?? `Card ${task.id}: ${task.title}`, '--', ...(sid ? how.fresh(sid) : how.fresh()), ...tail], { timeout: 180_000, as: boardAddress(board.label) });
679
+ const launchKey=`board-${task.id}-r${runId}-${(sid ?? randomUUID()).slice(0,8)}`;
680
+ const r = sc([...base, '--key', launchKey, '--input', input ?? `Card ${task.id}: ${task.title}`, '--', ...(sid ? how.fresh(sid) : how.fresh()), ...tail], { timeout: 180_000, as: boardAddress(board.label) });
680
681
  if (r.code !== 0) throw new Error(`supercode open --on ${task.machine}: ${(r.stderr || r.stdout).trim().slice(-500)}`);
681
682
  const pane = lastJson(r.stdout)?.pane ?? null;
683
+ const receipt=sc(['teams','rpc','launches.get',JSON.stringify({key:launchKey}),'--machine',task.machine],{timeout:30_000,as:boardAddress(board.label)});
684
+ const facts=receipt.code===0?lastJson(receipt.stdout):null;
685
+ if (!pane || facts?.inputDelivered===false || facts?.live===false || (!how.namesItself && !paneSurvives(task.machine,pane))) {
686
+ if(pane)stopSession(board,{surface:'pane',pane,machine:task.machine});
687
+ throw new Error(`${harness} launch did not become a working session: ${facts?.inputError??(!pane?'no pane returned':'pane ended or initial input was not delivered')}`);
688
+ }
682
689
  // a harness that names its own session is found in the fleet by the pane the board opened for it
683
690
  for (let waited = 0; !sid && pane && waited < 90_000; waited += 3000) {
684
691
  pause(3000);
package/board/ztrack.mjs CHANGED
@@ -259,7 +259,19 @@ class ZtrackBoard {
259
259
  load({ observe = false } = {}) {
260
260
  const text = read(this.path), archiveText = read(this.archive);
261
261
  const saved=this.get('snapshot', {});
262
- if (!observe && saved.documentHashes?.open===hash(text) && saved.documentHashes?.archived===hash(archiveText) && this.rows.normalized()) {
262
+ let cached=saved.documentHashes?.open===hash(text)&&saved.documentHashes?.archived===hash(archiveText);
263
+ if(!observe && !cached && saved.documentHashes) {
264
+ // The durable intent may have replaced the documents while its runtime commit
265
+ // is still pending. Readers keep the previous committed projection, never parse
266
+ // an intermediate pair of files. A real hand edit does not match these hashes.
267
+ const pending=this.get('pending');
268
+ cached=Boolean(pending?.files?.length===2 && pending.files.every(file=>{
269
+ const expected=file.path===this.path?saved.documentHashes.open:saved.documentHashes.archived;
270
+ const current=hash(file.path===this.path?text:archiveText);
271
+ return file.before===expected&&(current===file.before||current===hash(file.text));
272
+ }));
273
+ }
274
+ if (!observe && cached && this.rows.normalized()) {
263
275
  this.openCachedReader(saved);
264
276
  this.text=text;this.archiveText=archiveText;
265
277
  return;
@@ -506,7 +518,8 @@ class ZtrackBoard {
506
518
  }
507
519
  export(changes) {
508
520
  let entry; try { entry = workflowFor(this.root); } catch { return; }
509
- for (const { id } of this.mem.prepare('SELECT id FROM tasks').all()) projectStatus(this.mem, this.board(), entry, id);
521
+ const projected=new Set(changes.filter(c=>['tasks','supercode_cards'].includes(c.source.name)).map(c=>JSON.parse(c.source.key)[0]));
522
+ for(const id of projected)if(this.mem.prepare('SELECT 1 FROM tasks WHERE id=?').get(id))projectStatus(this.mem,this.board(),entry,id);
510
523
  const compat = new DatabaseSync(this.compatPath);
511
524
  try {
512
525
  compat.exec('BEGIN'); this.init(compat, { fresh: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.99",
3
+ "version": "0.4.101",
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": {