spur-board 0.55.0 → 0.56.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,5 +1,5 @@
1
- import { _ as buildCatalogSnapshot, ct as plainHttpAllowed, st as configSchema, y as OPERATIONS } from "./chunk-DdX2rQDT.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-3DiqeT6s.mjs";
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";
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";
@@ -148,6 +148,7 @@ const TASK_HOLDS = [
148
148
  "pr_snapshot_missing",
149
149
  "github_blind",
150
150
  "spur_blind",
151
+ "ticket_unconfirmed",
151
152
  "cycle_limit",
152
153
  "work_not_started"
153
154
  ];
@@ -1182,6 +1183,7 @@ const prFactsSchema = z.strictObject({
1182
1183
  ticketKeys: z.array(taskKeySchema).describe("Ticket keys found in the head branch name and the title."),
1183
1184
  updatedAt: at$2.describe("When the pull request last changed."),
1184
1185
  mergedAt: at$2.optional().describe("When the pull request merged; absent while it is not merged and in facts stored by an earlier version."),
1186
+ closedAt: at$2.optional().describe("When the pull request closed without merge; absent while it is not closed and in facts stored by an earlier version."),
1185
1187
  feedback: z.array(feedbackSchema).optional().describe("Comments and submitted reviews on the pull request, oldest first, without their text."),
1186
1188
  feedbackComplete: z.boolean().optional().describe("Whether feedback holds every comment back to the last one handed over, or to the start of the pull request; missing reads as incomplete.")
1187
1189
  }).describe("Facts about one pull request.");
@@ -1953,7 +1955,12 @@ const taskWhySchema = z.strictObject({
1953
1955
  }).describe("The gate of one column.")).describe("The gate of every column, To Do to Done; empty when the pull request facts are missing."),
1954
1956
  checksWaivedBy: z.literal("reposWithoutCi").nullable().describe("The config key that passed Dev's check condition for a repo without checks; null otherwise."),
1955
1957
  turn: turnViewSchema.nullable().describe("The open turn of the task; null when none is open."),
1956
- moves: z.array(moveViewSchema).describe("The last 5 column moves, oldest first.")
1958
+ moves: z.array(moveViewSchema).describe("The last 5 column moves, oldest first."),
1959
+ waiting: z.array(z.strictObject({
1960
+ reason: z.enum(GATE_REASONS).describe("The gate reason that waits on the fact."),
1961
+ head: commitShaSchema.describe("Head commit of the pull request the fact is about."),
1962
+ text: z.string().describe("The fact in one line, e.g. waiting for CI on <sha>.")
1963
+ }).describe("One fact the task waits for.")).min(1).optional().describe("Facts the task waits for that GitHub has not settled yet; absent when none.")
1957
1964
  }).describe("Why the task is in its column and what the dispatcher waits for.");
1958
1965
  const itemViewSchema = z.strictObject({
1959
1966
  id: itemIdSchema,
@@ -1979,7 +1986,8 @@ const linkViewSchema = z.strictObject({
1979
1986
  "worker",
1980
1987
  "other",
1981
1988
  "orchestrator"
1982
- ]).nullable().describe("Session role; null for a pull request or ticket.")
1989
+ ]).nullable().describe("Session role; null for a pull request or ticket."),
1990
+ state: z.enum(PR_STATES).optional().describe("Pull request state as last observed; absent for a session or ticket and for a pull request not observed yet. Only task.get sets it.")
1983
1991
  }).describe("An effective link to a task.");
1984
1992
  const detailOnly = "Present only with detail.";
1985
1993
  const count = (what) => z.int().min(0).describe(what);
@@ -3875,4 +3883,4 @@ function assertNever(value) {
3875
3883
  throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
3876
3884
  }
3877
3885
  //#endregion
