spur-board 0.56.0 → 0.57.0

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,4 +1,4 @@
1
- import { $ as errorContextSchema, S as renderJsonError, Z as ERRORS, c as tokenRequestStatusSchema, et as errorEnvelopeSchema, nt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-DfV3nwNC.mjs";
1
+ import { $ as errorContextSchema, S as renderJsonError, Z as ERRORS, c as tokenRequestStatusSchema, et as errorEnvelopeSchema, nt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-CTXzapf8.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -304,7 +304,8 @@ const columnConfig = z.strictObject({
304
304
  enabled: z.boolean().default(true).describe("false skips the column: tasks move past it and its exit condition is not checked. todo, dev and done cannot be disabled."),
305
305
  orchestrator: nonEmpty.default("none").describe("Who takes the column's turns. none: the task's live worker session, else the operator. operator: the operator, who also gets the questions asked in the column. Otherwise the name of a spurProjects entry whose sessions orchestrate the column and get the questions others ask in it."),
306
306
  cycleLimit: z.int().min(1).default(DEFAULT_CYCLE_LIMIT).describe("How many times a task may return to Dev from this column before the board stops it for the operator. Returns by the column executor, changes requested and external comments count; a conflict, red CI and a draft do not."),
307
- courseCheck: z.int().min(0).default(DEFAULT_COURSE_CHECK).describe("How many returns to Dev from this column, counted as for cycleLimit, before the board holds the task and asks the curator, or the operator when the project has no curator, to check its course. The answer resets the count and reaches the worker as a task comment. 0 turns the check off; cycleLimit is checked first.")
307
+ courseCheck: z.int().min(0).default(DEFAULT_COURSE_CHECK).describe("How many returns to Dev from this column, counted as for cycleLimit, before the board holds the task and asks courseCheckTo (by default the curator, or the operator when the project has no curator) to check its course. The answer resets the count and reaches the worker as a task comment. 0 turns the check off; cycleLimit is checked first."),
308
+ courseCheckTo: nonEmpty.optional().describe("Who answers this column's course check: operator, the curator's name, or the name of a column orchestrator. Without it, the curator, or the operator when the project has no curator. When the addressee has no live session the question moves to the operator; a conductor that is rung and does not answer keeps it, and the operator gets an item.")
308
309
  });
309
310
  /** The board rules: required columns present and enabled, built-ins in canonical order. */
310
311
  function checkBoard(items, ctx) {
@@ -409,6 +410,23 @@ const projectSchema = z.strictObject({
409
410
  message: `Unknown orchestrator ${JSON.stringify(orchestrator)}: use none, operator or a spurProjects name`
410
411
  });
411
412
  });
413
+ const curator = project.spurProjects.find((p) => p.role === "curator")?.name;
414
+ const orchestrators = new Set(project.columns.map((column) => column.orchestrator).filter((name) => name !== "none" && name !== "operator"));
415
+ project.columns.forEach(({ courseCheckTo }, j) => {
416
+ if (courseCheckTo === void 0 || courseCheckTo === "operator") return;
417
+ const known = spurNames.has(courseCheckTo);
418
+ if (known && (courseCheckTo === curator || orchestrators.has(courseCheckTo))) return;
419
+ const name = JSON.stringify(courseCheckTo);
420
+ ctx.addIssue({
421
+ code: "custom",
422
+ path: [
423
+ "columns",
424
+ j,
425
+ "courseCheckTo"
426
+ ],
427
+ message: known ? `courseCheckTo ${name} is not the curator and orchestrates no column: use operator, the curator or a column orchestrator` : `Unknown courseCheckTo ${name}: use operator or a spurProjects name`
428
+ });
429
+ });
412
430
  });
413
431
  /** A duration in integer milliseconds. Every duration key ends in `Ms`. */
