@volter/supercode-orchestrator 0.4.114 → 0.4.116
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/workflow.mjs +9 -2
- package/board/workspace.mjs +1 -0
- package/package.json +1 -1
package/board/workflow.mjs
CHANGED
|
@@ -127,8 +127,11 @@ const mailboxAnswers = new Map();
|
|
|
127
127
|
const execFileAsync = promisify(execFile);
|
|
128
128
|
export async function refreshRelationAnswers(board) {
|
|
129
129
|
const ids = new Set();
|
|
130
|
-
|
|
130
|
+
const entry = workflowFor(board.root);
|
|
131
|
+
for (const row of board.db.prepare("SELECT t.*,c.blocked_by FROM tasks t JOIN supercode_cards c ON c.task_id=t.id WHERE c.blocked_by IS NOT NULL AND c.blocked_by!='[]'").all()) {
|
|
132
|
+
if (!relationActive(board.db, board, entry, row)) continue;
|
|
131
133
|
for (const block of json(row.blocked_by, []) ?? []) if (block.kind === 'message') ids.add(block.id);
|
|
134
|
+
}
|
|
132
135
|
for (const row of board.db.prepare("SELECT e.payload FROM task_events e JOIN (SELECT task_id, MAX(id) id FROM task_events WHERE kind IN ('blocked','unblocked') GROUP BY task_id) last ON e.id=last.id JOIN tasks t ON t.id=e.task_id WHERE e.kind='blocked' AND t.status='blocked'").all()) {
|
|
133
136
|
const id = json(row.payload, {})?.waiting_on; if (id) ids.add(id);
|
|
134
137
|
}
|
|
@@ -886,8 +889,12 @@ export function fireRun(db, board, entry, id, name, { roles = [], payload = {},
|
|
|
886
889
|
return { from: status, to: statusOf(db, cardOf(db, id)), effects };
|
|
887
890
|
}
|
|
888
891
|
|
|
892
|
+
function relationActive(db, board, entry, task) {
|
|
893
|
+
const policy = entry.workflow.relations?.blocked_by;
|
|
894
|
+
return Boolean(policy) && holds(policy.guard ?? null, scopeOf(db, board, task, { params: entry.params }));
|
|
895
|
+
}
|
|
889
896
|
function settleRelations(db, board, entry, id, effects) {
|
|
890
|
-
if (!entry
|
|
897
|
+
if (!relationActive(db, board, entry, cardOf(db, id))) return;
|
|
891
898
|
const row = one(db, 'SELECT blocked_by FROM supercode_cards WHERE task_id = ?', id);
|
|
892
899
|
const blocks = json(row?.blocked_by, []) ?? [];
|
|
893
900
|
for (const block of blocks) {
|
package/board/workspace.mjs
CHANGED
|
@@ -24,6 +24,7 @@ export function declareWorkspace(kind, value, machine, branch = null) {
|
|
|
24
24
|
// A legacy path supplied explicitly is checked and registered on its machine, never copied into the card.
|
|
25
25
|
const info = workspaceDoor(machine, 'inspect', value);
|
|
26
26
|
if (kind === 'worktree' && info.linked) throw new Error('worktree workspace already names a linked worktree; name its repository for a solo worktree');
|
|
27
|
+
if (kind === 'dir' && !info.branch && !branch) throw new Error('a detached checkout has no portable branch identity; name the repository and a solo worktree branch');
|
|
27
28
|
const row = workspaceDoor(machine, 'register', value);
|
|
28
29
|
return { repository: row.repository, branch: branch ?? (kind === 'dir' ? row.branch : null), path: kind === 'dir' ? row.path : null };
|
|
29
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.116",
|
|
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": {
|