spur-board 0.147.0 → 0.148.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.
@@ -475,6 +475,7 @@ const columnConfig = z.strictObject({
475
475
  courseCheckTo: nonEmpty.optional().describe("Who answers this column's course check: operator, the curator's name, or the name of a column orchestrator listed in this project's spurProjects; a board-wide orchestrator is refused. Without it, the curator, or the operator when the project has no curator. When the addressee has no live session the question moves to the operator; a conductor that is rung and does not answer keeps it, and the operator gets an item."),
476
476
  requireResolvedThreads: z.boolean().optional().describe("true: a task leaves this column, and every column right of it, only when its PR has no unresolved review thread; an unresolved one sends it back to Dev, and the worker's Dev turn lists each thread. Outdated threads count; a thread counts until someone resolves it, whoever wrote it. Defaults to true on ready-to-merge and false elsewhere; allowed on dev through ready-to-merge."),
477
477
  approvalRule: z.enum(APPROVAL_RULES).optional().describe("What lets a task leave External Review. any-approval, the default: an approval by someone other than operatorGithubLogin and no changes requested by one. github-rules: that, and GitHub's review rule for the PR's base branch, from branch protection and rulesets, met on the PR's head: no changes requested (GitHub's review decision counts only once the merge state is computed), 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); and the merge not blocked. A required check, one GitHub marks required or a context the rule lists, pending or without a run GitHub marks required holds the head on CI unless the merge state is clean, unstable or has hooks. Only on the external-review column; a disabled one ignores it."),
478
+ quietAfterMs: z.int().min(0).optional().describe("How long a task may wait in External Review with an open PR and no new external review round before the board raises one operator item (external-quiet:) for it, in milliseconds. The wait runs from the latest of the task entering the column, the last Dev submit or arrival of the current PR head, the linking or reopening of the PR, and the last external review on the PR. While the PR source is blind or stale no item is raised and a raised one stays; that time still counts. A new external review, a new head or leaving the column clears the item. A signal only: it moves nothing and opens no turn. 0 or unset turns it off; else at least 300000 (5 minutes). Only on the external-review column; a disabled one ignores it."),
478
479
  quietTurnAfterMs: z.int().min(1).optional().describe("How long the orchestrator session holding a turn of this column may sit quiet at its prompt before the board reminds it, then raises a stuck-turn anomaly, in milliseconds. Defaults to health.idleInDevAfterMs. Named orchestrator only: allowed on an enabled column whose orchestrator is a Spur project, set here or filled board-wide; a worker or operator turn left in the column keeps health.idleInDevAfterMs."),
479
480
  noRecipientAfterMs: z.int().min(1).optional().describe("How long an untaken turn of this column may wait with no live session to ring before the board raises one operator item for the project and column, in milliseconds. The time runs from the later of the turn ring's creation and the moment the last session that could take it stopped being a recipient: the first of its end, leaving Spur's list or reaching a finished state (stopped, killed, errored or completed), so later changes in the same gap do not move it. Sessions that could take it are those of the column's Spur project and the task's linked orchestrator. Defaults to 600000 (10 minutes). Named orchestrator only: allowed on an enabled column whose orchestrator is a Spur project, set here or filled board-wide."),
480
481
  source: z.union([z.literal("manual").describe("manual: the operator moves tasks into and out of the column, the default."), trackerColumnSource]).optional().describe("Where ready-for-dev takes its tasks from: manual (the default), or a GitHub Project field mirrored by the board. Only on the ready-for-dev column.")
@@ -489,6 +490,14 @@ function approvalRuleOf(project) {
489
490
  return column?.enabled === true && column.approvalRule === "github-rules" ? "github-rules" : "any-approval";
490
491
  }
491
492
  /**
493
+ * How long a task waits in a project's External Review without a new external round before the
494
+ * board raises an operator item: the enabled external-review column's quietAfterMs, else 0 (off).
495
+ */
496
+ function externalQuietAfterMs(project) {
497
+ const column = project.columns.find((entry) => entry.id === "external-review");
498
+ return column?.enabled === true ? column.quietAfterMs ?? 0 : 0;
499
+ }
500
+ /**
492
501
  * The GitHub Project status a project's ready-for-dev column mirrors: set only when the column
493
502
  * is enabled and sets a tracker source on a github-issues project, else undefined (manual).
494
503
  */
@@ -532,6 +541,16 @@ function checkBoard(items, ctx) {
532
541
  path: [i, "approvalRule"],
533
542
  message: `Column ${JSON.stringify(item.id)} cannot set approvalRule: approvalRule is allowed only on the external-review column`
534
543
  });
544
+ if (item.quietAfterMs !== void 0 && item.id !== "external-review") ctx.addIssue({
545
+ code: "custom",
546
+ path: [i, "quietAfterMs"],
547
+ message: `Column ${JSON.stringify(item.id)} cannot set quietAfterMs: quietAfterMs is allowed only on the external-review column`
548
+ });
549
+ else if (item.quietAfterMs !== void 0 && item.quietAfterMs > 0 && item.quietAfterMs < 3e5) ctx.addIssue({
550
+ code: "custom",
551
+ path: [i, "quietAfterMs"],
552
+ message: "quietAfterMs must be 0 (off) or at least 300000 (5 minutes)"
553
+ });
535
554
  if (item.source !== void 0 && item.id !== "ready-for-dev") ctx.addIssue({
536
555
  code: "custom",
537
556
  path: [i, "source"],
@@ -3482,7 +3501,8 @@ const configViewSchema = z.strictObject({
3482
3501
  }).optional().describe("Why the last read failed; positions stay as the last complete read left them. Absent after a complete read.")
3483
3502
  })]).optional().describe("Where the column takes its tasks from; present only on Todo-group columns."),
