spur-board 0.133.0 → 0.134.1
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-CcqlB4rN.mjs → chunk-BA7MJmCk.mjs} +81 -49
- package/dist/{chunk-BC8T5XHO.mjs → chunk-CAcIV8kO.mjs} +1 -1
- package/dist/{chunk-CjHIyoJR.mjs → chunk-nXKh8r0i.mjs} +2 -2
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +172 -53
- package/dist/mcp.mjs +3 -3
- package/dist/web/assets/{index-MWxIqN95.css → index-DjMLmW3O.css} +1 -1
- package/dist/web/assets/index-EnNtaf0Z.js +64 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/skills/setup/references/web.md +3 -2
- package/skills/spur-board/references/how-board-works-done.md +27 -1
- package/skills/spur-board/references/how-board-works-inbox.md +1 -1
- package/skills/spur-board/references/how-board-works-turns.md +2 -1
- package/skills/spur-board/references/how-board-works-web.md +6 -4
- package/skills/spur-board/references/web-ui-task-turn.md +128 -0
- package/skills/spur-board/references/web-ui-task-view.md +4 -2
- package/skills/spur-board/references/web-ui.md +4 -3
- package/dist/web/assets/index-DrlglJWZ.js +0 -64
|
@@ -3140,6 +3140,75 @@ const taskMoveOutputSchema = z.strictObject({
|
|
|
3140
3140
|
column: z.enum(COLUMN_IDS).describe("Resulting position; correction uses the shadow position in shadow mode."),
|
|
3141
3141
|
settled: z.array(moveViewSchema).describe("Dispatcher moves after a correction, oldest first; empty for manual placement.")
|
|
3142
3142
|
});
|
|
3143
|
+
const inboxAckInputSchema = z.strictObject({ entries: z.array(z.union([
|
|
3144
|
+
z.strictObject({
|
|
3145
|
+
id: commentIdSchema,
|
|
3146
|
+
revision: z.int().positive().describe("Revision the caller read.")
|
|
3147
|
+
}),
|
|
3148
|
+
z.strictObject({ id: blockIdSchema }),
|
|
3149
|
+
z.strictObject({ id: turnIdSchema }),
|
|
3150
|
+
z.strictObject({ id: ringIdSchema })
|
|
3151
|
+
])).min(1).max(100).describe("Comment revisions, blocks, turns and ring IDs to acknowledge.") });
|
|
3152
|
+
const inboxAckOutputSchema = z.strictObject({
|
|
3153
|
+
acked: z.array(z.union([
|
|
3154
|
+
commentIdSchema,
|
|
3155
|
+
blockIdSchema,
|
|
3156
|
+
turnIdSchema,
|
|
3157
|
+
ringIdSchema
|
|
3158
|
+
])).describe("Entries now acknowledged."),
|
|
3159
|
+
alreadyHandled: z.array(z.union([
|
|
3160
|
+
commentIdSchema,
|
|
3161
|
+
blockIdSchema,
|
|
3162
|
+
turnIdSchema,
|
|
3163
|
+
ringIdSchema
|
|
3164
|
+
])).optional().describe("Entries that were already handled; nothing new was acknowledged for them.")
|
|
3165
|
+
});
|
|
3166
|
+
const taskSubmitInputSchema = z.strictObject({
|
|
3167
|
+
turn: z.union([turnIdSchema, taskKeyInputSchema]).describe("Turn ID you took (T4); while the project dispatcher is in shadow mode, the task key instead."),
|
|
3168
|
+
sha: commitShaSchema.max(64).describe("Full commit SHA at the head of the pull request, lowercase."),
|
|
3169
|
+
basis: z.enum(SUBMISSION_BASES).optional().describe("Testing provenance: tested (default), carried from a tested origin on this task, or skipped with a reason."),
|
|
3170
|
+
from: commitShaSchema.max(64).optional().describe("Full lowercase source SHA on this task; required only for carried."),
|
|
3171
|
+
reason: z.string().max(2e3).optional().describe("Literal nonblank explanation, up to 2000 UTF-16 units; required for carried and skipped.")
|
|
3172
|
+
});
|
|
3173
|
+
const taskSubmitOutputSchema = z.strictObject({
|
|
3174
|
+
task: taskViewSchema,
|
|
3175
|
+
turn: turnIdSchema.nullable().describe("The closed turn; null for a submit by task key in shadow mode."),
|
|
3176
|
+
sha: commitShaSchema.describe("The submitted commit SHA."),
|
|
3177
|
+
status: z.enum(["confirmed", "pending"]).default("confirmed").describe("confirmed: the board saw the PR head at sha. pending: accepted, pending confirmation - the board confirms the head on its next polls and hands the turn back with the reason if it cannot; do not resubmit or raise a block.")
|
|
3178
|
+
});
|
|
3179
|
+
const taskReturnInputSchema = z.strictObject({
|
|
3180
|
+
turn: turnIdSchema,
|
|
3181
|
+
reason: z.string().min(1).max(2e4).describe("What the worker must change, sent to the worker as a code block."),
|
|
3182
|
+
findings: z.int().min(0).optional().describe("Number of review findings the return sends; shown on the task's status row.")
|
|
3183
|
+
});
|
|
3184
|
+
const taskReturnOutputSchema = z.strictObject({
|
|
3185
|
+
task: taskViewSchema,
|
|
3186
|
+
block: blockViewSchema
|
|
3187
|
+
});
|
|
3188
|
+
/**
|
|
3189
|
+
* The three writes as `browserOperations` entries (`../browser.ts`), kept beside their schemas: the
|
|
3190
|
+
* web Turn section calls them, and the catalog shares the same schema objects.
|
|
3191
|
+
*/
|
|
3192
|
+
const turnWriteOperations = {
|
|
3193
|
+
"inbox.ack": {
|
|
3194
|
+
id: "inbox.ack",
|
|
3195
|
+
kind: "mutation",
|
|
3196
|
+
input: inboxAckInputSchema,
|
|
3197
|
+
output: inboxAckOutputSchema
|
|
3198
|
+
},
|
|
3199
|
+
"task.submit": {
|
|
3200
|
+
id: "task.submit",
|
|
3201
|
+
kind: "mutation",
|
|
3202
|
+
input: taskSubmitInputSchema,
|
|
3203
|
+
output: taskSubmitOutputSchema
|
|
3204
|
+
},
|
|
3205
|
+
"task.return": {
|
|
3206
|
+
id: "task.return",
|
|
3207
|
+
kind: "mutation",
|
|
3208
|
+
input: taskReturnInputSchema,
|
|
3209
|
+
output: taskReturnOutputSchema
|
|
3210
|
+
}
|
|
3211
|
+
};
|
|
3143
3212
|
// ../contracts/src/ops/config-view-schema.ts
|
|
3144
3213
|
const configViewSchema = z.strictObject({
|
|
3145
3214
|
projects: z.array(z.strictObject({
|
|
@@ -3195,7 +3264,7 @@ const columnsDescribeOutputSchema = z.strictObject({ projects: z.array(z.strictO
|
|
|
3195
3264
|
resolvedThreadsFrom: z.enum(COLUMN_IDS).nullable().describe("Leftmost enabled thread gate, or null when none."),
|
|
3196
3265
|
completion: z.strictObject({
|
|
3197
3266
|
to: z.literal("done").describe("Completion destination, separate from ordinary gate progression."),
|
|
3198
|
-
text: z.string().describe("Alternative completion routes: eligible linked merged PR with a tracker-done ticket (GitHub closed or effective Jira doneStatuses), or a done ticket without open linked PRs/live workers after fresh complete non-blind repository and Spur observations. Missing/unconfirmed merged-ticket status holds dispatch;
|
|
3267
|
+
text: z.string().describe("Alternative completion routes: eligible linked merged PR with a tracker-done ticket (GitHub closed or effective Jira doneStatuses), or a done ticket without open linked PRs/live workers after fresh complete non-blind repository and Spur observations. Missing/unconfirmed merged-ticket status holds dispatch; a ticket that stays non-done and changed in any way at or after the newest merge, in filter or manually included, resumes work; a ticket untouched since the merge stays unconfirmed; when no merged PR has a stored merge time (facts from before the dispatcher), work resumes once the ticket, in filter or manually included, is observed open at or past the judged PR last update plus the tracker interval. Blind GitHub and pending submits hold both routes. Includes eligibility/readability, non-archived scope and dispatcher-mode qualifications.")
|
|
3199
3268
|
}).describe("Project-wide completion route from any column other than Done. Completion bypasses normal gates; it is not conjoined with exit.conditions."),
|
|
3200
3269
|
columns: z.array(z.strictObject({
|
|
3201
3270
|
id: z.enum(COLUMN_IDS).describe("Enabled column in canonical order."),
|
|
@@ -3414,6 +3483,7 @@ taskHistoryOutputSchema.extend({ events: z.array(taskHistoryEventSchema.extend({
|
|
|
3414
3483
|
kind: z.string().min(1),
|
|
3415
3484
|
via: z.string().min(1).optional()
|
|
3416
3485
|
})) });
|
|
3486
|
+
({ ...turnWriteOperations });
|
|
3417
3487
|
// ../contracts/src/ops/catalog.ts
|
|
3418
3488
|
/** Longest free text an input takes: comments, questions, answers and reasons. */
|
|
3419
3489
|
const TEXT_MAX = 2e4;
|
|
@@ -3423,8 +3493,6 @@ const NAME_MAX = 256;
|
|
|
3423
3493
|
const LEGACY_TOKEN_NAME_MAX = 1048576;
|
|
3424
3494
|
/** Longest pull request URL or unblock reference an input takes. */
|
|
3425
3495
|
const REF_MAX = 2048;
|
|
3426
|
-
/** Most entries one `inbox.ack` call acknowledges. */
|
|
3427
|
-
const ACK_ENTRIES_MAX = 100;
|
|
3428
3496
|
const project = z.string().min(1).max(NAME_MAX).optional().describe("Project to limit the answer to; absent means every project the caller may see.");
|
|
3429
3497
|
const text = (what, max) => z.string().min(1).max(max).describe(what);
|
|
3430
3498
|
const target = z.string().min(1).describe("Pull request, session, or ticket linked to the task.");
|
|
@@ -4175,29 +4243,9 @@ const OPERATIONS = [
|
|
|
4175
4243
|
whenToUse: "Mark handled inbox items or a ring ID like N18-1 read; an item handled before comes back under alreadyHandled. The operator acks a turn ID to take over an open orchestrator turn, taken or not.",
|
|
4176
4244
|
whenNotToUse: "Use inbox_get to inspect them first."
|
|
4177
4245
|
},
|
|
4178
|
-
input:
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
revision: z.int().positive().describe("Revision the caller read.")
|
|
4182
|
-
}),
|
|
4183
|
-
z.strictObject({ id: blockIdSchema }),
|
|
4184
|
-
z.strictObject({ id: turnIdSchema }),
|
|
4185
|
-
z.strictObject({ id: ringIdSchema })
|
|
4186
|
-
])).min(1).max(ACK_ENTRIES_MAX).describe("Comment revisions, blocks, turns and ring IDs to acknowledge.") }),
|
|
4187
|
-
output: z.strictObject({
|
|
4188
|
-
acked: z.array(z.union([
|
|
4189
|
-
commentIdSchema,
|
|
4190
|
-
blockIdSchema,
|
|
4191
|
-
turnIdSchema,
|
|
4192
|
-
ringIdSchema
|
|
4193
|
-
])).describe("Entries now acknowledged."),
|
|
4194
|
-
alreadyHandled: z.array(z.union([
|
|
4195
|
-
commentIdSchema,
|
|
4196
|
-
blockIdSchema,
|
|
4197
|
-
turnIdSchema,
|
|
4198
|
-
ringIdSchema
|
|
4199
|
-
])).optional().describe("Entries that were already handled; nothing new was acknowledged for them.")
|
|
4200
|
-
}),
|
|
4246
|
+
input: inboxAckInputSchema,
|
|
4247
|
+
output: inboxAckOutputSchema,
|
|
4248
|
+
web: true,
|
|
4201
4249
|
grants: [{ grant: "project-agent" }, { grant: "operator" }],
|
|
4202
4250
|
errors: [
|
|
4203
4251
|
"wrong_id_kind",
|
|
@@ -4966,19 +5014,9 @@ const OPERATIONS = [
|
|
|
4966
5014
|
whenToUse: "Hand in the work of a turn you took, at the pull request head. Declare tested (default), carried from a tested origin on this task, or skipped; carried requires from and reason, skipped requires reason. While the project dispatcher is in shadow mode no turn opens: the column executor submits with the task key.",
|
|
4967
5015
|
whenNotToUse: "Use task_return to send the task back to Dev instead."
|
|
4968
5016
|
},
|
|
4969
|
-
input:
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
basis: z.enum(SUBMISSION_BASES).optional().describe("Testing provenance: tested (default), carried from a tested origin on this task, or skipped with a reason."),
|
|
4973
|
-
from: commitShaSchema.max(64).optional().describe("Full lowercase source SHA on this task; required only for carried."),
|
|
4974
|
-
reason: z.string().max(2e3).optional().describe("Literal nonblank explanation, up to 2000 UTF-16 units; required for carried and skipped.")
|
|
4975
|
-
}),
|
|
4976
|
-
output: z.strictObject({
|
|
4977
|
-
task: taskViewSchema,
|
|
4978
|
-
turn: turnIdSchema.nullable().describe("The closed turn; null for a submit by task key in shadow mode."),
|
|
4979
|
-
sha: commitShaSchema.describe("The submitted commit SHA."),
|
|
4980
|
-
status: z.enum(["confirmed", "pending"]).default("confirmed").describe("confirmed: the board saw the PR head at sha. pending: accepted, pending confirmation - the board confirms the head on its next polls and hands the turn back with the reason if it cannot; do not resubmit or raise a block.")
|
|
4981
|
-
}),
|
|
5017
|
+
input: taskSubmitInputSchema,
|
|
5018
|
+
output: taskSubmitOutputSchema,
|
|
5019
|
+
web: true,
|
|
4982
5020
|
grants: [
|
|
4983
5021
|
{ grant: "task-worker" },
|
|
4984
5022
|
{ grant: "column-orchestrator" },
|
|
@@ -5075,15 +5113,9 @@ const OPERATIONS = [
|
|
|
5075
5113
|
whenToUse: "Send the task back to Dev when the work needs code changes.",
|
|
5076
5114
|
whenNotToUse: "Use task_submit to hand in the work instead."
|
|
5077
5115
|
},
|
|
5078
|
-
input:
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
findings: z.int().min(0).optional().describe("Number of review findings the return sends; shown on the task's status row.")
|
|
5082
|
-
}),
|
|
5083
|
-
output: z.strictObject({
|
|
5084
|
-
task: taskViewSchema,
|
|
5085
|
-
block: blockViewSchema
|
|
5086
|
-
}),
|
|
5116
|
+
input: taskReturnInputSchema,
|
|
5117
|
+
output: taskReturnOutputSchema,
|
|
5118
|
+
web: true,
|
|
5087
5119
|
grants: [
|
|
5088
5120
|
{ grant: "task-worker" },
|
|
5089
5121
|
{ grant: "column-orchestrator" },
|
|
@@ -5308,7 +5340,7 @@ const OPERATIONS = [
|
|
|
5308
5340
|
resolvedThreadsFrom: null,
|
|
5309
5341
|
completion: {
|
|
5310
5342
|
to: "done",
|
|
5311
|
-
text: "Completion bypasses normal gates: an eligible linked merged PR with a done ticket (GitHub closed or configured Jira doneStatuses), or a done ticket without open linked PRs/live workers and with fresh complete non-blind repository and Spur observations. Missing/unconfirmed merged-ticket status holds dispatch. An open ticket resumes work after the
|
|
5343
|
+
text: "Completion bypasses normal gates: an eligible linked merged PR with a done ticket (GitHub closed or configured Jira doneStatuses), or a done ticket without open linked PRs/live workers and with fresh complete non-blind repository and Spur observations. Missing/unconfirmed merged-ticket status holds dispatch. An open ticket resumes work only once it changed at or after the newest merge, with in-filter or manual-inclusion evidence; when no merged PR has a stored merge time (facts from before the dispatcher), work resumes once the ticket, in filter or manually included, is observed open at or past the judged PR last update plus the tracker interval. Blind GitHub or a pending submit holds both routes."
|
|
5312
5344
|
},
|
|
5313
5345
|
columns: [{
|
|
5314
5346
|
id: "todo",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as renderJsonError, at as ERRORS, c as tokenRequestStatusSchema, ct as errorEnvelopeSchema, o as tokenRequestResultSchema, st as errorContextSchema, ut as successEnvelopeSchema } from "./chunk-
|
|
1
|
+
import { _ as renderJsonError, at as ERRORS, c as tokenRequestStatusSchema, ct as errorEnvelopeSchema, o as tokenRequestResultSchema, st as errorContextSchema, ut as successEnvelopeSchema } from "./chunk-BA7MJmCk.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 { Ct as plainHttpAllowed, d as buildCatalogSnapshot, p as OPERATIONS, xt as configSchema } from "./chunk-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { Ct as plainHttpAllowed, d as buildCatalogSnapshot, p as OPERATIONS, xt as configSchema } from "./chunk-BA7MJmCk.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-CAcIV8kO.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 { D as sortSkillFiles, T as skillReloadFileSchema, Tt as resolveWebOrigin, a as requestHashOf, at as ERRORS, et as actorIdSchema, f as roleCanUseOperation, ht as DEFAULT_STAND_PORT_RANGE, jt as SLACK_BOT_SCOPES, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as successEnvelopeSchema, wt as requiredSecretKeys, xt as configSchema } from "./chunk-
|
|
1
|
+
import { D as sortSkillFiles, T as skillReloadFileSchema, Tt as resolveWebOrigin, a as requestHashOf, at as ERRORS, et as actorIdSchema, f as roleCanUseOperation, ht as DEFAULT_STAND_PORT_RANGE, jt as SLACK_BOT_SCOPES, p as OPERATIONS, r as remoteDoctorReportSchema, u as SYSTEMD_SERVICE_SETTINGS, ut as successEnvelopeSchema, wt as requiredSecretKeys, xt as configSchema } from "./chunk-BA7MJmCk.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-CAcIV8kO.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-nXKh8r0i.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-CAcIV8kO.mjs";
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as REF_NUMBER, A as eventPayloadSchemas, At as ITEM_KINDS, B as REVIEW_DECISIONS, C as messageRefSchema, Ct as plainHttpAllowed, D as sortSkillFiles, Dt as COLUMN_GROUPS, E as skillReloadFilesSchema, Et as COLUMNS, F as prSourceId, Ft as isTodoGroupColumn, G as parseRingMarker, H as SESSION_HEALTH_STATES, I as sessionTransitionSchema, J as prReviewRuleSchema, K as prFactsSchema, L as sourceCursorSchema, M as batchSchema, Mt as TASK_HOLDS, N as defaultBranchFactSchema, Nt as TODO_GROUP_COLUMN_IDS, O as EVENT_KINDS, Ot as COLUMN_IDS, P as entityRefSchema, Pt as VIAS, Q as JIRA_PROJECT_KEY, R as trackerSourceId, S as interactionRefSchema, St as defaultAddressee, Tt as resolveWebOrigin, U as SESSION_STATUSES, V as REVIEW_STATES, W as isExternalAuthor, X as sessionFactsSchema, Y as ringMarker, Z as ticketFactsSchema, _t as approvalRuleOf, a as requestHashOf, at as ERRORS, b as conversationRefSchema, bt as configBindings, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, et as actorIdSchema, f as roleCanUseOperation, ft as DEFAULT_LINK, g as renderHttpProblem, gt as RESERVED_PROJECT, h as turnHandedSchema, i as TOKEN_REQUEST_LIMITS, it as parseRef$1, j as AdapterError, jt as SLACK_BOT_SCOPES, k as GATE_REASONS, kt as DISPATCHER_MODES, l as BOARD_TICK_MS, lt as ok, m as defaultBranchViewSchema, mt as DEFAULT_SLACK_COMMAND, n as doctorReportSchema, nt as errorCodeOf, o as tokenRequestResultSchema, ot as err, p as OPERATIONS, q as prRefSchema, rt as parseActorId, s as tokenRequestSchema, t as assertNever, tt as encodeActorId, ut as successEnvelopeSchema, vt as boardWideSpurProject, w as userIdSchema, wt as requiredSecretKeys, x as inboundEventSchema, xt as configSchema, y as SPACE_IDS, yt as columnTurnTimings, z as PR_STATES } from "./chunk-
|
|
1
|
+
import { $ as REF_NUMBER, A as eventPayloadSchemas, At as ITEM_KINDS, B as REVIEW_DECISIONS, C as messageRefSchema, Ct as plainHttpAllowed, D as sortSkillFiles, Dt as COLUMN_GROUPS, E as skillReloadFilesSchema, Et as COLUMNS, F as prSourceId, Ft as isTodoGroupColumn, G as parseRingMarker, H as SESSION_HEALTH_STATES, I as sessionTransitionSchema, J as prReviewRuleSchema, K as prFactsSchema, L as sourceCursorSchema, M as batchSchema, Mt as TASK_HOLDS, N as defaultBranchFactSchema, Nt as TODO_GROUP_COLUMN_IDS, O as EVENT_KINDS, Ot as COLUMN_IDS, P as entityRefSchema, Pt as VIAS, Q as JIRA_PROJECT_KEY, R as trackerSourceId, S as interactionRefSchema, St as defaultAddressee, Tt as resolveWebOrigin, U as SESSION_STATUSES, V as REVIEW_STATES, W as isExternalAuthor, X as sessionFactsSchema, Y as ringMarker, Z as ticketFactsSchema, _t as approvalRuleOf, a as requestHashOf, at as ERRORS, b as conversationRefSchema, bt as configBindings, c as tokenRequestStatusSchema, d as buildCatalogSnapshot, et as actorIdSchema, f as roleCanUseOperation, ft as DEFAULT_LINK, g as renderHttpProblem, gt as RESERVED_PROJECT, h as turnHandedSchema, i as TOKEN_REQUEST_LIMITS, it as parseRef$1, j as AdapterError, jt as SLACK_BOT_SCOPES, k as GATE_REASONS, kt as DISPATCHER_MODES, l as BOARD_TICK_MS, lt as ok, m as defaultBranchViewSchema, mt as DEFAULT_SLACK_COMMAND, n as doctorReportSchema, nt as errorCodeOf, o as tokenRequestResultSchema, ot as err, p as OPERATIONS, q as prRefSchema, rt as parseActorId, s as tokenRequestSchema, t as assertNever, tt as encodeActorId, ut as successEnvelopeSchema, vt as boardWideSpurProject, w as userIdSchema, wt as requiredSecretKeys, x as inboundEventSchema, xt as configSchema, y as SPACE_IDS, yt as columnTurnTimings, z as PR_STATES } from "./chunk-BA7MJmCk.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";
|
|
@@ -8024,24 +8024,47 @@ function ticketDone(project, status) {
|
|
|
8024
8024
|
return project.tracker.type === "jira" ? project.tracker.doneStatuses.includes(status) : status === "closed";
|
|
8025
8025
|
}
|
|
8026
8026
|
/**
|
|
8027
|
-
* How the ticket of a task stands after its PR merged at `mergedAt`: `done`; `
|
|
8028
|
-
*
|
|
8029
|
-
*
|
|
8030
|
-
*
|
|
8027
|
+
* How the ticket of a task stands after its PR merged at `mergedAt`: `done`; `reopened` once the
|
|
8028
|
+
* ticket changed at or after the merge and is still not done, in the filter or fetched by key for
|
|
8029
|
+
* a hand-added task; else `unconfirmed`, since a ticket untouched since the merge only waits to be
|
|
8030
|
+
* moved to done, and a ticket dropped from the filter keeps a stale status. An equal time counts as
|
|
8031
|
+
* a change: GitHub times have one-second precision, and a merge-triggered edit of the issue in the
|
|
8032
|
+
* same second shows the merge time. PR facts stored by an earlier version carry no merge time: for
|
|
8033
|
+
* them the ticket is `open`, as it was then, once seen open one tracker interval after the PR's
|
|
8034
|
+
* last change; that stops the merged PR counting like `reopened`, without naming a reopen.
|
|
8031
8035
|
*/
|
|
8032
|
-
function mergedTicket(project, config, ticket, manualInclude,
|
|
8036
|
+
function mergedTicket(project, config, ticket, manualInclude, pr) {
|
|
8033
8037
|
if (ticket === void 0) return "unconfirmed";
|
|
8034
8038
|
if (ticketDone(project, ticket.status)) return "done";
|
|
8035
|
-
|
|
8039
|
+
if (pr.mergedAt === void 0) return seenOpenSince(project, config, ticket, manualInclude, Date.parse(pr.updatedAt)) ? "open" : "unconfirmed";
|
|
8040
|
+
let facts;
|
|
8036
8041
|
try {
|
|
8037
8042
|
const parsed = ticketFactsSchema.safeParse(JSON.parse(ticket.detail));
|
|
8038
8043
|
if (!parsed.success) return "unconfirmed";
|
|
8039
|
-
|
|
8044
|
+
facts = parsed.data;
|
|
8040
8045
|
} catch {
|
|
8041
8046
|
return "unconfirmed";
|
|
8042
8047
|
}
|
|
8048
|
+
if (!(facts.inFilter || manualInclude)) return "unconfirmed";
|
|
8049
|
+
return Date.parse(facts.updatedAt) >= Date.parse(pr.mergedAt) ? "reopened" : "unconfirmed";
|
|
8050
|
+
}
|
|
8051
|
+
/**
|
|
8052
|
+
* Whether the tracker saw the ticket still not done, in the filter or fetched by key for a
|
|
8053
|
+
* hand-added task, at least one tracker interval after `since`: the grace in which a close the
|
|
8054
|
+
* PR's merge triggers may not be polled yet.
|
|
8055
|
+
*/
|
|
8056
|
+
function seenOpenSince(project, config, ticket, manualInclude, since) {
|
|
8057
|
+
if (ticket === void 0 || ticketDone(project, ticket.status)) return false;
|
|
8058
|
+
const parsed = (() => {
|
|
8059
|
+
try {
|
|
8060
|
+
return ticketFactsSchema.safeParse(JSON.parse(ticket.detail));
|
|
8061
|
+
} catch {
|
|
8062
|
+
return null;
|
|
8063
|
+
}
|
|
8064
|
+
})();
|
|
8065
|
+
if (parsed?.success !== true || !(parsed.data.inFilter || manualInclude)) return false;
|
|
8043
8066
|
const { intervalMs } = project.tracker.type === "jira" ? config.adapters.jira : config.adapters.githubIssues;
|
|
8044
|
-
return
|
|
8067
|
+
return Date.parse(ticket.observed_at) >= since + intervalMs;
|
|
8045
8068
|
}
|
|
8046
8069
|
/**
|
|
8047
8070
|
* Whether a PR link counts past the task's reopen floor: an open link, or a link not hidden by a
|
|
@@ -8076,6 +8099,19 @@ async function taskMergedPr(db, taskId) {
|
|
|
8076
8099
|
number: link.number
|
|
8077
8100
|
};
|
|
8078
8101
|
}
|
|
8102
|
+
/**
|
|
8103
|
+
* The newest merge time among the task's eligible merged PRs (those `taskMergedPr` picks from), or
|
|
8104
|
+
* null when none is readable. A merge after the judged PR's still holds a ticket edited before it.
|
|
8105
|
+
*/
|
|
8106
|
+
async function newestMergeAt(db, taskId) {
|
|
8107
|
+
return latest$1((await db.selectFrom("link").innerJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).select("pr_snapshot.detail").where("link.task_id", "=", taskId).where("link.entity", "=", "pr").where("link.pr_state", "=", "active").where("link.banned", "=", 0).where("pr_snapshot.state", "=", "merged").where(pastReopenFloor).execute()).map((row) => parsePr(row.detail)?.mergedAt ?? null));
|
|
8108
|
+
}
|
|
8109
|
+
/** The latest of some times, or null when none is given. */
|
|
8110
|
+
function latest$1(times) {
|
|
8111
|
+
let newest = null;
|
|
8112
|
+
for (const time of times) if (time != null && (newest === null || Date.parse(time) > Date.parse(newest))) newest = time;
|
|
8113
|
+
return newest;
|
|
8114
|
+
}
|
|
8079
8115
|
/** A PR snapshot's facts, or null when the detail is missing or unreadable. */
|
|
8080
8116
|
function parsePr(detail) {
|
|
8081
8117
|
if (detail === void 0) return null;
|
|
@@ -8818,7 +8854,7 @@ const BLOCK_ITEM_KINDS = ITEM_KINDS.filter((kind) => ITEM_POLICY[kind].block);
|
|
|
8818
8854
|
function fingerprint(candidate) {
|
|
8819
8855
|
return createHash("sha256").update(JSON.stringify([
|
|
8820
8856
|
candidate.key,
|
|
8821
|
-
candidate.summary,
|
|
8857
|
+
candidate.hashedSummary ?? candidate.summary,
|
|
8822
8858
|
candidate.source,
|
|
8823
8859
|
candidate.revision ?? null
|
|
8824
8860
|
])).digest("hex");
|
|
@@ -11278,6 +11314,7 @@ function createOpsRoute(app, options, callers = /* @__PURE__ */ new WeakMap()) {
|
|
|
11278
11314
|
if (operation === void 0) throw new CommandError("version_mismatch", "This daemon does not know the operation. Run `board service restart` to update the daemon, then retry.");
|
|
11279
11315
|
if (options.allow?.(operation) === false) throw new CommandError("forbidden", "This operation is not available on the web.");
|
|
11280
11316
|
const body = inputBody(request.body);
|
|
11317
|
+
if (options.requireKey?.(operation) === true && (body.key ?? "").trim() === "") throw new CommandError("usage", "Send a non-blank idempotency key with this write; a retry sends the same key.");
|
|
11281
11318
|
const parsed = operation.input.safeParse(body.input);
|
|
11282
11319
|
if (!parsed.success) throw new CommandError(errorCodeOf(parsed.error), "Fix the operation input.");
|
|
11283
11320
|
const run = () => dispatchOperation(options, operation.id, parsed.data, caller.actor, body.key);
|
|
@@ -14275,9 +14312,9 @@ const stallObservationSchema = z.object({
|
|
|
14275
14312
|
resumedAt: z.number().nullable()
|
|
14276
14313
|
});
|
|
14277
14314
|
const ENDED_WORKER_LABELS = {
|
|
14278
|
-
worker_completed: "worker ended (completed)
|
|
14279
|
-
worker_killed: "worker ended (killed)
|
|
14280
|
-
worker_vanished: "worker vanished
|
|
14315
|
+
worker_completed: "worker ended (completed)",
|
|
14316
|
+
worker_killed: "worker ended (killed)",
|
|
14317
|
+
worker_vanished: "worker vanished"
|
|
14281
14318
|
};
|
|
14282
14319
|
/** Health flags only the operator can resolve; each opens an operator block. */
|
|
14283
14320
|
const ANOMALY_FLAGS = /* @__PURE__ */ new Set([
|
|
@@ -14554,9 +14591,11 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
14554
14591
|
});
|
|
14555
14592
|
const liveSessionTasks = new Set(subjects.filter((subject) => subject.endedAt === null).map((subject) => subject.taskId));
|
|
14556
14593
|
const prs = await trx.selectFrom("link").leftJoin("pr_snapshot", (join) => join.on(sql`lower(pr_snapshot.repo) = lower(link.repo)`).onRef("pr_snapshot.number", "=", "link.number")).select([
|
|
14594
|
+
"link.id",
|
|
14557
14595
|
"link.task_id",
|
|
14558
14596
|
"link.repo",
|
|
14559
14597
|
"link.number",
|
|
14598
|
+
"link.pr_state",
|
|
14560
14599
|
"pr_snapshot.state",
|
|
14561
14600
|
"pr_snapshot.source",
|
|
14562
14601
|
"pr_snapshot.observed_at",
|
|
@@ -14580,62 +14619,103 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
14580
14619
|
ticketDone: project !== void 0 && ticket !== void 0 && ticketDone(project, ticket.status)
|
|
14581
14620
|
};
|
|
14582
14621
|
}
|
|
14622
|
+
const closeTime = (pr) => {
|
|
14623
|
+
const facts = pr.detail === null ? null : parseJson(prFactsSchema, pr.detail);
|
|
14624
|
+
return facts === null ? NaN : Date.parse(facts.closedAt ?? facts.updatedAt);
|
|
14625
|
+
};
|
|
14583
14626
|
const mergedAt = /* @__PURE__ */ new Map();
|
|
14627
|
+
const newestMerge = /* @__PURE__ */ new Map();
|
|
14628
|
+
const judged = /* @__PURE__ */ new Map();
|
|
14584
14629
|
for (const pr of prs) {
|
|
14585
14630
|
const state = taskPrs[String(pr.task_id)];
|
|
14586
14631
|
if (state === void 0) continue;
|
|
14587
14632
|
if (pr.state === "open") state.hasOpenPr = true;
|
|
14588
|
-
if (pr.state !== "merged") continue;
|
|
14633
|
+
if (pr.state !== "merged" || pr.pr_state !== "active") continue;
|
|
14589
14634
|
const facts = parsePr(pr.detail ?? void 0);
|
|
14590
14635
|
const at = facts === null ? null : facts.mergedAt ?? facts.updatedAt;
|
|
14591
14636
|
const newest = mergedAt.get(pr.task_id) ?? null;
|
|
14592
14637
|
if (newest === null || at !== null && Date.parse(at) >= Date.parse(newest)) mergedAt.set(pr.task_id, at);
|
|
14638
|
+
newestMerge.set(pr.task_id, latest$1([newestMerge.get(pr.task_id), facts?.mergedAt]));
|
|
14639
|
+
const current = judged.get(pr.task_id);
|
|
14640
|
+
if (current === void 0 || pr.id > current.id) judged.set(pr.task_id, {
|
|
14641
|
+
id: pr.id,
|
|
14642
|
+
facts,
|
|
14643
|
+
at,
|
|
14644
|
+
ref: `${pr.repo ?? ""}#${String(pr.number)}`
|
|
14645
|
+
});
|
|
14593
14646
|
}
|
|
14594
|
-
|
|
14595
|
-
const state = taskPrs[String(taskId)];
|
|
14596
|
-
const task = taskById.get(taskId);
|
|
14597
|
-
if (state === void 0 || task === void 0) continue;
|
|
14598
|
-
const project = config.projects.find((entry) => entry.id === task.project);
|
|
14599
|
-
state.hasMergedPr = at === null || project === void 0 || mergedTicket(project, config, tickets.find((entry) => entry.task_id === taskId), task.manual_include === 1, at) !== "open";
|
|
14600
|
-
}
|
|
14601
|
-
const heldKeys = [];
|
|
14647
|
+
const prClosed = /* @__PURE__ */ new Map();
|
|
14602
14648
|
for (const task of tasks) {
|
|
14603
14649
|
const state = taskPrs[String(task.id)];
|
|
14604
|
-
if (state === void 0 || state.hasOpenPr
|
|
14650
|
+
if (state === void 0 || state.hasOpenPr) continue;
|
|
14605
14651
|
const mergedSince = Date.parse(mergedAt.get(task.id) ?? "");
|
|
14606
|
-
const closed = prs.filter((pr) => pr.task_id === task.id && pr.state === "closed").map((pr) => {
|
|
14607
|
-
|
|
14608
|
-
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
closedAt: facts === null ? NaN : Date.parse(facts.closedAt ?? facts.updatedAt)
|
|
14612
|
-
};
|
|
14613
|
-
}).filter((pr) => !(pr.closedAt < mergedSince)).sort((left, right) => left.ref.localeCompare(right.ref));
|
|
14652
|
+
const closed = prs.filter((pr) => pr.task_id === task.id && pr.state === "closed").map((pr) => ({
|
|
14653
|
+
...pr,
|
|
14654
|
+
ref: `${pr.repo ?? ""}#${String(pr.number)}`,
|
|
14655
|
+
closedAt: closeTime(pr)
|
|
14656
|
+
})).filter((pr) => !(pr.closedAt < mergedSince)).sort((left, right) => left.ref.localeCompare(right.ref));
|
|
14614
14657
|
const first = closed[0];
|
|
14615
14658
|
if (first === void 0) continue;
|
|
14616
14659
|
const closedAt = Math.max(...closed.map((pr) => pr.closedAt));
|
|
14617
14660
|
const key = `pr-closed:${String(task.id)}`;
|
|
14618
14661
|
if (state.prCompleteAt === null || !(state.prCompleteAt >= closedAt)) {
|
|
14619
|
-
|
|
14662
|
+
prClosed.set(task.id, {
|
|
14663
|
+
held: true,
|
|
14664
|
+
key
|
|
14665
|
+
});
|
|
14620
14666
|
continue;
|
|
14621
14667
|
}
|
|
14622
14668
|
const refs = closed.map((pr) => pr.ref);
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14669
|
+
prClosed.set(task.id, {
|
|
14670
|
+
held: false,
|
|
14671
|
+
closedAt,
|
|
14672
|
+
item: {
|
|
14673
|
+
key,
|
|
14674
|
+
kind: "anomaly",
|
|
14675
|
+
taskId: task.id,
|
|
14676
|
+
summary: `${task.key}: linked pull request ${refs.join(", ")} closed without merge, no open PR`,
|
|
14677
|
+
factAt: first.observed_at,
|
|
14678
|
+
source: prSourceId(task.project, first.repo ?? ""),
|
|
14679
|
+
priority: 4,
|
|
14680
|
+
revision: refs.join(",")
|
|
14681
|
+
}
|
|
14682
|
+
});
|
|
14683
|
+
}
|
|
14684
|
+
const reopened = /* @__PURE__ */ new Map();
|
|
14685
|
+
const liftHeld = /* @__PURE__ */ new Set();
|
|
14686
|
+
for (const [taskId, { facts, at, ref }] of judged) {
|
|
14687
|
+
const state = taskPrs[String(taskId)];
|
|
14688
|
+
const task = taskById.get(taskId);
|
|
14689
|
+
if (state === void 0 || task === void 0) continue;
|
|
14690
|
+
const project = config.projects.find((entry) => entry.id === task.project);
|
|
14691
|
+
const ticket = tickets.find((entry) => entry.task_id === taskId);
|
|
14692
|
+
const storedMerge = latest$1([facts?.mergedAt, newestMerge.get(taskId)]);
|
|
14693
|
+
const judgement = facts === null || project === void 0 ? "unconfirmed" : mergedTicket(project, config, ticket, task.manual_include === 1, {
|
|
14694
|
+
...facts,
|
|
14695
|
+
...storedMerge === null ? {} : { mergedAt: storedMerge }
|
|
14632
14696
|
});
|
|
14697
|
+
const closure = prClosed.get(taskId);
|
|
14698
|
+
const seenOpen = project !== void 0 && seenOpenSince(project, config, ticket, task.manual_include === 1, Date.parse(mergedAt.get(taskId) ?? ""));
|
|
14699
|
+
const followUpClosed = closure?.held === false && seenOpen;
|
|
14700
|
+
state.hasMergedPr = at === null || project === void 0 || judgement !== "reopened" && judgement !== "open" && (judgement === "done" || !followUpClosed);
|
|
14701
|
+
if (judgement === "reopened") reopened.set(taskId, `; PR ${ref} merged, ticket reopened`);
|
|
14702
|
+
if (state.hasMergedPr && seenOpen && closure?.held === true) liftHeld.add(taskId);
|
|
14703
|
+
}
|
|
14704
|
+
const heldKeys = [];
|
|
14705
|
+
for (const task of tasks) {
|
|
14706
|
+
const closure = prClosed.get(task.id);
|
|
14707
|
+
if (closure === void 0) continue;
|
|
14708
|
+
const key = closure.held ? closure.key : closure.item.key;
|
|
14709
|
+
if (taskPrs[String(task.id)]?.hasMergedPr !== false) {
|
|
14710
|
+
if (liftHeld.has(task.id)) heldKeys.push(key);
|
|
14711
|
+
} else if (closure.held) heldKeys.push(key);
|
|
14712
|
+
else candidates.push(closure.item);
|
|
14633
14713
|
}
|
|
14634
14714
|
for (const task of tasks) {
|
|
14635
14715
|
const state = taskPrs[String(task.id)];
|
|
14636
14716
|
const project = config.projects.find((entry) => entry.id === task.project);
|
|
14637
14717
|
const ticket = tickets.find((entry) => entry.task_id === task.id);
|
|
14638
|
-
const closedWhileLive = state !== void 0 && project !== void 0 && ticket !== void 0 && ticketDone(project, ticket.status) && (state.hasOpenPr || liveSessionTasks.has(String(task.id))) && !state.hasMergedPr;
|
|
14718
|
+
const closedWhileLive = state !== void 0 && project !== void 0 && ticket !== void 0 && ticketDone(project, ticket.status) && (state.hasOpenPr || liveSessionTasks.has(String(task.id))) && !state.hasMergedPr && !prs.some((pr) => pr.task_id === task.id && pr.state === "merged");
|
|
14639
14719
|
if (task.membership === "out_of_filter" && !closedWhileLive) candidates.push({
|
|
14640
14720
|
key: `filter:${String(task.id)}`,
|
|
14641
14721
|
kind: "board_observation",
|
|
@@ -14791,6 +14871,23 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
14791
14871
|
now,
|
|
14792
14872
|
episode: previousEpisode === void 0 ? null : parseJson(episodeSchema, previousEpisode.value)
|
|
14793
14873
|
});
|
|
14874
|
+
if (liftHeld.size > 0) {
|
|
14875
|
+
const lifted = evaluateSessionHealth({
|
|
14876
|
+
sessions: subjects,
|
|
14877
|
+
tasks: Object.fromEntries(Object.entries(taskPrs).map(([id, state]) => [id, liftHeld.has(Number(id)) ? {
|
|
14878
|
+
...state,
|
|
14879
|
+
hasMergedPr: false
|
|
14880
|
+
} : state])),
|
|
14881
|
+
spur: {
|
|
14882
|
+
blind: spurBlind,
|
|
14883
|
+
observationComplete: spurComplete
|
|
14884
|
+
},
|
|
14885
|
+
config: config.health,
|
|
14886
|
+
now,
|
|
14887
|
+
episode: previousEpisode === void 0 ? null : parseJson(episodeSchema, previousEpisode.value)
|
|
14888
|
+
});
|
|
14889
|
+
for (const flag of [...lifted.flags, ...lifted.held]) if (liftHeld.has(Number(flag.taskId)) && ENDED_WORKER_LABELS[flag.kind] !== void 0) heldKeys.push(healthKey(Number(flag.taskId), flag));
|
|
14890
|
+
}
|
|
14794
14891
|
await trx.insertInto("meta").values({
|
|
14795
14892
|
key: "host_load_episode",
|
|
14796
14893
|
value: toJson(episodeSchema, health.episode)
|
|
@@ -14814,7 +14911,8 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
14814
14911
|
key: healthKey(task.id, flag),
|
|
14815
14912
|
kind: ANOMALY_FLAGS.has(flag.kind) && !asking ? "anomaly" : flag.kind === "worker_killed" ? "worker_ended" : "board_observation",
|
|
14816
14913
|
taskId: task.id,
|
|
14817
|
-
summary: `${task.key}: ${endedLabel
|
|
14914
|
+
summary: `${task.key}: ${endedLabel === void 0 ? flag.kind.replaceAll("_", " ") : `${endedLabel}${reopened.get(task.id) ?? ", no PR"}`} (${flag.sessionId})`,
|
|
14915
|
+
...endedLabel === void 0 ? {} : { hashedSummary: `${task.key}: ${endedLabel}, no PR (${flag.sessionId})` },
|
|
14818
14916
|
factAt: endedLabel === void 0 ? fact?.healthSince ?? null : spur?.last_complete_at ?? fact?.endedAt ?? null,
|
|
14819
14917
|
source: "spur",
|
|
14820
14918
|
priority: 4,
|
|
@@ -14878,10 +14976,13 @@ async function reconcileItems(trx, config, now, spurComplete, warnSkipped, spurC
|
|
|
14878
14976
|
if (old !== void 0 && (dismissal?.fingerprint === hash || !kept)) await clearReconciled(trx, old, new Date(now));
|
|
14879
14977
|
if (dismissal?.fingerprint === hash) continue;
|
|
14880
14978
|
if (kept) {
|
|
14881
|
-
if (old.fact_at !== candidate.factAt || old.source !== candidate.source) await trx.updateTable("operator_item").set({
|
|
14979
|
+
if (old.fact_at !== candidate.factAt || old.source !== candidate.source || old.text !== candidate.summary) await trx.updateTable("operator_item").set({
|
|
14882
14980
|
fact_at: candidate.factAt,
|
|
14883
|
-
source: candidate.source
|
|
14981
|
+
source: candidate.source,
|
|
14982
|
+
text: candidate.summary
|
|
14884
14983
|
}).where("id", "=", old.id).execute();
|
|
14984
|
+
const task = candidate.taskId === null ? void 0 : taskById.get(candidate.taskId);
|
|
14985
|
+
if (candidate.hashedSummary !== void 0 && old.text !== candidate.summary && old.block_id !== null && task !== void 0) await trx.updateTable("block").set({ reason: blockReason(task, candidate.summary) }).where("id", "=", old.block_id).where("state", "=", "open").execute();
|
|
14885
14986
|
continue;
|
|
14886
14987
|
}
|
|
14887
14988
|
const task = candidate.taskId === null ? null : taskById.get(candidate.taskId);
|
|
@@ -14922,14 +15023,18 @@ function prCompleteAt(project, sourceById) {
|
|
|
14922
15023
|
* Raises a ledger item with the operator block it stands for. An active item of the key is
|
|
14923
15024
|
* returned as it is, so a repeated raise opens no second block.
|
|
14924
15025
|
*/
|
|
15026
|
+
/** The reason of an item's block: the item text without its task key prefix. */
|
|
15027
|
+
function blockReason(task, text) {
|
|
15028
|
+
const prefix = `${task.key}: `;
|
|
15029
|
+
return text.startsWith(prefix) ? text.slice(prefix.length) : text;
|
|
15030
|
+
}
|
|
14925
15031
|
async function raiseAnomaly(trx, config, task, input, executorId) {
|
|
14926
15032
|
const active = await trx.selectFrom("operator_item").selectAll().where("item_key", "=", input.itemKey).where("cleared_at", "is", null).executeTakeFirst();
|
|
14927
15033
|
if (active !== void 0) return active;
|
|
14928
|
-
const prefix = `${task.key}: `;
|
|
14929
15034
|
const toCurator = input.itemKey.startsWith("turn-stall:") && curatorProject(config, task.project) !== null && (await curatorSession(trx, config, task.project))?.id !== executorId;
|
|
14930
15035
|
const block = await openSystemBlock(trx, {
|
|
14931
15036
|
task,
|
|
14932
|
-
reason:
|
|
15037
|
+
reason: blockReason(task, input.text),
|
|
14933
15038
|
at: input.at.toISOString(),
|
|
14934
15039
|
config,
|
|
14935
15040
|
...toCurator ? { addressee: "curator" } : {}
|
|
@@ -15064,13 +15169,12 @@ function healthKey(taskId, flag) {
|
|
|
15064
15169
|
// ../core/src/app/dispatch.ts
|
|
15065
15170
|
const CURSOR_KEY = "dispatcher_cursor";
|
|
15066
15171
|
/** Policy counterpart of readInput's mergedTicket qualification and dispatchTasks' scope. */
|
|
15067
|
-
function describeCompletion(project
|
|
15172
|
+
function describeCompletion(project) {
|
|
15068
15173
|
const route = describeCompletion$1();
|
|
15069
15174
|
const done = project.tracker.type === "jira" ? `a Jira status in ${JSON.stringify(project.tracker.doneStatuses)}` : "GitHub status \"closed\"";
|
|
15070
|
-
const interval = project.tracker.type === "jira" ? config.adapters.jira.intervalMs : config.adapters.githubIssues.intervalMs;
|
|
15071
15175
|
return {
|
|
15072
15176
|
...route,
|
|
15073
|
-
text: `${route.text} A done ticket means ${done}. After a merge, a missing ticket or unconfirmed status holds dispatch. An open ticket resumes work without the merged PR only once
|
|
15177
|
+
text: `${route.text} A done ticket means ${done}. After a merge, a missing ticket or unconfirmed status holds dispatch. An open ticket resumes work without the merged PR only once it changed at or after the newest merge, in the tracker filter or for a manually included task; a ticket untouched since the merge stays unconfirmed, and dropped-filter evidence alone stays unconfirmed; when no merged PR has a stored merge time (facts from before the dispatcher), work resumes once the ticket, in filter or manually included, is observed open at or past the judged PR's last update plus the tracker interval. Only non-archived tasks are evaluated; eligible links must be unbanned and past the reopen floor. Missing or unreadable facts for a chosen or fallback PR hold evaluation. Cycle holds do not stop completion shortcuts. Dispatcher on applies moves; shadow computes only a shadow position.`
|
|
15074
15178
|
};
|
|
15075
15179
|
}
|
|
15076
15180
|
const modeKey = (project) => `dispatcher_mode:${project}`;
|
|
@@ -15571,8 +15675,13 @@ async function readInput(trx, task, project, mode, blind, config, clock) {
|
|
|
15571
15675
|
let mergedOpen;
|
|
15572
15676
|
let ticketUnconfirmed = false;
|
|
15573
15677
|
if (pr?.state === "merged") {
|
|
15574
|
-
const
|
|
15575
|
-
|
|
15678
|
+
const ticket = await readTicket();
|
|
15679
|
+
const mergedAt = latest$1([pr.mergedAt, await newestMergeAt(trx, task.id)]);
|
|
15680
|
+
const judged = mergedTicket(project, config, ticket, task.manual_include === 1, {
|
|
15681
|
+
...pr,
|
|
15682
|
+
...mergedAt === null ? {} : { mergedAt }
|
|
15683
|
+
});
|
|
15684
|
+
if (judged === "reopened" || judged === "open") mergedOpen = {
|
|
15576
15685
|
repo: pr.repo,
|
|
15577
15686
|
number: pr.number
|
|
15578
15687
|
};
|
|
@@ -18253,7 +18362,7 @@ async function describeProject(trx, config, project) {
|
|
|
18253
18362
|
checksGate: project.checksGate,
|
|
18254
18363
|
reposWithoutCi: [...project.reposWithoutCi],
|
|
18255
18364
|
resolvedThreadsFrom: from ?? null,
|
|
18256
|
-
completion: describeCompletion(project
|
|
18365
|
+
completion: describeCompletion(project),
|
|
18257
18366
|
columns
|
|
18258
18367
|
};
|
|
18259
18368
|
}
|
|
@@ -21715,6 +21824,15 @@ function installEventStream(app, options) {
|
|
|
21715
21824
|
});
|
|
21716
21825
|
}
|
|
21717
21826
|
// ../core/src/api/web-server.ts
|
|
21827
|
+
/**
|
|
21828
|
+
* The Turn section's writes take and close a turn; the operator caller would otherwise get a
|
|
21829
|
+
* fresh key per request, so a keyless retry could take or close a turn again.
|
|
21830
|
+
*/
|
|
21831
|
+
const KEYED_WEB_WRITES = /* @__PURE__ */ new Set([
|
|
21832
|
+
"inbox.ack",
|
|
21833
|
+
"task.submit",
|
|
21834
|
+
"task.return"
|
|
21835
|
+
]);
|
|
21718
21836
|
const mime = {
|
|
21719
21837
|
".html": "text/html; charset=utf-8",
|
|
21720
21838
|
".js": "text/javascript; charset=utf-8",
|
|
@@ -21837,6 +21955,7 @@ async function createWebServer(options) {
|
|
|
21837
21955
|
...options,
|
|
21838
21956
|
identify: () => Promise.resolve({ actor: "operator" }),
|
|
21839
21957
|
allow: (operation) => operation.web !== null,
|
|
21958
|
+
requireKey: (operation) => KEYED_WEB_WRITES.has(operation.id),
|
|
21840
21959
|
runOperation: (id, input, run) => withVia("web", () => options.runOperation === void 0 ? run() : options.runOperation(id, input, run))
|
|
21841
21960
|
});
|
|
21842
21961
|
app.get("/v1/health", async () => {
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { at 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 { at as ERRORS, p as OPERATIONS, v as renderMcpError } from "./chunk-BA7MJmCk.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-CAcIV8kO.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-nXKh8r0i.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|