spur-board 0.63.3 → 0.63.5

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, Z as ERRORS, c as tokenRequestStatusSchema, et as errorEnvelopeSchema, g as renderJsonError, nt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-BONq7Qxa.mjs";
1
+ import { $ as errorContextSchema, Z as ERRORS, c as tokenRequestStatusSchema, et as errorEnvelopeSchema, g as renderJsonError, nt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-BdO94P44.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -1190,7 +1190,8 @@ const feedbackSchema = z.strictObject({
1190
1190
  type: z.enum(AUTHOR_TYPES).describe("Whether the author is a user or a bot.")
1191
1191
  }).nullable().describe("Who posted it; null for a deleted account."),
1192
1192
  postedAt: at$2.describe("When the comment was posted or the review submitted."),
1193
- state: z.enum(REVIEW_STATES).optional().describe("State of this review; missing for a comment and in snapshots written before it.")
1193
+ state: z.enum(REVIEW_STATES).optional().describe("State of this review; missing for a comment and in snapshots written before it."),
1194
+ statusComment: z.literal(true).optional().describe("True for a status comment of a reviewer service, marked by its last line; it is not external feedback. Missing otherwise.")
1194
1195
  });
1195
1196
  const prFactsSchema = z.strictObject({
1196
1197
  repo: repoSlugSchema.describe("Repository as owner/name."),
@@ -1,5 +1,5 @@
1
- import { ct as configSchema, d as buildCatalogSnapshot, lt as plainHttpAllowed, p as OPERATIONS } from "./chunk-BONq7Qxa.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-CDacbdk2.mjs";
1
+ import { ct as configSchema, d as buildCatalogSnapshot, lt as plainHttpAllowed, p as OPERATIONS } from "./chunk-BdO94P44.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-BJMN8jrU.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 { K as actorIdSchema, Z as ERRORS, a as requestHashOf, ct as configSchema, f as roleCanUseOperation, nt as successEnvelopeSchema, p as OPERATIONS, pt as SLACK_BOT_SCOPES, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as requiredSecretKeys } from "./chunk-BONq7Qxa.mjs";
1
+ import { K as actorIdSchema, Z as ERRORS, a as requestHashOf, ct as configSchema, f as roleCanUseOperation, nt as successEnvelopeSchema, p as OPERATIONS, pt as SLACK_BOT_SCOPES, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as requiredSecretKeys } from "./chunk-BdO94P44.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-CDacbdk2.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-B1XoUsys.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-BJMN8jrU.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-CNZV8Ua0.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-CDacbdk2.mjs";
1
+ import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-BJMN8jrU.mjs";
2
2
  export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as sessionTransitionSchema, B as prRefSchema, C as userIdSchema, D as batchSchema, E as AdapterError, F as SESSION_HEALTH_STATES, G as REF_NUMBER, H as sessionFactsSchema, I as SESSION_STATUSES, J as errorCodeOf, K as actorIdSchema, L as isExternalAuthor, M as trackerSourceId, N as PR_STATES, O as entityRefSchema, P as REVIEW_STATES, Q as err, R as parseRingMarker, S as messageRefSchema, T as eventPayloadSchemas, U as ticketFactsSchema, V as ringMarker, W as JIRA_PROJECT_KEY, X as parseRef$1, Y as parseActorId, Z as ERRORS, a as requestHashOf, b as inboundEventSchema, c as tokenRequestStatusSchema, ct as configSchema, d as buildCatalogSnapshot, dt as COLUMN_IDS, f as roleCanUseOperation, ft as DISPATCHER_MODES, h as renderHttpProblem, i as TOKEN_REQUEST_LIMITS, it as DEFAULT_LINK, j as sourceCursorSchema, k as prSourceId, l as BOARD_TICK_MS, lt as plainHttpAllowed, m as turnHandedSchema, mt as TASK_HOLDS, n as doctorReportSchema, nt as successEnvelopeSchema, o as tokenRequestResultSchema, ot as DEFAULT_SLACK_COMMAND, p as OPERATIONS, pt as SLACK_BOT_SCOPES, q as encodeActorId, s as tokenRequestSchema, st as RESERVED_PROJECT, t as assertNever, tt as ok, ut as requiredSecretKeys, v as SPACE_IDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as prFactsSchema } from "./chunk-BONq7Qxa.mjs";
1
+ import { A as sessionTransitionSchema, B as prRefSchema, C as userIdSchema, D as batchSchema, E as AdapterError, F as SESSION_HEALTH_STATES, G as REF_NUMBER, H as sessionFactsSchema, I as SESSION_STATUSES, J as errorCodeOf, K as actorIdSchema, L as isExternalAuthor, M as trackerSourceId, N as PR_STATES, O as entityRefSchema, P as REVIEW_STATES, Q as err, R as parseRingMarker, S as messageRefSchema, T as eventPayloadSchemas, U as ticketFactsSchema, V as ringMarker, W as JIRA_PROJECT_KEY, X as parseRef$1, Y as parseActorId, Z as ERRORS, a as requestHashOf, b as inboundEventSchema, c as tokenRequestStatusSchema, ct as configSchema, d as buildCatalogSnapshot, dt as COLUMN_IDS, f as roleCanUseOperation, ft as DISPATCHER_MODES, h as renderHttpProblem, i as TOKEN_REQUEST_LIMITS, it as DEFAULT_LINK, j as sourceCursorSchema, k as prSourceId, l as BOARD_TICK_MS, lt as plainHttpAllowed, m as turnHandedSchema, mt as TASK_HOLDS, n as doctorReportSchema, nt as successEnvelopeSchema, o as tokenRequestResultSchema, ot as DEFAULT_SLACK_COMMAND, p as OPERATIONS, pt as SLACK_BOT_SCOPES, q as encodeActorId, s as tokenRequestSchema, st as RESERVED_PROJECT, t as assertNever, tt as ok, ut as requiredSecretKeys, v as SPACE_IDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as prFactsSchema } from "./chunk-BdO94P44.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";
@@ -9858,9 +9858,12 @@ async function registerBlockNotification(trx, block, at) {
9858
9858
  }
9859
9859
  /**
9860
9860
  * Register an agent executor's turn. Core opens a turn, so no session authored it: the worker
9861
- * or column orchestrator the board selects is rung.
9861
+ * or column orchestrator the board selects is rung. A turn opened by the operation of the
9862
+ * session it would ring first rings only after `doorbells.firstRetryMs`, so an ack in that time
9863
+ * sends nothing.
9862
9864
  */
9863
- async function registerTurnNotification(trx, turn, at) {
9865
+ async function registerTurnNotification(trx, turn, at, opts) {
9866
+ const nextAt = await heldForOpener(trx, turn, opts) ? new Date(at.getTime() + opts.config.doorbells.firstRetryMs) : at;
9864
9867
  await trx.insertInto("notification").values({
9865
9868
  source_key: `turn:${String(turn.id)}:${turn.role}`,
9866
9869
  kind: "turn",
@@ -9872,13 +9875,25 @@ async function registerTurnNotification(trx, turn, at) {
9872
9875
  role: turn.role,
9873
9876
  author_session: null,
9874
9877
  recipient_session: null,
9875
- next_at: at.toISOString(),
9878
+ next_at: nextAt.toISOString(),
9876
9879
  last_outbox_id: null,
9877
9880
  acked_at: null,
9878
9881
  exhausted_at: null,
9879
9882
  created_at: at.toISOString()
9880
9883
  }).onConflict((oc) => oc.column("source_key").doNothing()).execute();
9881
9884
  }
9885
+ /** Whether the opener is the agent session the turn would ring now. */
9886
+ async function heldForOpener(trx, turn, opts) {
9887
+ const opener = opts.opener === void 0 ? void 0 : parseActorId(opts.opener);
9888
+ if (opener?.actor !== "agent") return false;
9889
+ return (await selectNotificationRecipient(trx, {
9890
+ task_id: turn.task_id,
9891
+ role: turn.role,
9892
+ author_session: null,
9893
+ kind: "turn",
9894
+ block_id: null
9895
+ }, opts.config))?.id === opener.actorRef.session;
9896
+ }
9882
9897
  /**
9883
9898
  * The key of the reminder to `session` about a turn it took at `takenAt`. The take time names the
9884
9899
  * ownership episode, so a session that loses the turn and takes it again gets a new reminder.
@@ -11281,7 +11296,7 @@ async function turnNotification(trx, turnId) {
11281
11296
  * An agent executor gets a ringing notification, the operator one `turn` item.
11282
11297
  */
11283
11298
  async function openTurn(trx, input) {
11284
- const { task, reason, handed, at, config } = input;
11299
+ const { task, reason, handed, at, config, opener } = input;
11285
11300
  const unclosed = await trx.selectFrom("turn").selectAll().where("task_id", "=", task.id).where("closed_at", "is", null).executeTakeFirst();
11286
11301
  if (unclosed?.column === task.column && unclosed.epoch === task.column_epoch) return unclosed;
11287
11302
  if (unclosed !== void 0) await closeTurns(trx, {
@@ -11319,7 +11334,10 @@ async function openTurn(trx, input) {
11319
11334
  blockId: null,
11320
11335
  at
11321
11336
  });
11322
- else await registerTurnNotification(trx, turn, at);
11337
+ else await registerTurnNotification(trx, turn, at, {
11338
+ config,
11339
+ opener
11340
+ });
11323
11341
  return turn;
11324
11342
  }
11325
11343
  /**
@@ -11388,10 +11406,11 @@ async function rerouteDemotedWorkerTurn(trx, input) {
11388
11406
  reason: "rerouted",
11389
11407
  at
11390
11408
  });
11409
+ const handed = await carriedFeedback(trx, turn);
11391
11410
  await openTurn(trx, {
11392
11411
  task,
11393
11412
  reason: turn.reason,
11394
- handed: turnHanded(turn),
11413
+ handed,
11395
11414
  at,
11396
11415
  config
11397
11416
  });
@@ -11540,7 +11559,34 @@ async function recalledFeedback(db, ref) {
11540
11559
  if (!isRecalled(row)) continue;
11541
11560
  for (const entry of handedOn(row, ref)) if (!entries.some((old) => sameHanded(old, entry))) entries.push(entry);
11542
11561
  }
11543
- return entries.sort((left, right) => isNewer(left, right) ? 1 : -1);
11562
+ return (await withoutStatusComments(db, entries)).sort((left, right) => isNewer(left, right) ? 1 : -1);
11563
+ }
11564
+ /** The feedback `turn` handed over, for the turn a reroute opens in its place. */
11565
+ async function carriedFeedback(db, turn) {
11566
+ return withoutStatusComments(db, turnHanded(turn));
11567
+ }
11568
+ /**
11569
+ * `entries` without those their PR's snapshot flags as a reviewer service's status comment
11570
+ * (`statusComment`): a turn may have handed one over before the flag existed. Every path that
11571
+ * hands earlier handed feedback over again reads it through here (`recalledFeedback`,
11572
+ * `carriedFeedback`). An entry whose snapshot is missing or unreadable stays.
11573
+ */
11574
+ async function withoutStatusComments(db, entries) {
11575
+ const flagged = [];
11576
+ const read = /* @__PURE__ */ new Set();
11577
+ for (const entry of entries) {
11578
+ const key = `${entry.repo.toLowerCase()}#${String(entry.number)}`;
11579
+ if (read.has(key)) continue;
11580
+ read.add(key);
11581
+ const snapshot = await db.selectFrom("pr_snapshot").select("detail").where(sql`lower(repo) = ${entry.repo.toLowerCase()}`).where("number", "=", entry.number).executeTakeFirst();
11582
+ for (const fact of parsePr(snapshot?.detail)?.feedback ?? []) if (fact.statusComment === true) flagged.push({
11583
+ ...entry,
11584
+ kind: fact.kind,
11585
+ id: fact.id,
11586
+ postedAt: fact.postedAt
11587
+ });
11588
+ }
11589
+ return entries.filter((entry) => !flagged.some((old) => sameHanded(old, entry)));
11544
11590
  }
11545
11591
  /** Whether two handed entries are the same feedback on the same PR. */
11546
11592
  function sameHanded(left, right) {
@@ -15376,10 +15422,12 @@ function externalApproval(pr, agentLogin) {
15376
15422
  * unless a correction or a reroute closed that turn untaken, or once a handling submission
15377
15423
  * (`handlingSubmits`) on this PR was made at or after it. The entries such an untaken turn handed
15378
15424
  * over come from the turn when a later poll dropped them from the snapshot (`recalledFeedback`).
15425
+ * A reviewer service's status comment (`statusComment`) never counts, and neither a recall nor a
15426
+ * reroute hands one over again (`withoutStatusComments` in `turns.ts`).
15379
15427
  */
15380
15428
  async function unhandledFeedback(trx, task, project, pr) {
15381
15429
  const approvals = pr.reviews.filter((review) => review.state === "approved");
15382
- const entries = (pr.feedback ?? []).filter((entry) => isExternalAuthor(entry, project.operatorGithubLogin) && !(entry.kind === "review" && (entry.state === void 0 ? approvals.some((review) => review.reviewer.toLowerCase() === entry.author?.login.toLowerCase() && Date.parse(review.submittedAt) === Date.parse(entry.postedAt)) : entry.state === "approved")));
15430
+ const entries = (pr.feedback ?? []).filter((entry) => isExternalAuthor(entry, project.operatorGithubLogin) && entry.statusComment !== true && !(entry.kind === "review" && (entry.state === void 0 ? approvals.some((review) => review.reviewer.toLowerCase() === entry.author?.login.toLowerCase() && Date.parse(review.submittedAt) === Date.parse(entry.postedAt)) : entry.state === "approved")));
15383
15431
  const submitted = (await handlingSubmits(trx, [task.id], [project])).filter((row) => submittedOn(row, pr));
15384
15432
  const newest = Math.max(...submitted.map((row) => Date.parse(row.submitted_at)));
15385
15433
  const [cursor] = await turnFeedbackCursors(trx, [{
@@ -15741,7 +15789,7 @@ async function applyOn(trx, task, read, result, ctx) {
15741
15789
  reason: "rerouted",
15742
15790
  at
15743
15791
  });
15744
- const carried = replaced === void 0 ? [] : turnHanded(replaced);
15792
+ const carried = replaced === void 0 ? [] : await carriedFeedback(trx, replaced);
15745
15793
  const handed = [...carried, ...read.handed.filter((entry) => !carried.some((old) => sameHanded(old, entry)))];
15746
15794
  const reason = read.mergedOpen === void 0 || turn.kind === "reroute" ? turnReason(turn, replaced?.reason) : `${turnReason(turn)} (PR ${read.mergedOpen.repo}#${String(read.mergedOpen.number)} merged, ticket still open)`;
15747
15795
  await openTurn(trx, {
@@ -15749,7 +15797,8 @@ async function applyOn(trx, task, read, result, ctx) {
15749
15797
  reason: handedBack === void 0 ? reason : `${reason} (submit of ${handedBack.sha.slice(0, 7)}: ${handedBack.failure})`,
15750
15798
  handed: current.column === "dev" ? handed : [],
15751
15799
  at,
15752
- config
15800
+ config,
15801
+ opener: ctx.actor
15753
15802
  });
15754
15803
  }
15755
15804
  /**
@@ -16456,13 +16505,14 @@ const CONFIRMATION = {
16456
16505
  function createTurnMutations(deps) {
16457
16506
  const { config, prPoller, completeSince } = deps;
16458
16507
  /** Dispatches the task after the command's change and returns its fresh row. */
16459
- async function dispatched(trx, taskId, at) {
16460
- await dispatchTasks(trx, [taskId], {
16508
+ async function dispatched(trx, id, at, actor) {
16509
+ await dispatchTasks(trx, [id], {
16461
16510
  config,
16462
16511
  at: new Date(at),
16463
- complete: completeSince
16512
+ complete: completeSince,
16513
+ actor
16464
16514
  });
16465
- return taskById(trx, taskId);
16515
+ return taskById(trx, id);
16466
16516
  }
16467
16517
  async function submitShadow(trx, input, ctx) {
16468
16518
  const task = await shadowTask(trx, input.turn, config);
@@ -16482,7 +16532,7 @@ function createTurnMutations(deps) {
16482
16532
  ...CONFIRMATION[confirmed]
16483
16533
  }, ctx.actor);
16484
16534
  return {
16485
- task: taskView(await dispatched(trx, task.id, ctx.at)),
16535
+ task: taskView(await dispatched(trx, task.id, ctx.at, ctx.actor)),
16486
16536
  turn: null,
16487
16537
  sha: input.sha,
16488
16538
  status: "confirmed"
@@ -16525,7 +16575,7 @@ function createTurnMutations(deps) {
16525
16575
  ...CONFIRMATION[confirmed]
16526
16576
  }, ctx.actor);
16527
16577
  return {
16528
- task: taskView(await dispatched(trx, task.id, ctx.at)),
16578
+ task: taskView(await dispatched(trx, task.id, ctx.at, ctx.actor)),
16529
16579
  turn: input.turn,
16530
16580
  sha: input.sha,
16531
16581
  status: confirmed === "pending" ? "pending" : "confirmed"
@@ -16549,7 +16599,7 @@ function createTurnMutations(deps) {
16549
16599
  turn: turnLabel(turn.id),
16550
16600
  block: `B${String(block.id)}`
16551
16601
  });
16552
- const moved = await dispatched(trx, task.id, ctx.at);
16602
+ const moved = await dispatched(trx, task.id, ctx.at, ctx.actor);
16553
16603
  return {
16554
16604
  task: taskView(moved),
16555
16605
  block: blockView(block, taskSubject(moved))
@@ -16579,7 +16629,7 @@ function createTurnMutations(deps) {
16579
16629
  reason: input.reason,
16580
16630
  config
16581
16631
  });
16582
- const settled = await dispatched(trx, task.id, ctx.at);
16632
+ const settled = await dispatched(trx, task.id, ctx.at, ctx.actor);
16583
16633
  return {
16584
16634
  task: taskView(settled),
16585
16635
  from: corrected.from,
@@ -19188,7 +19238,7 @@ function teamScopeDenied(error, query) {
19188
19238
  }
19189
19239
  const REVIEWER_FIELDS = "requestedReviewer { __typename ... on Bot { login } ... on Mannequin { login } ... on User { login } ... on Team { slug } ... on EnterpriseTeam { slug } } asCodeOwner";
19190
19240
  const REVIEW_FIELDS = "id author { __typename login } state commit { oid } submittedAt";
19191
- const COMMENT_FIELDS = "nodes { id author { __typename login } createdAt } pageInfo { hasPreviousPage startCursor }";
19241
+ const COMMENT_FIELDS = "nodes { id author { __typename login } createdAt body } pageInfo { hasPreviousPage startCursor }";
19192
19242
  const CLOSING_FIELDS = "nodes { number repository { nameWithOwner } } pageInfo { hasNextPage endCursor }";
19193
19243
  const prFields = (number, closing = false) => `id number url title updatedAt mergedAt closedAt state isDraft mergeable mergeStateStatus
19194
19244
  author { login } headRefName headRefOid
@@ -19397,7 +19447,8 @@ const nodes = (node) => z.object({ nodes: z.array(node) });
19397
19447
  const commentWire = z.object({
19398
19448
  id: z.string().min(1),
19399
19449
  author: typedActor,
19400
- createdAt: z.iso.datetime()
19450
+ createdAt: z.iso.datetime(),
19451
+ body: z.string().optional()
19401
19452
  });
19402
19453
  const loginReviewer = (type) => z.object({
19403
19454
  __typename: z.literal(type),
@@ -19556,6 +19607,16 @@ function feedbackAuthor(wire) {
19556
19607
  type: wire.__typename === "Bot" ? "bot" : "user"
19557
19608
  };
19558
19609
  }
19610
+ const STATUS_LINE = new RegExp(`^<!-- (?:${["board-reviewer-progress", "board-reviewer-unavailable"].join("|")}):\\S+ -->$`);
19611
+ /**
19612
+ * Whether a comment body is a reviewer service's status comment: its last non-blank line, with
19613
+ * trailing whitespace trimmed, is exactly one of the `STATUS_MARKERS` markers. A quoted marker,
19614
+ * a marker followed by text or one inside a line does not match; a missing body never does.
19615
+ */
19616
+ function isStatusComment(body) {
19617
+ const last = body?.trimEnd().split("\n").at(-1);
19618
+ return last !== void 0 && STATUS_LINE.test(last);
19619
+ }
19559
19620
  function feedbackOf(reviews, comments, held) {
19560
19621
  const entries = /* @__PURE__ */ new Map();
19561
19622
  const add = (entry) => {
@@ -19566,7 +19627,8 @@ function feedbackOf(reviews, comments, held) {
19566
19627
  kind: "comment",
19567
19628
  id: node.id,
19568
19629
  author: feedbackAuthor(node.author),
19569
- postedAt: node.createdAt
19630
+ postedAt: node.createdAt,
19631
+ ...isStatusComment(node.body) ? { statusComment: true } : {}
19570
19632
  });
19571
19633
  for (const node of reviews) {
19572
19634
  if (node.submittedAt == null) continue;
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { Z as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-BONq7Qxa.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-CDacbdk2.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-B1XoUsys.mjs";
1
+ import { Z as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-BdO94P44.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-BJMN8jrU.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CNZV8Ua0.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.63.3",
3
+ "version": "0.63.5",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -1,147 +1,158 @@
1
1
  # How the Board works
2
2
 
3
- Start with `board task <task> --why`: it explains the gates, holds, open turn and
4
- last moves behind the task's position.
3
+ `board task <task> --why`: gates, holds, waits, turn and moves.
5
4
 
6
5
  ## Columns and executors
7
6
 
8
- The fixed order is `todo`, `ready-for-dev`, `dev`, `review`, `product-review`,
7
+ Order: `todo`, `ready-for-dev`, `dev`, `review`, `product-review`,
9
8
  `external-review`, `qa`, `ready-to-merge`, `done`.
10
- `projects[].columns[].enabled` false, or omitting an optional column, skips it and
11
- its gate; To Do, Dev and Done must stay enabled.
9
+ `projects[].columns[].enabled` false or an omitted optional column skips its gate;
10
+ To Do, Dev and Done stay enabled.
12
11
 
13
- Each column has one executor, selected by `projects[].columns[].orchestrator`:
14
- `none` uses the task's live worker, falling back to the operator; `operator` uses
15
- the operator; another value names a configured Spur project whose session takes
16
- the turn. The worker owns the code and branch. Other column executors inspect the
17
- head and submit it or return it with findings; they do not push to that branch.
12
+ Each column has one executor: `projects[].columns[].orchestrator` selects
13
+ `none` (live worker, else operator), `operator`, or a project with role
14
+ `orchestrator` or `curator`. The worker owns the code and branch; other executors
15
+ inspect and submit the head or return findings without pushing.
18
16
 
19
- `projects[].spurProjects[].role` currently accepts `worker`, `operator` and
20
- `curator`. The curator answers questions and checks direction. A separate
21
- `orchestrator` project role is planned, not available; today column assignment
22
- uses the configured Spur project name rather than that role value.
17
+ `projects[].spurProjects[].role` accepts `worker`, `operator`, `curator` and
18
+ `orchestrator`. Curators check direction; orchestrators execute columns, never as workers.
23
19
 
24
20
  ## Gates and placement
25
21
 
26
- The operational moves, turns and course checks below apply with
27
- `projects[].dispatcher.mode: on`. The default is `shadow`: gates record a proposed
28
- position, but open no turns, doorbells or blocks; submit using the task key.
29
-
30
- Gates are cumulative: a column checks its own enabled exit gate and every enabled
31
- gate to its left. At a turn boundary, a broken earlier gate returns the task to
32
- the leftmost failing column. A taken turn normally holds its column until it is
33
- submitted, returned or closed by a new head. Pending CI, unknown mergeability and
34
- incomplete comment history are waits, not reasons by themselves to send work back.
35
- Downstream handoff waits for settled prerequisites; Dev can still receive a
36
- repair turn to fix red CI, a draft, conflicts or unhandled external comments.
37
-
38
- Dev needs an open, non-draft PR, passing checks, no conflict, handled external
39
- feedback, complete comment history and a submit on the current head. With no
40
- required checks, non-skipped checks are evaluated. `projects[].reposWithoutCi`
41
- waives the check requirement only for a listed repository with no checks at all;
42
- it does not waive a failing or skipped required check.
43
-
44
- Review and Product Review need current-head review marks. External Review waits
45
- for external approval. QA needs a current-head submission; Ready to Merge waits
46
- for the PR to merge. A column with executor `none` can use a worker submission on
47
- that head from another worker-executed column. These fixed gate rules have no
48
- configuration switch beyond enabling columns and the no-CI exception above.
49
-
50
- A Review or Product Review mark lasts across visits while its head remains
51
- current. A visit submission belongs to one column visit; a move left clears
52
- submissions at that column and to its right. A new head invalidates internal
53
- Review and Product Review marks, even if an older head later comes back.
22
+ Facts (head, checks, reviews, comments, ticket, sessions) feed gates. The
23
+ dispatcher has two actions: move the task and open an executor turn (at most one
24
+ per evaluation). Turns follow unmet entry gates, actionable post-submit failures,
25
+ rerouting or Done wrap-up. Holds and existing turns can yield neither action.
26
+
27
+ Moves, turns and course checks require `projects[].dispatcher.mode: on`. The
28
+ default is `shadow`: proposed placement only, no turns, doorbells or blocks.
29
+
30
+ Gates are cumulative: each column checks its enabled gate and those to its left. At a turn boundary, broken gates return work to the leftmost failing
31
+ column. Taken turns hold until submit, return or a new head. Pending CI, unknown
32
+ mergeability and incomplete comment history are waits. Downstream handoff waits
33
+ for settled prerequisites; Dev can receive a repair turn for red CI, drafts,
34
+ conflicts or unhandled external comments.
35
+
36
+ Dev needs an open non-draft PR, passing checks, no conflict, handled external
37
+ feedback, complete comment history and current-head submit. Feedback excludes
38
+ bots, approvals and `projects[].operatorGithubLogin` (agents' account), so worker
39
+ thread replies never count; others' posts do.
40
+ A status comment whose last line is a hidden `board-reviewer-progress` or
41
+ `board-reviewer-unavailable` marker is not external feedback. Non-skipped checks
42
+ count when none are required. `projects[].reposWithoutCi` waives absent checks
43
+ for listed repos, never failing or skipped required ones.
44
+
45
+ Review and Product Review need current-head internal review marks, separate from
46
+ External Review's external approval. QA needs a current-head submission; Ready to Merge waits for merge. Executor `none` may reuse same-head worker submissions
47
+ from other worker columns. Fixed gate rules have no configuration switch
48
+ beyond enabled columns and the no-CI exception.
49
+
50
+ A Review or Product Review mark lasts across visits on the current head. A visit
51
+ submission belongs to one column visit; moving left clears submissions there and
52
+ to its right. New heads invalidate internal Review and Product Review marks,
53
+ even if an old head returns.
54
+
55
+ Derived anomalies include a PR closed without merge with no open PR, or a closed
56
+ ticket with live work and no merged PR. `board status` lists them; they can also
57
+ surface as operator block threads.
54
58
 
55
59
  ## Turns and delivery
56
60
 
57
- A turn `T<number>` hands one column visit to its executor. First acknowledge it
58
- with keyed `board inbox ack <entries>`. Only the acknowledging session may submit
59
- or return it: keyed `board submit <turn> <sha>` accepts the head, and keyed
60
- `board return <turn> <reason>` sends findings back to Dev. A worker submits a fresh
61
- PR head after pushing. In shadow mode, use keyed `board submit <task> <sha>`.
62
- An unseen head answers `pending`: that submit is final,
63
- so do not resubmit or raise a block; the Board confirms it or hands the turn back
61
+ A turn `T<number>` assigns a visit. Use keyed `board inbox ack <entries>`.
62
+ Only the acknowledging session may submit or return: keyed
63
+ `board submit <turn> <sha>` accepts the head; keyed
64
+ `board return <turn> <reason>` sends findings to Dev.
65
+ In shadow mode, use keyed `board submit <task> <sha>`.
66
+ Unseen heads answer `pending`: that submit is final; do not resubmit or raise a
67
+ block. It confirms or returns the turn
64
68
  (`projects[].dispatcher.submitConfirmMs`).
65
69
 
66
- A new head closes taken turns outside Dev; a taken Dev turn survives the worker's
67
- push so that worker can submit it. An unacknowledged turn does not hold back a
68
- return for CI, draft, conflict or external comments. The operator gets one inbox
69
- item and Slack thread for a turn, which closes when the task leaves the column.
70
+ A new head closes taken turns outside Dev; taken Dev turns survive pushes.
71
+ Untaken turns allow returns for CI, drafts, conflicts or external comments.
72
+ Operator turns get one inbox item and Slack thread until the task leaves.
70
73
 
71
- Closed turns receive no further Board sends. Obsolete queued rings are dropped,
72
- but a message already accepted by Spur cannot be retracted. On receipt, check
73
- `board inbox` and act only on a current turn; after `turn_closed`, read it again.
74
+ Closed turns receive no further Board sends. Obsolete queued rings are dropped;
75
+ a message already accepted by Spur cannot be retracted. Check `board inbox` and
76
+ act only on a current turn; reread after `turn_closed`.
74
77
 
75
- ## Course checks and cycle limits
78
+ ## Doorbells
79
+
80
+ A doorbell expects action: read `board inbox` for the turn, addressed
81
+ block, answer or follow-up. Ordinary task comments do not ring; nor does a block
82
+ tracked by its author role ring itself. Rings are separate from moves.
83
+
84
+ Unacknowledged series repeat, up to three delivered rings;
85
+ acknowledgement stops them. Removal notices and quiet-turn reminders ring once.
86
+ Busy recipients defer delivery; pending delivery or earlier rings in the Spur
87
+ queue defer repeats. Queued rings can exhaust their waiting window.
76
88
 
77
- `projects[].columns[].courseCheck` defaults to 3 counted returns to Dev from that
78
- column; `courseCheck: 0` disables the course check.
79
- `projects[].columns[].cycleLimit` defaults to 10 and takes priority if both limits
80
- are reached. Executor returns, changes requested and external comments count;
81
- CI failures, conflicts and drafts alone do not count. Reopening a ticket or
82
- switching dispatcher mode does not count as a return.
89
+ Most notices await recipients; taskless worker, orchestrator and operator-agent
90
+ answers end without a live asking session. Curator and course-check orchestrator
91
+ questions fall back to operator. Operator conversations await their project.
92
+ Exhaustion alerts the operator, except removals and quiet-turn reminders;
93
+ curator questions move to operator.
83
94
 
84
- A course check holds the task and asks for direction, with open findings.
85
- `projects[].columns[].courseCheckTo` may name `operator`, the curator, or a
86
- configured column orchestrator. Without it, the target is the curator selected by
87
- `projects[].spurProjects[].role`, or the operator if no curator is configured.
88
- An answer resets the course count and reaches the worker as a task comment.
89
- The cycle limit is separate: only the operator can resolve it and reset its count.
95
+ ## Course checks and cycle limits
96
+
97
+ `projects[].columns[].courseCheck` defaults to 3 counted returns to Dev;
98
+ `courseCheck: 0` disables it. `projects[].columns[].cycleLimit` defaults to 10 and
99
+ takes priority. Executor returns, changes requested and external comments count;
100
+ CI failures, conflicts and drafts alone do not count, nor reopened tickets or
101
+ mode switches.
90
102
 
91
- If the course-check addressee has no live session, the question falls back to the
92
- operator. A live conductor that was rung but does not answer keeps the question;
93
- the operator gets an item to intervene.
103
+ Course checks hold work for direction.
104
+ `projects[].columns[].courseCheckTo`: `operator`, curator or column orchestrator.
105
+ Default: curator (`projects[].spurProjects[].role`), else operator. An answer
106
+ resets the course count and reaches the worker as a task comment. Only the
107
+ operator can resolve the separate cycle limit and reset its count. With no live
108
+ session the question falls back to the operator; a live conductor that does not
109
+ answer keeps the question, with an intervention item.
94
110
 
95
111
  ## Blocks and escalation
96
112
 
97
- A question (`needs_input`) goes to the column's configured orchestrator, then the
98
- curator when no other orchestrator takes it, otherwise the operator. Routing
99
- avoids asking yourself: an orchestrator's own question goes to the curator, and
100
- the curator's own question goes to the operator. A column explicitly assigned to
101
- `operator` also sends questions to the operator.
113
+ A question (`needs_input`) goes to the column orchestrator, else curator, else
114
+ operator. Routing avoids asking yourself: orchestrators ask the curator; curators
115
+ ask the operator.
116
+
117
+ A `code` block goes to the worker; a `dependency` or `external` block stays with
118
+ its author's role. Questions escalate from column orchestrator to curator to
119
+ operator; other blocks escalate straight to the operator. Use keyed
120
+ `board escalate <block>` if the addressee cannot resolve it.
102
121
 
103
- A `code` block goes to the worker to repair. A `dependency` or `external` block
104
- stays with its author's role to track the dependency or outside event. Questions
105
- can escalate from column orchestrator to curator to operator; other blocks
106
- escalate straight to the operator. Escalation skips a step your own project also
107
- holds: a curator that also orchestrates the column escalates its column's
108
- question straight to the operator. Use keyed `board escalate <block>`
109
- when the current addressee cannot resolve it.
122
+ Taskless: all roles, operator only:
123
+ `board project ask <project> <text> --to operator --key <key>`.
124
+ Project `needs_input` blocks get Slack threads except operator-agent asks;
125
+ operator: `board inbox`, keyed `board answer`. Answers reach a current curator session; other roles use the asking session.
110
126
 
111
- The routing configuration is `projects[].columns[].orchestrator`,
112
- `projects[].spurProjects[].role` and `operator.slack` (the operator's Slack user
113
- ID). Role addresses follow the current session filling the role.
127
+ Routing: `projects[].columns[].orchestrator`, `projects[].spurProjects[].role`,
128
+ `operator.slack` (Slack user ID). Roles follow the current session.
114
129
 
115
130
  ## Slack now
116
131
 
117
- `slack.channels.feed` carries summaries like curator answers and operator
118
- items, except items shown elsewhere and delivery problems.
132
+ `slack.channels.feed` carries curator answers and operator items,
133
+ except those elsewhere and delivery problems.
119
134
  `slack.channels.orchestrators` carries block threads addressed to the operator by
120
- someone else. Answer in the existing block thread to preserve its task context.
135
+ others. Answer in the existing block thread.
121
136
 
122
137
  ## Slack addressing
123
138
 
124
- Once a `projects[].spurProjects[].shortName` is set, a new operator message in
139
+ With `projects[].spurProjects[].shortName`, a new operator message in
125
140
  `slack.channels.orchestrators` starts a conversation. A leading registered
126
- `@shortName` selects that Spur project and is stripped. With an
127
- absent or unknown leading name, `slack.defaultAddressee` receives the complete
128
- text, retaining any unknown prefix; without it the Board replies once with the
129
- valid prefixes. A mention in the middle, or a Slack `<@U…>` mention, addresses
130
- nobody; an unknown name causes no lookup error. The operator checks short-name
131
- collisions with workspace names. A task key right after the prefix attaches
132
- that task.
133
-
134
- The addressee is rung with the block ID, reads it in `board inbox` and replies
135
- in the thread with `board answer`. Each operator thread message rings it again;
136
- `close` or ✅ in the thread closes it. Replies use
137
- `projects[].spurProjects[].displayName` and `icon`, else the project name and
138
- role icon (`board` for operator roles). With no live session,
141
+ `@shortName` selects that Spur project and is stripped. With an absent or unknown
142
+ leading name, `slack.defaultAddressee` receives the complete text, retaining any
143
+ unknown prefix; without it the Board replies once with the valid prefixes.
144
+ Middle mentions or Slack `<@U…>` address nobody; unknown names cause no lookup
145
+ error. The operator checks short-name collisions with workspace names.
146
+ A task key after the prefix attaches it.
147
+
148
+ The addressee gets the block ID, reads `board inbox`, replies with
149
+ `board answer`. Each operator thread message rings again; `close` or ✅ in the
150
+ thread closes it. Replies use `projects[].spurProjects[].displayName` and `icon`,
151
+ else project name and role icon (`board` for operator). Without a session,
139
152
  `board status` lists it as waiting.
140
153
 
141
154
  ## Done follows the ticket
142
155
 
143
- One linked PR merging does not by itself finish the task. Done follows ticket
144
- completion: `projects[].tracker.doneStatuses` defines Jira's done statuses;
145
- for GitHub, the Issue must be closed. After a merge the Board waits for tracker
146
- confirmation; if the ticket remains open once that confirmation settles, work
147
- continues and another PR can be linked.
156
+ One linked PR merging does not by itself finish the task. Done follows the
157
+ ticket: `projects[].tracker.doneStatuses` for Jira; for GitHub, the Issue must be
158
+ closed. If it stays open after merge, link another PR.