3484
3503
  quietTurnAfterMs: z.int().min(1).optional().describe("Effective quiet time of an orchestrator turn before its reminder, in milliseconds; present only on columns with a named orchestrator."),
3485
- noRecipientAfterMs: z.int().min(1).optional().describe("Effective wait of an untaken turn with no live session before the operator item, in milliseconds; present only on columns with a named orchestrator.")
3504
+ noRecipientAfterMs: z.int().min(1).optional().describe("Effective wait of an untaken turn with no live session before the operator item, in milliseconds; present only on columns with a named orchestrator."),
3505
+ quietAfterMs: z.int().min(3e5).optional().describe("How long a task waits in External Review without a new external review round before the operator item, in milliseconds; present only on the external-review column when above 0.")
3486
3506
  })).describe("Enabled board columns."),
3487
3507
  dispatcher: z.strictObject({ mode: z.enum(DISPATCHER_MODES).describe("Effective dispatcher mode.") }).describe("Dispatcher configuration."),
3488
3508
  spurProjects: z.array(z.strictObject({
@@ -3557,7 +3577,11 @@ const columnsDescribeOutputSchema = z.strictObject({ projects: z.array(z.strictO
3557
3577
  operatorItemAfterReminderReadMs: z.int().min(0).describe("Further quiet time after reminder read/current quiet period before operator item."),
3558
3578
  unhealthyAfterMs: z.int().min(0).describe("Unhealthy executor episode before operator item."),
3559
3579
  text: z.string().describe("Timing origins, pauses and dispatcher-mode qualification.")
3560
- }).nullable().describe("Taken-agent-turn silence policy; null for operator, dispatcher and Todo.")
3580
+ }).nullable().describe("Taken-agent-turn silence policy; null for operator, dispatcher and Todo."),
3581
+ quiet: z.strictObject({
3582
+ operatorItemAfterMs: z.int().min(0).describe("Effective quietAfterMs: how long a task waits here without a new external review round before one operator item; 0 is off."),
3583
+ text: z.string().describe("What the item is and that it moves nothing and opens no turn.")
3584
+ }).nullable().describe("No-new-external-round policy; present (0 = off) on External Review, null elsewhere.")
3561
3585
  }).describe("Question and silent-executor escalation."),
