spur-board 0.70.0 → 0.72.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-CmoLxaIV.mjs → chunk-BRdjSAl1.mjs} +2 -2
- package/dist/{chunk-BBfFVeh3.mjs → chunk-Di9QGxO1.mjs} +24 -0
- package/dist/{chunk-BxDheuT8.mjs → chunk-QCOwDTOu.mjs} +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +82 -16
- package/dist/mcp.mjs +3 -3
- package/dist/migrations/0023_source_budget.sql +5 -0
- package/package.json +1 -1
- package/skills/spur-board/references/how-board-works-blocks.md +19 -0
- package/skills/spur-board/references/how-board-works-columns.md +66 -0
- package/skills/spur-board/references/how-board-works-done.md +6 -0
- package/skills/spur-board/references/how-board-works-slack.md +26 -0
- package/skills/spur-board/references/how-board-works-turns.md +67 -0
- package/skills/spur-board/references/how-board-works.md +6 -175
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as buildCatalogSnapshot, dt as configSchema, p as OPERATIONS, pt as plainHttpAllowed } from "./chunk-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { d as buildCatalogSnapshot, dt as configSchema, p as OPERATIONS, pt as plainHttpAllowed } from "./chunk-Di9QGxO1.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-QCOwDTOu.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";
|
|
@@ -1725,6 +1725,7 @@ const batchSchema = z.strictObject({
|
|
|
1725
1725
|
usage: z.strictObject({ points: z.int().nonnegative().describe("Reported points consumed.") }).optional().describe("Reported source points consumed by this attempt."),
|
|
1726
1726
|
budget: z.strictObject({
|
|
1727
1727
|
remaining: z.int().min(0).describe("Requests or points the source still allows."),
|
|
1728
|
+
limit: z.int().positive().optional().describe("Full budget the source restores at reset; omitted when it reports none."),
|
|
1728
1729
|
resetAt: z.iso.datetime().describe("When the source restores the full budget.")
|
|
1729
1730
|
}).optional().describe("Request budget the source reported on this poll; omitted when it reports none.")
|
|
1730
1731
|
}).superRefine((batch, ctx) => {
|
|
@@ -1824,6 +1825,9 @@ const EVENT_KINDS = [
|
|
|
1824
1825
|
"task_shadow_moved",
|
|
1825
1826
|
"task_corrected",
|
|
1826
1827
|
"dispatcher_mode_changed",
|
|
1828
|
+
"turn_opened",
|
|
1829
|
+
"turn_taken",
|
|
1830
|
+
"turn_closed",
|
|
1827
1831
|
"block_opened",
|
|
1828
1832
|
"block_escalated",
|
|
1829
1833
|
"block_unblocked",
|
|
@@ -1995,6 +1999,21 @@ const eventPayloadSchemas = {
|
|
|
1995
1999
|
from: z.enum(DISPATCHER_MODES),
|
|
1996
2000
|
to: z.enum(DISPATCHER_MODES)
|
|
1997
2001
|
}),
|
|
2002
|
+
/** `addressee` is the turn's executor; an empty `reason` is kept rather than refused. */
|
|
2003
|
+
turn_opened: z.looseObject({
|
|
2004
|
+
turn: S,
|
|
2005
|
+
column: z.enum(COLUMN_IDS),
|
|
2006
|
+
addressee: role,
|
|
2007
|
+
reason: z.string()
|
|
2008
|
+
}),
|
|
2009
|
+
turn_taken: z.looseObject({
|
|
2010
|
+
turn: S,
|
|
2011
|
+
taker: actorIdSchema
|
|
2012
|
+
}),
|
|
2013
|
+
turn_closed: z.looseObject({
|
|
2014
|
+
turn: S,
|
|
2015
|
+
outcome: z.enum(TURN_OUTCOMES)
|
|
2016
|
+
}),
|
|
1998
2017
|
block_opened: z.looseObject({
|
|
1999
2018
|
block: S,
|
|
2000
2019
|
type: z.enum(BLOCK_TYPES),
|
|
@@ -2624,6 +2643,11 @@ const sourceViewSchema = z.strictObject({
|
|
|
2624
2643
|
"stale"
|
|
2625
2644
|
]).nullable().describe("Why this source is blind, or null when it is usable."),
|
|
2626
2645
|
message: z.string().nullable().describe("Short explanation of the source state."),
|
|
2646
|
+
budget: z.strictObject({
|
|
2647
|
+
remaining: z.int().nonnegative().describe("Requests or points the source still allowed."),
|
|
2648
|
+
limit: z.int().positive().nullable().describe("Full budget the source restores at reset, or null when it reported none."),
|
|
2649
|
+
resetAt: z.iso.datetime().describe("When the source said it restores the full budget.")
|
|
2650
|
+
}).nullable().describe("Request budget from the last poll of this source that reported one, or null when none did."),
|
|
2627
2651
|
stale: z.boolean().describe("Whether facts from this source exceed their freshness threshold."),
|
|
2628
2652
|
warmingUp: z.boolean().describe("Whether this source needs a complete poll in this daemon run.")
|
|
2629
2653
|
}).describe("Freshness and availability of one source.");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-Di9QGxO1.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { request } from "node:http";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Q as ERRORS, _t as SLACK_BOT_SCOPES, a as requestHashOf, dt as configSchema, f as roleCanUseOperation, mt as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, _t as SLACK_BOT_SCOPES, a as requestHashOf, dt as configSchema, f as roleCanUseOperation, mt as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-Di9QGxO1.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
|
-
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-
|
|
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-QCOwDTOu.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-BRdjSAl1.mjs";
|
|
5
5
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
6
6
|
import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
7
7
|
import { homedir, hostname, userInfo } from "node:os";
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-QCOwDTOu.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as SLACK_BOT_SCOPES, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, c as tokenRequestStatusSchema, ct as RESERVED_PROJECT, d as buildCatalogSnapshot, dt as configSchema, f as roleCanUseOperation, ft as defaultAddressee, gt as DISPATCHER_MODES, h as renderHttpProblem, ht as COLUMN_IDS, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as boardWideSpurProject, m as turnHandedSchema, mt as requiredSecretKeys, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as plainHttpAllowed, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as configBindings, v as SPACE_IDS, vt as TASK_HOLDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as parseRingMarker } from "./chunk-
|
|
1
|
+
import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as SLACK_BOT_SCOPES, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, c as tokenRequestStatusSchema, ct as RESERVED_PROJECT, d as buildCatalogSnapshot, dt as configSchema, f as roleCanUseOperation, ft as defaultAddressee, gt as DISPATCHER_MODES, h as renderHttpProblem, ht as COLUMN_IDS, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as boardWideSpurProject, m as turnHandedSchema, mt as requiredSecretKeys, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as plainHttpAllowed, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as configBindings, v as SPACE_IDS, vt as TASK_HOLDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as parseRingMarker } from "./chunk-Di9QGxO1.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -11317,6 +11317,7 @@ function listenApiServer(app, port) {
|
|
|
11317
11317
|
//#region ../core/src/app/turns.ts
|
|
11318
11318
|
const handedSchema = z.array(turnHandedSchema);
|
|
11319
11319
|
const turnItemKey = (turnId) => `turn:${String(turnId)}`;
|
|
11320
|
+
const turnRef = (turnId) => `T${String(turnId)}`;
|
|
11320
11321
|
/**
|
|
11321
11322
|
* Who executes a column's turn: its orchestrator project, the operator, or for a column with
|
|
11322
11323
|
* no orchestrator the live worker, else the operator.
|
|
@@ -11369,6 +11370,12 @@ async function openTurn(trx, input) {
|
|
|
11369
11370
|
created_at: at.toISOString(),
|
|
11370
11371
|
head_sha: snapshot?.head_sha.toLowerCase() ?? null
|
|
11371
11372
|
}).returningAll().executeTakeFirstOrThrow();
|
|
11373
|
+
await emit(trx, "turn_opened", task.project, task.id, turn.created_at, {
|
|
11374
|
+
turn: turnRef(turn.id),
|
|
11375
|
+
column: turn.column,
|
|
11376
|
+
addressee: turn.role,
|
|
11377
|
+
reason: turn.reason
|
|
11378
|
+
});
|
|
11372
11379
|
if (role === "operator") await raiseItem(trx, {
|
|
11373
11380
|
itemKey: turnItemKey(turn.id),
|
|
11374
11381
|
kind: "turn",
|
|
@@ -11412,6 +11419,10 @@ async function takeTurn(trx, input) {
|
|
|
11412
11419
|
acked_at: at.toISOString()
|
|
11413
11420
|
}).where("id", "=", turnId).execute();
|
|
11414
11421
|
await trx.updateTable("notification").set({ acked_at: at.toISOString() }).where("turn_id", "=", turnId).where("kind", "=", "turn_reminder").where("acked_at", "is", null).where("exhausted_at", "is", null).execute();
|
|
11422
|
+
await emit(trx, "turn_taken", (await trx.selectFrom("task").select("project").where("id", "=", turn.task_id).executeTakeFirstOrThrow()).project, turn.task_id, at.toISOString(), {
|
|
11423
|
+
turn: turnRef(turnId),
|
|
11424
|
+
taker: actor
|
|
11425
|
+
}, actor);
|
|
11415
11426
|
return true;
|
|
11416
11427
|
}
|
|
11417
11428
|
/**
|
|
@@ -11424,7 +11435,13 @@ async function closeTurns(trx, input) {
|
|
|
11424
11435
|
closed_at: at.toISOString(),
|
|
11425
11436
|
closed_reason: reason
|
|
11426
11437
|
}).where("task_id", "=", taskId).where("closed_at", "is", null).returning("id").execute();
|
|
11438
|
+
if (closed.length === 0) return;
|
|
11439
|
+
const task = await trx.selectFrom("task").select("project").where("id", "=", taskId).executeTakeFirstOrThrow();
|
|
11427
11440
|
for (const { id } of closed) {
|
|
11441
|
+
await emit(trx, "turn_closed", task.project, taskId, at.toISOString(), {
|
|
11442
|
+
turn: turnRef(id),
|
|
11443
|
+
outcome: reason
|
|
11444
|
+
});
|
|
11428
11445
|
await closeTurnNotification(trx, id, at);
|
|
11429
11446
|
const item = await trx.selectFrom("operator_item").select("id").where("item_key", "=", turnItemKey(id)).where("cleared_at", "is", null).executeTakeFirst();
|
|
11430
11447
|
if (item !== void 0) await clearItem(trx, item.id, at);
|
|
@@ -14113,6 +14130,11 @@ async function getStatus(deps, options = {}) {
|
|
|
14113
14130
|
lastCompleteAt: last,
|
|
14114
14131
|
blindReason,
|
|
14115
14132
|
message: row?.blind_message ?? null,
|
|
14133
|
+
budget: row?.budget_remaining != null && row.budget_reset_at != null ? {
|
|
14134
|
+
remaining: row.budget_remaining,
|
|
14135
|
+
limit: row.budget_limit,
|
|
14136
|
+
resetAt: row.budget_reset_at
|
|
14137
|
+
} : null,
|
|
14116
14138
|
stale: last === null || clock.now() - Date.parse(last) > config.thresholds.staleMultiplier * interval(config, source),
|
|
14117
14139
|
warmingUp: !completeSince.has(source)
|
|
14118
14140
|
};
|
|
@@ -16254,6 +16276,29 @@ async function taskTurns(trx, task, detail) {
|
|
|
16254
16276
|
turns
|
|
16255
16277
|
};
|
|
16256
16278
|
}
|
|
16279
|
+
/** The summary of a turn open, take or close: the turn, its executor, taker or outcome. */
|
|
16280
|
+
function turnSummary(kind, payloadText) {
|
|
16281
|
+
try {
|
|
16282
|
+
if (kind === "turn_opened") {
|
|
16283
|
+
const payload = eventPayloadSchemas[kind].safeParse(JSON.parse(payloadText));
|
|
16284
|
+
if (!payload.success) return null;
|
|
16285
|
+
const { turn, column, addressee } = payload.data;
|
|
16286
|
+
const reason = payload.data.reason.replace(/\s+/g, " ").trim();
|
|
16287
|
+
return `Turn ${turn} opened in ${column} for ${addressee}${reason === "" ? "" : `: ${reason}`}`;
|
|
16288
|
+
}
|
|
16289
|
+
if (kind === "turn_taken") {
|
|
16290
|
+
const payload = eventPayloadSchemas[kind].safeParse(JSON.parse(payloadText));
|
|
16291
|
+
return payload.success ? `Turn ${payload.data.turn} taken by ${payload.data.taker}` : null;
|
|
16292
|
+
}
|
|
16293
|
+
if (kind === "turn_closed") {
|
|
16294
|
+
const payload = eventPayloadSchemas[kind].safeParse(JSON.parse(payloadText));
|
|
16295
|
+
return payload.success ? `Turn ${payload.data.turn} closed: ${payload.data.outcome}` : null;
|
|
16296
|
+
}
|
|
16297
|
+
return null;
|
|
16298
|
+
} catch {
|
|
16299
|
+
return null;
|
|
16300
|
+
}
|
|
16301
|
+
}
|
|
16257
16302
|
//#endregion
|
|
16258
16303
|
//#region ../core/src/app/task-sessions.ts
|
|
16259
16304
|
/** Current facts of the effective session links that task.get exposes. */
|
|
@@ -16342,6 +16387,9 @@ const EVENT_SUMMARIES = {
|
|
|
16342
16387
|
task_shadow_moved: "Shadow move",
|
|
16343
16388
|
task_corrected: "Column corrected by the operator",
|
|
16344
16389
|
dispatcher_mode_changed: "Dispatcher mode changed",
|
|
16390
|
+
turn_opened: "Turn opened",
|
|
16391
|
+
turn_taken: "Turn taken",
|
|
16392
|
+
turn_closed: "Turn closed",
|
|
16345
16393
|
block_opened: "Block opened",
|
|
16346
16394
|
block_escalated: "Block escalated",
|
|
16347
16395
|
block_unblocked: "Block unblocked",
|
|
@@ -16548,7 +16596,7 @@ function createTaskQueries(deps) {
|
|
|
16548
16596
|
at: row.at,
|
|
16549
16597
|
kind,
|
|
16550
16598
|
actor: eventActor(row),
|
|
16551
|
-
summary: linkOrEscalationSummary(kind, row.payload) ?? shadowSummary(kind, row.payload) ?? submitSummary(kind, row.payload) ?? EVENT_SUMMARIES[kind]
|
|
16599
|
+
summary: linkOrEscalationSummary(kind, row.payload) ?? shadowSummary(kind, row.payload) ?? submitSummary(kind, row.payload) ?? turnSummary(kind, row.payload) ?? EVENT_SUMMARIES[kind]
|
|
16552
16600
|
}];
|
|
16553
16601
|
});
|
|
16554
16602
|
return {
|
|
@@ -17250,7 +17298,7 @@ async function updateTerminal(trx, config, taskId, at, completeSince, blind) {
|
|
|
17250
17298
|
async function blindReason(trx, source) {
|
|
17251
17299
|
return (await trx.selectFrom("source_state").select("blind_reason").where("source", "=", source).executeTakeFirst())?.blind_reason ?? null;
|
|
17252
17300
|
}
|
|
17253
|
-
async function sourceState(trx, source, state, observedAt, cursor) {
|
|
17301
|
+
async function sourceState(trx, source, state, observedAt, cursor, budget) {
|
|
17254
17302
|
await trx.insertInto("source_state").values({
|
|
17255
17303
|
source,
|
|
17256
17304
|
initialized: observedAt === void 0 ? 0 : 1,
|
|
@@ -17259,7 +17307,10 @@ async function sourceState(trx, source, state, observedAt, cursor) {
|
|
|
17259
17307
|
blind_message: state.blind?.message ?? null,
|
|
17260
17308
|
cursor: cursor ?? null,
|
|
17261
17309
|
observed_at: observedAt ?? null,
|
|
17262
|
-
gone: toJson(z.array(entityRefSchema), [...state.gone])
|
|
17310
|
+
gone: toJson(z.array(entityRefSchema), [...state.gone]),
|
|
17311
|
+
budget_remaining: budget?.remaining ?? null,
|
|
17312
|
+
budget_limit: budget?.limit ?? null,
|
|
17313
|
+
budget_reset_at: budget?.resetAt ?? null
|
|
17263
17314
|
}).onConflict((oc) => oc.column("source").doUpdateSet((eb) => ({
|
|
17264
17315
|
initialized: observedAt === void 0 ? eb.ref("source_state.initialized") : 1,
|
|
17265
17316
|
last_complete_at: state.lastCompleteAt ?? null,
|
|
@@ -17267,7 +17318,10 @@ async function sourceState(trx, source, state, observedAt, cursor) {
|
|
|
17267
17318
|
blind_message: state.blind?.message ?? null,
|
|
17268
17319
|
cursor: cursor ?? eb.ref("source_state.cursor"),
|
|
17269
17320
|
observed_at: observedAt ?? eb.ref("source_state.observed_at"),
|
|
17270
|
-
gone: toJson(z.array(entityRefSchema), [...state.gone])
|
|
17321
|
+
gone: toJson(z.array(entityRefSchema), [...state.gone]),
|
|
17322
|
+
budget_remaining: budget === void 0 ? eb.ref("source_state.budget_remaining") : budget.remaining,
|
|
17323
|
+
budget_limit: budget === void 0 ? eb.ref("source_state.budget_limit") : budget.limit ?? null,
|
|
17324
|
+
budget_reset_at: budget === void 0 ? eb.ref("source_state.budget_reset_at") : budget.resetAt
|
|
17271
17325
|
}))).execute();
|
|
17272
17326
|
}
|
|
17273
17327
|
/**
|
|
@@ -17902,7 +17956,7 @@ function createObservationCore(deps) {
|
|
|
17902
17956
|
const wasBlind = await blindReason(trx, source);
|
|
17903
17957
|
const previousSpur = source === "spur" ? await trx.selectFrom("source_state").select("last_complete_at").where("source", "=", source).executeTakeFirst() : void 0;
|
|
17904
17958
|
const spurGap = previousSpur?.last_complete_at != null && Date.parse(batch.observedAt) > Date.parse(previousSpur.last_complete_at) + config.adapters.spur.intervalMs * config.thresholds.staleMultiplier;
|
|
17905
|
-
await sourceState(trx, source, observation.state, batch.observedAt, batch.cursor);
|
|
17959
|
+
await sourceState(trx, source, observation.state, batch.observedAt, batch.cursor, batch.budget);
|
|
17906
17960
|
await recordUsage(trx, source, batch.usage, now);
|
|
17907
17961
|
for (const probe of batch.prProbes ?? []) {
|
|
17908
17962
|
if (probe.status !== "closed") continue;
|
|
@@ -19631,21 +19685,21 @@ function aliases(numbers, fields) {
|
|
|
19631
19685
|
}
|
|
19632
19686
|
const discoveryStates = (bootstrap) => bootstrap ? "OPEN" : "OPEN, MERGED, CLOSED";
|
|
19633
19687
|
function discoveryQuery(bootstrap = false) {
|
|
19634
|
-
return `query PrBatch($owner: String!, $repo: String!) { rateLimit { cost remaining resetAt } repository(owner: $owner, name: $repo) { pullRequests(first: 100, states: [${discoveryStates(bootstrap)}], orderBy: {field: UPDATED_AT, direction: DESC}) { ${DISCOVERY_FIELDS} }${bootstrap ? " mergedBaseline: pullRequests(first: 1, states: [MERGED, CLOSED], orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { updatedAt } }" : ""} } }`;
|
|
19688
|
+
return `query PrBatch($owner: String!, $repo: String!) { rateLimit { cost limit remaining resetAt } repository(owner: $owner, name: $repo) { pullRequests(first: 100, states: [${discoveryStates(bootstrap)}], orderBy: {field: UPDATED_AT, direction: DESC}) { ${DISCOVERY_FIELDS} }${bootstrap ? " mergedBaseline: pullRequests(first: 1, states: [MERGED, CLOSED], orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { updatedAt } }" : ""} } }`;
|
|
19635
19689
|
}
|
|
19636
19690
|
function stateQuery(numbers) {
|
|
19637
|
-
return `query PrStates($owner: String!, $repo: String!) { rateLimit { cost remaining resetAt } ${aliases(numbers, () => "number state")} }`;
|
|
19691
|
+
return `query PrStates($owner: String!, $repo: String!) { rateLimit { cost limit remaining resetAt } ${aliases(numbers, () => "number state")} }`;
|
|
19638
19692
|
}
|
|
19639
19693
|
function indexQuery(numbers) {
|
|
19640
|
-
return `query PrIndex($owner: String!, $repo: String!) { rateLimit { cost remaining resetAt } ${aliases(numbers, () => INDEX_FIELDS)} }`;
|
|
19694
|
+
return `query PrIndex($owner: String!, $repo: String!) { rateLimit { cost limit remaining resetAt } ${aliases(numbers, () => INDEX_FIELDS)} }`;
|
|
19641
19695
|
}
|
|
19642
19696
|
function detailQuery(numbers, closing = false) {
|
|
19643
|
-
return `query PrDetails($owner: String!, $repo: String!) { rateLimit { cost remaining resetAt } ${aliases(numbers, (number) => prFields(number, closing))} }`;
|
|
19697
|
+
return `query PrDetails($owner: String!, $repo: String!) { rateLimit { cost limit remaining resetAt } ${aliases(numbers, (number) => prFields(number, closing))} }`;
|
|
19644
19698
|
}
|
|
19645
19699
|
function pageQuery(connection, bootstrap = false) {
|
|
19646
|
-
if (connection === "comments") return `query PrPage($owner: String!, $repo: String!, $number: Int!, $before: String!) { rateLimit { cost remaining resetAt } repository(owner: $owner, name: $repo) { pullRequest(number: $number) { comments(last: 100, before: $before) { ${COMMENT_FIELDS} } } } }`;
|
|
19647
|
-
if (connection === "pullRequests") return `query DiscoveryPage($owner: String!, $repo: String!, $after: String!) { rateLimit { cost remaining resetAt } repository(owner: $owner, name: $repo) { pullRequests(first: 100, after: $after, states: [${discoveryStates(bootstrap)}], orderBy: {field: UPDATED_AT, direction: DESC}) { ${DISCOVERY_FIELDS} } } }`;
|
|
19648
|
-
return `query PrPage($owner: String!, $repo: String!, $number: Int!, $after: String!) { rateLimit { cost remaining resetAt } repository(owner: $owner, name: $repo) { pullRequest(number: $number) { ${connection === "closingIssuesReferences" ? `closingIssuesReferences(first: 100, after: $after) { ${CLOSING_FIELDS} }` : connection === "contexts" ? `statusCheckRollup { contexts(first: 100, after: $after) { nodes { ... on CheckRun { __typename name status conclusion startedAt completedAt checkSuite { createdAt } isRequired(pullRequestNumber: $number) } ... on StatusContext { __typename context state createdAt isRequired(pullRequestNumber: $number) } } pageInfo { hasNextPage endCursor } } }` : `${connection}(first: 100, after: $after) { nodes { ${connection === "reviews" ? REVIEW_FIELDS : connection === "reviewThreads" ? THREAD_FIELDS : REVIEWER_FIELDS} } pageInfo { hasNextPage endCursor } }`} } } }`;
|
|
19700
|
+
if (connection === "comments") return `query PrPage($owner: String!, $repo: String!, $number: Int!, $before: String!) { rateLimit { cost limit remaining resetAt } repository(owner: $owner, name: $repo) { pullRequest(number: $number) { comments(last: 100, before: $before) { ${COMMENT_FIELDS} } } } }`;
|
|
19701
|
+
if (connection === "pullRequests") return `query DiscoveryPage($owner: String!, $repo: String!, $after: String!) { rateLimit { cost limit remaining resetAt } repository(owner: $owner, name: $repo) { pullRequests(first: 100, after: $after, states: [${discoveryStates(bootstrap)}], orderBy: {field: UPDATED_AT, direction: DESC}) { ${DISCOVERY_FIELDS} } } }`;
|
|
19702
|
+
return `query PrPage($owner: String!, $repo: String!, $number: Int!, $after: String!) { rateLimit { cost limit remaining resetAt } repository(owner: $owner, name: $repo) { pullRequest(number: $number) { ${connection === "closingIssuesReferences" ? `closingIssuesReferences(first: 100, after: $after) { ${CLOSING_FIELDS} }` : connection === "contexts" ? `statusCheckRollup { contexts(first: 100, after: $after) { nodes { ... on CheckRun { __typename name status conclusion startedAt completedAt checkSuite { createdAt } isRequired(pullRequestNumber: $number) } ... on StatusContext { __typename context state createdAt isRequired(pullRequestNumber: $number) } } pageInfo { hasNextPage endCursor } } }` : `${connection}(first: 100, after: $after) { nodes { ${connection === "reviews" ? REVIEW_FIELDS : connection === "reviewThreads" ? THREAD_FIELDS : REVIEWER_FIELDS} } pageInfo { hasNextPage endCursor } }`} } } }`;
|
|
19649
19703
|
}
|
|
19650
19704
|
/**
|
|
19651
19705
|
* The failure that GraphQL `errors` mean for the whole request, in rule order: a rate limit is
|
|
@@ -19723,10 +19777,14 @@ var GithubClient = class {
|
|
|
19723
19777
|
const failure = graphqlFailure(errors, query, response.headers, this.now());
|
|
19724
19778
|
if (failure !== null) throw failure;
|
|
19725
19779
|
const data = parseWire(dataWire, wire.data, MALFORMED$3, ["data"]);
|
|
19780
|
+
const limit = z.object({ rateLimit: z.object({ limit: z.int().positive() }) }).safeParse(wire.data);
|
|
19726
19781
|
return {
|
|
19727
19782
|
data,
|
|
19728
19783
|
errors,
|
|
19729
|
-
budget:
|
|
19784
|
+
budget: limit.success ? {
|
|
19785
|
+
...data.rateLimit,
|
|
19786
|
+
limit: limit.data.rateLimit.limit
|
|
19787
|
+
} : data.rateLimit
|
|
19730
19788
|
};
|
|
19731
19789
|
}
|
|
19732
19790
|
};
|
|
@@ -21023,7 +21081,10 @@ function matchesFilter(issue, tracker) {
|
|
|
21023
21081
|
if (tracker.label !== void 0) return issue.labels.some((label) => label.name === tracker.label);
|
|
21024
21082
|
return issue.milestone?.title === tracker.milestone;
|
|
21025
21083
|
}
|
|
21026
|
-
/**
|
|
21084
|
+
/**
|
|
21085
|
+
* The REST `core` budget from GitHub's rate-limit headers; undefined when remaining or reset is
|
|
21086
|
+
* invalid. An invalid `x-ratelimit-limit` is left out of the budget.
|
|
21087
|
+
*/
|
|
21027
21088
|
function restBudget(headers) {
|
|
21028
21089
|
const remaining = headers.get("x-ratelimit-remaining");
|
|
21029
21090
|
const reset = headers.get("x-ratelimit-reset");
|
|
@@ -21034,7 +21095,12 @@ function restBudget(headers) {
|
|
|
21034
21095
|
if (!Number.isSafeInteger(count) || Number.isNaN(resetAt.getTime())) return void 0;
|
|
21035
21096
|
const iso = resetAt.toISOString();
|
|
21036
21097
|
if (!/^\d{4}-/.test(iso)) return void 0;
|
|
21037
|
-
|
|
21098
|
+
const limit = Number(headers.get("x-ratelimit-limit")?.match(/^\d+$/)?.[0]);
|
|
21099
|
+
return Number.isSafeInteger(limit) && limit > 0 ? {
|
|
21100
|
+
remaining: count,
|
|
21101
|
+
limit,
|
|
21102
|
+
resetAt: iso
|
|
21103
|
+
} : {
|
|
21038
21104
|
remaining: count,
|
|
21039
21105
|
resetAt: iso
|
|
21040
21106
|
};
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } 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 { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-Di9QGxO1.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-QCOwDTOu.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-BRdjSAl1.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- Request budget each source reported on its last batch that carried one. observe writes the three
|
|
2
|
+
-- columns together from one batch or leaves them alone; reportSourceState never changes them.
|
|
3
|
+
ALTER TABLE source_state ADD COLUMN budget_remaining INTEGER;
|
|
4
|
+
ALTER TABLE source_state ADD COLUMN budget_limit INTEGER;
|
|
5
|
+
ALTER TABLE source_state ADD COLUMN budget_reset_at TEXT;
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Blocks and escalation
|
|
2
|
+
|
|
3
|
+
## Blocks and escalation
|
|
4
|
+
|
|
5
|
+
A question (`needs_input`): column orchestrator, else curator, else
|
|
6
|
+
operator. Routing avoids asking yourself; curators ask the operator.
|
|
7
|
+
|
|
8
|
+
A `code` block goes to the worker; `dependency` or `external` block stays with
|
|
9
|
+
its author's role. Escalation: column orchestrator to curator to
|
|
10
|
+
operator; other blocks escalate straight to the operator. Keyed
|
|
11
|
+
`board escalate <block>` if its addressee cannot resolve it.
|
|
12
|
+
|
|
13
|
+
Taskless: all roles, operator only:
|
|
14
|
+
`board project ask <project> <text> --to operator --key <key>`.
|
|
15
|
+
Project `needs_input` blocks get Slack threads except operator-agent asks;
|
|
16
|
+
operator: `board inbox`, keyed `board answer`. Answers reach a current curator session; other roles use the asking session.
|
|
17
|
+
|
|
18
|
+
`projects[].columns[].orchestrator`, `projects[].spurProjects[].role`,
|
|
19
|
+
`operator.slack`.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Columns and executors
|
|
2
|
+
|
|
3
|
+
## Columns and executors
|
|
4
|
+
|
|
5
|
+
`todo`, `ready-for-dev`, `dev`, `review`, `product-review`,
|
|
6
|
+
`external-review`, `qa`, `ready-to-merge`, `done`.
|
|
7
|
+
`projects[].columns[].enabled`: disabled/omitted columns skip gates;
|
|
8
|
+
To Do, Dev, Done stay enabled.
|
|
9
|
+
|
|
10
|
+
Each column has one executor: `projects[].columns[].orchestrator`:
|
|
11
|
+
`none` (live worker, else operator), `operator`, or project with role
|
|
12
|
+
`orchestrator` or `curator`. The worker owns the code and branch; others inspect/return, never push.
|
|
13
|
+
|
|
14
|
+
`projects[].spurProjects[].role` accepts `worker`, `operator`, `curator` and
|
|
15
|
+
`orchestrator`.
|
|
16
|
+
|
|
17
|
+
Top-level `spurProjects[].columns` fills `none` columns board-wide;
|
|
18
|
+
`role: operator` there serves operatorless projects, one session acting in
|
|
19
|
+
each. A project-level binding wins.
|
|
20
|
+
|
|
21
|
+
## Gates and placement
|
|
22
|
+
|
|
23
|
+
Facts (head, checks, reviews, comments, ticket, sessions) feed gates; two actions: move the task and open an executor turn (at most one
|
|
24
|
+
per evaluation). Turns follow unmet entry gates, actionable post-submit failures,
|
|
25
|
+
rerouting or Done wrap-up. Holds and existing turns can yield neither action.
|
|
26
|
+
|
|
27
|
+
Moves, turns and course checks need `projects[].dispatcher.mode: on`;
|
|
28
|
+
default is `shadow`: no doorbells or blocks.
|
|
29
|
+
|
|
30
|
+
Gates are cumulative: each column checks its enabled gate and those to its left. At a turn boundary, failed gates return to the leftmost failing
|
|
31
|
+
column. Taken turns hold until submit, return or a new head. Pending CI, unknown
|
|
32
|
+
mergeability and incomplete comment history are waits. Downstream handoff waits
|
|
33
|
+
for settled prerequisites; Dev can receive a repair turn.
|
|
34
|
+
|
|
35
|
+
Dev needs an open non-draft PR, passing checks, no conflict, handled
|
|
36
|
+
feedback, comment history and current-head submit. Feedback excludes
|
|
37
|
+
bots, approvals and `projects[].operatorGithubLogin` (agents' account), so worker
|
|
38
|
+
thread replies never count; others' posts do.
|
|
39
|
+
The repo owner's and the human operator's own accounts count too, unless one is
|
|
40
|
+
that login: a PR comment is a change request; talk to agents in Slack
|
|
41
|
+
(`@shortName`) or the Board. A review-thread reply is a new review. An approval
|
|
42
|
+
hides its inline comments; thread resolution and the head a comment was left on
|
|
43
|
+
change nothing for feedback. Bots (GitHub Apps) neither return a task, approve it nor block
|
|
44
|
+
an approval; their threads still count. Handled means handed by ID to a Dev turn, not answered; in shadow
|
|
45
|
+
mode, a later submit in Dev or an executor `none` column handles it.
|
|
46
|
+
An edit after the hand makes it unhandled again, returning a task right of Dev.
|
|
47
|
+
A status comment whose last line is a hidden `board-reviewer-progress` or
|
|
48
|
+
`board-reviewer-unavailable` marker is not external feedback. No required checks: non-skipped count. `projects[].reposWithoutCi` waives absent checks
|
|
49
|
+
for listed repos; never failed/skipped required ones.
|
|
50
|
+
|
|
51
|
+
Review and Product Review need current-head internal review marks, separate from
|
|
52
|
+
External Review's external approval. QA: current-head submit; Ready to Merge awaits merge. Executor `none` may reuse same-head submits of other worker columns. Fixed gate rules have no configuration switch
|
|
53
|
+
except enabled columns, no-CI and resolved threads.
|
|
54
|
+
|
|
55
|
+
`projects[].columns[].requireResolvedThreads` (default: `ready-to-merge` only)
|
|
56
|
+
gates that column and those right of it: an unresolved review thread, outdated
|
|
57
|
+
or by anyone, returns the task to Dev, whose turn lists each thread link. The
|
|
58
|
+
worker fixes or answers, then resolves each; reviewers never do. A
|
|
59
|
+
Dev submit on the same head moves right, keeping marks and approval. An
|
|
60
|
+
approval's inline notes are threads; it still passes External Review.
|
|
61
|
+
|
|
62
|
+
Review/Product Review mark lasts across visits on the current head. A visit
|
|
63
|
+
submission belongs to one column visit; moving left clears it and those to the right. New heads invalidate internal Review and Product Review marks.
|
|
64
|
+
|
|
65
|
+
PR closed without merge with no open PR, or closed
|
|
66
|
+
ticket with live work and no merged PR. `board status` lists them as operator block threads.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Slack now
|
|
2
|
+
|
|
3
|
+
## Slack now
|
|
4
|
+
|
|
5
|
+
`slack.channels.feed`: curator answers and operator items,
|
|
6
|
+
except delivery/health/ended-worker items and blocks.
|
|
7
|
+
`slack.channels.orchestrators`: block threads addressed to the operator by
|
|
8
|
+
others. Answer in the existing block thread.
|
|
9
|
+
|
|
10
|
+
## Slack addressing
|
|
11
|
+
|
|
12
|
+
With a `projects[].spurProjects[].shortName`, `spurProjects[].shortName` or
|
|
13
|
+
board-wide operator, a new operator message in
|
|
14
|
+
`slack.channels.orchestrators` starts a conversation. A leading registered
|
|
15
|
+
`@shortName` selects that Spur project and is stripped. With absent or unknown
|
|
16
|
+
leading name, complete text, retaining any
|
|
17
|
+
unknown prefix, goes to `slack.defaultAddressee`, else board-wide operator, else
|
|
18
|
+
first project with an operator; else Board replies once with the valid prefixes.
|
|
19
|
+
Middle mentions or Slack `<@U…>` address nobody; unknown names cause no lookup
|
|
20
|
+
error. The operator checks short-name collisions with workspace names.
|
|
21
|
+
A task key after the prefix attaches it.
|
|
22
|
+
|
|
23
|
+
Read `board inbox`; reply via `board answer`. Each operator thread message rings again; `close` or ✅ in the
|
|
24
|
+
thread closes it. Replies use `projects[].spurProjects[].displayName` and `icon`, top-level ones too,
|
|
25
|
+
else project name and role icon (`board` for operator). No session:
|
|
26
|
+
`board status` lists it as waiting.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Turns and delivery
|
|
2
|
+
|
|
3
|
+
## Turns and delivery
|
|
4
|
+
|
|
5
|
+
A turn `T<number>`: keyed `board inbox ack <entries>`.
|
|
6
|
+
Only the acknowledging session may submit or return: keyed
|
|
7
|
+
`board submit <turn> <sha>` accepts the head; keyed
|
|
8
|
+
`board return <turn> <reason>` sends findings to Dev. In
|
|
9
|
+
shadow mode, use keyed `board submit <task> <sha>`.
|
|
10
|
+
Unseen heads answer `pending`: that submit is final; do not resubmit or raise a
|
|
11
|
+
block. Confirm timeout: `projects[].dispatcher.submitConfirmMs`.
|
|
12
|
+
|
|
13
|
+
A new head closes taken turns outside Dev; taken Dev turns survive pushes.
|
|
14
|
+
Right of Dev, red CI, a draft, a conflict, an external comment or an unresolved
|
|
15
|
+
thread where required returns the task to Dev at once, unless a turn is taken; then after its submit or return.
|
|
16
|
+
The Dev turn hands the comments, beside a return's `code` block.
|
|
17
|
+
Each handed entry has its `url`, `editedAt` once edited, and a review's inline
|
|
18
|
+
`comments` with `url` and `threadId`. Turns of a Dev visit opened by a return
|
|
19
|
+
show `returned`: who, from, the turn, the `code` block and the verbatim reason.
|
|
20
|
+
|
|
21
|
+
Closed turns receive no further Board sends; Obsolete queued rings are dropped;
|
|
22
|
+
a message already accepted by Spur cannot be retracted. Check `board inbox` and
|
|
23
|
+
act only on a current turn; reread after `turn_closed`.
|
|
24
|
+
Task history (`board task history <task>`) shows journal events `turn_opened`,
|
|
25
|
+
`turn_taken` and `turn_closed`: executor, taker, outcome.
|
|
26
|
+
|
|
27
|
+
Open-turn executors in `needs_input`, `error`, `rate_limited` or `stopped` raise
|
|
28
|
+
one question after `health.turnStallAfterMs` (default 600000): curator unless self, else
|
|
29
|
+
operator. Time starts at the later turn/state start; taking never resets it.
|
|
30
|
+
One frozen explanation/dismissal per turn/session/state episode. Recovery,
|
|
31
|
+
replacement, removal, archive or turn closure withdraws it. Blind Spur opens none,
|
|
32
|
+
holds existing; gaps restart timing for new questions.
|
|
33
|
+
|
|
34
|
+
## Doorbells
|
|
35
|
+
|
|
36
|
+
A turn opened for you by your own confirmed submit or return is first rung only after `doorbells.firstRetryMs`; a turn opened for you any other way rings at once.
|
|
37
|
+
|
|
38
|
+
A doorbell expects action: read `board inbox` for the turn, addressed
|
|
39
|
+
block, answer or follow-up. Ordinary task comments do not ring; nor does a block
|
|
40
|
+
tracked by its author role ring itself.
|
|
41
|
+
|
|
42
|
+
Repeat up to three delivered rings;
|
|
43
|
+
acknowledgement stops them. Removal notices and quiet-turn reminders ring once.
|
|
44
|
+
Busy recipients defer delivery; pending delivery or earlier rings in the Spur
|
|
45
|
+
queue defer repeats. Queues can exhaust their waiting window.
|
|
46
|
+
|
|
47
|
+
Most notices await recipients; taskless worker, orchestrator and operator-agent
|
|
48
|
+
answers end without a live asking session. Curator and course-check orchestrator
|
|
49
|
+
questions fall back to operator. Operator conversations await their project.
|
|
50
|
+
Exhaustion alerts the operator, except removals and quiet-turn reminders;
|
|
51
|
+
curator questions move to operator.
|
|
52
|
+
|
|
53
|
+
## Course checks and cycle limits
|
|
54
|
+
|
|
55
|
+
`projects[].columns[].courseCheck` defaults to 3 returns to Dev;
|
|
56
|
+
`courseCheck: 0` disables it. `projects[].columns[].cycleLimit` defaults to 10 and
|
|
57
|
+
takes priority. Executor returns and external comments (a changes-requested
|
|
58
|
+
review is one) count, as do thread returns; CI failures, conflicts and drafts alone do not count, nor
|
|
59
|
+
reopened tickets or mode switches.
|
|
60
|
+
|
|
61
|
+
If returns keep hitting the same mechanism, fix the bug class once; cover its variants with one table test. Put remaining edges with no user-visible effect under Risk in the PR description. Still fix P0/P1 and user-visible findings in this PR.
|
|
62
|
+
`projects[].columns[].courseCheckTo`: `operator`, curator or column orchestrator.
|
|
63
|
+
Default: curator (`projects[].spurProjects[].role`), else operator. An answer
|
|
64
|
+
resets the course count and reaches the worker as a task comment. Only the
|
|
65
|
+
operator can resolve the separate cycle limit and reset its count. With no live
|
|
66
|
+
session it falls back to the operator; a live conductor that does not
|
|
67
|
+
answer keeps the question.
|
|
@@ -1,178 +1,9 @@
|
|
|
1
1
|
# How the Board works
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Choose the topic for the decision or action in front of you:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Each column has one executor: `projects[].columns[].orchestrator`:
|
|
11
|
-
`none` (live worker, else operator), `operator`, or project with role
|
|
12
|
-
`orchestrator` or `curator`. The worker owns the code and branch; others inspect/return, never push.
|
|
13
|
-
|
|
14
|
-
`projects[].spurProjects[].role` accepts `worker`, `operator`, `curator` and
|
|
15
|
-
`orchestrator`.
|
|
16
|
-
|
|
17
|
-
Top-level `spurProjects[].columns` fills `none` columns board-wide;
|
|
18
|
-
`role: operator` there serves operatorless projects, one session acting in
|
|
19
|
-
each. A project-level binding wins.
|
|
20
|
-
|
|
21
|
-
## Gates and placement
|
|
22
|
-
|
|
23
|
-
Facts (head, checks, reviews, comments, ticket, sessions) feed gates; two actions: move the task and open an executor turn (at most one
|
|
24
|
-
per evaluation). Turns follow unmet entry gates, actionable post-submit failures,
|
|
25
|
-
rerouting or Done wrap-up. Holds and existing turns can yield neither action.
|
|
26
|
-
|
|
27
|
-
Moves, turns and course checks need `projects[].dispatcher.mode: on`;
|
|
28
|
-
default is `shadow`: no doorbells or blocks.
|
|
29
|
-
|
|
30
|
-
Gates are cumulative: each column checks its enabled gate and those to its left. At a turn boundary, failed gates return to the leftmost failing
|
|
31
|
-
column. Taken turns hold until submit, return or a new head. Pending CI, unknown
|
|
32
|
-
mergeability and incomplete comment history are waits. Downstream handoff waits
|
|
33
|
-
for settled prerequisites; Dev can receive a repair turn.
|
|
34
|
-
|
|
35
|
-
Dev needs an open non-draft PR, passing checks, no conflict, handled
|
|
36
|
-
feedback, comment history and current-head submit. Feedback excludes
|
|
37
|
-
bots, approvals and `projects[].operatorGithubLogin` (agents' account), so worker
|
|
38
|
-
thread replies never count; others' posts do.
|
|
39
|
-
The repo owner's and the human operator's own accounts count too, unless one is
|
|
40
|
-
that login: a PR comment is a change request; talk to agents in Slack
|
|
41
|
-
(`@shortName`) or the Board. A review-thread reply is a new review. An approval
|
|
42
|
-
hides its inline comments; thread resolution and the head a comment was left on
|
|
43
|
-
change nothing for feedback. Bots (GitHub Apps) neither return a task, approve it nor block
|
|
44
|
-
an approval; their threads still count. Handled means handed by ID to a Dev turn, not answered; in shadow
|
|
45
|
-
mode, a later submit in Dev or an executor `none` column handles it.
|
|
46
|
-
An edit after the hand makes it unhandled again, returning a task right of Dev.
|
|
47
|
-
A status comment whose last line is a hidden `board-reviewer-progress` or
|
|
48
|
-
`board-reviewer-unavailable` marker is not external feedback. No required checks: non-skipped count. `projects[].reposWithoutCi` waives absent checks
|
|
49
|
-
for listed repos; never failed/skipped required ones.
|
|
50
|
-
|
|
51
|
-
Review and Product Review need current-head internal review marks, separate from
|
|
52
|
-
External Review's external approval. QA: current-head submit; Ready to Merge awaits merge. Executor `none` may reuse same-head submits of other worker columns. Fixed gate rules have no configuration switch
|
|
53
|
-
except enabled columns, no-CI and resolved threads.
|
|
54
|
-
|
|
55
|
-
`projects[].columns[].requireResolvedThreads` (default: `ready-to-merge` only)
|
|
56
|
-
gates that column and those right of it: an unresolved review thread, outdated
|
|
57
|
-
or by anyone, returns the task to Dev, whose turn lists each thread link. The
|
|
58
|
-
worker fixes or answers, then resolves each; reviewers never do. A
|
|
59
|
-
Dev submit on the same head moves right, keeping marks and approval. An
|
|
60
|
-
approval's inline notes are threads; it still passes External Review.
|
|
61
|
-
|
|
62
|
-
Review/Product Review mark lasts across visits on the current head. A visit
|
|
63
|
-
submission belongs to one column visit; moving left clears it and those to the right. New heads invalidate internal Review and Product Review marks.
|
|
64
|
-
|
|
65
|
-
PR closed without merge with no open PR, or closed
|
|
66
|
-
ticket with live work and no merged PR. `board status` lists them as operator block threads.
|
|
67
|
-
|
|
68
|
-
## Turns and delivery
|
|
69
|
-
|
|
70
|
-
A turn `T<number>`: keyed `board inbox ack <entries>`.
|
|
71
|
-
Only the acknowledging session may submit or return: keyed
|
|
72
|
-
`board submit <turn> <sha>` accepts the head; keyed
|
|
73
|
-
`board return <turn> <reason>` sends findings to Dev. In
|
|
74
|
-
shadow mode, use keyed `board submit <task> <sha>`.
|
|
75
|
-
Unseen heads answer `pending`: that submit is final; do not resubmit or raise a
|
|
76
|
-
block. Confirm timeout: `projects[].dispatcher.submitConfirmMs`.
|
|
77
|
-
|
|
78
|
-
A new head closes taken turns outside Dev; taken Dev turns survive pushes.
|
|
79
|
-
Right of Dev, red CI, a draft, a conflict, an external comment or an unresolved
|
|
80
|
-
thread where required returns the task to Dev at once, unless a turn is taken; then after its submit or return.
|
|
81
|
-
The Dev turn hands the comments, beside a return's `code` block.
|
|
82
|
-
Each handed entry has its `url`, `editedAt` once edited, and a review's inline
|
|
83
|
-
`comments` with `url` and `threadId`. Turns of a Dev visit opened by a return
|
|
84
|
-
show `returned`: who, from, the turn, the `code` block and the verbatim reason.
|
|
85
|
-
|
|
86
|
-
Closed turns receive no further Board sends; Obsolete queued rings are dropped;
|
|
87
|
-
a message already accepted by Spur cannot be retracted. Check `board inbox` and
|
|
88
|
-
act only on a current turn; reread after `turn_closed`.
|
|
89
|
-
|
|
90
|
-
Open-turn executors in `needs_input`, `error`, `rate_limited` or `stopped` raise
|
|
91
|
-
one question after `health.turnStallAfterMs` (default 600000): curator unless self, else
|
|
92
|
-
operator. Time starts at the later turn/state start; taking never resets it.
|
|
93
|
-
One frozen explanation/dismissal per turn/session/state episode. Recovery,
|
|
94
|
-
replacement, removal, archive or turn closure withdraws it. Blind Spur opens none,
|
|
95
|
-
holds existing; gaps restart timing for new questions.
|
|
96
|
-
|
|
97
|
-
## Doorbells
|
|
98
|
-
|
|
99
|
-
A turn opened for you by your own confirmed submit or return is first rung only after `doorbells.firstRetryMs`; a turn opened for you any other way rings at once.
|
|
100
|
-
|
|
101
|
-
A doorbell expects action: read `board inbox` for the turn, addressed
|
|
102
|
-
block, answer or follow-up. Ordinary task comments do not ring; nor does a block
|
|
103
|
-
tracked by its author role ring itself.
|
|
104
|
-
|
|
105
|
-
Repeat up to three delivered rings;
|
|
106
|
-
acknowledgement stops them. Removal notices and quiet-turn reminders ring once.
|
|
107
|
-
Busy recipients defer delivery; pending delivery or earlier rings in the Spur
|
|
108
|
-
queue defer repeats. Queues can exhaust their waiting window.
|
|
109
|
-
|
|
110
|
-
Most notices await recipients; taskless worker, orchestrator and operator-agent
|
|
111
|
-
answers end without a live asking session. Curator and course-check orchestrator
|
|
112
|
-
questions fall back to operator. Operator conversations await their project.
|
|
113
|
-
Exhaustion alerts the operator, except removals and quiet-turn reminders;
|
|
114
|
-
curator questions move to operator.
|
|
115
|
-
|
|
116
|
-
## Course checks and cycle limits
|
|
117
|
-
|
|
118
|
-
`projects[].columns[].courseCheck` defaults to 3 returns to Dev;
|
|
119
|
-
`courseCheck: 0` disables it. `projects[].columns[].cycleLimit` defaults to 10 and
|
|
120
|
-
takes priority. Executor returns and external comments (a changes-requested
|
|
121
|
-
review is one) count, as do thread returns; CI failures, conflicts and drafts alone do not count, nor
|
|
122
|
-
reopened tickets or mode switches.
|
|
123
|
-
|
|
124
|
-
If returns keep hitting the same mechanism, fix the bug class once; cover its variants with one table test. Put remaining edges with no user-visible effect under Risk in the PR description. Still fix P0/P1 and user-visible findings in this PR.
|
|
125
|
-
`projects[].columns[].courseCheckTo`: `operator`, curator or column orchestrator.
|
|
126
|
-
Default: curator (`projects[].spurProjects[].role`), else operator. An answer
|
|
127
|
-
resets the course count and reaches the worker as a task comment. Only the
|
|
128
|
-
operator can resolve the separate cycle limit and reset its count. With no live
|
|
129
|
-
session it falls back to the operator; a live conductor that does not
|
|
130
|
-
answer keeps the question.
|
|
131
|
-
|
|
132
|
-
## Blocks and escalation
|
|
133
|
-
|
|
134
|
-
A question (`needs_input`): column orchestrator, else curator, else
|
|
135
|
-
operator. Routing avoids asking yourself; curators ask the operator.
|
|
136
|
-
|
|
137
|
-
A `code` block goes to the worker; `dependency` or `external` block stays with
|
|
138
|
-
its author's role. Escalation: column orchestrator to curator to
|
|
139
|
-
operator; other blocks escalate straight to the operator. Keyed
|
|
140
|
-
`board escalate <block>` if its addressee cannot resolve it.
|
|
141
|
-
|
|
142
|
-
Taskless: all roles, operator only:
|
|
143
|
-
`board project ask <project> <text> --to operator --key <key>`.
|
|
144
|
-
Project `needs_input` blocks get Slack threads except operator-agent asks;
|
|
145
|
-
operator: `board inbox`, keyed `board answer`. Answers reach a current curator session; other roles use the asking session.
|
|
146
|
-
|
|
147
|
-
`projects[].columns[].orchestrator`, `projects[].spurProjects[].role`,
|
|
148
|
-
`operator.slack`.
|
|
149
|
-
|
|
150
|
-
## Slack now
|
|
151
|
-
|
|
152
|
-
`slack.channels.feed`: curator answers and operator items,
|
|
153
|
-
except delivery/health/ended-worker items and blocks.
|
|
154
|
-
`slack.channels.orchestrators`: block threads addressed to the operator by
|
|
155
|
-
others. Answer in the existing block thread.
|
|
156
|
-
|
|
157
|
-
## Slack addressing
|
|
158
|
-
|
|
159
|
-
With a `projects[].spurProjects[].shortName`, `spurProjects[].shortName` or
|
|
160
|
-
board-wide operator, a new operator message in
|
|
161
|
-
`slack.channels.orchestrators` starts a conversation. A leading registered
|
|
162
|
-
`@shortName` selects that Spur project and is stripped. With absent or unknown
|
|
163
|
-
leading name, complete text, retaining any
|
|
164
|
-
unknown prefix, goes to `slack.defaultAddressee`, else board-wide operator, else
|
|
165
|
-
first project with an operator; else Board replies once with the valid prefixes.
|
|
166
|
-
Middle mentions or Slack `<@U…>` address nobody; unknown names cause no lookup
|
|
167
|
-
error. The operator checks short-name collisions with workspace names.
|
|
168
|
-
A task key after the prefix attaches it.
|
|
169
|
-
|
|
170
|
-
Read `board inbox`; reply via `board answer`. Each operator thread message rings again; `close` or ✅ in the
|
|
171
|
-
thread closes it. Replies use `projects[].spurProjects[].displayName` and `icon`, top-level ones too,
|
|
172
|
-
else project name and role icon (`board` for operator). No session:
|
|
173
|
-
`board status` lists it as waiting.
|
|
174
|
-
|
|
175
|
-
## Done follows the ticket
|
|
176
|
-
|
|
177
|
-
One linked PR merging does not by itself finish the task. Done: `projects[].tracker.doneStatuses` for Jira; for GitHub, the Issue must be
|
|
178
|
-
closed. If still open, link another PR.
|
|
5
|
+
- [Columns and gates](how-board-works-columns.md): find the executor, placement rules and gate requirements.
|
|
6
|
+
- [Turns and delivery](how-board-works-turns.md): acknowledge work, submit or return, handle doorbells and repeated returns.
|
|
7
|
+
- [Blocks and escalation](how-board-works-blocks.md): route a question or escalate a block.
|
|
8
|
+
- [Slack conversations](how-board-works-slack.md): choose a channel, address an agent and answer in a thread.
|
|
9
|
+
- [Done follows the ticket](how-board-works-done.md): check when a task is finished.
|