3878
- export { errorEnvelopeSchema as $, EVENT_KINDS as A, sessionFactsSchema as B, renderMcpError as C, interactionRefSchema as D, inboundEventSchema as E, isExternalAuthor as F, encodeActorId as G, JIRA_PROJECT_KEY as H, parseRingMarker as I, parseRef as J, errorCodeOf as K, prFactsSchema as L, REVIEW_STATES as M, SESSION_HEALTH_STATES as N, messageRefSchema as O, SESSION_STATUSES as P, errorContextSchema as Q, prRefSchema as R, renderJsonError as S, conversationRefSchema as T, REF_NUMBER as U, ticketFactsSchema as V, actorIdSchema as W, ERRORS as X, taskKeySchema as Y, err as Z, buildCatalogSnapshot as _, requestHashOf as a, DEFAULT_SLACK_COMMAND as at, turnHandedSchema as b, tokenRequestStatusSchema as c, plainHttpAllowed as ct, AdapterError as d, DISPATCHER_MODES as dt, ok as et, batchSchema as f, SLACK_BOT_SCOPES as ft, trackerSourceId as g, sourceCursorSchema as h, TOKEN_REQUEST_LIMITS as i, DEFAULT_SLACK_APP_NAME as it, eventPayloadSchemas as j, userIdSchema as k, BOARD_TICK_MS as l, requiredSecretKeys as lt, prSourceId as m, doctorReportSchema as n, DEFAULT_HTTP_PORT as nt, tokenRequestResultSchema as o, RESERVED_PROJECT as ot, entityRefSchema as p, parseActorId as q, remoteDoctorReportSchema as r, DEFAULT_LINK as rt, tokenRequestSchema as s, configSchema as st, assertNever as t, successEnvelopeSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, COLUMN_IDS as ut, roleCanUseOperation as v, SPACE_IDS as w, renderHttpProblem as x, OPERATIONS as y, ringMarker as z };
3886
+ export { errorContextSchema as $, EVENT_KINDS as A, ringMarker as B, renderMcpError as C, interactionRefSchema as D, inboundEventSchema as E, SESSION_STATUSES as F, actorIdSchema as G, ticketFactsSchema as H, isExternalAuthor as I, parseActorId as J, encodeActorId as K, parseRingMarker as L, PR_STATES as M, REVIEW_STATES as N, messageRefSchema as O, SESSION_HEALTH_STATES as P, err as Q, prFactsSchema as R, renderJsonError as S, conversationRefSchema as T, JIRA_PROJECT_KEY as U, sessionFactsSchema as V, REF_NUMBER as W, taskKeySchema as X, parseRef as Y, ERRORS as Z, buildCatalogSnapshot as _, requestHashOf as a, DEFAULT_SLACK_APP_NAME as at, turnHandedSchema as b, tokenRequestStatusSchema as c, configSchema as ct, AdapterError as d, COLUMN_IDS as dt, errorEnvelopeSchema as et, batchSchema as f, DISPATCHER_MODES as ft, trackerSourceId as g, sourceCursorSchema as h, TOKEN_REQUEST_LIMITS as i, DEFAULT_LINK as it, eventPayloadSchemas as j, userIdSchema as k, BOARD_TICK_MS as l, plainHttpAllowed as lt, prSourceId as m, TASK_HOLDS as mt, doctorReportSchema as n, successEnvelopeSchema as nt, tokenRequestResultSchema as o, DEFAULT_SLACK_COMMAND as ot, entityRefSchema as p, SLACK_BOT_SCOPES as pt, errorCodeOf as q, remoteDoctorReportSchema as r, DEFAULT_HTTP_PORT as rt, tokenRequestSchema as s, RESERVED_PROJECT as st, assertNever as t, ok as tt, SYSTEMD_SERVICE_SETTINGS as u, requiredSecretKeys as ut, roleCanUseOperation as v, SPACE_IDS as w, renderHttpProblem as x, OPERATIONS as y, prRefSchema as z };
@@ -1,4 +1,4 @@
1
- import { $ as errorEnvelopeSchema, Q as errorContextSchema, S as renderJsonError, X as ERRORS, c as tokenRequestStatusSchema, o as tokenRequestResultSchema, tt as successEnvelopeSchema } from "./chunk-DdX2rQDT.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-DfV3nwNC.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 { W as actorIdSchema, X as ERRORS, a as requestHashOf, ft as SLACK_BOT_SCOPES, lt as requiredSecretKeys, r as remoteDoctorReportSchema, st as configSchema, tt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS, v as roleCanUseOperation, y as OPERATIONS } from "./chunk-DdX2rQDT.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-DfV3nwNC.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-3DiqeT6s.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-COsEkoTY.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";
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-3DiqeT6s.mjs";
1
+ import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-aIvdot-z.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 sessionFactsSchema, D as interactionRefSchema, E as inboundEventSchema, F as isExternalAuthor, G as encodeActorId, H as JIRA_PROJECT_KEY, I as parseRingMarker, J as parseRef$1, K as errorCodeOf, L as prFactsSchema, M as REVIEW_STATES, N as SESSION_HEALTH_STATES, O as messageRefSchema, P as SESSION_STATUSES, R as prRefSchema, T as conversationRefSchema, U as REF_NUMBER, V as ticketFactsSchema, W as actorIdSchema, X as ERRORS, Y as taskKeySchema, Z as err, _ as buildCatalogSnapshot, a as requestHashOf, at as DEFAULT_SLACK_COMMAND, b as turnHandedSchema, c as tokenRequestStatusSchema, ct as plainHttpAllowed, d as AdapterError, dt as DISPATCHER_MODES, et as ok, f as batchSchema, ft as SLACK_BOT_SCOPES, g as trackerSourceId, h as sourceCursorSchema, i as TOKEN_REQUEST_LIMITS, j as eventPayloadSchemas, k as userIdSchema, l as BOARD_TICK_MS, lt as requiredSecretKeys, m as prSourceId, n as doctorReportSchema, o as tokenRequestResultSchema, ot as RESERVED_PROJECT, p as entityRefSchema, q as parseActorId, rt as DEFAULT_LINK, s as tokenRequestSchema, st as configSchema, t as assertNever, tt as successEnvelopeSchema, ut as COLUMN_IDS, v as roleCanUseOperation, w as SPACE_IDS, x as renderHttpProblem, y as OPERATIONS, z as ringMarker } from "./chunk-DdX2rQDT.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-DfV3nwNC.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";
@@ -7994,6 +7994,26 @@ function ticketDone(project, status) {
7994
7994
  return project.tracker.type === "jira" ? project.tracker.doneStatuses.includes(status) : status === "closed";
7995
7995
  }
