@volter/supercode-orchestrator 0.5.155 → 0.5.156

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.
@@ -838,8 +838,11 @@ async function startCards(board, fleet, lanes, settings, report, entry, effects,
838
838
  };
839
839
  for (const task of everyCard) {
840
840
  if (only && task.id !== only) continue;
841
+ // a subtask or a card with a run is never started here, whatever its scope says: no scope is built to learn it (the
842
+ // scope of each of a board's 2,155 unarchived cards, 2,039 of them subtasks or running, was 0.8 s of every round)
843
+ if (task.subtask_of || task.current_run_id) continue;
841
844
  const state = scopeFor(task).card;
842
- if (task.subtask_of || state.archived || task.current_run_id || ['done', 'cancelled'].includes(state.status)) continue;
845
+ if (state.archived || ['done', 'cancelled'].includes(state.status)) continue;
843
846
  if (state.dispatch_hold) { waiting(task, 'dispatch held: an explicit start or verified adoption must release it'); continue; }
844
847
  if (workflow.run && state.paused) { waiting(task, `paused: ${state.paused.reason ?? 'manager pause'}`); continue; }
845
848
  if (workflow.run && state.blocked_by.length) { waiting(task, `blocked by ${state.blocked_by.map(b => b.id).join(', ')}`); continue; }
@@ -3087,9 +3090,10 @@ async function activatePullRequestReviews(board, entry, report, effects, { only
3087
3090
  const eligible = db => {
3088
3091
  const task = getTask(db, id);
3089
3092
  if (!task) return false;
3093
+ // a status the platform cannot request a review from needs no scope built to say so
3094
+ if (!transitionsFor(entry.workflow, statusOf(db, task), 'request_review').some(t => !t.by || t.by.includes('platform'))) return false;
3090
3095
  const scope = scopeOf(db, board, task, { params: entry.params });
3091
- if (!transitionsFor(entry.workflow, statusOf(db, task), 'request_review').some(t => !t.by || t.by.includes('platform')) ||
3092
- scope.card.dispatch_hold || scope.card.paused || scope.card.blocked_by.length) return false;
3096
+ if (scope.card.dispatch_hold || scope.card.paused || scope.card.blocked_by.length) return false;
3093
3097
  // The card's Tasks are its subtasks; an open one holds the review, and says so.
3094
3098
  const open = scope.card.subtasks.filter(t => !['done', 'cancelled'].includes(t.status));
3095
3099
  return open.length ? open : true;
package/board/store.mjs CHANGED
@@ -150,6 +150,10 @@ export function layOut(db, { fresh }) {
150
150
  db.exec(PUBLICATION_SCHEMA);
151
151
  const have = new Set(db.prepare('PRAGMA table_info(supercode_cards)').all().map((c) => c.name));
152
152
  for (const [column, type] of Object.entries(OURS_COLUMNS)) if (!have.has(column)) db.exec(`ALTER TABLE supercode_cards ADD COLUMN ${column} ${type}`);
153
+ // A card's subtasks are read by the arc they name, for every scope built (workflow.mjs scopeOf): without this index
154
+ // each read walked every card's row. Laid out here, after the column it names exists on a store of any age and before
155
+ // any statement is prepared; no statement names it, so a store without it is only slower.
156
+ db.exec('CREATE INDEX IF NOT EXISTS idx_supercode_cards_subtask_of ON supercode_cards(subtask_of)');
153
157
  const effectColumns = new Set(db.prepare('PRAGMA table_info(supercode_effects)').all().map((c) => c.name));
154
158
  for (const [column, type] of Object.entries(EFFECT_COLUMNS)) if (!effectColumns.has(column)) db.exec(`ALTER TABLE supercode_effects ADD COLUMN ${column} ${type}`);
155
159
  // what changed is marked by the store itself, whoever writes it (published.mjs)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.155",
3
+ "version": "0.5.156",
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": {
@@ -24,7 +24,7 @@
24
24
  "check-types": "node scripts/generate-types.mjs --check"
25
25
  },
26
26
  "dependencies": {
27
- "@volter/supercode-harness-sdk": "^0.3.95",
27
+ "@volter/supercode-harness-sdk": "^0.3.96",
28
28
  "@volter/teams": "0.2.65",
29
29
  "@volter/ztrack": "^2.4.23",
30
30
  "yaml": "^2.9.0"