spur-board 0.165.2 → 0.166.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 { d as tokenRequestStatusSchema, gt as errorEnvelopeSchema, ht as errorContextSchema, l as tokenRequestResultSchema, pt as ERRORS, vt as successEnvelopeSchema, x as renderJsonError } from "./chunk-WBquNfmp.mjs";
1
+ import { d as tokenRequestStatusSchema, gt as errorEnvelopeSchema, ht as errorContextSchema, l as tokenRequestResultSchema, pt as ERRORS, vt as successEnvelopeSchema, x as renderJsonError } from "./chunk-_tWJWhul.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { z } from "zod";
4
4
  import { request } from "node:http";
@@ -1,5 +1,5 @@
1
- import { Mt as plainHttpAllowed, g as OPERATIONS, kt as configSchema, m as buildCatalogSnapshot } from "./chunk-WBquNfmp.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-s4AWMQEb.mjs";
1
+ import { Mt as plainHttpAllowed, g as OPERATIONS, kt as configSchema, m as buildCatalogSnapshot } from "./chunk-_tWJWhul.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-Bp_JzHSF.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";
@@ -2411,6 +2411,7 @@ const GATE_REASONS = [
2411
2411
  "not_approved",
2412
2412
  "changes_requested",
2413
2413
  "review_rule_blocked",
2414
+ "awaiting_required_reviewers",
2414
2415
  "merge_state_unknown",
2415
2416
  "review_rule_unreadable",
2416
2417
  "not_merged"
@@ -3244,9 +3245,10 @@ const taskWhySchema = z.strictObject({
3244
3245
  turn: turnViewSchema.nullable().describe("The open turn of the task; null when none is open."),
3245
3246
  moves: z.array(moveViewSchema).describe("The last 5 column moves, oldest first."),
3246
3247
  waiting: z.array(z.strictObject({
3247
- reason: z.enum(GATE_REASONS).describe("The gate reason that waits on the fact; checks_red only when the project checksGate is not dev, and review_rule_blocked, changes_requested, merge_state_unknown and review_rule_unreadable only when External Review sets approvalRule github-rules."),
3248
+ reason: z.enum(GATE_REASONS).describe("The gate reason that waits on the fact; checks_red only when the project checksGate is not dev, and review_rule_blocked, awaiting_required_reviewers, changes_requested, merge_state_unknown and review_rule_unreadable only when External Review sets approvalRule github-rules."),
3248
3249
  head: commitShaSchema.describe("Head commit of the pull request the fact is about."),
3249
- text: z.string().describe("The fact in one line, e.g. waiting for CI on <sha>. When the project checksGate is not dev, checks_pending reads checks running, exit from <checksGate> waits for green, and checks_red reads checks red. Under approvalRule github-rules, review_rule_blocked reads merge blocked by the GitHub review rule, changes_requested reads changes requested, merge_state_unknown reads GitHub has not computed the merge state yet, and review_rule_unreadable reads the GitHub review rule for the base branch could not be read, none with the sha.")
3250
+ text: z.string().describe("The fact in one line, e.g. waiting for CI on <sha>. When the project checksGate is not dev, checks_pending reads checks running, exit from <checksGate> waits for green, and checks_red reads checks red. Under approvalRule github-rules, review_rule_blocked reads merge blocked by the GitHub review rule, awaiting_required_reviewers reads awaiting required reviewers: <logins and team slugs>, changes_requested reads changes requested, merge_state_unknown reads GitHub has not computed the merge state yet, and review_rule_unreadable reads the GitHub review rule for the base branch could not be read, none with the sha."),
3251
+ reviewers: z.array(z.string().min(1)).min(1).optional().describe("Logins and team slugs the pull request waits for, in GitHub's request order; present only with awaiting_required_reviewers.")
3250
3252
  }).describe("One fact the task waits for.")).min(1).optional().describe("Facts the task waits for that GitHub has not settled yet, plus red checks the task returns to Dev on when the project checksGate is not dev, and the GitHub review rule waits under approvalRule github-rules; absent when none.")
3251
3253
  }).describe("Why the task is in its column and what the dispatcher waits for.");
3252
3254
  const itemViewSchema = z.strictObject({
@@ -3296,6 +3298,7 @@ const statusTaskSchema = taskViewSchema.extend({
3296
3298
  session: z.string().min(1).nullable().describe("Session the newest block notification for the addressee went to; null for the operator or before assignment.")
3297
3299
  }).describe("One open block.")).describe("Open blocks on the task, oldest first, without their text."),
3298
3300
  returned: statusReturnedSchema.optional().describe("The return that put the task in Dev. Present only while the task stays in Dev after the return and before its next submit."),
3301
+ awaitedReviewers: z.array(z.string().min(1)).min(1).optional().describe("Logins and team slugs External Review waits for under approvalRule github-rules, in GitHub's request order: the reviewers of the awaiting_required_reviewers wait that task.get --why lists. Present only while the task is in External Review with that reason."),
3299
3302
  ticket: ticketFactsSchema.nullable().optional().describe(`Latest ticket facts, or null before observation. ${detailOnly}`),
3300
3303
  prs: z.array(prFactsSchema).optional().describe(`Latest facts for linked pull requests. ${detailOnly}`),
3301
3304
  sessions: z.array(statusSessionFactsSchema).optional().describe(`Latest facts for linked sessions. ${detailOnly}`),
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { Ct as DEFAULT_STAND_PORT_RANGE, Ft as resolveWebOrigin, It as slackConfigured, Pt as requiredSecretKeys, Ut as SLACK_BOT_SCOPES, c as requestHashOf, ct as actorIdSchema, g as OPERATIONS, h as roleCanUseOperation, j as sortSkillFiles, k as skillReloadFileSchema, kt as configSchema, n as SLACK_OFF_FIX, o as remoteDoctorReportSchema, p as SYSTEMD_SERVICE_SETTINGS, pt as ERRORS, r as SLACK_PARTLY_FIX, vt as successEnvelopeSchema } from "./chunk-WBquNfmp.mjs";
1
+ import { Ct as DEFAULT_STAND_PORT_RANGE, Ft as resolveWebOrigin, It as slackConfigured, Pt as requiredSecretKeys, Ut as SLACK_BOT_SCOPES, c as requestHashOf, ct as actorIdSchema, g as OPERATIONS, h as roleCanUseOperation, j as sortSkillFiles, k as skillReloadFileSchema, kt as configSchema, n as SLACK_OFF_FIX, o as remoteDoctorReportSchema, p as SYSTEMD_SERVICE_SETTINGS, pt as ERRORS, r as SLACK_PARTLY_FIX, vt as successEnvelopeSchema } from "./chunk-_tWJWhul.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
- import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-s4AWMQEb.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-DUsL7Taa.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-Bp_JzHSF.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-BzKjwY-N.mjs";
5
5
  import { createHash, randomBytes, randomUUID } from "node:crypto";
6
6
  import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
7
7
  import { homedir, hostname, tmpdir, userInfo } from "node:os";
package/dist/client.mjs CHANGED
@@ -1 +1 @@
1
- export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-s4AWMQEb.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-Bp_JzHSF.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as prApprovalPairSchema, A as skillReloadFilesSchema, At as defaultAddressee, B as entityRefSchema, Bt as COLUMN_IDS, C as SPACE_IDS, D as messageRefSchema, Dt as columnTurnTimings, E as interactionRefSchema, Et as boardWideSpurProject, F as AdapterError, Ft as resolveWebOrigin, G as trackerSourceId, Gt as TODO_GROUP_COLUMN_IDS, H as prSourceId, Ht as ITEM_KINDS, I as MIRROR_FAILURES, It as slackConfigured, J as REVIEW_STATES, K as PR_STATES, Kt as VIAS, L as MIRROR_FAILURE_CODES, Lt as BLOCK_TYPES, M as EVENT_KINDS, Mt as plainHttpAllowed, N as GATE_REASONS, Nt as readyMirrorOf, O as userIdSchema, Ot as configBindings, P as eventPayloadSchemas, Pt as requiredSecretKeys, Q as parseRingMarker, R as batchSchema, Rt as COLUMNS, St as DEFAULT_SLACK_COMMAND, T as inboundEventSchema, Tt as approvalRuleOf, U as sessionTransitionSchema, Ut as SLACK_BOT_SCOPES, V as mirrorSourceId, Vt as DISPATCHER_MODES, W as sourceCursorSchema, Wt as TASK_HOLDS, X as SESSION_STATUSES, Y as SESSION_HEALTH_STATES, Z as isExternalAuthor, _ as defaultBranchViewSchema, _t as ok, a as doctorReportSchema, at as ticketFactsSchema, b as renderHttpProblem, bt as DEFAULT_LINK, c as requestHashOf, ct as actorIdSchema, d as tokenRequestStatusSchema, dt as parseActorId, et as prFactsSchema, f as BOARD_TICK_MS, ft as parseRef$1, g as OPERATIONS, h as roleCanUseOperation, i as SPUR_MIN_VERSION, it as sessionFactsSchema, j as sortSkillFiles, jt as externalQuietAfterMs, kt as configSchema, l as tokenRequestResultSchema, lt as encodeActorId, m as buildCatalogSnapshot, mt as err, n as SLACK_OFF_FIX, nt as prReviewRuleSchema, ot as JIRA_PROJECT_KEY, pt as ERRORS, q as REVIEW_DECISIONS, qt as isTodoGroupColumn, r as SLACK_PARTLY_FIX, rt as ringMarker, s as TOKEN_REQUEST_LIMITS, st as REF_NUMBER, t as assertNever, tt as prRefSchema, u as tokenRequestSchema, ut as errorCodeOf, v as inboxNoSessionSchema, vt as successEnvelopeSchema, w as conversationRefSchema, wt as RESERVED_PROJECT, y as turnHandedSchema, z as defaultBranchFactSchema, zt as COLUMN_GROUPS } from "./chunk-WBquNfmp.mjs";
1
+ import { $ as prApprovalPairSchema, A as skillReloadFilesSchema, At as defaultAddressee, B as entityRefSchema, Bt as COLUMN_IDS, C as SPACE_IDS, D as messageRefSchema, Dt as columnTurnTimings, E as interactionRefSchema, Et as boardWideSpurProject, F as AdapterError, Ft as resolveWebOrigin, G as trackerSourceId, Gt as TODO_GROUP_COLUMN_IDS, H as prSourceId, Ht as ITEM_KINDS, I as MIRROR_FAILURES, It as slackConfigured, J as REVIEW_STATES, K as PR_STATES, Kt as VIAS, L as MIRROR_FAILURE_CODES, Lt as BLOCK_TYPES, M as EVENT_KINDS, Mt as plainHttpAllowed, N as GATE_REASONS, Nt as readyMirrorOf, O as userIdSchema, Ot as configBindings, P as eventPayloadSchemas, Pt as requiredSecretKeys, Q as parseRingMarker, R as batchSchema, Rt as COLUMNS, St as DEFAULT_SLACK_COMMAND, T as inboundEventSchema, Tt as approvalRuleOf, U as sessionTransitionSchema, Ut as SLACK_BOT_SCOPES, V as mirrorSourceId, Vt as DISPATCHER_MODES, W as sourceCursorSchema, Wt as TASK_HOLDS, X as SESSION_STATUSES, Y as SESSION_HEALTH_STATES, Z as isExternalAuthor, _ as defaultBranchViewSchema, _t as ok, a as doctorReportSchema, at as ticketFactsSchema, b as renderHttpProblem, bt as DEFAULT_LINK, c as requestHashOf, ct as actorIdSchema, d as tokenRequestStatusSchema, dt as parseActorId, et as prFactsSchema, f as BOARD_TICK_MS, ft as parseRef$1, g as OPERATIONS, h as roleCanUseOperation, i as SPUR_MIN_VERSION, it as sessionFactsSchema, j as sortSkillFiles, jt as externalQuietAfterMs, kt as configSchema, l as tokenRequestResultSchema, lt as encodeActorId, m as buildCatalogSnapshot, mt as err, n as SLACK_OFF_FIX, nt as prReviewRuleSchema, ot as JIRA_PROJECT_KEY, pt as ERRORS, q as REVIEW_DECISIONS, qt as isTodoGroupColumn, r as SLACK_PARTLY_FIX, rt as ringMarker, s as TOKEN_REQUEST_LIMITS, st as REF_NUMBER, t as assertNever, tt as prRefSchema, u as tokenRequestSchema, ut as errorCodeOf, v as inboxNoSessionSchema, vt as successEnvelopeSchema, w as conversationRefSchema, wt as RESERVED_PROJECT, y as turnHandedSchema, z as defaultBranchFactSchema, zt as COLUMN_GROUPS } from "./chunk-_tWJWhul.mjs";
2
2
  import { t as apiBaseUrl } from "./chunk-Bzb7aI8R.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -15308,7 +15308,7 @@ const CONDITION_DEFINITIONS = {
15308
15308
  },
