@volter/supercode-orchestrator 0.5.213 → 0.5.215
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 +3 -1
- package/board/workspace.mjs +13 -1
- package/package.json +4 -4
package/board/workflow.mjs
CHANGED
|
@@ -1027,7 +1027,9 @@ const ACTIONS = {
|
|
|
1027
1027
|
if (task.current_run_id) throw new Error('End the current run before moving its card.');
|
|
1028
1028
|
if ((value ?? null) === task.machine) return;
|
|
1029
1029
|
if (task.workspace_kind !== 'scratch' && (!task.workspace_anchor || isWorkspacePath(task.workspace_anchor))) throw new Error('declare the repository and branch with workflow specify --workspace before moving a legacy path card');
|
|
1030
|
-
|
|
1030
|
+
ACTIONS.forget_session(ctx, '*');
|
|
1031
|
+
run(ctx.db, 'UPDATE tasks SET workspace_path=NULL WHERE id=?', ctx.id);
|
|
1032
|
+
cardField(ctx, 'workspace_root', null);
|
|
1031
1033
|
cardField(ctx, 'machine', value ?? null);
|
|
1032
1034
|
return;
|
|
1033
1035
|
}
|
package/board/workspace.mjs
CHANGED
|
@@ -78,8 +78,11 @@ export async function declareWorkspace(kind, value, machine, branch = null) {
|
|
|
78
78
|
const info = await workspaceDoor(machine, 'inspect', value);
|
|
79
79
|
if (kind === 'worktree' && info.linked) throw new Error('worktree workspace already names a linked worktree; name its repository for a solo worktree');
|
|
80
80
|
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');
|
|
81
|
+
if (kind === 'dir' && info.linked && branch && branch !== info.branch) throw new Error(`worktree ${value} is on branch ${info.branch ?? '(detached)'}, not ${branch}`);
|
|
81
82
|
const row = await workspaceDoor(machine, 'register', value);
|
|
82
|
-
|
|
83
|
+
// A primary path plus another branch names that repository's checkout of the branch. A matching explicit
|
|
84
|
+
// checkout stays pinned to the path the manager supplied, even when another clone has the same branch mapped.
|
|
85
|
+
return { repository: row.repository, branch: branch ?? (kind === 'dir' ? row.branch : null), path: kind === 'dir' && (!branch || branch === row.branch) ? row.path : null };
|
|
83
86
|
}
|
|
84
87
|
/** The checkouts this machine keeps of any repository on `branch`: where an arc changing several repositories
|
|
85
88
|
* keeps its work in each of them (its own worktree aside). Another machine's map is not read from here. */
|
|
@@ -110,6 +113,14 @@ export async function resolveWorkspace(task, create = false) {
|
|
|
110
113
|
if (info.linked) throw new Error('worktree declaration is already a linked worktree; name its repository instead');
|
|
111
114
|
throw new Error('legacy worktree path needs registration and a repository declaration before launch');
|
|
112
115
|
}
|
|
116
|
+
if (task.workspace_kind === 'dir' && task.workspace_path) {
|
|
117
|
+
const cached = await workspaceDoor(task.machine, 'inspect', task.workspace_path);
|
|
118
|
+
if (cached.repository !== repositoryId(declared) || (task.branch_name && cached.branch !== task.branch_name)) {
|
|
119
|
+
throw new Error(`card checkout ${task.workspace_path} does not match ${declared}, branch ${task.branch_name ?? '(primary)'}; retarget its workspace explicitly`);
|
|
120
|
+
}
|
|
121
|
+
if (create) await workspaceDoor(task.machine, 'register', cached.root);
|
|
122
|
+
return cached;
|
|
123
|
+
}
|
|
113
124
|
// A primary checkout can change when another clone is registered. That does
|
|
114
125
|
// not move an already allocated card worktree. Machine moves and workspace
|
|
115
126
|
// retargets clear this runtime receipt; never borrow an arbitrary checkout.
|
|
@@ -119,6 +130,7 @@ export async function resolveWorkspace(task, create = false) {
|
|
|
119
130
|
const cached = await workspaceDoor(task.machine, 'inspect', task.workspace_path);
|
|
120
131
|
if (cached.linked && basename(cached.path) === worktreeFolder(task) && basename(dirname(cached.path)) === '.worktrees' &&
|
|
121
132
|
cached.repository === repositoryId(declared) && cached.branch === worktreeBranch(task)) {
|
|
133
|
+
if (create) await workspaceDoor(task.machine, 'register', cached.root);
|
|
122
134
|
return { ...cached, root: dirname(dirname(cached.path)) };
|
|
123
135
|
}
|
|
124
136
|
throw new Error(`card worktree ${task.workspace_path} does not match ${declared}, branch ${worktreeBranch(task)}; retarget its workspace explicitly`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.215",
|
|
4
|
+
"gitHead": "8267b3766f01d81c1c3e2acd3451b36aa587bf47",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"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
7
|
"exports": {
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"check-types": "node scripts/generate-types.mjs --check"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@volter/supercode-teams": "^0.3.
|
|
36
|
+
"@volter/supercode-teams": "^0.3.350",
|
|
36
37
|
"@volter/supercode-terminal": "^0.3.10",
|
|
37
38
|
"@volter/supercode-harness-sdk": "^0.3.104",
|
|
38
39
|
"@volter/teams": "0.2.99",
|
|
@@ -61,6 +62,5 @@
|
|
|
61
62
|
"board",
|
|
62
63
|
"apply",
|
|
63
64
|
"README.md"
|
|
64
|
-
]
|
|
65
|
-
"gitHead": "d017029f1b1d9293e295839a496be94a641b1ac0"
|
|
65
|
+
]
|
|
66
66
|
}
|