spur-board 0.160.0 → 0.160.1
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/dist/{chunk-CV__xxV8.mjs → chunk-C4g6_v8X.mjs} +1 -1
- package/dist/{chunk-bxssICzu.mjs → chunk-De2rPW0w.mjs} +2 -2
- package/dist/{chunk-DpR7gxfh.mjs → chunk-DrCDq9Bd.mjs} +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +63 -15
- package/dist/mcp.mjs +3 -3
- package/package.json +1 -1
- package/skills/spur-board/references/how-board-works-done.md +9 -2
- package/skills/spur-board/references/how-board-works-turns.md +10 -10
|
@@ -195,7 +195,7 @@ const SUBMISSION_BASES = [
|
|
|
195
195
|
* when the task moved on (it also covers returns and mode switches recorded by older versions),
|
|
196
196
|
* `corrected` by the operator's column correction, `rerouted` to another executor,
|
|
197
197
|
* `mode_changed` by a dispatcher mode switch, `archived` with the task. `moved` also closes a
|
|
198
|
-
* Done wrap-up turn whose holder session ended.
|
|
198
|
+
* Done wrap-up turn whose holder session ended, or an untaken one with no recipient left.
|
|
199
199
|
*/
|
|
200
200
|
const TURN_OUTCOMES = [
|
|
201
201
|
"submitted",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { At as plainHttpAllowed, Dt as configSchema, f as buildCatalogSnapshot, m as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { At as plainHttpAllowed, Dt as configSchema, f as buildCatalogSnapshot, m as OPERATIONS } from "./chunk-C4g6_v8X.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-DrCDq9Bd.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { closeSync, constants, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { homedir } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dt as ERRORS, gt as successEnvelopeSchema, l as tokenRequestStatusSchema, mt as errorEnvelopeSchema, pt as errorContextSchema, s as tokenRequestResultSchema, y as renderJsonError } from "./chunk-
|
|
1
|
+
import { dt as ERRORS, gt as successEnvelopeSchema, l as tokenRequestStatusSchema, mt as errorEnvelopeSchema, pt as errorContextSchema, s as tokenRequestResultSchema, y as renderJsonError } from "./chunk-C4g6_v8X.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { request } from "node:http";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bt as SLACK_BOT_SCOPES, D as skillReloadFileSchema, Dt as configSchema, Mt as requiredSecretKeys, Nt as resolveWebOrigin, d as SYSTEMD_SERVICE_SETTINGS, dt as ERRORS, gt as successEnvelopeSchema, i as remoteDoctorReportSchema, k as sortSkillFiles, m as OPERATIONS, o as requestHashOf, ot as actorIdSchema, p as roleCanUseOperation, xt as DEFAULT_STAND_PORT_RANGE } from "./chunk-
|
|
1
|
+
import { Bt as SLACK_BOT_SCOPES, D as skillReloadFileSchema, Dt as configSchema, Mt as requiredSecretKeys, Nt as resolveWebOrigin, d as SYSTEMD_SERVICE_SETTINGS, dt as ERRORS, gt as successEnvelopeSchema, i as remoteDoctorReportSchema, k as sortSkillFiles, m as OPERATIONS, o as requestHashOf, ot as actorIdSchema, p as roleCanUseOperation, xt as DEFAULT_STAND_PORT_RANGE } from "./chunk-C4g6_v8X.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
|
|
3
|
-
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-
|
|
4
|
-
import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-
|
|
3
|
+
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-DrCDq9Bd.mjs";
|
|
4
|
+
import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-De2rPW0w.mjs";
|
|
5
5
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
6
6
|
import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
7
7
|
import { homedir, hostname, tmpdir, userInfo } from "node:os";
|
package/dist/client.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-
|
|
1
|
+
export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-DrCDq9Bd.mjs";
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as prRefSchema, A as EVENT_KINDS, At as plainHttpAllowed, B as prSourceId, Bt as SLACK_BOT_SCOPES, C as inboundEventSchema, Ct as approvalRuleOf, Dt as configSchema, E as userIdSchema, Et as configBindings, F as MIRROR_FAILURE_CODES, Ft as COLUMNS, G as REVIEW_DECISIONS, H as sourceCursorSchema, Ht as TODO_GROUP_COLUMN_IDS, I as batchSchema, It as COLUMN_GROUPS, J as SESSION_STATUSES, K as REVIEW_STATES, L as defaultBranchFactSchema, Lt as COLUMN_IDS, M as eventPayloadSchemas, Mt as requiredSecretKeys, N as AdapterError, Nt as resolveWebOrigin, O as skillReloadFilesSchema, Ot as defaultAddressee, P as MIRROR_FAILURES, Pt as BLOCK_TYPES, Q as prFactsSchema, R as entityRefSchema, Rt as DISPATCHER_MODES, S as conversationRefSchema, St as RESERVED_PROJECT, T as messageRefSchema, Tt as columnTurnTimings, U as trackerSourceId, Ut as VIAS, V as sessionTransitionSchema, Vt as TASK_HOLDS, W as PR_STATES, Wt as isTodoGroupColumn, X as parseRingMarker, Y as isExternalAuthor, Z as prApprovalPairSchema, _ as turnHandedSchema, a as TOKEN_REQUEST_LIMITS, at as REF_NUMBER, bt as DEFAULT_SLACK_COMMAND, c as tokenRequestSchema, ct as errorCodeOf, dt as ERRORS, et as prReviewRuleSchema, f as buildCatalogSnapshot, ft as err, g as inboxNoSessionSchema, gt as successEnvelopeSchema, h as defaultBranchViewSchema, ht as ok, it as JIRA_PROJECT_KEY, j as GATE_REASONS, jt as readyMirrorOf, k as sortSkillFiles, kt as externalQuietAfterMs, l as tokenRequestStatusSchema, lt as parseActorId, m as OPERATIONS, n as SPUR_MIN_VERSION, nt as sessionFactsSchema, o as requestHashOf, ot as actorIdSchema, p as roleCanUseOperation, q as SESSION_HEALTH_STATES, r as doctorReportSchema, rt as ticketFactsSchema, s as tokenRequestResultSchema, st as encodeActorId, t as assertNever, tt as ringMarker, u as BOARD_TICK_MS, ut as parseRef$1, v as renderHttpProblem, vt as DEFAULT_LINK, w as interactionRefSchema, wt as boardWideSpurProject, x as SPACE_IDS, z as mirrorSourceId, zt as ITEM_KINDS } from "./chunk-
|
|
1
|
+
import { $ as prRefSchema, A as EVENT_KINDS, At as plainHttpAllowed, B as prSourceId, Bt as SLACK_BOT_SCOPES, C as inboundEventSchema, Ct as approvalRuleOf, Dt as configSchema, E as userIdSchema, Et as configBindings, F as MIRROR_FAILURE_CODES, Ft as COLUMNS, G as REVIEW_DECISIONS, H as sourceCursorSchema, Ht as TODO_GROUP_COLUMN_IDS, I as batchSchema, It as COLUMN_GROUPS, J as SESSION_STATUSES, K as REVIEW_STATES, L as defaultBranchFactSchema, Lt as COLUMN_IDS, M as eventPayloadSchemas, Mt as requiredSecretKeys, N as AdapterError, Nt as resolveWebOrigin, O as skillReloadFilesSchema, Ot as defaultAddressee, P as MIRROR_FAILURES, Pt as BLOCK_TYPES, Q as prFactsSchema, R as entityRefSchema, Rt as DISPATCHER_MODES, S as conversationRefSchema, St as RESERVED_PROJECT, T as messageRefSchema, Tt as columnTurnTimings, U as trackerSourceId, Ut as VIAS, V as sessionTransitionSchema, Vt as TASK_HOLDS, W as PR_STATES, Wt as isTodoGroupColumn, X as parseRingMarker, Y as isExternalAuthor, Z as prApprovalPairSchema, _ as turnHandedSchema, a as TOKEN_REQUEST_LIMITS, at as REF_NUMBER, bt as DEFAULT_SLACK_COMMAND, c as tokenRequestSchema, ct as errorCodeOf, dt as ERRORS, et as prReviewRuleSchema, f as buildCatalogSnapshot, ft as err, g as inboxNoSessionSchema, gt as successEnvelopeSchema, h as defaultBranchViewSchema, ht as ok, it as JIRA_PROJECT_KEY, j as GATE_REASONS, jt as readyMirrorOf, k as sortSkillFiles, kt as externalQuietAfterMs, l as tokenRequestStatusSchema, lt as parseActorId, m as OPERATIONS, n as SPUR_MIN_VERSION, nt as sessionFactsSchema, o as requestHashOf, ot as actorIdSchema, p as roleCanUseOperation, q as SESSION_HEALTH_STATES, r as doctorReportSchema, rt as ticketFactsSchema, s as tokenRequestResultSchema, st as encodeActorId, t as assertNever, tt as ringMarker, u as BOARD_TICK_MS, ut as parseRef$1, v as renderHttpProblem, vt as DEFAULT_LINK, w as interactionRefSchema, wt as boardWideSpurProject, x as SPACE_IDS, z as mirrorSourceId, zt as ITEM_KINDS } from "./chunk-C4g6_v8X.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -15619,13 +15619,18 @@ async function turnsWithoutSession(trx, config, now, taskById) {
|
|
|
15619
15619
|
/**
|
|
15620
15620
|
* Reconciles every item in the caller's observation or tick transaction. It first closes each
|
|
15621
15621
|
* Done wrap-up turn whose holder session ended (`closeEndedDoneTurns`), so no stall item is
|
|
15622
|
-
* raised for it
|
|
15622
|
+
* raised for it, and, while Spur is current, each untaken one left with no recipient
|
|
15623
|
+
* (`closeUnaddressedDoneTurns`).
|
|
15623
15624
|
*/
|
|
15624
15625
|
async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurContinuityStartAt) {
|
|
15625
|
-
await closeEndedDoneTurns(trx, new Date(now));
|
|
15626
|
-
const candidates = [];
|
|
15627
15626
|
const sources = await trx.selectFrom("source_state").selectAll().execute();
|
|
15628
15627
|
const sourceById = new Map(sources.map((state) => [state.source, state]));
|
|
15628
|
+
const spur = sourceById.get("spur");
|
|
15629
|
+
const spurBlind = spur !== void 0 && spur.blind_reason !== null;
|
|
15630
|
+
const spurExpired = spur?.last_complete_at != null && now > Date.parse(spur.last_complete_at) + config.adapters.spur.intervalMs * config.thresholds.staleMultiplier;
|
|
15631
|
+
await closeEndedDoneTurns(trx, new Date(now));
|
|
15632
|
+
if (!(spurBlind || !spurComplete || spurExpired)) await closeUnaddressedDoneTurns(trx, config, new Date(now));
|
|
15633
|
+
const candidates = [];
|
|
15629
15634
|
for (const source of sources) {
|
|
15630
15635
|
if (source.blind_reason === null) continue;
|
|
15631
15636
|
if (source.blind_reason === "stale" && source.source !== "spur") continue;
|
|
@@ -15746,8 +15751,6 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
15746
15751
|
source: null,
|
|
15747
15752
|
priority: ITEM_POLICY.post_failed.priority
|
|
15748
15753
|
});
|
|
15749
|
-
const spur = sourceById.get("spur");
|
|
15750
|
-
const spurBlind = spur !== void 0 && spur.blind_reason !== null;
|
|
15751
15754
|
const subjects = (await trx.selectFrom("link").innerJoin("session_snapshot", "session_snapshot.id", "link.session_id").select([
|
|
15752
15755
|
"link.task_id",
|
|
15753
15756
|
"link.role",
|
|
@@ -15925,7 +15928,6 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
15925
15928
|
observedAt: null,
|
|
15926
15929
|
resumedAt: null
|
|
15927
15930
|
} : parseJson(stallObservationSchema, observationRow.value);
|
|
15928
|
-
const spurExpired = spur?.last_complete_at != null && now > Date.parse(spur.last_complete_at) + config.adapters.spur.intervalMs * config.thresholds.staleMultiplier;
|
|
15929
15931
|
const observation = spurBlind || !spurComplete || spurExpired ? {
|
|
15930
15932
|
...previousObservation,
|
|
15931
15933
|
blind: true,
|
|
@@ -15959,11 +15961,7 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
15959
15961
|
}, config) : void 0;
|
|
15960
15962
|
if (executor === void 0 && turn.acked_at === null) {
|
|
15961
15963
|
const target = config.projects.find((entry) => entry.id === task.project)?.columns.find((entry) => entry.id === turn.column)?.orchestrator;
|
|
15962
|
-
|
|
15963
|
-
for (const row of stopped) if (await trx.selectFrom("link").select("id").where("task_id", "=", task.id).where("session_id", "=", row.id).where("role", "=", turn.role === "worker" ? "worker" : "orchestrator").where("banned", "=", 0).executeTakeFirst() !== void 0 || turn.role !== "worker" && row.spur_project === target) {
|
|
15964
|
-
executor = row;
|
|
15965
|
-
break;
|
|
15966
|
-
}
|
|
15964
|
+
executor = await stoppedExecutor(trx, task.id, turn.role, target);
|
|
15967
15965
|
}
|
|
15968
15966
|
if (executor === void 0 || executor.ended_at !== null || executor.absent_since !== null) {
|
|
15969
15967
|
await observeTurnEpisode(trx, turn.id, null);
|
|
@@ -16068,8 +16066,24 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
16068
16066
|
}).onConflict((oc) => oc.column("key").doUpdateSet({ value: toJson(episodeSchema, health.episode) })).execute();
|
|
16069
16067
|
const resting = await restingHolders(trx, config, now);
|
|
16070
16068
|
const restingIdle = (flag) => flag.kind === "worker_idle" && resting.has(`${flag.taskId}:${flag.sessionId}`);
|
|
16069
|
+
const turnTasks = new Set(turns.map((turn) => turn.task_id));
|
|
16070
|
+
const latestDoneTurns = new Map((await trx.selectFrom("turn").innerJoin("task", "task.id", "turn.task_id").select([
|
|
16071
|
+
"turn.task_id",
|
|
16072
|
+
"turn.acked_at",
|
|
16073
|
+
"turn.role",
|
|
16074
|
+
"turn.closed_reason"
|
|
16075
|
+
]).where("turn.column", "=", "done").where("task.column", "=", "done").whereRef("turn.epoch", "=", "task.column_epoch").orderBy("turn.id").execute()).map((turn) => [turn.task_id, turn]));
|
|
16076
|
+
const unaddressedDone = new Set([...latestDoneTurns.values()].filter((turn) => turn.closed_reason === "moved" && turn.acked_at === null && turn.role === "worker").map((turn) => turn.task_id));
|
|
16077
|
+
const addressed = /* @__PURE__ */ new Set();
|
|
16078
|
+
for (const taskId of unaddressedDone) {
|
|
16079
|
+
if (!taskById.has(taskId) || turnTasks.has(taskId)) continue;
|
|
16080
|
+
const session = await stoppedExecutor(trx, taskId, "worker", void 0);
|
|
16081
|
+
if (session !== void 0) addressed.add(`${String(taskId)}:${session.id}`);
|
|
16082
|
+
}
|
|
16083
|
+
const stoppedInDone = new Set(subjects.filter((subject) => subject.role === "worker" && subject.lifecycle === "stopped" && subject.endedAt === null && addressed.has(`${subject.taskId}:${subject.id}`)).map((subject) => `${subject.taskId}:${subject.id}`));
|
|
16084
|
+
const stoppedRetained = (flag) => ["stuck_worker", "needs_input"].includes(flag.kind) && stoppedInDone.has(`${flag.taskId}:${flag.sessionId}`);
|
|
16071
16085
|
for (const flag of health.flags) {
|
|
16072
|
-
if (endedHolders.has(`${flag.taskId}:${flag.sessionId}`) || restingIdle(flag)) continue;
|
|
16086
|
+
if (endedHolders.has(`${flag.taskId}:${flag.sessionId}`) || restingIdle(flag) || stoppedRetained(flag)) continue;
|
|
16073
16087
|
const task = taskById.get(Number(flag.taskId));
|
|
16074
16088
|
if (task === void 0) continue;
|
|
16075
16089
|
const fact = subjects.find((subject) => subject.taskId === flag.taskId && subject.id === flag.sessionId);
|
|
@@ -16130,12 +16144,12 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
16130
16144
|
const ordered = orderItems(candidates);
|
|
16131
16145
|
const seen = /* @__PURE__ */ new Set([...ordered.map((item) => item.key), ...heldKeys]);
|
|
16132
16146
|
for (const flag of health.held) {
|
|
16133
|
-
if (endedHolders.has(`${flag.taskId}:${flag.sessionId}`) || restingIdle(flag)) continue;
|
|
16147
|
+
if (endedHolders.has(`${flag.taskId}:${flag.sessionId}`) || restingIdle(flag) || stoppedRetained(flag)) continue;
|
|
16134
16148
|
const task = taskById.get(Number(flag.taskId));
|
|
16135
16149
|
if (task !== void 0 && !stalled.has(`${flag.taskId}:${flag.sessionId}`)) seen.add(healthKey(task.id, flag));
|
|
16136
16150
|
}
|
|
16137
16151
|
const existing = await trx.selectFrom("operator_item").selectAll().where("kind", "in", RECONCILED_KINDS).where("cleared_at", "is", null).execute();
|
|
16138
|
-
const stillInError = new Set(health.hostLoad === null ? [] : subjects.filter((subject) => subject.endedAt === null && subject.health === "error" && subject.role !== "other" && !stalled.has(`${subject.taskId}:${subject.id}`)).map((subject) => healthKey(Number(subject.taskId), {
|
|
16152
|
+
const stillInError = new Set(health.hostLoad === null ? [] : subjects.filter((subject) => subject.endedAt === null && subject.health === "error" && subject.role !== "other" && !stalled.has(`${subject.taskId}:${subject.id}`) && !stoppedInDone.has(`${subject.taskId}:${subject.id}`)).map((subject) => healthKey(Number(subject.taskId), {
|
|
16139
16153
|
taskId: subject.taskId,
|
|
16140
16154
|
sessionId: subject.id,
|
|
16141
16155
|
kind: subject.role === "worker" ? "stuck_worker" : "stuck_orchestrator"
|
|
@@ -16276,6 +16290,26 @@ async function closeEndedDoneTurns(trx, at) {
|
|
|
16276
16290
|
for (const item of items) await clearReconciled(trx, item, at, reason);
|
|
16277
16291
|
}
|
|
16278
16292
|
}
|
|
16293
|
+
/**
|
|
16294
|
+
* Closes, as `moved`, each untaken worker-role Done wrap-up turn of an unarchived Done task when
|
|
16295
|
+
* no recipient is left: no live worker session is linked to the task and Done has no
|
|
16296
|
+
* orchestrator. The caller runs it only while Spur is current, so a missed session end does not
|
|
16297
|
+
* close a turn a live worker still holds.
|
|
16298
|
+
*/
|
|
16299
|
+
async function closeUnaddressedDoneTurns(trx, config, at) {
|
|
16300
|
+
const turns = await trx.selectFrom("turn").innerJoin("task", "task.id", "turn.task_id").select(["turn.task_id", "task.project"]).where("turn.closed_at", "is", null).where("turn.acked_at", "is", null).where("turn.role", "=", "worker").where("turn.column", "=", "done").where("task.column", "=", "done").where("task.membership", "!=", "archived").orderBy("turn.id").execute();
|
|
16301
|
+
for (const turn of turns) {
|
|
16302
|
+
const project = config.projects.find((candidate) => candidate.id === turn.project);
|
|
16303
|
+
if (project === void 0) continue;
|
|
16304
|
+
if ((project.columns.find((column) => column.id === "done")?.orchestrator ?? "none") !== "none") continue;
|
|
16305
|
+
if (await linkedSession(trx, turn.task_id, "worker") !== void 0) continue;
|
|
16306
|
+
await closeTurns(trx, {
|
|
16307
|
+
taskId: turn.task_id,
|
|
16308
|
+
reason: "moved",
|
|
16309
|
+
at
|
|
16310
|
+
});
|
|
16311
|
+
}
|
|
16312
|
+
}
|
|
16279
16313
|
/** Raise ended-holder attention from ownership, independent of links, PRs and source freshness. */
|
|
16280
16314
|
async function endedTurnItems(trx, tasks, candidates, at, spurConfirmedAt) {
|
|
16281
16315
|
const holders = /* @__PURE__ */ new Set();
|
|
@@ -16356,6 +16390,20 @@ async function observeTurnEpisode(trx, turnId, fact) {
|
|
|
16356
16390
|
}).onConflict((oc) => oc.column("key").doUpdateSet({ value: toJson(stallEpisodeSchema, episode) })).execute();
|
|
16357
16391
|
return episode;
|
|
16358
16392
|
}
|
|
16393
|
+
/**
|
|
16394
|
+
* The stopped session an untaken turn of `role` with no live recipient is diagnosed against: the
|
|
16395
|
+
* newest stopped, present session linked to the task in that role, or for a column orchestrator
|
|
16396
|
+
* turn one of the column's orchestrator project `target`. It runs on every reconcile, so each
|
|
16397
|
+
* query is scoped to the task's links or to that project.
|
|
16398
|
+
*/
|
|
16399
|
+
async function stoppedExecutor(trx, taskId, role, target) {
|
|
16400
|
+
const newestStopped = trx.selectFrom("session_snapshot").selectAll("session_snapshot").where("session_snapshot.state", "=", "stopped").where("session_snapshot.ended_at", "is", null).where("session_snapshot.absent_since", "is", null).orderBy("session_snapshot.first_seen", "desc").orderBy("session_snapshot.id").limit(1);
|
|
16401
|
+
const linked = await newestStopped.innerJoin("link", "link.session_id", "session_snapshot.id").where("link.task_id", "=", taskId).where("link.entity", "=", "session").where("link.role", "=", role === "worker" ? "worker" : "orchestrator").where("link.banned", "=", 0).executeTakeFirst();
|
|
16402
|
+
if (role === "worker" || target === void 0) return linked;
|
|
16403
|
+
const inProject = await newestStopped.where("session_snapshot.spur_project", "=", target).executeTakeFirst();
|
|
16404
|
+
if (linked === void 0 || inProject === void 0) return linked ?? inProject;
|
|
16405
|
+
return inProject.first_seen > linked.first_seen || inProject.first_seen === linked.first_seen && inProject.id < linked.id ? inProject : linked;
|
|
16406
|
+
}
|
|
16359
16407
|
function healthKey(taskId, flag) {
|
|
16360
16408
|
return `health:${String(taskId)}:${flag.sessionId}:${flag.kind}`;
|
|
16361
16409
|
}
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as renderMcpError, dt as ERRORS, m as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, r as requestOperation } from "./chunk-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-
|
|
1
|
+
import { b as renderMcpError, dt as ERRORS, m as OPERATIONS } from "./chunk-C4g6_v8X.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-DrCDq9Bd.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-De2rPW0w.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
package/package.json
CHANGED
|
@@ -54,5 +54,12 @@ Entering Done opens one wrap-up turn (`done: wrap up`) for the live worker, or f
|
|
|
54
54
|
column's orchestrator (`projects[].columns[].orchestrator`); none for an operator Done or when
|
|
55
55
|
neither a live worker nor a Done orchestrator is available. It closes like any turn (submit, the task leaving Done, archive), and
|
|
56
56
|
also when its holder session ends: that close shows `turn_closed` outcome `moved`, and the
|
|
57
|
-
holder's end raises no stall block on it.
|
|
58
|
-
|
|
57
|
+
holder's end raises no stall block on it. An untaken wrap-up turn closes the same way when no
|
|
58
|
+
recipient is left: no live worker is linked to the task (its worker ended, stopped without an
|
|
59
|
+
end time, or was unlinked) and Done has no orchestrator. That close raises no stall question
|
|
60
|
+
and waits for a complete Spur read, not while Spur is blind or stale; a turn already left open
|
|
61
|
+
closes on the first such read. A worker Spur still lists as completed or errored without an end
|
|
62
|
+
time counts as linked and live here, so its wrap-up stays open until Spur reports the end or the
|
|
63
|
+
worker is unlinked. If wrap-up work remains, resume or relink a worker. After an
|
|
64
|
+
end, a live worker
|
|
65
|
+
still linked to the task, or the Done orchestrator, gets a new one.
|
|
@@ -27,7 +27,7 @@ must be a tested submission on this task or a carried submission with a tested
|
|
|
27
27
|
origin. Carry chains retain the supplied source and pin the original tested row;
|
|
28
28
|
no git ancestry is checked. `skipped` requires a reason. `tested` permits a reason;
|
|
29
29
|
only `carried` permits `from`. Supplied reasons are nonblank literal text of
|
|
30
|
-
at most 2,000 UTF-16 units. Workers and column orchestrators keep their
|
|
30
|
+
at most 2,000 UTF-16 units. Workers and column orchestrators keep their
|
|
31
31
|
submit permissions for every basis. All bases close turns and follow the same
|
|
32
32
|
head confirmation and gates; only returns increment course and cycle counts.
|
|
33
33
|
|
|
@@ -40,7 +40,8 @@ pre-update backup restore; the migrated database has no downgrade guarantee.
|
|
|
40
40
|
After a catalog upgrade, restart the daemon and MCP clients together.
|
|
41
41
|
|
|
42
42
|
A new head closes taken turns outside Dev and Done; taken Dev turns and Done
|
|
43
|
-
wrap-up turns survive pushes, and a wrap-up turn closes when its holder ends
|
|
43
|
+
wrap-up turns survive pushes, and a wrap-up turn closes when its holder ends or,
|
|
44
|
+
untaken, no recipient is left.
|
|
44
45
|
Right of Dev, red CI, a draft, a conflict, an external comment or an unresolved
|
|
45
46
|
thread where required returns the task to Dev at once, unless a turn is taken; then after its submit or return.
|
|
46
47
|
The Dev turn hands the comments, beside a return's `code` block.
|
|
@@ -76,11 +77,11 @@ An accepted ended session holding the current non-Done turn raises one
|
|
|
76
77
|
counts, including unknown; an open PR or another linked live session does not
|
|
77
78
|
resolve the held turn. Start a replacement worker, retake an operator turn
|
|
78
79
|
(`board inbox ack`), or archive the task. The item clears on turn closure,
|
|
79
|
-
|
|
80
|
+
holder replacement, archive or departure from the column visit. Existing
|
|
80
81
|
ended-holder stall blocks withdraw with a recorded reason,
|
|
81
|
-
even while Spur is blind. Removing a link alone leaves
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
even while Spur is blind. Removing a link alone leaves a taken turn unresolved.
|
|
83
|
+
Stopped sessions with no end time keep stall timing;
|
|
84
|
+
untaken Done wrap-ups close only when no live worker or Done orchestrator is left.
|
|
84
85
|
|
|
85
86
|
## Doorbells
|
|
86
87
|
|
|
@@ -103,10 +104,9 @@ curator questions move to operator.
|
|
|
103
104
|
|
|
104
105
|
A taken turn is reminded, then flagged stuck, after `health.idleInDevAfterMs` of quiet;
|
|
105
106
|
a named column orchestrator's turn uses the column's
|
|
106
|
-
`quietTurnAfterMs
|
|
107
|
-
its `noRecipientAfterMs` (default 10 minutes,
|
|
108
|
-
|
|
109
|
-
or finished state), the operator gets one `no-session:` inbox item per column.
|
|
107
|
+
`quietTurnAfterMs`. When the column's untaken turns have no live session to ring for
|
|
108
|
+
its `noRecipientAfterMs` (default 10 minutes, from the later of the ring's creation and the
|
|
109
|
+
loss of the last eligible recipient: its first end, absence or finished state), the operator gets one `no-session:` inbox item per column.
|
|
110
110
|
|
|
111
111
|
A holder can [wait on its turn](how-board-works-waits.md).
|
|
112
112
|
|