15309
15309
  review_rule_satisfied: {
15310
15310
  text: "GitHub's review rule for the base branch, from branch protection and rulesets, is satisfied on the current PR head: a required check completed, or, when none is required, every check except skipped ones green and at least one (no checks at all also counts); no changes requested, GitHub's review decision counting only once the merge state is computed; and the merge not blocked. A required check, one GitHub marks required or a context the rule lists, that is pending or missing holds the head on CI unless the merge state is clean, unstable or has hooks; only a run GitHub marks required completes a listed context.",
15311
- reasons: ({ reviewRule }) => reviewRule === void 0 || reviewRule.changesRequested ? [] : [...RULE_REASONS[reviewRule.decision]]
15311
+ reasons: ({ reviewRule }) => reviewRule === void 0 || reviewRule.changesRequested ? [] : reviewRule.decision === "blocked" && (reviewRule.awaiting?.length ?? 0) > 0 ? ["awaiting_required_reviewers"] : [...RULE_REASONS[reviewRule.decision]]
15312
15312
  },
15313
15313
  merged: {
15314
15314
  text: "The pull request is merged.",
@@ -15435,6 +15435,7 @@ const CONDITION_OF = {
15435
15435
  not_approved: "approved",
15436
15436
  changes_requested: "approved",
15437
15437
  review_rule_blocked: "review_rule_satisfied",
15438
+ awaiting_required_reviewers: "review_rule_satisfied",
15438
15439
  merge_state_unknown: "review_rule_satisfied",
15439
15440
  review_rule_unreadable: "review_rule_satisfied",
15440
15441
  not_merged: "merged"
@@ -18380,6 +18381,27 @@ function externalReviews(pr, agentLogin) {
18380
18381
  return pr.reviews.filter((review) => external(review.reviewer));
18381
18382
  }
18382
18383
  /**
18384
+ * The pending review requests that can meet a review requirement GitHub still waits for, named by
18385
+ * login or team slug in GitHub's request order; empty unless the rule was read and GitHub reads the
18386
+ * merge blocked. While the rule's approvals are not all given, any user or team request counts;
18387
+ * once they are, only a request GitHub made of a code owner, and only when the rule requires a
18388
+ * code owner review; otherwise none, so a rule with no review requirement waits for nobody, even
18389
+ * for a code owner GitHub requested on its own: its block has another cause. Every reviewer's
18390
+ * latest approval counts as given, on any commit and by any author: that is at least as many as
18391
+ * GitHub counts (a stale approval it dismisses reads as dismissed), so a request it might still
18392
+ * need can be missed but never one it cannot use, and a missed one keeps the immediate item. A
18393
+ * request to a user whose approval already counts never counts: another approval from them adds
18394
+ * none, and an owner's approval already serves the code owner review. Bots and a request stored
18395
+ * by an earlier version without a kind never count.
18396
+ */
18397
+ function awaitedReviewers(pr, rule) {
18398
+ if (rule === null || pr.mergeState !== "blocked") return [];
18399
+ const approvers = new Set(pr.reviews.filter((review) => review.state === "approved").map((review) => review.reviewer.toLowerCase()));
18400
+ const approvalsMissing = approvers.size < (rule.approvals ?? 0);
18401
+ if (!approvalsMissing && !rule.codeOwners) return [];
18402
+ return pr.reviewRequests.flatMap((request) => request.id !== void 0 && (request.kind === "team" || request.kind === "user" && !approvers.has(request.id.toLowerCase())) && (approvalsMissing || request.asCodeOwner) ? [request.id] : []);
18403
+ }
18404
+ /**
18383
18405
  * Changes requested by GitHub's review verdict, or by an external reviewer's latest review. While
18384
18406
  * GitHub has not computed mergeability or the merge state, its verdict does not count, so the head
18385
18407
  * holds as on any unknown read instead of moving the task; a reviewer's latest review always counts, as
@@ -18502,6 +18524,7 @@ async function gateRead(trx, source, pr, agentLogin) {
18502
18524
  approved,
18503
18525
  changesRequested: changesRequested(pr, null, agentLogin),
18504
18526
  decision: "undecided",
18527
+ awaiting: [],
18505
18528
  row,
18506
18529
  clock: false
18507
18530
  };
@@ -18514,24 +18537,54 @@ async function gateRead(trx, source, pr, agentLogin) {
18514
18537
  approved,
18515
18538
  changesRequested: read.requested,
18516
18539
  decision: read.gate,
18540
+ awaiting: read.gate === "blocked" && !read.requested ? awaitedReviewers(pr, rule) : [],
18517
18541
  row,
18518
18542
  clock: read.clock
18519
18543
  };
18520
18544
  }
18521
18545
  /** What External Review reads under github-rules (`gateRead`). */
18522
18546
  async function storedReviewRule(trx, source, pr, agentLogin) {
18523
- const { approved, changesRequested: requested, decision } = await gateRead(trx, source, pr, agentLogin);
18547
+ const { approved, changesRequested: requested, decision, awaiting } = await gateRead(trx, source, pr, agentLogin);
18524
18548
  return {
18525
18549
  approved,
18526
18550
  changesRequested: requested,
18527
- decision
18551
+ decision,
18552
+ ...awaiting.length === 0 ? {} : { awaiting }
18553
+ };
18554
+ }
18555
+ /**
18556
+ * The open PR of a task as the gate reads it: its stored snapshot and, unless the project's checks
18557
+ * gate is Dev, the same facts with the checks the Board saw cancelled and not yet rerun. Null
18558
+ * without a linked open PR.
18559
+ */
18560
+ async function taskGatePr(trx, project, taskId) {
18561
+ const link = await taskPr(trx, taskId);
18562
+ if (link === null || !link.open) return null;
18563
+ const pr = parsePr((await trx.selectFrom("pr_snapshot").select("detail").where(sql`lower(repo) = ${link.repo.toLowerCase()}`).where("number", "=", link.number).executeTakeFirst())?.detail);
18564
+ if (pr === null || pr.state !== "open") return null;
18565
+ const source = prSourceId(project.id, pr.repo);
18566
+ return {
18567
+ pr,
18568
+ gatePr: project.checksGate === "dev" ? pr : await withUnconfirmedCancels(trx, source, pr),
18569
+ source
18528
18570
  };
18529
18571
  }
18572
+ /**
18573
+ * The logins and team slugs a github-rules task's External Review condition waits for
18574
+ * (`awaiting_required_reviewers`), from the same read as the gate; empty otherwise.
18575
+ */
18576
+ async function awaitedReviewersOf(trx, project, taskId) {
18577
+ if (approvalRuleOf(project) !== "github-rules") return [];
18578
+ const read = await taskGatePr(trx, project, taskId);
18579
+ if (read === null) return [];
18580
+ return (await gateRead(trx, read.source, read.gatePr, project.operatorGithubLogin)).awaiting;
18581
+ }
18530
18582
  const upper = (value) => value === null ? "null" : value.toUpperCase();
18531
18583
  /**
18532
18584
  * The items of github-rules tasks in External Review. A head GitHub blocks with every review thread
18533
- * resolved, while the external approval is in place and External Review has no orchestrator, raises
18534
- * one at once; its shown text carries GitHub's current values and nothing is written. Otherwise an
18585
+ * resolved and no awaited reviewer (`awaitedReviewers`), while the external approval is in place
18586
+ * and External Review has no orchestrator, raises one at once; its shown text carries GitHub's
18587
+ * current values and nothing is written. Otherwise an
18535
18588
  * item comes for a head that has stayed undecided for `REVIEW_RULE_UNDECIDED_MS` and whose gate,
18536
18589
  * read as `readInput` reads it, still runs the clock: a
18537
18590
  * newer read of the head by another project's source can name someone to act first or carry
@@ -18545,17 +18598,15 @@ async function reviewRuleItems(trx, config, now, tasks) {
18545
18598
  if (task.column !== "external-review") continue;
18546
18599
  const project = config.projects.find((entry) => entry.id === task.project);
18547
18600
  if (project === void 0 || approvalRuleOf(project) !== "github-rules") continue;
18548
- const link = await taskPr(trx, task.id);
18549
- if (link === null || !link.open) continue;
18550
- const pr = parsePr((await trx.selectFrom("pr_snapshot").select("detail").where(sql`lower(repo) = ${link.repo.toLowerCase()}`).where("number", "=", link.number).executeTakeFirst())?.detail);
18551
- if (pr === null || pr.state !== "open") continue;
18552
- const source = prSourceId(project.id, pr.repo);
18553
- const gate = await gateRead(trx, source, project.checksGate === "dev" ? pr : await withUnconfirmedCancels(trx, source, pr), project.operatorGithubLogin);
18601
+ const read = await taskGatePr(trx, project, task.id);
18602
+ if (read === null) continue;
18603
+ const { pr, source } = read;
18604
+ const gate = await gateRead(trx, source, read.gatePr, project.operatorGithubLogin);
18554
18605
  const row = gate.row;
18555
18606
  const ref = `${pr.repo.toLowerCase()}#${String(pr.number)}`;
18556
18607
  const executor = project.columns.find((column) => column.id === "external-review")?.orchestrator ?? "none";
18557
- if (row !== null && gate.decision === "blocked" && gate.approved && !gate.changesRequested && executor === "none") {
18558
- const what = `${task.key}: GitHub blocks the merge of ${ref} on ${row.headSha.slice(0, 7)} with every review thread resolved and the approval in place`;
18608
+ if (row !== null && gate.decision === "blocked" && gate.approved && !gate.changesRequested && gate.awaiting.length === 0 && executor === "none") {
18609
+ const what = `${task.key}: GitHub's branch rules block the merge of ${ref} on ${row.headSha.slice(0, 7)} and the Board cannot tell why`;
18559
18610
  candidates.push({
18560
18611
  key: `${REVIEW_RULE_KEY}${String(task.id)}:${ref}:${row.headSha}`,
18561
18612
  kind: "board_observation",
@@ -22296,6 +22347,7 @@ async function getStatus(deps, options = {}) {
22296
22347
  }
22297
22348
  const blocks = openBlocks.get(task.id) ?? [];
22298
22349
  const returned = returns.get(task.id);
22350
+ const awaited = task.column === "external-review" && project !== void 0 ? await awaitedReviewersOf(store.db, project, task.id) : [];
22299
22351
  tasks.push({
22300
22352
  key: task.key,
22301
22353
  submission: submissions.get(task.id) ?? null,
@@ -22315,6 +22367,7 @@ async function getStatus(deps, options = {}) {
22315
22367
  openBlocks: blocks.length,
22316
22368
  blocks,
22317
22369
  ...returned === void 0 ? {} : { returned },
22370
+ ...awaited.length === 0 ? {} : { awaitedReviewers: awaited },
22318
22371
  turn: turns.get(task.id) ?? null,
22319
22372
  prSummary: summaries.length === 0 ? null : summaries,
22320
22373
  links: {
@@ -23028,6 +23081,7 @@ function createTaskQueries(deps) {
23028
23081
  const head = facts.pr?.headSha.toLowerCase();
23029
23082
  const { checksGate } = project;
23030
23083
  const waitText = (reason, sha) => reason === "checks_pending" && checksGate !== "dev" ? `checks running, exit from ${checksGate} waits for green` : reason === "merge_state_unknown" || reason === "review_rule_unreadable" ? WAITING_FOR[reason] : `${WAITING_FOR[reason]} on ${sha}`;
23084
+ const awaited = [...facts.reviewRule?.awaiting ?? []];
23031
23085
  const waiting = gate.ok || head === void 0 ? [] : gate.reasons.flatMap((reason) => HOLD_ONLY.has(reason) ? [{
23032
23086
  reason,
23033
23087
  head,
@@ -23036,6 +23090,11 @@ function createTaskQueries(deps) {
23036
23090
  reason,
23037
23091
  head,
23038
23092
  text: "checks red"
23093
+ }] : reason === "awaiting_required_reviewers" ? [{
23094
+ reason,
23095
+ head,
23096
+ text: `awaiting required reviewers: ${awaited.join(", ")}`,
23097
+ reviewers: awaited
23039
23098
  }] : Object.hasOwn(RULE_WAITS, reason) ? [{
23040
23099
  reason,
23041
23100
  head,
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { S as renderMcpError, g as OPERATIONS, pt as ERRORS } from "./chunk-WBquNfmp.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-s4AWMQEb.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-DUsL7Taa.mjs";
1
+ import { S as renderMcpError, g as OPERATIONS, pt as ERRORS } from "./chunk-_tWJWhul.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-Bp_JzHSF.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-BzKjwY-N.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";