414
432
  function durationMs(fallback, description) {
@@ -1,5 +1,5 @@
1
- import { _ as buildCatalogSnapshot, ct as configSchema, lt as plainHttpAllowed, y as OPERATIONS } from "./chunk-DfV3nwNC.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-aIvdot-z.mjs";
1
+ import { _ as buildCatalogSnapshot, ct as configSchema, lt as plainHttpAllowed, y as OPERATIONS } from "./chunk-CTXzapf8.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-BiDQ4g_3.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";
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { G as actorIdSchema, Z as ERRORS, a as requestHashOf, ct as configSchema, nt as successEnvelopeSchema, pt as SLACK_BOT_SCOPES, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as requiredSecretKeys, v as roleCanUseOperation, y as OPERATIONS } from "./chunk-DfV3nwNC.mjs";
1
+ import { G as actorIdSchema, Z as ERRORS, a as requestHashOf, ct as configSchema, nt as successEnvelopeSchema, pt as SLACK_BOT_SCOPES, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as requiredSecretKeys, v as roleCanUseOperation, y as OPERATIONS } from "./chunk-CTXzapf8.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-DAMwWWmT.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-aIvdot-z.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-DeAk_J4r.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-BiDQ4g_3.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-Fhr2daA8.mjs";
5
5
  import { createHash, randomBytes, randomUUID } from "node:crypto";
6
6
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
7
7
  import { homedir, hostname, userInfo } from "node:os";
package/dist/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-aIvdot-z.mjs";
1
+ import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-BiDQ4g_3.mjs";
2
2
  export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as EVENT_KINDS, B as ringMarker, D as interactionRefSchema, E as inboundEventSchema, F as SESSION_STATUSES, G as actorIdSchema, H as ticketFactsSchema, I as isExternalAuthor, J as parseActorId, K as encodeActorId, L as parseRingMarker, M as PR_STATES, N as REVIEW_STATES, O as messageRefSchema, P as SESSION_HEALTH_STATES, Q as err, R as prFactsSchema, T as conversationRefSchema, U as JIRA_PROJECT_KEY, V as sessionFactsSchema, W as REF_NUMBER, X as taskKeySchema, Y as parseRef$1, Z as ERRORS, _ as buildCatalogSnapshot, a as requestHashOf, b as turnHandedSchema, c as tokenRequestStatusSchema, ct as configSchema, d as AdapterError, dt as COLUMN_IDS, f as batchSchema, ft as DISPATCHER_MODES, g as trackerSourceId, h as sourceCursorSchema, i as TOKEN_REQUEST_LIMITS, it as DEFAULT_LINK, j as eventPayloadSchemas, k as userIdSchema, l as BOARD_TICK_MS, lt as plainHttpAllowed, m as prSourceId, mt as TASK_HOLDS, n as doctorReportSchema, nt as successEnvelopeSchema, o as tokenRequestResultSchema, ot as DEFAULT_SLACK_COMMAND, p as entityRefSchema, pt as SLACK_BOT_SCOPES, q as errorCodeOf, s as tokenRequestSchema, st as RESERVED_PROJECT, t as assertNever, tt as ok, ut as requiredSecretKeys, v as roleCanUseOperation, w as SPACE_IDS, x as renderHttpProblem, y as OPERATIONS, z as prRefSchema } from "./chunk-DfV3nwNC.mjs";
