@volter/supercode-orchestrator 0.4.63 → 0.4.64

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/workflow.mjs +19 -0
  2. package/package.json +1 -1
@@ -86,6 +86,23 @@ function answerTo(id) {
86
86
  try { return JSON.parse(r.stdout)?.[0]?.replies?.[0]?.id ?? null; } catch { return null; }
87
87
  }
88
88
 
89
+ const OPEN_OUTCOME = /^(\s*[-*] )\[ \] (.+)$/;
90
+ /** Whether `body` is `was` with only outcomes ticked: each changed line was `- [ ] X` and is now `- [x] X` or
91
+ * `- [x] X: <pointer>`; no other line added, removed or changed. */
92
+ function onlyTicks(was, body) {
93
+ if (typeof body !== 'string') return false;
94
+ const before = String(was ?? '').split('\n');
95
+ const after = body.split('\n');
96
+ if (before.length !== after.length) return false;
97
+ return before.every((line, i) => {
98
+ if (line === after[i]) return true;
99
+ const open = OPEN_OUTCOME.exec(line);
100
+ if (!open) return false;
101
+ const ticked = `${open[1]}[x] ${open[2]}`;
102
+ return after[i] === ticked || (after[i].startsWith(`${ticked}: `) && after[i].length > ticked.length + 2);
103
+ });
104
+ }
105
+
89
106
  /** The session message `id` was filed for (`supercode message show`): who was asked; or null. */
90
107
  function askedOf(id) {
91
108
  if (!id) return null;
@@ -130,6 +147,8 @@ export function scopeOf(db, board, task, { params, event = {}, extra = {} } = {}
130
147
  // the message whose answer the standing block waits for (`block --waiting-on`), and that answer's id once it has landed
131
148
  waiting_on: waitingOn,
132
149
  answer: () => answerTo(waitingOn),
150
+ // whether an edit of its text only ticks outcome lines (the card's own session's door to its acceptance)
151
+ only_ticks: (body) => onlyTicks(task.body, body),
133
152
  asked_of: () => askedOf(waitingOn),
134
153
  last_block_event: one(db, "SELECT kind FROM task_events WHERE task_id = ? AND kind IN ('blocked', 'unblocked') ORDER BY id DESC LIMIT 1", task.id)?.kind ?? null,
135
154
  // where the latest interruption says the card resumes (any status the workflow declares); none recorded: null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.63",
3
+ "version": "0.4.64",
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": {