spur-board 0.147.0 → 0.149.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.
- package/dist/{chunk-BS5xzBWL.mjs → chunk-B49czSp7.mjs} +29 -4
- package/dist/{chunk-DEbPRDF0.mjs → chunk-BqpntwKX.mjs} +1 -1
- package/dist/{chunk-CTCKroE3.mjs → chunk-CwyzJDIl.mjs} +2 -2
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +138 -26
- package/dist/mcp.mjs +3 -3
- package/dist/web/assets/{index-DuIWV_i0.js → index-hXCwPFEF.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/skills/spur-board/references/how-board-works-columns.md +22 -17
- package/skills/spur-board/references/how-board-works-inbox.md +10 -9
- package/skills/spur-board/references/how-board-works-slack.md +2 -1
- package/skills/spur-board/references/how-board-works.md +2 -1
|
@@ -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,
|
|
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-
|
|
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 {
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
8949
|
-
title: `${key}: ${
|
|
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
|
|
9806
|
+
summary: capPoints(itemLineText(item), MAX_SUMMARY),
|
|
9798
9807
|
url: item.url,
|
|
9799
9808
|
by: actor,
|
|
9800
9809
|
at
|
|
@@ -11623,14 +11632,21 @@ function executorDone(column, facts) {
|
|
|
11623
11632
|
}
|
|
11624
11633
|
/**
|
|
11625
11634
|
* The leftmost enabled column that requires resolved threads: `requireResolvedThreads`, by default
|
|
11626
|
-
* true on Ready to Merge only.
|
|
11635
|
+
* true on Ready to Merge only. Under `approvalRule: github-rules`, a review rule GitHub blocks on
|
|
11636
|
+
* unresolved threads (`facts.reviewRule`) also requires them from External Review on, whatever
|
|
11637
|
+
* `requireResolvedThreads` says. Undefined when no column requires them.
|
|
11627
11638
|
*/
|
|
11628
|
-
function threadsFrom(project) {
|
|
11629
|
-
|
|
11639
|
+
function threadsFrom(project, facts) {
|
|
11640
|
+
const from = project.columns.find((c) => c.enabled && (c.requireResolvedThreads ?? c.id === "ready-to-merge"))?.id;
|
|
11641
|
+
if (facts?.reviewRule?.decision !== "unresolved_threads" || approvalRuleOf(project) !== "github-rules") return from;
|
|
11642
|
+
return from !== void 0 && COLUMN_IDS.indexOf(from) < COLUMN_IDS.indexOf("external-review") ? from : "external-review";
|
|
11630
11643
|
}
|
|
11631
|
-
/**
|
|
11632
|
-
|
|
11633
|
-
|
|
11644
|
+
/**
|
|
11645
|
+
* Whether any column of the project requires resolved review threads, with `facts` as
|
|
11646
|
+
* `threadsFrom` reads them.
|
|
11647
|
+
*/
|
|
11648
|
+
function threadsGated(project, facts) {
|
|
11649
|
+
return threadsFrom(project, facts) !== void 0;
|
|
11634
11650
|
}
|
|
11635
11651
|
/**
|
|
11636
11652
|
* Dev's failing reasons. `threads` adds the resolved-threads condition: it holds for the gate of
|
|
@@ -11656,7 +11672,7 @@ function gateCheckReasons(facts, waived) {
|
|
|
11656
11672
|
* The failing reasons of one column's exit condition. Only Dev's resolved-threads condition depends
|
|
11657
11673
|
* on the column asked: `threads` says whether it counts. A `gate_broken` move re-evaluates at Dev,
|
|
11658
11674
|
* where that condition may not count, so a reason or hand-over that must survive it keys on the
|
|
11659
|
-
* facts and `threadsGated(project)` (`withThreads`, `turnThreads`), and `explainGates` takes
|
|
11675
|
+
* facts and `threadsGated(project, facts)` (`withThreads`, `turnThreads`), and `explainGates` takes
|
|
11660
11676
|
* `blockedIn` from `evaluateGate`.
|
|
11661
11677
|
*/
|
|
11662
11678
|
function columnCondition(column, facts, project, waived, threads) {
|
|
@@ -11749,14 +11765,15 @@ function describeConditions(column, project) {
|
|
|
11749
11765
|
* Evaluates the exit conditions of every enabled column from To Do up to and including `column`,
|
|
11750
11766
|
* and returns the leftmost one that fails. A column absent from the project's columns or disabled
|
|
11751
11767
|
* passes through. A merged pull request passes every column. Dev's resolved-threads condition
|
|
11752
|
-
* counts when `column` is at or right of the leftmost
|
|
11768
|
+
* counts when `column` is at or right of the leftmost column requiring resolved threads
|
|
11769
|
+
* (`threadsFrom`).
|
|
11753
11770
|
* Once Dev is evaluated with its check condition passed by `reposWithoutCi`, the result carries
|
|
11754
11771
|
* `checksWaivedBy`.
|
|
11755
11772
|
*/
|
|
11756
11773
|
function evaluateGate(column, facts, project) {
|
|
11757
11774
|
if (facts.pr?.state === "merged") return { ok: true };
|
|
11758
11775
|
const waived = noCiWaives(facts.pr, project);
|
|
11759
|
-
const from = threadsFrom(project);
|
|
11776
|
+
const from = threadsFrom(project, facts);
|
|
11760
11777
|
const threads = from !== void 0 && COLUMN_IDS.indexOf(from) <= COLUMN_IDS.indexOf(column);
|
|
11761
11778
|
let marker = {};
|
|
11762
11779
|
for (const id of COLUMN_IDS.slice(0, COLUMN_IDS.indexOf(column) + 1)) {
|
|
@@ -11846,14 +11863,15 @@ const CONDITION_OF = {
|
|
|
11846
11863
|
const STOPS_DEV = /* @__PURE__ */ new Set(["no_pr", "pr_closed"]);
|
|
11847
11864
|
/**
|
|
11848
11865
|
* Every column's own exit conditions with their state, and where its cumulative gate blocks, as
|
|
11849
|
-
* `evaluateGate` decides it for each column. Dev's own conditions count resolved threads once
|
|
11850
|
-
*
|
|
11866
|
+
* `evaluateGate` decides it for each column. Dev's own conditions count resolved threads once a
|
|
11867
|
+
* column requires them (`threadsGated`). A merged pull request passes every column and every
|
|
11868
|
+
* condition.
|
|
11851
11869
|
* `checksWaivedBy` is the marker `evaluateGate('done')` carries, or null.
|
|
11852
11870
|
*/
|
|
11853
11871
|
function explainGates(facts, project) {
|
|
11854
11872
|
const merged = facts.pr?.state === "merged";
|
|
11855
11873
|
const waived = noCiWaives(facts.pr, project);
|
|
11856
|
-
const threads = threadsGated(project);
|
|
11874
|
+
const threads = threadsGated(project, facts);
|
|
11857
11875
|
let checksWaivedBy = null;
|
|
11858
11876
|
return {
|
|
11859
11877
|
gates: COLUMN_IDS.map((column) => {
|
|
@@ -12081,7 +12099,7 @@ function dispatch(input) {
|
|
|
12081
12099
|
};
|
|
12082
12100
|
};
|
|
12083
12101
|
const withThreads = (next) => {
|
|
12084
|
-
if (next?.column !== "dev" || !threadsGated(project) || facts.unresolvedThreads === 0) return next;
|
|
12102
|
+
if (next?.column !== "dev" || !threadsGated(project, facts) || facts.unresolvedThreads === 0) return next;
|
|
12085
12103
|
const { reasons } = next;
|
|
12086
12104
|
if (reasons.some((r) => r === "no_pr" || r === "pr_closed" || r === "unresolved_threads")) return next;
|
|
12087
12105
|
const added = /* @__PURE__ */ new Set([...reasons, "unresolved_threads"]);
|
|
@@ -14809,8 +14827,11 @@ async function storedReviewRule(trx, source, pr, agentLogin) {
|
|
|
14809
14827
|
}
|
|
14810
14828
|
const upper = (value) => value === null ? "null" : value.toUpperCase();
|
|
14811
14829
|
/**
|
|
14812
|
-
* The items of github-rules tasks in External Review
|
|
14813
|
-
*
|
|
14830
|
+
* The items of github-rules tasks in External Review. A head GitHub blocks with every review thread
|
|
14831
|
+
* resolved, while the external approval is in place and External Review has no orchestrator, raises
|
|
14832
|
+
* one at once; its shown text carries GitHub's current values and nothing is written. Otherwise an
|
|
14833
|
+
* item comes for a head that has stayed undecided for `REVIEW_RULE_UNDECIDED_MS` and whose gate,
|
|
14834
|
+
* read as `readInput` reads it, still runs the clock: a
|
|
14814
14835
|
* newer read of the head by another project's source can name someone to act first or carry
|
|
14815
14836
|
* GitHub's answer, and then no item is raised or kept. GitHub's values are frozen in the row at
|
|
14816
14837
|
* the first reconcile past the threshold and again when the cause changes, so a later poll or a
|
|
@@ -14829,9 +14850,24 @@ async function reviewRuleItems(trx, config, now, tasks) {
|
|
|
14829
14850
|
const source = prSourceId(project.id, pr.repo);
|
|
14830
14851
|
const gate = await gateRead(trx, source, project.checksGate === "dev" ? pr : await withUnconfirmedCancels(trx, source, pr), project.operatorGithubLogin);
|
|
14831
14852
|
const row = gate.row;
|
|
14853
|
+
const ref = `${pr.repo.toLowerCase()}#${String(pr.number)}`;
|
|
14854
|
+
const executor = project.columns.find((column) => column.id === "external-review")?.orchestrator ?? "none";
|
|
14855
|
+
if (row !== null && gate.decision === "blocked" && gate.approved && !gate.changesRequested && executor === "none") {
|
|
14856
|
+
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`;
|
|
14857
|
+
candidates.push({
|
|
14858
|
+
key: `${REVIEW_RULE_KEY}${String(task.id)}:${ref}:${row.headSha}`,
|
|
14859
|
+
kind: "board_observation",
|
|
14860
|
+
taskId: task.id,
|
|
14861
|
+
summary: `${what} (mergeStateStatus=${upper(pr.mergeState)}, mergeable=${upper(pr.mergeable)}, reviewDecision=${upper(row.reviewDecision)})`,
|
|
14862
|
+
hashedSummary: what,
|
|
14863
|
+
factAt: row.observedAt ?? null,
|
|
14864
|
+
source,
|
|
14865
|
+
priority: 4
|
|
14866
|
+
});
|
|
14867
|
+
continue;
|
|
14868
|
+
}
|
|
14832
14869
|
if (row?.undecidedSince == null || !gate.clock) continue;
|
|
14833
14870
|
if (now - Date.parse(row.undecidedSince) < REVIEW_RULE_UNDECIDED_MS) continue;
|
|
14834
|
-
const ref = `${pr.repo.toLowerCase()}#${String(pr.number)}`;
|
|
14835
14871
|
const what = gate.decision === "unreadable" ? `The GitHub review rule for the base branch of ${ref} could not be read` : `GitHub has not decided the review rule of ${ref}`;
|
|
14836
14872
|
let raised = row.raised;
|
|
14837
14873
|
if (raised === null || !raised.startsWith(what)) {
|
|
@@ -14950,6 +14986,67 @@ function evaluateSessionHealth(input) {
|
|
|
14950
14986
|
function prsPolledSince(task, since) {
|
|
14951
14987
|
return task.prCompleteAt !== null && task.prCompleteAt >= Date.parse(since);
|
|
14952
14988
|
}
|
|
14989
|
+
// ../core/src/app/external-quiet.ts
|
|
14990
|
+
/**
|
|
14991
|
+
* The items of tasks waiting in External Review with an open PR and no new external review round
|
|
14992
|
+
* for the project's `quietAfterMs`. The wait runs from the latest of the task entering the column,
|
|
14993
|
+
* the last Dev submit on the current head, the head's arrival on this PR, the PR's linking to the
|
|
14994
|
+
* 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
|
|
14995
|
+
* is held, so a review that lands in the gap shows on the next complete read.
|
|
14996
|
+
*/
|
|
14997
|
+
async function externalQuietItems(trx, config, now, tasks, sourceById) {
|
|
14998
|
+
const candidates = [];
|
|
14999
|
+
const held = [];
|
|
15000
|
+
for (const task of tasks) {
|
|
15001
|
+
if (task.column !== "external-review") continue;
|
|
15002
|
+
const project = config.projects.find((entry) => entry.id === task.project);
|
|
15003
|
+
const threshold = project === void 0 ? 0 : externalQuietAfterMs(project);
|
|
15004
|
+
if (project === void 0 || threshold === 0) continue;
|
|
15005
|
+
const pr = await prFacts(trx, task.id);
|
|
15006
|
+
if (pr?.state !== "open") continue;
|
|
15007
|
+
const key = `${EXTERNAL_QUIET_KEY}${String(task.id)}:${String(task.column_epoch)}`;
|
|
15008
|
+
const source = prSourceId(project.id, pr.repo);
|
|
15009
|
+
const state = sourceById.get(source);
|
|
15010
|
+
const lastComplete = state?.last_complete_at ?? null;
|
|
15011
|
+
if (state === void 0 || state.blind_reason !== null || lastComplete === null || now - Date.parse(lastComplete) > config.thresholds.staleMultiplier * sourceInterval(config, source)) {
|
|
15012
|
+
held.push(key);
|
|
15013
|
+
continue;
|
|
15014
|
+
}
|
|
15015
|
+
const head = pr.headSha.toLowerCase();
|
|
15016
|
+
const reviews = externalReviews(pr, project.operatorGithubLogin);
|
|
15017
|
+
const [entry] = await readStatusColumnEntries(trx, /* @__PURE__ */ new Set([task.project]), task.id);
|
|
15018
|
+
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();
|
|
15019
|
+
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([
|
|
15020
|
+
eb("kind", "=", "link_added"),
|
|
15021
|
+
eb.and([eb("kind", "=", "pr_state_changed"), sql`json_extract(payload, '$.to') = 'open'`]),
|
|
15022
|
+
eb.and([eb("kind", "=", "head_moved"), sql`lower(json_extract(payload, '$.to')) = ${head}`])
|
|
15023
|
+
])).executeTakeFirst();
|
|
15024
|
+
const since = Math.max(Date.parse(entry?.at ?? task.created_at), ...[
|
|
15025
|
+
submit?.at,
|
|
15026
|
+
arrival?.at,
|
|
15027
|
+
...reviews.map((review) => review.submittedAt)
|
|
15028
|
+
].filter((at) => typeof at === "string").map((at) => Date.parse(at)));
|
|
15029
|
+
if (now - since < threshold) continue;
|
|
15030
|
+
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));
|
|
15031
|
+
const sha = head.slice(0, 7);
|
|
15032
|
+
const last = latest === void 0 ? `no external review on ${sha}` : `latest external review on ${sha}: ${latest.state.replaceAll("_", " ")} by ${latest.reviewer} at ${latest.submittedAt}`;
|
|
15033
|
+
const what = (waited) => `${task.key}: ${pr.repo}#${String(pr.number)} has had no new external review round${waited}, since ${new Date(since).toISOString()}; ${last}`;
|
|
15034
|
+
candidates.push({
|
|
15035
|
+
key,
|
|
15036
|
+
kind: "board_observation",
|
|
15037
|
+
taskId: task.id,
|
|
15038
|
+
summary: what(` for ${String(Math.floor((now - since) / 6e4))} min`),
|
|
15039
|
+
hashedSummary: what(""),
|
|
15040
|
+
factAt: lastComplete,
|
|
15041
|
+
source,
|
|
15042
|
+
priority: 4
|
|
15043
|
+
});
|
|
15044
|
+
}
|
|
15045
|
+
return {
|
|
15046
|
+
candidates,
|
|
15047
|
+
held
|
|
15048
|
+
};
|
|
15049
|
+
}
|
|
14953
15050
|
// ../core/src/app/quiet-turns.ts
|
|
14954
15051
|
/**
|
|
14955
15052
|
* How long the holder of a taken turn may sit quiet before it is reminded, then flagged: the column
|
|
@@ -15713,6 +15810,9 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
15713
15810
|
heldKeys.push(...held.map((item) => item.item_key));
|
|
15714
15811
|
} else candidates.push(...await turnsWithoutSession(trx, config, now, taskById));
|
|
15715
15812
|
candidates.push(...await reviewRuleItems(trx, config, now, tasks));
|
|
15813
|
+
const quiet = await externalQuietItems(trx, config, now, tasks, sourceById);
|
|
15814
|
+
candidates.push(...quiet.candidates);
|
|
15815
|
+
heldKeys.push(...quiet.held);
|
|
15716
15816
|
candidates.push(...await turnWaitItems(trx, config, taskById));
|
|
15717
15817
|
const ordered = orderItems(candidates);
|
|
15718
15818
|
const seen = /* @__PURE__ */ new Set([...ordered.map((item) => item.key), ...heldKeys]);
|
|
@@ -15734,7 +15834,11 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
15734
15834
|
if (item.source === "spur" && spurHeld.has(item.item_key) || stillInError.has(item.item_key)) seen.add(item.item_key);
|
|
15735
15835
|
}
|
|
15736
15836
|
for (const item of existing) if (!seen.has(item.item_key)) await clearReconciled(trx, item, new Date(now));
|
|
15737
|
-
const ended = (await trx.selectFrom("dismissal").select("item_key").where((eb) => eb.or([
|
|
15837
|
+
const ended = (await trx.selectFrom("dismissal").select("item_key").where((eb) => eb.or([
|
|
15838
|
+
eb("item_key", "like", "pr-closed:%"),
|
|
15839
|
+
eb("item_key", "like", "ticket-closed:%"),
|
|
15840
|
+
eb("item_key", "like", `${REVIEW_RULE_KEY}%`)
|
|
15841
|
+
])).execute()).map((row) => row.item_key).filter((key) => !seen.has(key));
|
|
15738
15842
|
if (ended.length > 0) await trx.deleteFrom("dismissal").where("item_key", "in", ended).execute();
|
|
15739
15843
|
for (const candidate of ordered) {
|
|
15740
15844
|
const hash = fingerprint(candidate);
|
|
@@ -18815,11 +18919,13 @@ async function taskSessions(trx, taskId) {
|
|
|
18815
18919
|
// ../core/src/app/turn-view.ts
|
|
18816
18920
|
/**
|
|
18817
18921
|
* The unresolved review threads a Dev turn lists, read live from the task's PR snapshot: only on a
|
|
18818
|
-
* project requiring resolved threads
|
|
18819
|
-
*
|
|
18922
|
+
* project requiring resolved threads, or for a turn whose reason names `unresolved_threads` (a
|
|
18923
|
+
* return GitHub's review rule caused), and an open PR, and only threads with an id and a link
|
|
18924
|
+
* (facts stored by an earlier version lack them). Undefined when none.
|
|
18820
18925
|
*/
|
|
18821
18926
|
async function turnThreads(trx, taskId, project, turn) {
|
|
18822
|
-
if (turn.column !== "dev" || project === void 0
|
|
18927
|
+
if (turn.column !== "dev" || project === void 0) return void 0;
|
|
18928
|
+
if (!(turn.reason.split(": ")[1] ?? "").split(", ").includes("unresolved_threads") && !threadsGated(project)) return void 0;
|
|
18823
18929
|
const pr = await prFacts(trx, taskId);
|
|
18824
18930
|
if (pr?.state !== "open") return void 0;
|
|
18825
18931
|
const threads = pr.reviewThreads.flatMap(({ resolved, id, url, outdated }) => resolved || id === void 0 || url === void 0 ? [] : [{
|
|
@@ -19298,7 +19404,11 @@ async function describeProject(trx, config, project) {
|
|
|
19298
19404
|
operatorItemAfterReminderReadMs: quietAfterMs,
|
|
19299
19405
|
unhealthyAfterMs: config.health.turnStallAfterMs,
|
|
19300
19406
|
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
|
-
}
|
|
19407
|
+
},
|
|
19408
|
+
quiet: column.id === "external-review" ? {
|
|
19409
|
+
operatorItemAfterMs: externalQuietAfterMs(project),
|
|
19410
|
+
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."
|
|
19411
|
+
} : null
|
|
19302
19412
|
},
|
|
19303
19413
|
movedBy: mirror !== void 0 && column.id === "ready-for-dev" ? {
|
|
19304
19414
|
kind: "mirror",
|
|
@@ -19658,6 +19768,7 @@ function observationAction(item) {
|
|
|
19658
19768
|
if (key.startsWith("pr-outcome:")) return "check the pull request, then close the item or archive the task";
|
|
19659
19769
|
if (key.startsWith("lookup:")) return "check the ticket in the tracker, then close the item or archive the task";
|
|
19660
19770
|
if (key.startsWith("default-branch:")) return "open the failing run; fix or revert";
|
|
19771
|
+
if (key.startsWith("external-quiet:")) return EXTERNAL_QUIET_ACTION;
|
|
19661
19772
|
if (key.startsWith("operator-block:")) return `answer ${blockName(item)}`;
|
|
19662
19773
|
if (key.startsWith("block:")) return `answer ${blockName(item)} if it is a question, or close it with a reason`;
|
|
19663
19774
|
if (key.startsWith("filter:")) return "return the ticket to the tracker filter, or finish or unlink the linked work";
|
|
@@ -20564,7 +20675,8 @@ function createOperationRegistry(deps) {
|
|
|
20564
20675
|
...timings === null ? {} : {
|
|
20565
20676
|
quietTurnAfterMs: timings.quietTurnAfterMs,
|
|
20566
20677
|
noRecipientAfterMs: timings.noRecipientAfterMs
|
|
20567
|
-
}
|
|
20678
|
+
},
|
|
20679
|
+
...column.id !== "external-review" || externalQuietAfterMs(project) === 0 ? {} : { quietAfterMs: externalQuietAfterMs(project) }
|
|
20568
20680
|
};
|
|
20569
20681
|
}),
|
|
20570
20682
|
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-
|
|
2
|
-
import { o as CliError, r as requestOperation } from "./chunk-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-
|
|
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";
|