7996
7996
  /**
7997
+ * How the ticket of a task stands after its PR merged at `mergedAt`: `done`; `open` once the
7998
+ * tracker saw it open at least one tracker interval after the merge, in the filter or fetched by
7999
+ * key for a hand-added task; else `unconfirmed`, since the close a merge triggers may not be
8000
+ * polled yet and a ticket dropped from the filter keeps a stale status.
8001
+ */
8002
+ function mergedTicket(project, config, ticket, manualInclude, mergedAt) {
8003
+ if (ticket === void 0) return "unconfirmed";
8004
+ if (ticketDone(project, ticket.status)) return "done";
8005
+ let inFilter;
8006
+ try {
8007
+ const parsed = ticketFactsSchema.safeParse(JSON.parse(ticket.detail));
8008
+ if (!parsed.success) return "unconfirmed";
8009
+ inFilter = parsed.data.inFilter;
8010
+ } catch {
8011
+ return "unconfirmed";
8012
+ }
8013
+ const { intervalMs } = project.tracker.type === "jira" ? config.adapters.jira : config.adapters.githubIssues;
8014
+ return (inFilter || manualInclude) && Date.parse(ticket.observed_at) >= Date.parse(mergedAt) + intervalMs ? "open" : "unconfirmed";
8015
+ }
8016
+ /**
7997
8017
  * Whether a PR link counts past the task's reopen floor: an open link, or a link not hidden by a
7998
8018
  * reopen. For a query over `link`. Written so a link without a marker counts: the negated form
7999
8019
  * is NULL there and would drop it.
@@ -8015,6 +8035,17 @@ async function taskPr(db, taskId) {
8015
8035
  open: link.pr_open === 1
8016
8036
  };
8017
8037
  }
8038
+ /**
8039
+ * The task's newest merged PR: the newest active unbanned link past the reopen floor whose PR is
8040
+ * seen merged. Completes a task whose follow-up PR closed unmerged after an earlier merge.
8041
+ */
8042
+ async function taskMergedPr(db, taskId) {
8043
+ const link = await db.selectFrom("link").innerJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).select(["link.repo", "link.number"]).where("link.task_id", "=", taskId).where("link.entity", "=", "pr").where("link.pr_state", "=", "active").where("link.banned", "=", 0).where("pr_snapshot.state", "=", "merged").where(pastReopenFloor).orderBy("link.id", "desc").executeTakeFirst();
8044
+ return link?.repo == null || link.number === null ? null : {
8045
+ repo: link.repo,
8046
+ number: link.number
8047
+ };
8048
+ }
8018
8049
  /** A PR snapshot's facts, or null when the detail is missing or unreadable. */