1
+ import { A as EVENT_KINDS, B as ringMarker, D as interactionRefSchema, E as inboundEventSchema, F as SESSION_STATUSES, G as actorIdSchema, H as ticketFactsSchema, I as isExternalAuthor, J as parseActorId, K as encodeActorId, L as parseRingMarker, M as PR_STATES, N as REVIEW_STATES, O as messageRefSchema, P as SESSION_HEALTH_STATES, Q as err, R as prFactsSchema, T as conversationRefSchema, U as JIRA_PROJECT_KEY, V as sessionFactsSchema, W as REF_NUMBER, X as taskKeySchema, Y as parseRef$1, Z as ERRORS, _ as buildCatalogSnapshot, a as requestHashOf, b as turnHandedSchema, c as tokenRequestStatusSchema, ct as configSchema, d as AdapterError, dt as COLUMN_IDS, f as batchSchema, ft as DISPATCHER_MODES, g as trackerSourceId, h as sourceCursorSchema, i as TOKEN_REQUEST_LIMITS, it as DEFAULT_LINK, j as eventPayloadSchemas, k as userIdSchema, l as BOARD_TICK_MS, lt as plainHttpAllowed, m as prSourceId, mt as TASK_HOLDS, n as doctorReportSchema, nt as successEnvelopeSchema, o as tokenRequestResultSchema, ot as DEFAULT_SLACK_COMMAND, p as entityRefSchema, pt as SLACK_BOT_SCOPES, q as errorCodeOf, s as tokenRequestSchema, st as RESERVED_PROJECT, t as assertNever, tt as ok, ut as requiredSecretKeys, v as roleCanUseOperation, w as SPACE_IDS, x as renderHttpProblem, y as OPERATIONS, z as prRefSchema } from "./chunk-CTXzapf8.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -9978,16 +9978,17 @@ async function restartNotification(trx, sourceKey, at) {
9978
9978
  }).where("source_key", "=", sourceKey).where("acked_at", "is", null).where("exhausted_at", "is not", null).returning("id").executeTakeFirst() === void 0) throw new CommandError("retry_not_applicable", "The doorbell was read or is still ringing; close the item instead.");
9979
9979
  }
9980
9980
  /**
9981
- * Ends a notification's ring series. A curator block moves to the operator; a removal, a turn
9982
- * reminder or a ring with no session to name ends alone; anything else raises the operator item, whose Retry restarts
9983
- * the series (`restartNotification`). Every end journals `doorbell_undelivered`.
9981
+ * Ends a notification's ring series. A curator block, and a block that ended with no session
9982
+ * (`noRecipientEnd`), move to the operator; a removal, a turn reminder or another ring with no
9983
+ * session to name ends alone; anything else raises the operator item, whose Retry restarts the
9984
+ * series (`restartNotification`). Every end journals `doorbell_undelivered`.
9984
9985
  */
