spur-board 0.113.0 → 0.113.2

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.
@@ -1,5 +1,5 @@
1
- import { d as buildCatalogSnapshot, gt as plainHttpAllowed, mt as configSchema, p as OPERATIONS } from "./chunk-5l4Msgb0.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-Bw_gFKmQ.mjs";
1
+ import { d as buildCatalogSnapshot, gt as plainHttpAllowed, mt as configSchema, p as OPERATIONS } from "./chunk-rTvExhCq.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-D8Hzrgjz.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 { _ as renderJsonError, at as successEnvelopeSchema, c as tokenRequestStatusSchema, et as ERRORS, nt as errorContextSchema, o as tokenRequestResultSchema, rt as errorEnvelopeSchema } from "./chunk-5l4Msgb0.mjs";
1
+ import { _ as renderJsonError, at as successEnvelopeSchema, c as tokenRequestStatusSchema, et as ERRORS, nt as errorContextSchema, o as tokenRequestResultSchema, rt as errorEnvelopeSchema } from "./chunk-rTvExhCq.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -666,7 +666,7 @@ const configObject = z.strictObject({
666
666
  appId: z.string().regex(/^A[A-Z0-9]+$/, "Expected a Slack app ID").optional().describe("Slack app ID, such as A0123456789. When slack.channels is set and SLACK_APP_CONFIG_TOKEN is present, board doctor reads this app's manifest to check the installed slash command against slack.command."),
667
667
  channels: z.strictObject({
668
668
  orchestrators: nonEmpty.optional().describe("Slack channel ID, such as C0123456789, where the board opens a thread for each block addressed to the operator by someone else. Once either channel is set, the daemon does not start without the other channel and SLACK_BOT_TOKEN, and without SLACK_APP_TOKEN it reads nothing from Slack."),
669
- feed: nonEmpty.optional().describe("Slack channel ID where the board posts a line for each curator answer, each newly installed version, each revoked operator token, each `/board tokens` list and each operator item, with the buttons the operator presses. Operator items about failed Slack posts, transport health, undelivered answers and ended workers, and those shown as operator blocks, get no feed line. A line whose item clears before it is first sent, such as an expired token request, is dropped. Set it together with orchestrators.")
669
+ feed: nonEmpty.optional().describe("Slack channel ID where the board posts a line for each curator answer, each newly installed version, each revoked operator token, each `/board tokens` list and each operator item, with the buttons the operator presses. Operator items about failed Slack posts, transport health and undelivered answers, and those shown as operator blocks, get no feed line. A line whose item clears before it is first sent, such as an expired token request, is dropped. Set it together with orchestrators.")
670
670
  }).prefault({}),
671
671
  defaultAddressee: z.string().optional().describe("The shortName, top-level or under projects[].spurProjects, of the Spur project that gets a new orchestrators-channel message which does not start with a known @<shortName>. Without it, such a message goes to the top-level spurProjects operator; without one, when any shortName is set, to the operator of the first board project that lists one; otherwise it gets one reply listing the valid prefixes, or is skipped when no shortName is configured.")