8019
8050
  function parsePr(detail) {
8020
8051
  if (detail === void 0) return null;
@@ -12977,7 +13008,7 @@ async function existingLink(trx, taskId, input, ticket) {
12977
13008
  async function sessionRole(trx, taskId) {
12978
13009
  return await trx.selectFrom("link").select("id").where("task_id", "=", taskId).where("entity", "=", "session").where("role", "=", "worker").where("banned", "=", 0).executeTakeFirst() === void 0 ? "worker" : "other";
12979
13010
  }
12980
- async function prConflict(trx, taskId, repo, number, open) {
13011
+ async function prConflict(trx, taskId, repo, number, open, doneTicket) {
12981
13012
  const links = await trx.selectFrom("link").leftJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).select([
12982
13013
  "link.repo",
12983
13014
  "link.number",
@@ -12988,7 +13019,7 @@ async function prConflict(trx, taskId, repo, number, open) {
12988
13019
  for (const link of links) {
12989
13020
  if (link.repo?.toLowerCase() === repo && link.number === number) continue;
12990
13021
  const blocking = `${link.repo ?? ""}#${String(link.number ?? "")}`;
12991
- if (link.state === "merged") throw new CommandError("link_conflict", `${blocking} is merged; manual PR replacement is not allowed.`);
13022
+ if (link.state === "merged" && doneTicket) throw new CommandError("link_conflict", `${blocking} is merged; manual PR replacement is not allowed.`);
12992
13023
  if (open && link.pr_state === "active" && link.pr_open === 1) throw new CommandError("link_conflict", `${blocking} is already the open PR for this task.`);
12993
13024
  }
12994
13025
  }
@@ -13003,7 +13034,12 @@ async function run(trx, input, ctx, config, remove) {
13003
13034
  const pr = input.mode === "pr" ? prIdentity(input.pr) : null;
13004
13035
  const facts = pr === null ? null : await snapshot(trx, pr.repo, pr.number);
13005
13036
  const open = facts?.state !== "closed" && facts?.state !== "merged";
13006
- if (!remove && pr !== null) await prConflict(trx, task.id, pr.repo, pr.number, open);
13037
+ if (!remove && pr !== null) {
13038
+ const project = config.projects.find((entry) => entry.id === task.project);
13039
+ const status = await trx.selectFrom("ticket_snapshot").select("status").where("task_id", "=", task.id).executeTakeFirst();
13040
+ const doneTicket = project !== void 0 && status !== void 0 && ticketDone(project, status.status);
13041
+ await prConflict(trx, task.id, pr.repo, pr.number, open, doneTicket);
13042
+ }
13007
13043
  if (remove) {
13008
13044
  if (current?.banned === 1) return {
13009
13045
  task: key,
@@ -13364,12 +13400,6 @@ async function getStatus(deps, options = {}) {
13364
13400
  hiddenUnlinkedSessions: sessionRows.length - unlinkedSessions.length
13365
13401
  };
13366
13402
  }
13367
- //#endregion
13368
- //#region ../core/src/domain/gates.ts
13369
- /**
13370
- * The hold-only reasons: a fact is not known yet, and waiting resolves it. See `GateResult` for
13371
- * the caller rule.
13372
- */
13373
13403
  const HOLD_ONLY = /* @__PURE__ */ new Set([
13374
13404
  "mergeable_unknown",
13375
13405
  "checks_pending",
@@ -13595,7 +13625,8 @@ const STEP_BOUND = 2 * COLUMN_IDS.length;
13595
13625
  const NO_TURN = {
13596
13626
  visit: "none",
13597
13627
  open: false,
13598
- operatorUntaken: false
13628
+ operatorUntaken: false,
13629
+ headMoved: false
13599
13630
  };
13600
13631
  const indexOf$2 = (column) => COLUMN_IDS.indexOf(column);
13601
13632
  function orchestratorOf(project, column) {
@@ -13703,7 +13734,8 @@ function dispatch(input) {
13703
13734
  }
13704
13735
  const reasons = [...gate.reasons];
13705
13736
  if (gate.column !== column) {
13706
- if (cycleHeld || turn.open || reasons.every((reason) => HOLD_ONLY.has(reason))) return result(null);
13737
+ const held = turn.open && !turn.headMoved;
13738
+ if (cycleHeld || held || reasons.every((reason) => HOLD_ONLY.has(reason))) return result(null);
13707
13739
  move(gate.column, "gate_broken", reasons);
13708
13740
  continue;
13709
13741
  }
@@ -14172,11 +14204,30 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped) {
14172
14204
  prCompleteAt: prCompleteAt(config.projects.find((entry) => entry.id === task.project), sourceById),
14173
14205
  turnSessions: []
14174
14206
  };
14207
+ const tickets = await trx.selectFrom("ticket_snapshot").select([
14208
+ "task_id",
14209
+ "status",
14210
+ "detail",
14211
+ "source",
14212
+ "observed_at"
14213
+ ]).execute();
14214
+ const mergedAt = /* @__PURE__ */ new Map();
14175
14215
  for (const pr of prs) {
14176
14216
  const state = taskPrs[String(pr.task_id)];
14177
14217
  if (state === void 0) continue;
14178
14218
  if (pr.state === "open") state.hasOpenPr = true;
14179
- if (pr.state === "merged") state.hasMergedPr = true;
14219
+ if (pr.state !== "merged") continue;
14220
+ const facts = parsePr(pr.detail ?? void 0);
14221
+ const at = facts === null ? null : facts.mergedAt ?? facts.updatedAt;
14222
+ const newest = mergedAt.get(pr.task_id) ?? null;
14223
+ if (newest === null || at !== null && Date.parse(at) >= Date.parse(newest)) mergedAt.set(pr.task_id, at);
14224
+ }
14225
+ for (const [taskId, at] of mergedAt) {
14226
+ const state = taskPrs[String(taskId)];
14227
+ const task = taskById.get(taskId);
14228
+ if (state === void 0 || task === void 0) continue;
14229
+ const project = config.projects.find((entry) => entry.id === task.project);
14230
+ state.hasMergedPr = at === null || project === void 0 || mergedTicket(project, config, tickets.find((entry) => entry.task_id === taskId), task.manual_include === 1, at) !== "open";
14180
14231
  }
14181
14232
  const workerTurns = await trx.selectFrom("turn").select(["task_id", "acked_by"]).where("role", "=", "worker").where("closed_at", "is", null).where("acked_at", "is not", null).execute();
14182
14233
  for (const turn of workerTurns) {
@@ -14187,13 +14238,18 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped) {
14187
14238
  for (const task of tasks) {
14188
14239
  const state = taskPrs[String(task.id)];
14189
14240
  if (state === void 0 || state.hasOpenPr || state.hasMergedPr) continue;
14190
- const closed = prs.filter((pr) => pr.task_id === task.id && pr.state === "closed").map((pr) => ({
14191
- ...pr,
14192
- ref: `${pr.repo ?? ""}#${String(pr.number)}`
14193
- })).sort((left, right) => left.ref.localeCompare(right.ref));
14241
+ const mergedSince = Date.parse(mergedAt.get(task.id) ?? "");
14242
+ const closed = prs.filter((pr) => pr.task_id === task.id && pr.state === "closed").map((pr) => {
14243
+ const facts = pr.detail === null ? null : parseJson(prFactsSchema, pr.detail);
14244
+ return {
14245
+ ...pr,
14246
+ ref: `${pr.repo ?? ""}#${String(pr.number)}`,
14247
+ closedAt: facts === null ? NaN : Date.parse(facts.closedAt ?? facts.updatedAt)
14248
+ };
14249
+ }).filter((pr) => !(pr.closedAt < mergedSince)).sort((left, right) => left.ref.localeCompare(right.ref));
14194
14250
  const first = closed[0];
14195
14251
  if (first === void 0) continue;
14196
- const closedAt = Math.max(...closed.map((pr) => pr.detail === null ? NaN : Date.parse(parseJson(prFactsSchema, pr.detail).updatedAt)));
14252
+ const closedAt = Math.max(...closed.map((pr) => pr.closedAt));
14197
14253
  const key = `pr-closed:${String(task.id)}`;
14198
14254
  if (state.prCompleteAt === null || !(state.prCompleteAt >= closedAt)) {
14199
14255
  heldKeys.push(key);
@@ -14211,12 +14267,6 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped) {
14211
14267
  revision: refs.join(",")
14212
14268
  });
14213
14269
  }
14214
- const tickets = await trx.selectFrom("ticket_snapshot").select([
14215
- "task_id",
14216
- "status",
14217
- "detail",
14218
- "source"
14219
- ]).execute();
14220
14270
  for (const task of tasks) {
14221
14271
  const state = taskPrs[String(task.id)];
14222
14272
  const project = config.projects.find((entry) => entry.id === task.project);
@@ -14451,13 +14501,23 @@ const MARK_COLUMNS = ["review", "product-review"];
14451
14501
  const indexOf = (column) => COLUMN_IDS.indexOf(column);
14452
14502
  /**
14453
14503
  * Sets `voided_at` on the unvoided submits of `columns`. Review and product-review marks are
14454
- * never voided.
14504
+ * not voided by a move; a new PR head voids them (`voidMarksOffHead`).
14455
14505
  */
14456
14506
  async function voidColumns(trx, taskId, columns, at) {
14457
14507
  const voided = columns.filter((column) => !MARK_COLUMNS.includes(column));
14458
14508
  if (voided.length === 0) return;
14459
14509
  await trx.updateTable("submission").set({ voided_at: at.toISOString() }).where("task_id", "=", taskId).where("voided_at", "is", null).where("column", "in", voided).execute();
14460
14510
  }
14511
+ /**
14512
+ * Sets `voided_at` on the unvoided Review and Product Review marks of PR `repo#number` that are
14513
+ * not on `head`, for the PR's new head: a mark lasts only while its head stays the PR's head, so
14514
+ * a head that comes back to an earlier commit needs fresh marks. Marks made before submissions
14515
+ * recorded their PR count for the tasks linked to the PR.
14516
+ */
14517
+ async function voidMarksOffHead(trx, input) {
14518
+ const repo = input.repo.toLowerCase();
14519
+ await trx.updateTable("submission").set({ voided_at: input.at }).where("voided_at", "is", null).where("column", "in", MARK_COLUMNS).where(sql`lower(commit_sha) != ${input.head.toLowerCase()}`).where((eb) => eb.or([eb.and([eb(sql`lower(pr_repo)`, "=", repo), eb("pr_number", "=", input.number)]), eb.and([eb("pr_repo", "is", null), eb("task_id", "in", eb.selectFrom("link").select("task_id").where("entity", "=", "pr").where(sql`lower(repo) = ${repo}`).where("number", "=", input.number))])])).execute();
14520
+ }
14461
14521
  /** Voids the submits of `to` and every column right of it, as a left move does. */
14462
14522
  async function voidSubmits(trx, taskId, to, at) {
14463
14523
  await voidColumns(trx, taskId, COLUMN_IDS.filter((column) => indexOf(column) >= indexOf(to)), at);
@@ -14739,13 +14799,40 @@ function handedOf(pr, entry) {
14739
14799
  * The dispatcher input of one task, or null when a stored snapshot is missing or unreadable. It
14740
14800
  * only reads.
14741
14801
  */
14742
- async function readInput(trx, task, project, mode, blind) {
14802
+ async function readInput(trx, task, project, mode, blind, config) {
14803
+ const readPr = async (ref) => parsePr((await trx.selectFrom("pr_snapshot").select("detail").where(sql`lower(repo) = ${ref.repo.toLowerCase()}`).where("number", "=", ref.number).executeTakeFirst())?.detail);
14743
14804
  const link = await taskPr(trx, task.id);
14744
14805
  let pr = null;
14745
14806
  if (link !== null) {
14746
- pr = parsePr((await trx.selectFrom("pr_snapshot").select("detail").where(sql`lower(repo) = ${link.repo.toLowerCase()}`).where("number", "=", link.number).executeTakeFirst())?.detail);
14807
+ pr = await readPr(link);
14747
14808
  if (pr === null) return null;
14748
14809
  }
14810
+ const readTicket = () => trx.selectFrom("ticket_snapshot").select([
14811
+ "status",
14812
+ "detail",
14813
+ "observed_at"
14814
+ ]).where("task_id", "=", task.id).executeTakeFirst();
14815
+ if (pr !== null && pr.state !== "merged") {
14816
+ const merged = await taskMergedPr(trx, task.id);
14817
+ if (merged !== null) {
14818
+ const ticket = await readTicket();
14819
+ if (pr.state === "closed" && link?.open !== true || ticket !== void 0 && ticketDone(project, ticket.status)) {
14820
+ pr = await readPr(merged);
14821
+ if (pr === null) return null;
14822
+ }
14823
+ }
14824
+ }
14825
+ let mergedOpen;
14826
+ let ticketUnconfirmed = false;
14827
+ if (pr?.state === "merged") {
14828
+ const judged = mergedTicket(project, config, await readTicket(), task.manual_include === 1, pr.mergedAt ?? pr.updatedAt);
14829
+ if (judged === "open") mergedOpen = {
14830
+ repo: pr.repo,
14831
+ number: pr.number
14832
+ };
14833
+ ticketUnconfirmed = judged === "unconfirmed";
14834
+ }
14835
+ if (mergedOpen !== void 0) pr = null;
14749
14836
  const githubBlind = (pr === null ? project.repos : [pr.repo]).some((repo) => blind(prSourceId(project.id, repo)));
14750
14837
  const marks = (await trx.selectFrom("submission").select(["column", "commit_sha"]).where("task_id", "=", task.id).where("voided_at", "is", null).orderBy("id").execute()).map((row) => {
14751
14838
  const headSha = row.commit_sha.toLowerCase();
@@ -14779,7 +14866,7 @@ async function readInput(trx, task, project, mode, blind) {
14779
14866
  unhandledExternalComments: unhandled.length,
14780
14867
  marks
14781
14868
  },
14782
- reopened: await trx.selectFrom("link").select("id").where("task_id", "=", task.id).where("reopen_hidden_at", "is not", null).executeTakeFirst() !== void 0,
14869
+ reopened: mergedOpen === void 0 && await trx.selectFrom("link").select("id").where("task_id", "=", task.id).where("reopen_hidden_at", "is not", null).executeTakeFirst() !== void 0,
14783
14870
  openPr: link?.open === true,
14784
14871
  githubBlind,
14785
14872
  spurBlind: blind("spur"),
@@ -14788,11 +14875,14 @@ async function readInput(trx, task, project, mode, blind) {
14788
14875
  turn: {
14789
14876
  visit: last === void 0 ? "none" : unclosed !== void 0 ? "unclosed" : last.closed_reason === "submitted" ? "submitted" : "none",
14790
14877
  open: unclosed?.acked_at != null,
14791
- operatorUntaken: unclosed?.role === "operator" && unclosed.acked_at === null
14878
+ operatorUntaken: unclosed?.role === "operator" && unclosed.acked_at === null,
14879
+ headMoved: unclosed !== void 0 && unclosed.head_sha !== null && pr !== null && unclosed.head_sha !== pr.headSha.toLowerCase()
14792
14880
  }
14793
14881
  },
14794
14882
  handed,
14795
- unclosed
14883
+ unclosed,
14884
+ mergedOpen,
14885
+ ticketUnconfirmed
14796
14886
  };
14797
14887
  }
14798
14888
  async function applyShadow(trx, task, project, result, at) {
@@ -14857,7 +14947,7 @@ async function applyOn(trx, task, read, result, ctx) {
14857
14947
  const handed = [...carried, ...read.handed.filter((entry) => !carried.some((old) => sameHanded(old, entry)))];
14858
14948
  await openTurn(trx, {
14859
14949
  task: current,
14860
- reason: turnReason(turn, replaced?.reason),
14950
+ 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)`,
14861
14951
  handed: current.column === "dev" ? handed : [],
14862
14952
  at,
14863
14953
  config
@@ -14877,8 +14967,8 @@ async function dispatchTasks(trx, taskIds, ctx) {
14877
14967
  const project = ctx.config.projects.find((entry) => entry.id === task.project);
14878
14968
  if (project === void 0) continue;
14879
14969
  const mode = project.dispatcher.mode;
14880
- const read = await readInput(trx, task, project, mode, blind);
14881
- if (read === null) continue;
14970
+ const read = await readInput(trx, task, project, mode, blind, ctx.config);
14971
+ if (read === null || read.ticketUnconfirmed) continue;
14882
14972
  const result = dispatch(read.input);
14883
14973
  if (mode === "shadow") await applyShadow(trx, task, project, result, ctx.at);
14884
14974
  else await applyOn(trx, task, read, result, ctx);
@@ -14911,6 +15001,16 @@ async function dispatchSource(trx, source, ctx) {
14911
15001
  if (projects.length === 0) return;
14912
15002
  await dispatchTasks(trx, (await trx.selectFrom("task").select("id").where("project", "in", projects).where("membership", "!=", "archived").execute()).map((task) => task.id), ctx);
14913
15003
  }
15004
+ /**
15005
+ * Evaluates the tasks of a tracker source's project that are out of Done and whose PR merged:
15006
+ * a poll that only refreshes an unchanged open ticket journals nothing, yet can confirm it open
15007
+ * past the merge.
15008
+ */
15009
+ async function dispatchMergedTickets(trx, source, ctx) {
15010
+ const project = ctx.config.projects.find((entry) => trackerSourceId(entry) === source);
15011
+ if (project === void 0) return;
15012
+ await dispatchTasks(trx, (await trx.selectFrom("task").innerJoin("link", "link.task_id", "task.id").innerJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).select("task.id").distinct().where("task.project", "=", project.id).where("task.membership", "!=", "archived").where((eb) => eb.or([eb("task.column", "!=", "done"), eb("task.shadow_column", "!=", "done")])).where("link.entity", "=", "pr").where("link.pr_state", "=", "active").where("link.banned", "=", 0).where("pr_snapshot.state", "=", "merged").execute()).map((task) => task.id), ctx);
15013
+ }
14914
15014
  //#endregion
14915
15015
  //#region ../core/src/app/task-turns.ts
14916
15016
  /** How many closed turns `task.get --detail` shows. */
@@ -14948,6 +15048,12 @@ async function taskTurns(trx, task, detail) {
14948
15048
  //#region ../core/src/app/task-queries.ts
14949
15049
  /** How many of the last moves `task.get --why` shows. */
14950
15050
  const WHY_MOVES = 5;
15051
+ /** The fact each hold-only gate reason waits for, as `--why` names it. */
15052
+ const WAITING_FOR = {
15053
+ checks_pending: "waiting for CI",
15054
+ mergeable_unknown: "waiting for GitHub to compute mergeability",
15055
+ comment_history_incomplete: "waiting for the board to read the full PR comment history"
15056
+ };
14951
15057
  const EVENT_SUMMARIES = {
14952
15058
  head_moved: "Pull request head moved",
14953
15059
  pr_facts_changed: "Pull request facts changed",
@@ -15098,7 +15204,7 @@ function createTaskQueries(deps) {
15098
15204
  const read = await readInput(trx, {
15099
15205
  ...task,
15100
15206
  column
15101
- }, project, mode, await blindSources(trx, completeSince));
15207
+ }, project, mode, await blindSources(trx, completeSince), config);
15102
15208
  if (read === null) return {
15103
15209
  ...shared,
15104
15210
  dispatcher: mode,
@@ -15106,8 +15212,16 @@ function createTaskQueries(deps) {
15106
15212
  gates: [],
15107
15213
  checksWaivedBy: null
15108
15214
  };
15109
- const { gates, checksWaivedBy } = explainGates(read.input.facts, read.input.project);
15110
- const holds = dispatchHolds(read.input);
15215
+ const { facts } = read.input;
15216
+ const { gates, checksWaivedBy } = explainGates(facts, read.input.project);
15217
+ const gate = evaluateGate(column, facts, read.input.project);
15218
+ const head = facts.pr?.headSha.toLowerCase();
15219
+ const waiting = gate.ok || head === void 0 ? [] : gate.reasons.filter((reason) => HOLD_ONLY.has(reason)).map((reason) => ({
15220
+ reason,
15221
+ head,
15222
+ text: `${WAITING_FOR[reason]} on ${head}`
15223
+ }));
15224
+ const holds = [...dispatchHolds(read.input), ...read.ticketUnconfirmed ? ["ticket_unconfirmed"] : []].sort((left, right) => TASK_HOLDS.indexOf(left) - TASK_HOLDS.indexOf(right));
15111
15225
  const heldBy = holds.includes("cycle_limit") ? await holdBlocks(trx, task.id) : [];
15112
15226
  return {
15113
15227
  ...shared,
@@ -15115,7 +15229,8 @@ function createTaskQueries(deps) {
15115
15229
  holds,
15116
15230
  ...heldBy.length === 0 ? {} : { heldBy },
15117
15231
  gates,
15118
- checksWaivedBy
15232
+ checksWaivedBy,
15233
+ ...waiting.length === 0 ? {} : { waiting }
15119
15234
  };
15120
15235
  }
15121
15236
  /** The blocks of the active cycle-limit and course-check items that hold the task's turn. */
@@ -15130,12 +15245,18 @@ function createTaskQueries(deps) {
15130
15245
  const [blocks, comments, links] = await Promise.all([
15131
15246
  trx.selectFrom("block").selectAll().where("task_id", "=", task.id).orderBy("id").execute(),
15132
15247
  trx.selectFrom("comment").selectAll().where("task_id", "=", task.id).orderBy("id").execute(),
15133
- trx.selectFrom("link").selectAll().where("task_id", "=", task.id).where("banned", "=", 0).orderBy("id").execute()
15248
+ trx.selectFrom("link").leftJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).selectAll("link").select("pr_snapshot.state").where("link.task_id", "=", task.id).where("link.banned", "=", 0).orderBy("link.id").execute()
15134
15249
  ]);
15135
15250
  return {
15136
15251
  task: taskView(task),
15137
15252
  ...await taskTurns(trx, task, input.detail === true),
15138
- links: links.map(linkView),
15253
+ links: links.map(({ state, ...link }) => {
15254
+ const observed = PR_STATES.find((value) => value === state);
15255
+ return {
15256
+ ...linkView(link),
15257
+ ...observed === void 0 ? {} : { state: observed }
15258
+ };
15259
+ }),
15139
15260
  blocks: blocks.map((block) => blockView(block, task)),
15140
15261
  comments: comments.map((comment) => commentView(comment, task)),
15141
15262
  ...input.why === true ? { why: await why(trx, task) } : {}
@@ -15552,7 +15673,7 @@ function createTurnMutations(deps) {
15552
15673
  if (!project.columns.some((column) => column.id === input.column && column.enabled)) throw new CommandError("move_not_allowed", `Column ${input.column} is not enabled in project ${project.id}; pick one of ${project.columns.filter((column) => column.enabled && column.id !== "done").map((column) => column.id).join(", ")}.`);
15553
15674
  const pr = await taskPr(trx, task.id);
15554
15675
  if (pr !== null) {
15555
- if ((await trx.selectFrom("pr_snapshot").select("state").where(sql`lower(repo) = ${pr.repo.toLowerCase()}`).where("number", "=", pr.number).executeTakeFirst())?.state === "merged") throw new CommandError("move_not_allowed", `Merged pull request ${`${pr.repo}#${String(pr.number)}`} keeps the task in Done; unlink it first with \`board unlink ${task.key} --pr https://github.com/${pr.repo}/pull/${String(pr.number)} --reason <text>\`.`);
15676
+ if ((await trx.selectFrom("pr_snapshot").select("state").where(sql`lower(repo) = ${pr.repo.toLowerCase()}`).where("number", "=", pr.number).executeTakeFirst())?.state === "merged") throw new CommandError("move_not_allowed", `Merged pull request ${`${pr.repo}#${String(pr.number)}`} sets the task's column: Done once its ticket is done, Dev while it stays open; unlink it first with \`board unlink ${task.key} --pr https://github.com/${pr.repo}/pull/${String(pr.number)} --reason <text>\`.`);
15556
15677
  }
15557
15678
  const corrected = await correctColumn(trx, {
15558
15679
  taskId: task.id,
@@ -15798,7 +15919,7 @@ async function updateTerminal(trx, config, taskId, at, completeSince, blind) {
15798
15919
  const complete = completeSince.get(source);
15799
15920
  return !blind.has(source) && complete !== void 0 && complete > (task.last_change_at ?? task.created_at);
15800
15921
  });
15801
- const terminal = !hasOpen && (merged || doneTicket && githubComplete);
15922
+ const terminal = !hasOpen && doneTicket && (merged || githubComplete);
15802
15923
  await trx.updateTable("task").set({ terminal_at: terminal ? task.terminal_at ?? (merged ? at : task.last_change_at ?? at) : null }).where("id", "=", taskId).execute();
15803
15924
  }
15804
15925
  async function blindReason(trx, source) {
@@ -16017,6 +16138,12 @@ async function pr(trx, config, fact, at, source) {
16017
16138
  source,
16018
16139
  observed_at: at
16019
16140
  })).execute();
16141
+ if (old !== void 0 && old.head_sha.toLowerCase() !== fact.headSha.toLowerCase()) await voidMarksOffHead(trx, {
16142
+ repo: fact.repo,
16143
+ number: fact.number,
16144
+ head: fact.headSha,
16145
+ at
16146
+ });
16020
16147
  const project = projectForSource(config, source);
16021
16148
  if (project === void 0) return;
16022
16149
  for (const key of fact.ticketKeys) {
@@ -16467,6 +16594,7 @@ function createObservationCore(deps) {
16467
16594
  };
16468
16595
  const recovered = wasBlind !== null && observation.state.blind === void 0;
16469
16596
  if (observation.effectiveComplete && !completeSince.has(source) || recovered) await dispatchSource(trx, source, dispatchContext);
16597
+ await dispatchMergedTickets(trx, source, dispatchContext);
16470
16598
  await dispatchJournaled(trx, dispatchContext);
16471
16599
  await reconcileItems(trx, config, now, currentComplete.has("spur"), warnSkipped);
16472
16600
  if (deps.productVersion !== void 0) await enqueueLiveAfterFirstPoll(trx, {
@@ -16634,6 +16762,7 @@ function whyLines(key, why, blocks) {
16634
16762
  return [
16635
16763
  line(`Task ${key} is in ${why.column}${mode}.`),
16636
16764
  ...why.holds.length === 0 ? [] : [line(`Held: ${why.holds.join(", ")}.`)],
16765
+ ...(why.waiting ?? []).map((entry) => line(`${entry.text.charAt(0).toUpperCase()}${entry.text.slice(1)}.`)),
16637
16766
  ...why.gates.filter((gate) => gate.enabled && !gate.ok).map((gate) => line(`${gate.column}: ${gate.conditions.toSorted((a, b) => STATE_ORDER[a.state] - STATE_ORDER[b.state]).map((condition) => `${condition.condition} ${condition.state}${condition.reason === null ? "" : ` (${condition.reason})`}`).join(", ")}`)),
16638
16767
  ...passing.length === 0 ? [] : [line(`Gates passing: ${passing.join(", ")}.`)],
16639
16768
  ...here === void 0 ? [] : [line(here.blockedIn === null ? `The ${why.column} gate passes.` : `The ${why.column} gate is blocked at ${here.blockedIn}.`)],
@@ -16682,6 +16811,7 @@ function commandReply(id, value, input) {
16682
16811
  body: [
16683
16812
  line(`Task ${result.task.key}: ${result.task.column} (${result.task.membership})`),
16684
16813
  turnLine(result.turn),
16814
+ ...result.links.flatMap((link) => link.kind === "pr" ? [line(`Pull request ${link.ref}: ${link.state ?? "not observed yet"}`)] : []),
16685
16815
  ...result.blocks.flatMap((block) => [line(`Block ${block.id} (${block.state}, ${block.type}):`), quote(block.reason)]),
16686
16816
  ...result.comments.flatMap((comment) => [line(`Comment ${comment.id} by ${comment.author}:`), quote(comment.text)])
16687
16817
  ]
@@ -17950,7 +18080,7 @@ const REVIEWER_FIELDS = "requestedReviewer { __typename ... on Bot { login } ...
17950
18080
  const REVIEW_FIELDS = "id author { __typename login } state commit { oid } submittedAt";
17951
18081
  const COMMENT_FIELDS = "nodes { id author { __typename login } createdAt } pageInfo { hasPreviousPage startCursor }";
17952
18082
  const CLOSING_FIELDS = "nodes { number repository { nameWithOwner } } pageInfo { hasNextPage endCursor }";
17953
- const prFields = (number, closing = false) => `id number url title updatedAt mergedAt state isDraft mergeable mergeStateStatus
18083
+ const prFields = (number, closing = false) => `id number url title updatedAt mergedAt closedAt state isDraft mergeable mergeStateStatus
17954
18084
  author { login } headRefName headRefOid
17955
18085
  statusCheckRollup { contexts(first: 100) { nodes {
17956
18086
  ... on CheckRun { __typename name status conclusion startedAt completedAt checkSuite { createdAt } isRequired(pullRequestNumber: ${String(number)}) }
@@ -18169,6 +18299,7 @@ const prWire = z.object({
18169
18299
  title: z.string(),
18170
18300
  updatedAt: z.string(),
18171
18301
  mergedAt: z.string().nullable(),
18302
+ closedAt: z.string().nullable(),
18172
18303
  state: z.string(),
18173
18304
  isDraft: z.boolean(),
18174
18305
  mergeable: z.string(),
@@ -18449,6 +18580,7 @@ function normalizePr(repo, value, rule, feedbackComplete, held = []) {
18449
18580
  ticketKeys: prKeys(rule, title, headBranch, closingRefs(wire.closingIssuesReferences)),
18450
18581
  updatedAt: wire.updatedAt,
18451
18582
  ...state === "merged" && wire.mergedAt !== null ? { mergedAt: wire.mergedAt } : {},
18583
+ ...state === "closed" && wire.closedAt !== null ? { closedAt: wire.closedAt } : {},
18452
18584
  feedback: feedbackOf(wire.reviews.nodes, wire.comments.nodes, held),
18453
18585
  feedbackComplete
18454
18586
  };
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { C as renderMcpError, X as ERRORS, y as OPERATIONS } from "./chunk-DdX2rQDT.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-3DiqeT6s.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-COsEkoTY.mjs";
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";
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.55.0",
3
+ "version": "0.56.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -20,8 +20,8 @@ reuse it only to retry the same action and input after an uncertain outcome you
20
20
  ## Turns
21
21
 
22
22
  A turn T<number> hands a column visit to its executor. Ack it first with keyed
23
- `board inbox ack <entries>`; only the session that acked may submit or return it. An unacked
24
- turn delays no return, e.g. on a new head, red CI, a draft, a conflict or external comments.
23
+ `board inbox ack <entries>`; only the session that acked may submit or return it. A new head
24
+ closes a turn outside Dev. Unacked turns delay no return: red CI, draft, conflict, comments.
25
25
  On `turn_closed`, act only on a turn `board inbox` lists. Shadow mode opens no turn:
26
26
  `board submit <task> <sha>`.
27
27