3562
3586
  movedBy: z.strictObject({
3563
3587
  kind: z.enum([
@@ -5786,7 +5810,8 @@ const OPERATIONS = [
5786
5810
  escalation: {
5787
5811
  chain: [],
5788
5812
  noRecipient: null,
5789
- silent: null
5813
+ silent: null,
5814
+ quiet: null
5790
5815
  },
5791
5816
  movedBy: {
5792
5817
  kind: "manual",
@@ -5957,4 +5982,4 @@ const remoteDoctorReportSchema = z.object({
5957
5982
  function assertNever(value) {
5958
5983
  throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
5959
5984
  }
5960
- export { ringMarker as $, eventPayloadSchemas as A, resolveWebOrigin as At, sourceCursorSchema as B, isTodoGroupColumn as Bt, messageRefSchema as C, columnTurnTimings as Ct, sortSkillFiles as D, plainHttpAllowed as Dt, skillReloadFilesSchema as E, defaultAddressee as Et, defaultBranchFactSchema as F, ITEM_KINDS as Ft, SESSION_HEALTH_STATES as G, PR_STATES as H, entityRefSchema as I, SLACK_BOT_SCOPES as It, parseRingMarker as J, SESSION_STATUSES as K, mirrorSourceId as L, TASK_HOLDS as Lt, MIRROR_FAILURES as M, COLUMN_GROUPS as Mt, MIRROR_FAILURE_CODES as N, COLUMN_IDS as Nt, EVENT_KINDS as O, readyMirrorOf as Ot, batchSchema as P, DISPATCHER_MODES as Pt, prReviewRuleSchema as Q, prSourceId as R, TODO_GROUP_COLUMN_IDS as Rt, interactionRefSchema as S, boardWideSpurProject as St, skillReloadFileSchema as T, configSchema as Tt, REVIEW_DECISIONS as U, trackerSourceId as V, REVIEW_STATES as W, prFactsSchema as X, prApprovalPairSchema as Y, prRefSchema as Z, renderJsonError as _, DEFAULT_SLACK_APP_NAME as _t, requestHashOf as a, encodeActorId as at, conversationRefSchema as b, RESERVED_PROJECT as bt, tokenRequestStatusSchema as c, parseRef as ct, buildCatalogSnapshot as d, errorContextSchema as dt, sessionFactsSchema as et, roleCanUseOperation as f, errorEnvelopeSchema as ft, renderHttpProblem as g, DEFAULT_LINK as gt, turnHandedSchema as h, DEFAULT_HTTP_PORT as ht, TOKEN_REQUEST_LIMITS as i, actorIdSchema as it, AdapterError as j, COLUMNS as jt, GATE_REASONS as k, requiredSecretKeys as kt, BOARD_TICK_MS as l, ERRORS as lt, defaultBranchViewSchema as m, successEnvelopeSchema as mt, doctorReportSchema as n, JIRA_PROJECT_KEY as nt, tokenRequestResultSchema as o, errorCodeOf as ot, OPERATIONS as p, ok as pt, isExternalAuthor as q, remoteDoctorReportSchema as r, REF_NUMBER as rt, tokenRequestSchema as s, parseActorId as st, assertNever as t, ticketFactsSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, err as ut, renderMcpError as v, DEFAULT_SLACK_COMMAND as vt, userIdSchema as w, configBindings as wt, inboundEventSchema as x, approvalRuleOf as xt, SPACE_IDS as y, DEFAULT_STAND_PORT_RANGE as yt, sessionTransitionSchema as z, VIAS as zt };
5985
+ export { ringMarker as $, eventPayloadSchemas as A, requiredSecretKeys as At, sourceCursorSchema as B, VIAS as Bt, messageRefSchema as C, columnTurnTimings as Ct, sortSkillFiles as D, externalQuietAfterMs as Dt, skillReloadFilesSchema as E, defaultAddressee as Et, defaultBranchFactSchema as F, DISPATCHER_MODES as Ft, SESSION_HEALTH_STATES as G, PR_STATES as H, entityRefSchema as I, ITEM_KINDS as It, parseRingMarker as J, SESSION_STATUSES as K, mirrorSourceId as L, SLACK_BOT_SCOPES as Lt, MIRROR_FAILURES as M, COLUMNS as Mt, MIRROR_FAILURE_CODES as N, COLUMN_GROUPS as Nt, EVENT_KINDS as O, plainHttpAllowed as Ot, batchSchema as P, COLUMN_IDS as Pt, prReviewRuleSchema as Q, prSourceId as R, TASK_HOLDS as Rt, interactionRefSchema as S, boardWideSpurProject as St, skillReloadFileSchema as T, configSchema as Tt, REVIEW_DECISIONS as U, trackerSourceId as V, isTodoGroupColumn as Vt, REVIEW_STATES as W, prFactsSchema as X, prApprovalPairSchema as Y, prRefSchema as Z, renderJsonError as _, DEFAULT_SLACK_APP_NAME as _t, requestHashOf as a, encodeActorId as at, conversationRefSchema as b, RESERVED_PROJECT as bt, tokenRequestStatusSchema as c, parseRef as ct, buildCatalogSnapshot as d, errorContextSchema as dt, sessionFactsSchema as et, roleCanUseOperation as f, errorEnvelopeSchema as ft, renderHttpProblem as g, DEFAULT_LINK as gt, turnHandedSchema as h, DEFAULT_HTTP_PORT as ht, TOKEN_REQUEST_LIMITS as i, actorIdSchema as it, AdapterError as j, resolveWebOrigin as jt, GATE_REASONS as k, readyMirrorOf as kt, BOARD_TICK_MS as l, ERRORS as lt, defaultBranchViewSchema as m, successEnvelopeSchema as mt, doctorReportSchema as n, JIRA_PROJECT_KEY as nt, tokenRequestResultSchema as o, errorCodeOf as ot, OPERATIONS as p, ok as pt, isExternalAuthor as q, remoteDoctorReportSchema as r, REF_NUMBER as rt, tokenRequestSchema as s, parseActorId as st, assertNever as t, ticketFactsSchema as tt, SYSTEMD_SERVICE_SETTINGS as u, err as ut, renderMcpError as v, DEFAULT_SLACK_COMMAND as vt, userIdSchema as w, configBindings as wt, inboundEventSchema as x, approvalRuleOf as xt, SPACE_IDS as y, DEFAULT_STAND_PORT_RANGE as yt, sessionTransitionSchema as z, TODO_GROUP_COLUMN_IDS as zt };
@@ -1,4 +1,4 @@
1
- import { _ as renderJsonError, c as tokenRequestStatusSchema, dt as errorContextSchema, ft as errorEnvelopeSchema, lt as ERRORS, mt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-BS5xzBWL.mjs";
1
+ import { _ as renderJsonError, c as tokenRequestStatusSchema, dt as errorContextSchema, ft as errorEnvelopeSchema, lt as ERRORS, mt as successEnvelopeSchema, o as tokenRequestResultSchema } from "./chunk-B49czSp7.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 { Dt as plainHttpAllowed, Tt as configSchema, d as buildCatalogSnapshot, p as OPERATIONS } from "./chunk-BS5xzBWL.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-DEbPRDF0.mjs";
1
+ import { Ot as plainHttpAllowed, Tt as configSchema, d as buildCatalogSnapshot, p as OPERATIONS } from "./chunk-B49czSp7.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-BqpntwKX.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 { At as resolveWebOrigin, D as sortSkillFiles, It as SLACK_BOT_SCOPES, T as skillReloadFileSchema, Tt as configSchema, a as requestHashOf, f as roleCanUseOperation, it as actorIdSchema, kt as requiredSecretKeys, lt as ERRORS, mt as successEnvelopeSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as DEFAULT_STAND_PORT_RANGE } from "./chunk-BS5xzBWL.mjs";
1
+ import { At as requiredSecretKeys, D as sortSkillFiles, Lt as SLACK_BOT_SCOPES, T as skillReloadFileSchema, Tt as configSchema, a as requestHashOf, f as roleCanUseOperation, it as actorIdSchema, jt as resolveWebOrigin, lt as ERRORS, mt as successEnvelopeSchema, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, yt as DEFAULT_STAND_PORT_RANGE } from "./chunk-B49czSp7.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-DEbPRDF0.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-CTCKroE3.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-BqpntwKX.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-CwyzJDIl.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-DEbPRDF0.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-BqpntwKX.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ringMarker, A as eventPayloadSchemas, At as resolveWebOrigin, B as sourceCursorSchema, Bt as isTodoGroupColumn, C as messageRefSchema, Ct as columnTurnTimings, D as sortSkillFiles, Dt as plainHttpAllowed, E as skillReloadFilesSchema, Et as defaultAddressee, F as defaultBranchFactSchema, Ft as ITEM_KINDS, G as SESSION_HEALTH_STATES, H as PR_STATES, I as entityRefSchema, It as SLACK_BOT_SCOPES, J as parseRingMarker, K as SESSION_STATUSES, L as mirrorSourceId, Lt as TASK_HOLDS, M as MIRROR_FAILURES, Mt as COLUMN_GROUPS, N as MIRROR_FAILURE_CODES, Nt as COLUMN_IDS, O as EVENT_KINDS, Ot as readyMirrorOf, P as batchSchema, Pt as DISPATCHER_MODES, Q as prReviewRuleSchema, R as prSourceId, Rt as TODO_GROUP_COLUMN_IDS, S as interactionRefSchema, St as boardWideSpurProject, Tt as configSchema, U as REVIEW_DECISIONS, V as trackerSourceId, W as REVIEW_STATES, X as prFactsSchema, Y as prApprovalPairSchema, Z as prRefSchema, a as requestHashOf, at as encodeActorId, b as conversationRefSchema, bt as RESERVED_PROJECT, c as tokenRequestStatusSchema, ct as parseRef$1, d as buildCatalogSnapshot, et as sessionFactsSchema, f as roleCanUseOperation, g as renderHttpProblem, gt as DEFAULT_LINK, h as turnHandedSchema, i as TOKEN_REQUEST_LIMITS, it as actorIdSchema, j as AdapterError, jt as COLUMNS, k as GATE_REASONS, kt as requiredSecretKeys, l as BOARD_TICK_MS, lt as ERRORS, m as defaultBranchViewSchema, mt as successEnvelopeSchema, n as doctorReportSchema, nt as JIRA_PROJECT_KEY, o as tokenRequestResultSchema, ot as errorCodeOf, p as OPERATIONS, pt as ok, q as isExternalAuthor, rt as REF_NUMBER, s as tokenRequestSchema, st as parseActorId, t as assertNever, tt as ticketFactsSchema, ut as err, vt as DEFAULT_SLACK_COMMAND, w as userIdSchema, wt as configBindings, x as inboundEventSchema, xt as approvalRuleOf, y as SPACE_IDS, z as sessionTransitionSchema, zt as VIAS } from "./chunk-BS5xzBWL.mjs";
1
+ import { $ as ringMarker, A as eventPayloadSchemas, At as requiredSecretKeys, B as sourceCursorSchema, Bt as VIAS, C as messageRefSchema, Ct as columnTurnTimings, D as sortSkillFiles, Dt as externalQuietAfterMs, E as skillReloadFilesSchema, Et as defaultAddressee, F as defaultBranchFactSchema, Ft as DISPATCHER_MODES, G as SESSION_HEALTH_STATES, H as PR_STATES, I as entityRefSchema, It as ITEM_KINDS, J as parseRingMarker, K as SESSION_STATUSES, L as mirrorSourceId, Lt as SLACK_BOT_SCOPES, M as MIRROR_FAILURES, Mt as COLUMNS, N as MIRROR_FAILURE_CODES, Nt as COLUMN_GROUPS, O as EVENT_KINDS, Ot as plainHttpAllowed, P as batchSchema, Pt as COLUMN_IDS, Q as prReviewRuleSchema, R as prSourceId, Rt as TASK_HOLDS, S as interactionRefSchema, St as boardWideSpurProject, Tt as configSchema, U as REVIEW_DECISIONS, V as trackerSourceId, Vt as isTodoGroupColumn, W as REVIEW_STATES, X as prFactsSchema, Y as prApprovalPairSchema, Z as prRefSchema, a as requestHashOf, at as encodeActorId, b as conversationRefSchema, bt as RESERVED_PROJECT, c as tokenRequestStatusSchema, ct as parseRef$1, d as buildCatalogSnapshot, et as sessionFactsSchema, f as roleCanUseOperation, g as renderHttpProblem, gt as DEFAULT_LINK, h as turnHandedSchema, i as TOKEN_REQUEST_LIMITS, it as actorIdSchema, j as AdapterError, jt as resolveWebOrigin, k as GATE_REASONS, kt as readyMirrorOf, l as BOARD_TICK_MS, lt as ERRORS, m as defaultBranchViewSchema, mt as successEnvelopeSchema, n as doctorReportSchema, nt as JIRA_PROJECT_KEY, o as tokenRequestResultSchema, ot as errorCodeOf, p as OPERATIONS, pt as ok, q as isExternalAuthor, rt as REF_NUMBER, s as tokenRequestSchema, st as parseActorId, t as assertNever, tt as ticketFactsSchema, ut as err, vt as DEFAULT_SLACK_COMMAND, w as userIdSchema, wt as configBindings, x as inboundEventSchema, xt as approvalRuleOf, y as SPACE_IDS, z as sessionTransitionSchema, zt as TODO_GROUP_COLUMN_IDS } from "./chunk-B49czSp7.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";
@@ -8840,6 +8840,14 @@ const CONVERSATION_KEY = "conversation:";
8840
8840
  const NO_SESSION_KEY = "no-session:";
8841
8841
  /** The item of a github-rules task whose PR head GitHub has left undecided in External Review. */
8842
8842
  const REVIEW_RULE_KEY = "review-rule:";
8843
+ /** The item of a task waiting in External Review with no new external review round for its quietAfterMs. */
8844
+ const EXTERNAL_QUIET_KEY = "external-quiet:";
8845
+ /** The operator's action on an external-quiet item; its inbox entry and its feed line end with it. */
8846
+ const EXTERNAL_QUIET_ACTION = "request a new external review round or approve the PR by hand";
8847
+ /** The text of an item's feed line: its text, and for an external-quiet item its action. */
8848
+ function itemLineText(item) {
8849
+ return item.item_key.startsWith("external-quiet:") ? `${item.text}: ${EXTERNAL_QUIET_ACTION}` : item.text;
8850
+ }
8843
8851
  /** The block an item is about: its ledger block, else the block its key names. */
8844
8852
  function itemBlockRef(item) {
8845
8853
  if (item.block_id !== null) return item.block_id;
@@ -8940,13 +8948,14 @@ async function raiseItemWith(trx, input, writeLine) {
8940
8948
  await journal$3(trx, item, "from_you_raised", input.at, input.rule);
8941
8949
  if (ITEM_POLICY[input.kind].feed) {
8942
8950
  const key = (item.task_id === null ? null : await trx.selectFrom("task").select("key").where("id", "=", item.task_id).executeTakeFirstOrThrow())?.key ?? "spur-board";
8951
+ const text = itemLineText(item);
8943
8952
  const line = await writeLine(trx, {
8944
8953
  itemId: item.id,
8945
8954
  itemKey: item.item_key,
8946
8955
  raise: item.raise_no,
8947
8956
  key,
8948
- text: item.text,
8949
- title: `${key}: ${item.text}`,
8957
+ text,
8958
+ title: `${key}: ${text}`,
8950
8959
  url: item.url,
8951
8960
  taskId: item.task_id,
8952
8961
  actions: itemActions(item.id, input.kind),
@@ -9794,7 +9803,7 @@ async function clearItem(trx, itemId, at, actor = "system", writeEdit) {
9794
9803
  lineId: item.line_outbox_id,
9795
9804
  key: task?.key ?? "spur-board",
9796
9805
  taskId: item.task_id,
9797
- summary: capPoints(item.text, MAX_SUMMARY),
9806
+ summary: capPoints(itemLineText(item), MAX_SUMMARY),
9798
9807
  url: item.url,
9799
9808
  by: actor,
9800
9809
  at
@@ -14950,6 +14959,67 @@ function evaluateSessionHealth(input) {
14950
14959
  function prsPolledSince(task, since) {
14951
14960
  return task.prCompleteAt !== null && task.prCompleteAt >= Date.parse(since);
14952
14961
  }
14962
+ // ../core/src/app/external-quiet.ts
14963
+ /**
14964
+ * The items of tasks waiting in External Review with an open PR and no new external review round
14965
+ * for the project's `quietAfterMs`. The wait runs from the latest of the task entering the column,
14966
+ * the last Dev submit on the current head, the head's arrival on this PR, the PR's linking to the
14967
+ * task or reopening, and the last external review on the PR. While the PR's source is blind or stale nothing is raised and the item of the current visit
14968
+ * is held, so a review that lands in the gap shows on the next complete read.
14969
+ */
14970
+ async function externalQuietItems(trx, config, now, tasks, sourceById) {
14971
+ const candidates = [];
14972
+ const held = [];
14973
+ for (const task of tasks) {
14974
+ if (task.column !== "external-review") continue;
14975
+ const project = config.projects.find((entry) => entry.id === task.project);
14976
+ const threshold = project === void 0 ? 0 : externalQuietAfterMs(project);
14977
+ if (project === void 0 || threshold === 0) continue;
14978
+ const pr = await prFacts(trx, task.id);
14979
+ if (pr?.state !== "open") continue;
14980
+ const key = `${EXTERNAL_QUIET_KEY}${String(task.id)}:${String(task.column_epoch)}`;
14981
+ const source = prSourceId(project.id, pr.repo);
14982
+ const state = sourceById.get(source);
14983
+ const lastComplete = state?.last_complete_at ?? null;
14984
+ if (state === void 0 || state.blind_reason !== null || lastComplete === null || now - Date.parse(lastComplete) > config.thresholds.staleMultiplier * sourceInterval(config, source)) {
14985
+ held.push(key);
14986
+ continue;
14987
+ }
14988
+ const head = pr.headSha.toLowerCase();
14989
+ const reviews = externalReviews(pr, project.operatorGithubLogin);
14990
+ const [entry] = await readStatusColumnEntries(trx, /* @__PURE__ */ new Set([task.project]), task.id);
14991
+ const submit = await trx.selectFrom("submission").select((eb) => eb.fn.max("submitted_at").as("at")).where("task_id", "=", task.id).where("column", "=", "dev").where(sql`lower(commit_sha) = ${head}`).executeTakeFirst();
14992
+ const arrival = await trx.selectFrom("event").select((eb) => eb.fn.max("at").as("at")).where("task_id", "=", task.id).where(sql`lower(json_extract(payload, '$.repo')) = ${pr.repo.toLowerCase()}`).where(sql`json_extract(payload, '$.pr') = ${pr.number}`).where((eb) => eb.or([
14993
+ eb("kind", "=", "link_added"),
14994
+ eb.and([eb("kind", "=", "pr_state_changed"), sql`json_extract(payload, '$.to') = 'open'`]),
14995
+ eb.and([eb("kind", "=", "head_moved"), sql`lower(json_extract(payload, '$.to')) = ${head}`])
14996
+ ])).executeTakeFirst();
14997
+ const since = Math.max(Date.parse(entry?.at ?? task.created_at), ...[
14998
+ submit?.at,
14999
+ arrival?.at,
15000
+ ...reviews.map((review) => review.submittedAt)
15001
+ ].filter((at) => typeof at === "string").map((at) => Date.parse(at)));
15002
+ if (now - since < threshold) continue;
15003
+ const [latest] = reviews.filter((review) => review.commitSha.toLowerCase() === head).sort((left, right) => Date.parse(right.submittedAt) - Date.parse(left.submittedAt) || left.reviewer.localeCompare(right.reviewer));
15004
+ const sha = head.slice(0, 7);
15005
+ const last = latest === void 0 ? `no external review on ${sha}` : `latest external review on ${sha}: ${latest.state.replaceAll("_", " ")} by ${latest.reviewer} at ${latest.submittedAt}`;
15006
+ const what = (waited) => `${task.key}: ${pr.repo}#${String(pr.number)} has had no new external review round${waited}, since ${new Date(since).toISOString()}; ${last}`;
15007
+ candidates.push({
15008
+ key,
15009
+ kind: "board_observation",
15010
+ taskId: task.id,
15011
+ summary: what(` for ${String(Math.floor((now - since) / 6e4))} min`),
15012
+ hashedSummary: what(""),
15013
+ factAt: lastComplete,
15014
+ source,
15015
+ priority: 4
15016
+ });
15017
+ }
15018
+ return {
15019
+ candidates,
15020
+ held
15021
+ };
15022
+ }
14953
15023
  // ../core/src/app/quiet-turns.ts
14954
15024
  /**
14955
15025
  * How long the holder of a taken turn may sit quiet before it is reminded, then flagged: the column
@@ -15713,6 +15783,9 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
15713
15783
  heldKeys.push(...held.map((item) => item.item_key));
15714
15784
  } else candidates.push(...await turnsWithoutSession(trx, config, now, taskById));
15715
15785
  candidates.push(...await reviewRuleItems(trx, config, now, tasks));
15786
+ const quiet = await externalQuietItems(trx, config, now, tasks, sourceById);
15787
+ candidates.push(...quiet.candidates);
15788
+ heldKeys.push(...quiet.held);
15716
15789
  candidates.push(...await turnWaitItems(trx, config, taskById));
15717
15790
  const ordered = orderItems(candidates);
15718
15791
  const seen = /* @__PURE__ */ new Set([...ordered.map((item) => item.key), ...heldKeys]);
@@ -19298,7 +19371,11 @@ async function describeProject(trx, config, project) {
19298
19371
  operatorItemAfterReminderReadMs: quietAfterMs,
19299
19372
  unhealthyAfterMs: config.health.turnStallAfterMs,
19300
19373
  text: `Active with dispatcher on; shadow only models policy. A taken named executor uses its effective column quietTurnAfterMs. Existing worker/operator turns keep the global idle threshold. A taken agent turn gets one reminder after observed idle time; an operator item follows after the reminder is read and another quiet period. Open questions and blind sources pause observation. An unread reminder does not start the post-read timer; an exhausted failed reminder can raise an operator item once the current quiet period reaches remindAfterMs. Unhealthy executor episodes use continuous observation and turnStallAfterMs. Ordinary doorbells wait ${String(config.doorbells.firstRetryMs)}, then ${String(config.doorbells.secondRetryMs)} ms between delivered rings; the final unanswered pause is ${String(config.doorbells.unansweredAfterMs)} ms.`
19301
- }
19374
+ },
19375
+ quiet: column.id === "external-review" ? {
19376
+ operatorItemAfterMs: externalQuietAfterMs(project),
19377
+ text: "quietAfterMs (0 = off): an external-quiet: inbox item when a task with an open PR waits here that long without a new external review round. It moves nothing and opens no turn."
19378
+ } : null
19302
19379
  },
19303
19380
  movedBy: mirror !== void 0 && column.id === "ready-for-dev" ? {
19304
19381
  kind: "mirror",
@@ -19658,6 +19735,7 @@ function observationAction(item) {
19658
19735
  if (key.startsWith("pr-outcome:")) return "check the pull request, then close the item or archive the task";
19659
19736
  if (key.startsWith("lookup:")) return "check the ticket in the tracker, then close the item or archive the task";
19660
19737
  if (key.startsWith("default-branch:")) return "open the failing run; fix or revert";
19738
+ if (key.startsWith("external-quiet:")) return EXTERNAL_QUIET_ACTION;
19661
19739
  if (key.startsWith("operator-block:")) return `answer ${blockName(item)}`;
19662
19740
  if (key.startsWith("block:")) return `answer ${blockName(item)} if it is a question, or close it with a reason`;
19663
19741
  if (key.startsWith("filter:")) return "return the ticket to the tracker filter, or finish or unlink the linked work";
@@ -20564,7 +20642,8 @@ function createOperationRegistry(deps) {
20564
20642
  ...timings === null ? {} : {
20565
20643
  quietTurnAfterMs: timings.quietTurnAfterMs,
20566
20644
  noRecipientAfterMs: timings.noRecipientAfterMs
20567
- }
20645
+ },
20646
+ ...column.id !== "external-review" || externalQuietAfterMs(project) === 0 ? {} : { quietAfterMs: externalQuietAfterMs(project) }
20568
20647
  };
20569
20648
  }),
20570
20649
  dispatcher: { mode: project.dispatcher.mode },
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { lt as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-BS5xzBWL.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-DEbPRDF0.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CTCKroE3.mjs";
1
+ import { lt as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-B49czSp7.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-BqpntwKX.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CwyzJDIl.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";