@galda/cli 0.10.53 → 0.10.54
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/app/index.html +4 -3
- package/engine/server.mjs +13 -0
- package/package.json +1 -1
package/app/index.html
CHANGED
|
@@ -6894,16 +6894,17 @@ function renderFsTodo(){
|
|
|
6894
6894
|
// (only a reply task, which Doing excludes) — it used to vanish from the lane (Masa 2026-07-24).
|
|
6895
6895
|
// Show it in Doing as a goal row, and stop its old stopped task from lingering under "Needs you".
|
|
6896
6896
|
const runningTaskGoalIds = new Set(running.filter((t) => !t.reply).map((t) => t.goalId));
|
|
6897
|
-
const
|
|
6897
|
+
const runningReplyGoalIds = new Set(list.filter((t) => t.reply && t.status === 'running').map((t) => t.goalId));
|
|
6898
|
+
const resumedGoalIds = new Set(runningReplyGoalIds);
|
|
6898
6899
|
const doingGoals = pgoals.filter((g) => g.status === 'running' && g.startedAt
|
|
6899
|
-
&& !runningTaskGoalIds.has(g.id) && !pausedGoalIds.has(g.id));
|
|
6900
|
+
&& runningReplyGoalIds.has(g.id) && !runningTaskGoalIds.has(g.id) && !pausedGoalIds.has(g.id));
|
|
6900
6901
|
// A reply that was OVER the parallel cap (engine PR #342): the goal is 'running'
|
|
6901
6902
|
// but startedAt is cleared, and its only pending work is a QUEUED reply task —
|
|
6902
6903
|
// which Doing needs startedAt for, and Next-up excludes (!t.reply). With no
|
|
6903
6904
|
// bucket it vanished. Surface these "parked" goals at the TOP of To Do ("最上部",
|
|
6904
6905
|
// Masa 2026-07-24) as Queued rows — not "Working on it" (nothing runs yet). They
|
|
6905
6906
|
// auto-promote to Doing the moment a slot frees and the engine sets startedAt.
|
|
6906
|
-
const parkedReplyGoals = pgoals.filter((g) => g.status === 'running'
|
|
6907
|
+
const parkedReplyGoals = pgoals.filter((g) => g.status === 'running'
|
|
6907
6908
|
&& !pausedGoalIds.has(g.id) && !runningTaskGoalIds.has(g.id)
|
|
6908
6909
|
&& list.some((t) => t.goalId === g.id && t.reply && t.status === 'queued')
|
|
6909
6910
|
&& !list.some((t) => t.goalId === g.id && !t.reply && ['running', 'queued'].includes(t.status)));
|
package/engine/server.mjs
CHANGED
|
@@ -1102,6 +1102,7 @@ function rebuildQueuesAfterAdopt() {
|
|
|
1102
1102
|
for (const p of projects) queues.set(p.id, { running: new Set(), waiting: [] });
|
|
1103
1103
|
for (const p of projects) {
|
|
1104
1104
|
const pending = tasks.filter((t) => t.projectId === p.id && t.status === 'queued').sort((a, b) => a.num - b.num);
|
|
1105
|
+
reconcileQueuedGoalStarts(p.id);
|
|
1105
1106
|
queues.get(p.id).waiting.push(...pending);
|
|
1106
1107
|
pump(p.id);
|
|
1107
1108
|
for (const g of goals.filter((g) => g.projectId === p.id && g.status === 'stacked')) {
|
|
@@ -1111,6 +1112,17 @@ function rebuildQueuesAfterAdopt() {
|
|
|
1111
1112
|
}
|
|
1112
1113
|
}
|
|
1113
1114
|
|
|
1115
|
+
function reconcileQueuedGoalStarts(projectId) {
|
|
1116
|
+
const projectTasks = tasks.filter((task) => task.projectId === projectId);
|
|
1117
|
+
for (const goal of goals.filter((item) => item.projectId === projectId && item.status === 'running' && item.startedAt)) {
|
|
1118
|
+
const goalTasks = projectTasks.filter((task) => task.goalId === goal.id);
|
|
1119
|
+
if (goalTasks.some((task) => task.status === 'queued') && !goalTasks.some((task) => task.status === 'running')) {
|
|
1120
|
+
goal.startedAt = null;
|
|
1121
|
+
saveGoal(goal);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1114
1126
|
const ACTIVITY_LIMIT = 1000;
|
|
1115
1127
|
function activityLine(line) {
|
|
1116
1128
|
return String(line ?? '')
|
|
@@ -4939,6 +4951,7 @@ server.listen(PORT, '127.0.0.1', () => {
|
|
|
4939
4951
|
for (const p of projects) {
|
|
4940
4952
|
const pending = tasks.filter((t) => t.projectId === p.id && t.status === 'queued').sort((a, b) => a.num - b.num);
|
|
4941
4953
|
const q = queues.get(p.id);
|
|
4954
|
+
reconcileQueuedGoalStarts(p.id);
|
|
4942
4955
|
q.waiting.push(...pending);
|
|
4943
4956
|
if (pending.length) console.log(`[manager] ${p.id}: re-queued ${pending.length} pending task(s) after restart`);
|
|
4944
4957
|
pump(p.id);
|
package/package.json
CHANGED