9985
9986
  async function endNotification(trx, n, task, end) {
9986
9987
  const { session, reason, at, config } = end;
9987
9988
  await trx.updateTable("notification").set({ exhausted_at: at.toISOString() }).where("id", "=", n.id).execute();
9988
9989
  if (n.rings === 0) await releaseAfterCourseNote(trx, n, at);
9989
9990
  const addressee = parseAddressee(n.role);
9990
- if (n.kind === "block" && addressee.kind === "curator") await moveBlockToAddressee(trx, {
9991
+ if (n.kind === "block" && (addressee.kind === "curator" || session === null)) await moveBlockToAddressee(trx, {
9991
9992
  task,
9992
9993
  block: await trx.selectFrom("block").selectAll().where("id", "=", noticeBlockId(n)).executeTakeFirstOrThrow(),
9993
9994
  to: "operator",
@@ -10052,10 +10053,17 @@ async function ringUndelivered(trx, input) {
10052
10053
  config: input.config
10053
10054
  });
10054
10055
  }
10055
- /** Why a notification with no recipient ends now, or null when it stays due for a next session. */
10056
- function noRecipientEnd(n) {
10056
+ /**
10057
+ * Why a notification with no recipient ends now, or null when it stays due for a next session. A
10058
+ * curator block, and an orchestrator block of a course check, end with `session: null`, which
10059
+ * `endNotification` turns into a move to the operator.
10060
+ */
10061
+ async function noRecipientEnd(trx, n) {
10057
10062
  if (n.kind === "removed" || n.kind === "turn_reminder" || n.kind === "answer" && n.role === "operator") return "no live addressee";
10058
- return n.kind === "block" && n.role === "curator" ? "no live curator session" : null;
10063
+ if (n.kind !== "block") return null;
10064
+ if (n.role === "curator") return "no live curator session";
10065
+ if (parseAddressee(n.role).kind !== "orchestrator") return null;
10066
+ return await trx.selectFrom("operator_item").select("id").where("kind", "=", "course_check").where("block_id", "=", noticeBlockId(n)).executeTakeFirst() === void 0 ? null : "no live orchestrator session";
10059
10067
  }
10060
10068
  /** A ring never carries comment or reason text: only where to look. */
10061
10069
  async function ringText(trx, n, task, ring) {
@@ -10090,7 +10098,7 @@ async function reconcileDoorbells(trx, at, config) {
10090
10098
  const session = await selectNotificationRecipient(trx, n, config);
10091
10099
  const keepsRings = resolvedByProject(n.role);
10092
10100
  if (session === void 0) {
10093
- const reason = noRecipientEnd(n);
10101
+ const reason = await noRecipientEnd(trx, n);
10094
10102
  if (reason !== null) await endNotification(trx, n, await trx.selectFrom("task").selectAll().where("id", "=", n.task_id).executeTakeFirstOrThrow(), {
10095
10103
  session: null,
10096
10104
  reason,
@@ -13854,8 +13862,8 @@ async function returnCounts(trx, taskId, column) {
13854
13862
  }
13855
13863
  /**
13856
13864
  * Raises the course check of a task's column, once while it is open: a `system` question to the
13857
- * curator, or to the operator when the project has no curator, with the open findings in its
13858
- * reason. The answer to the block resets the course count.
13865
+ * column's `courseCheckTo` addressee (`courseAddressee`), with the open findings in its reason.
13866
+ * The answer to the block resets the course count.
13859
13867
  */
13860
13868
  async function raiseCourseCheck(trx, input) {
13861
13869
  const { task, column, count, at, config } = input;
@@ -13868,7 +13876,7 @@ async function raiseCourseCheck(trx, input) {
13868
13876
  reason: await courseSummary(trx, task, column, count, url),
13869
13877
  at: at.toISOString(),
13870
13878
  config,
13871
- addressee: curatorProject(config, task.project) === null ? "operator" : "curator"
13879
+ addressee: courseAddressee(config, task.project, column)
13872
13880
  });
13873
13881
  return raiseItem(trx, {
13874
13882
  itemKey,
@@ -13880,6 +13888,21 @@ async function raiseCourseCheck(trx, input) {
13880
13888
  at
13881
13889
  });
13882
13890
  }
13891
+ /**
13892
+ * Who a column's course check asks: `courseCheckTo` read as the operator, the curator, or the
13893
+ * orchestrator of this column or else of the first column it orchestrates. Without the key, or
13894
+ * with a name that no longer fits, the curator, or the operator when the project has none.
13895
+ */
13896
+ function courseAddressee(config, projectId, column) {
13897
+ const fallback = curatorProject(config, projectId) === null ? "operator" : "curator";
13898
+ const columns = config.projects.find((project) => project.id === projectId)?.columns ?? [];
13899
+ const to = columns.find((c) => c.id === column)?.courseCheckTo;
13900
+ if (to === void 0) return fallback;
13901
+ if (to === "operator") return "operator";
13902
+ if (to === curatorProject(config, projectId)) return "curator";
13903
+ const orchestrated = columns.find((c) => c.id === column && c.orchestrator === to) ?? columns.find((c) => c.orchestrator === to);
13904
+ return orchestrated === void 0 ? fallback : `orchestrator:${orchestrated.id}`;
13905
+ }
13883
13906
  /** The question of a course check: the count, the open findings and the links. */
13884
13907
  async function courseSummary(trx, task, column, count, url) {
13885
13908
  const pr = await prFacts(trx, task.id);
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { C as renderMcpError, Z as ERRORS, y as OPERATIONS } from "./chunk-DfV3nwNC.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-aIvdot-z.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-DeAk_J4r.mjs";
1
+ import { C as renderMcpError, Z as ERRORS, y as OPERATIONS } from "./chunk-CTXzapf8.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-BiDQ4g_3.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-Fhr2daA8.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.56.0",
3
+ "version": "0.57.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"