672
672
  }).prefault({}),
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { St as SLACK_BOT_SCOPES, Y as actorIdSchema, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, et as ERRORS, f as roleCanUseOperation, mt as configSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as DEFAULT_STAND_PORT_RANGE, vt as resolveWebOrigin } from "./chunk-5l4Msgb0.mjs";
1
+ import { St as SLACK_BOT_SCOPES, Y as actorIdSchema, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, et as ERRORS, f as roleCanUseOperation, mt as configSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as DEFAULT_STAND_PORT_RANGE, vt as resolveWebOrigin } from "./chunk-rTvExhCq.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-Bw_gFKmQ.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-DFqvm5hQ.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-D8Hzrgjz.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-CmspwSGJ.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-Bw_gFKmQ.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-D8Hzrgjz.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as parseRef$1, A as defaultBranchFactSchema, B as isExternalAuthor, C as messageRefSchema, Ct as TASK_HOLDS, D as eventPayloadSchemas, E as GATE_REASONS, F as trackerSourceId, G as sessionFactsSchema, H as prFactsSchema, I as PR_STATES, J as REF_NUMBER, K as ticketFactsSchema, L as REVIEW_STATES, M as prSourceId, N as sessionTransitionSchema, O as AdapterError, P as sourceCursorSchema, Q as parseActorId, R as SESSION_HEALTH_STATES, S as interactionRefSchema, St as SLACK_BOT_SCOPES, T as EVENT_KINDS, U as prRefSchema, V as parseRingMarker, W as ringMarker, X as encodeActorId, Y as actorIdSchema, Z as errorCodeOf, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, b as conversationRefSchema, bt as DISPATCHER_MODES, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as RESERVED_PROJECT, et as ERRORS, f as roleCanUseOperation, ft as boardWideSpurProject, g as renderHttpProblem, gt as plainHttpAllowed, h as turnHandedSchema, ht as defaultAddressee, i as TOKEN_REQUEST_LIMITS, it as ok, j as entityRefSchema, k as batchSchema, l as BOARD_TICK_MS, lt as DEFAULT_SLACK_COMMAND, m as defaultBranchViewSchema, mt as configSchema, n as doctorReportSchema, o as tokenRequestResultSchema, p as OPERATIONS, pt as configBindings, q as JIRA_PROJECT_KEY, s as tokenRequestSchema, st as DEFAULT_LINK, t as assertNever, tt as err, vt as resolveWebOrigin, w as userIdSchema, wt as VIAS, x as inboundEventSchema, xt as ITEM_KINDS, y as SPACE_IDS, yt as COLUMN_IDS, z as SESSION_STATUSES } from "./chunk-5l4Msgb0.mjs";
1
+ import { $ as parseRef$1, A as defaultBranchFactSchema, B as isExternalAuthor, C as messageRefSchema, Ct as TASK_HOLDS, D as eventPayloadSchemas, E as GATE_REASONS, F as trackerSourceId, G as sessionFactsSchema, H as prFactsSchema, I as PR_STATES, J as REF_NUMBER, K as ticketFactsSchema, L as REVIEW_STATES, M as prSourceId, N as sessionTransitionSchema, O as AdapterError, P as sourceCursorSchema, Q as parseActorId, R as SESSION_HEALTH_STATES, S as interactionRefSchema, St as SLACK_BOT_SCOPES, T as EVENT_KINDS, U as prRefSchema, V as parseRingMarker, W as ringMarker, X as encodeActorId, Y as actorIdSchema, Z as errorCodeOf, _t as requiredSecretKeys, a as requestHashOf, at as successEnvelopeSchema, b as conversationRefSchema, bt as DISPATCHER_MODES, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, dt as RESERVED_PROJECT, et as ERRORS, f as roleCanUseOperation, ft as boardWideSpurProject, g as renderHttpProblem, gt as plainHttpAllowed, h as turnHandedSchema, ht as defaultAddressee, i as TOKEN_REQUEST_LIMITS, it as ok, j as entityRefSchema, k as batchSchema, l as BOARD_TICK_MS, lt as DEFAULT_SLACK_COMMAND, m as defaultBranchViewSchema, mt as configSchema, n as doctorReportSchema, o as tokenRequestResultSchema, p as OPERATIONS, pt as configBindings, q as JIRA_PROJECT_KEY, s as tokenRequestSchema, st as DEFAULT_LINK, t as assertNever, tt as err, vt as resolveWebOrigin, w as userIdSchema, wt as VIAS, x as inboundEventSchema, xt as ITEM_KINDS, y as SPACE_IDS, yt as COLUMN_IDS, z as SESSION_STATUSES } from "./chunk-rTvExhCq.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";
@@ -8658,7 +8658,7 @@ const ITEM_POLICY = {
8658
8658
  },
