@volter/supercode-orchestrator 0.5.113 → 0.5.114

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/dispatch.mjs +17 -4
  2. package/package.json +1 -1
@@ -2674,17 +2674,30 @@ export async function plan({ root, lanes, settings, slugs = null, params = {} })
2674
2674
  return out;
2675
2675
  }
2676
2676
 
2677
- /** Whether an arc with no open PR may be one that changed no code and is due its review: it filed and closed tasks
2678
- * (a fresh arc with none has not started), and no review of it is pending or passed (after changes are requested,
2679
- * closing the tasks that own the findings makes it due again). */
2677
+ /** Whether an arc with no open PR may be one that changed no code and is due its review: it has done work, by filing
2678
+ * tasks or by a run that ended with an Acceptance outcome ticked (a fresh arc with neither has not started), and no
2679
+ * review of it is pending or passed (after changes are requested, closing the tasks that own the findings makes it
2680
+ * due again). */
2680
2681
  function noCodeReviewDue(board, id) {
2681
2682
  return view(board, (db) => {
2682
- if (!db.prepare('SELECT 1 FROM supercode_cards WHERE subtask_of = ? LIMIT 1').get(id)) return false;
2683
+ const filed = db.prepare('SELECT 1 FROM supercode_cards WHERE subtask_of = ? LIMIT 1').get(id);
2684
+ if (!filed && !(db.prepare('SELECT 1 FROM task_runs WHERE task_id = ? AND ended_at IS NOT NULL LIMIT 1').get(id) &&
2685
+ outcomeTicked(db.prepare('SELECT body FROM tasks WHERE id = ?').get(id)?.body))) return false;
2683
2686
  const last = db.prepare("SELECT kind FROM task_events WHERE task_id = ? AND kind IN ('review_requested', 'changes_requested', 'review_pass','review_voided') ORDER BY id DESC LIMIT 1").get(id);
2684
2687
  return !last || ['changes_requested','review_voided'].includes(last.kind);
2685
2688
  });
2686
2689
  }
2687
2690
 
2691
+ /** Whether a card body ticks some outcome under its Acceptance heading. */
2692
+ function outcomeTicked(body) {
2693
+ let acceptance = false;
2694
+ return String(body ?? '').split('\n').some((line) => {
2695
+ const heading = /^#{1,6}\s+(.+?)\s*$/.exec(line);
2696
+ if (heading) acceptance = heading[1].toLowerCase() === 'acceptance';
2697
+ return acceptance && /^\s*[-*] \[[xX]\] \S/.test(line);
2698
+ });
2699
+ }
2700
+
2688
2701
  /** An opened PR asks for the declared review transition once the arc's tasks are closed. */
2689
2702
  // A task written in the card's own Tasks section that did not become a subtask holds its review too.
2690
2703
  /** The arc's session still in a turn: its review, and the close of that session the request brings (end_run), wait for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.5.113",
3
+ "version": "0.5.114",
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": {