8659
8659
  worker_ended: {
8660
8660
  retry: "none",
8661
- feed: false,
8661
+ feed: true,
8662
8662
  priority: 4,
8663
8663
  buttons: "item",
8664
8664
  reconciled: true,
@@ -15538,7 +15538,7 @@ function evaluateSessionHealth(input) {
15538
15538
  seen.add(identity);
15539
15539
  const task = tasks[session.taskId];
15540
15540
  if (session.endedAt !== null) {
15541
- if (session.role === "worker" && (session.endReason === "complete" || session.endReason === "kill" || session.endReason === "vanished") && task !== void 0 && !task.hasOpenPr && !task.hasMergedPr && !liveWorkerTasks.has(session.taskId)) {
15541
+ if (session.role === "worker" && (session.endReason === "complete" || session.endReason === "kill" || session.endReason === "vanished") && task !== void 0 && !task.ticketDone && !task.hasOpenPr && !task.hasMergedPr && !liveWorkerTasks.has(session.taskId)) {
15542
15542
  const flag = {
15543
15543
  taskId: session.taskId,
15544
15544
  sessionId: session.id,
@@ -15672,7 +15672,7 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
15672
15672
  }
15673
15673
  const tasks = await trx.selectFrom("task").selectAll().where("membership", "!=", "archived").execute();
15674
15674
  const taskById = new Map(tasks.map((task) => [task.id, task]));
15675
- const endedHolders = await endedTurnItems(trx, taskById, candidates, new Date(now));
15675
+ const endedHolders = await endedTurnItems(trx, taskById, candidates, new Date(now), sourceById.get("spur")?.last_complete_at ?? null);
15676
15676
  const misses = await trx.selectFrom("source_miss").selectAll().execute();
15677
15677
  for (const miss of misses) {
15678
15678
  if (miss.gone !== 1) continue;
@@ -15783,12 +15783,6 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
15783
15783
  "pr_snapshot.observed_at",
15784
15784
  "pr_snapshot.detail"
15785
15785
  ]).where("link.entity", "=", "pr").where("link.banned", "=", 0).where(pastReopenFloor).execute();
15786
- const taskPrs = {};
15787
- for (const task of tasks) taskPrs[String(task.id)] = {
15788
- hasOpenPr: false,
15789
- hasMergedPr: false,
15790
- prCompleteAt: prCompleteAt(config.projects.find((entry) => entry.id === task.project), sourceById)
15791
- };
15792
15786
  const tickets = await trx.selectFrom("ticket_snapshot").select([
15793
15787
  "task_id",
15794
15788
  "status",
@@ -15796,6 +15790,17 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
15796
15790
  "source",
15797
15791
  "observed_at"
15798
15792
  ]).execute();
15793
+ const taskPrs = {};
15794
+ for (const task of tasks) {
15795
+ const project = config.projects.find((entry) => entry.id === task.project);
15796
+ const ticket = tickets.find((entry) => entry.task_id === task.id);
15797
+ taskPrs[String(task.id)] = {
15798
+ hasOpenPr: false,
15799
+ hasMergedPr: false,
15800
+ prCompleteAt: prCompleteAt(project, sourceById),
15801
+ ticketDone: project !== void 0 && ticket !== void 0 && ticketDone(project, ticket.status)
15802
+ };
15803
+ }
15799
15804
  const mergedAt = /* @__PURE__ */ new Map();
15800
15805
  for (const pr of prs) {
15801
15806
  const state = taskPrs[String(pr.task_id)];
@@ -16031,7 +16036,7 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
16031
16036
  kind: ANOMALY_FLAGS.has(flag.kind) && !asking ? "anomaly" : flag.kind === "worker_killed" ? "worker_ended" : "board_observation",
16032
16037
  taskId: task.id,
16033
16038
  summary: `${task.key}: ${endedLabel ?? flag.kind.replaceAll("_", " ")} (${flag.sessionId})`,
16034
- factAt: fact?.healthSince ?? null,
16039
+ factAt: endedLabel === void 0 ? fact?.healthSince ?? null : spur?.last_complete_at ?? fact?.endedAt ?? null,
16035
16040
  source: "spur",
16036
16041
  priority: 4,
16037
16042
  revision: endedLabel === void 0 ? fact?.healthSince ?? null : fact?.endedAt ?? null
@@ -16072,7 +16077,7 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
16072
16077
  sessionId: subject.id,
16073
16078
  kind: subject.role === "worker" ? "stuck_worker" : "stuck_orchestrator"
16074
16079
  })));
16075
- const spurHeld = spurBlind ? await blindHeldKeys(trx, subjects.filter((subject) => !endedHolders.has(`${subject.taskId}:${subject.id}`))) : /* @__PURE__ */ new Set();
16080
+ const spurHeld = spurBlind ? await blindHeldKeys(trx, subjects.filter((subject) => !endedHolders.has(`${subject.taskId}:${subject.id}`) && !(subject.endedAt !== null && taskPrs[subject.taskId]?.ticketDone === true))) : /* @__PURE__ */ new Set();
16076
16081
  if (stallBlind) for (const key of stallHeld) spurHeld.add(key);
16077
16082
  for (const item of existing) {
16078
16083
  if (item.kind !== "anomaly") continue;
@@ -16191,7 +16196,7 @@ async function closeEndedDoneTurns(trx, at) {
16191
16196
  }
16192
16197
  }
16193
16198
  /** Raise ended-holder attention from ownership, independent of links, PRs and source freshness. */
16194
- async function endedTurnItems(trx, tasks, candidates, at) {
16199
+ async function endedTurnItems(trx, tasks, candidates, at, spurConfirmedAt) {
16195
16200
  const holders = /* @__PURE__ */ new Set();
16196
16201
  const turns = await trx.selectFrom("turn").selectAll().where("closed_at", "is", null).where("acked_at", "is not", null).execute();
16197
16202
  for (const turn of turns) {
@@ -16214,7 +16219,7 @@ async function endedTurnItems(trx, tasks, candidates, at) {
16214
16219
  kind: "worker_ended",
16215
16220
  taskId: task.id,
16216
16221
  summary: `${task.key}: turn T${String(turn.id)} holder ${sessionId} ended`,
16217
- factAt: session.ended_at,
16222
+ factAt: spurConfirmedAt ?? session.ended_at,
16218
16223
  revision: session.ended_at,
16219
16224
  source: "spur",
16220
16225
  priority: 4
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { et as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-5l4Msgb0.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-Bw_gFKmQ.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-DFqvm5hQ.mjs";
1
+ import { et as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-rTvExhCq.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-D8Hzrgjz.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CmspwSGJ.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";