spur-board 0.119.0 → 0.120.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.
@@ -3937,7 +3937,7 @@ const OPERATIONS = [
3937
3937
  kind: "mutation",
3938
3938
  description: "Mark comments, agent-addressed blocks, turns or doorbell rings as read; acking a turn makes the caller its taker.",
3939
3939
  mcp: {
3940
- whenToUse: "Mark handled inbox items or a ring ID like N18-1 read; an item handled before comes back under alreadyHandled.",
3940
+ 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.",
3941
3941
  whenNotToUse: "Use inbox_get to inspect them first."
3942
3942
  },
3943
3943
  input: z.strictObject({ entries: z.array(z.union([
@@ -3963,7 +3963,7 @@ const OPERATIONS = [
3963
3963
  ringIdSchema
3964
3964
  ])).optional().describe("Entries that were already handled; nothing new was acknowledged for them.")
3965
3965
  }),
3966
- grants: [{ grant: "project-agent" }],
3966
+ grants: [{ grant: "project-agent" }, { grant: "operator" }],
3967
3967
  errors: [
3968
3968
  "wrong_id_kind",
3969
3969
  "not_found",
@@ -4726,7 +4726,7 @@ const OPERATIONS = [
4726
4726
  defineOperation({
4727
4727
  id: "task.submit",
4728
4728
  kind: "mutation",
4729
- description: "Submit the task's pull request head for a turn this session took; the turn closes; a pending result is final.",
4729
+ description: "Submit the task's pull request head for a turn the caller took; the turn closes; a pending result is final.",
4730
4730
  mcp: {
4731
4731
  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.",
4732
4732
  whenNotToUse: "Use task_return to send the task back to Dev instead."
@@ -4744,7 +4744,11 @@ const OPERATIONS = [
4744
4744
  sha: commitShaSchema.describe("The submitted commit SHA."),
4745
4745
  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.")
4746
4746
  }),
4747
- grants: [{ grant: "task-worker" }, { grant: "column-orchestrator" }],
4747
+ grants: [
4748
+ { grant: "task-worker" },
4749
+ { grant: "column-orchestrator" },
4750
+ { grant: "operator" }
4751
+ ],
4748
4752
  errors: [
4749
4753
  "wrong_id_kind",
4750
4754
  "not_found",
@@ -4831,7 +4835,7 @@ const OPERATIONS = [
4831
4835
  defineOperation({
4832
4836
  id: "task.return",
4833
4837
  kind: "mutation",
4834
- description: "Return the task of a turn this session took to Dev; the reason opens a worker code block.",
4838
+ description: "Return the task of a turn the caller took to Dev; the reason opens a worker code block.",
4835
4839
  mcp: {
4836
4840
  whenToUse: "Send the task back to Dev when the work needs code changes.",
4837
4841
  whenNotToUse: "Use task_submit to hand in the work instead."
@@ -4845,7 +4849,11 @@ const OPERATIONS = [
4845
4849
  task: taskViewSchema,
4846
4850
  block: blockViewSchema
4847
4851
  }),
4848
- grants: [{ grant: "task-worker" }, { grant: "column-orchestrator" }],
4852
+ grants: [
4853
+ { grant: "task-worker" },
4854
+ { grant: "column-orchestrator" },
4855
+ { grant: "operator" }
4856
+ ],
4849
4857
  errors: [
4850
4858
  "wrong_id_kind",
4851
4859
  "not_found",
@@ -1,4 +1,4 @@
1
- import { _ as renderJsonError, at as errorContextSchema, c as tokenRequestStatusSchema, ct as successEnvelopeSchema, o as tokenRequestResultSchema, ot as errorEnvelopeSchema, rt as ERRORS } from "./chunk-CkMLCW2S.mjs";
1
+ import { _ as renderJsonError, at as errorContextSchema, c as tokenRequestStatusSchema, ct as successEnvelopeSchema, o as tokenRequestResultSchema, ot as errorEnvelopeSchema, rt as ERRORS } from "./chunk-CkCVuwFY.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 { _t as configSchema, d as buildCatalogSnapshot, p as OPERATIONS, yt as plainHttpAllowed } from "./chunk-CkMLCW2S.mjs";
2
- import { o as CliError, t as fetchCatalogVersion } from "./chunk-B1Mpg_7f.mjs";
1
+ import { _t as configSchema, d as buildCatalogSnapshot, p as OPERATIONS, yt as plainHttpAllowed } from "./chunk-CkCVuwFY.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-DLPQMmSY.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, Dt as SLACK_BOT_SCOPES, Q as actorIdSchema, T as skillReloadFileSchema, _t as configSchema, a as requestHashOf, bt as requiredSecretKeys, ct as successEnvelopeSchema, f as roleCanUseOperation, p as OPERATIONS, pt as DEFAULT_STAND_PORT_RANGE, r as remoteDoctorReportSchema, rt as ERRORS, u as SYSTEMD_SERVICE_SETTINGS, xt as resolveWebOrigin } from "./chunk-CkMLCW2S.mjs";
1
+ import { D as sortSkillFiles, Dt as SLACK_BOT_SCOPES, Q as actorIdSchema, T as skillReloadFileSchema, _t as configSchema, a as requestHashOf, bt as requiredSecretKeys, ct as successEnvelopeSchema, f as roleCanUseOperation, p as OPERATIONS, pt as DEFAULT_STAND_PORT_RANGE, r as remoteDoctorReportSchema, rt as ERRORS, u as SYSTEMD_SERVICE_SETTINGS, xt as resolveWebOrigin } from "./chunk-CkCVuwFY.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-B1Mpg_7f.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-CBZ5yyYo.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-DLPQMmSY.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-zj6P829U.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-B1Mpg_7f.mjs";
1
+ export { t as fetchCatalogVersion, n as fetchTokenStatus, r as requestOperation, i as requestSkillReload, a as requestTokenEnrollment } from "./chunk-DLPQMmSY.mjs";
package/dist/daemon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as encodeActorId, A as eventPayloadSchemas, At as isTodoGroupColumn, B as REVIEW_STATES, C as messageRefSchema, Ct as COLUMN_GROUPS, D as sortSkillFiles, Dt as SLACK_BOT_SCOPES, E as skillReloadFilesSchema, Et as ITEM_KINDS, F as prSourceId, G as prFactsSchema, H as SESSION_STATUSES, I as sessionTransitionSchema, J as sessionFactsSchema, K as prRefSchema, L as sourceCursorSchema, M as batchSchema, N as defaultBranchFactSchema, O as EVENT_KINDS, Ot as TASK_HOLDS, P as entityRefSchema, Q as actorIdSchema, R as trackerSourceId, S as interactionRefSchema, St as COLUMNS, Tt as DISPATCHER_MODES, U as isExternalAuthor, V as SESSION_HEALTH_STATES, W as parseRingMarker, X as JIRA_PROJECT_KEY, Y as ticketFactsSchema, Z as REF_NUMBER, _t as configSchema, a as requestHashOf, b as conversationRefSchema, bt as requiredSecretKeys, c as tokenRequestStatusSchema, ct as successEnvelopeSchema, d as buildCatalogSnapshot, et as errorCodeOf, f as roleCanUseOperation, ft as DEFAULT_SLACK_COMMAND, g as renderHttpProblem, gt as configBindings, h as turnHandedSchema, ht as boardWideSpurProject, i as TOKEN_REQUEST_LIMITS, it as err, j as AdapterError, k as GATE_REASONS, kt as VIAS, l as BOARD_TICK_MS, m as defaultBranchViewSchema, mt as RESERVED_PROJECT, n as doctorReportSchema, nt as parseRef$1, o as tokenRequestResultSchema, p as OPERATIONS, q as ringMarker, rt as ERRORS, s as tokenRequestSchema, st as ok, t as assertNever, tt as parseActorId, ut as DEFAULT_LINK, vt as defaultAddressee, w as userIdSchema, wt as COLUMN_IDS, x as inboundEventSchema, xt as resolveWebOrigin, y as SPACE_IDS, yt as plainHttpAllowed, z as PR_STATES } from "./chunk-CkMLCW2S.mjs";
1
+ import { $ as encodeActorId, A as eventPayloadSchemas, At as isTodoGroupColumn, B as REVIEW_STATES, C as messageRefSchema, Ct as COLUMN_GROUPS, D as sortSkillFiles, Dt as SLACK_BOT_SCOPES, E as skillReloadFilesSchema, Et as ITEM_KINDS, F as prSourceId, G as prFactsSchema, H as SESSION_STATUSES, I as sessionTransitionSchema, J as sessionFactsSchema, K as prRefSchema, L as sourceCursorSchema, M as batchSchema, N as defaultBranchFactSchema, O as EVENT_KINDS, Ot as TASK_HOLDS, P as entityRefSchema, Q as actorIdSchema, R as trackerSourceId, S as interactionRefSchema, St as COLUMNS, Tt as DISPATCHER_MODES, U as isExternalAuthor, V as SESSION_HEALTH_STATES, W as parseRingMarker, X as JIRA_PROJECT_KEY, Y as ticketFactsSchema, Z as REF_NUMBER, _t as configSchema, a as requestHashOf, b as conversationRefSchema, bt as requiredSecretKeys, c as tokenRequestStatusSchema, ct as successEnvelopeSchema, d as buildCatalogSnapshot, et as errorCodeOf, f as roleCanUseOperation, ft as DEFAULT_SLACK_COMMAND, g as renderHttpProblem, gt as configBindings, h as turnHandedSchema, ht as boardWideSpurProject, i as TOKEN_REQUEST_LIMITS, it as err, j as AdapterError, k as GATE_REASONS, kt as VIAS, l as BOARD_TICK_MS, m as defaultBranchViewSchema, mt as RESERVED_PROJECT, n as doctorReportSchema, nt as parseRef$1, o as tokenRequestResultSchema, p as OPERATIONS, q as ringMarker, rt as ERRORS, s as tokenRequestSchema, st as ok, t as assertNever, tt as parseActorId, ut as DEFAULT_LINK, vt as defaultAddressee, w as userIdSchema, wt as COLUMN_IDS, x as inboundEventSchema, xt as resolveWebOrigin, y as SPACE_IDS, yt as plainHttpAllowed, z as PR_STATES } from "./chunk-CkCVuwFY.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";
@@ -8419,6 +8419,9 @@ function emptyAllowed(entry) {
8419
8419
  if (entry.grants === "any" || entry.grants.some((rule) => rule.grant !== "operator")) throw new Error(`Taskless operation ${entry.id} must remain operator-only`);
8420
8420
  return true;
8421
8421
  }
8422
+ function operatorAckRefused(entry, actor, target) {
8423
+ return entry.id === "inbox.ack" && actor === "operator" && target.kind === "found" && target.id?.startsWith("T") !== true;
8424
+ }
8422
8425
  /** Parse, replay, authorize, then apply one catalog mutation in one transaction. */
8423
8426
  function createApply(deps) {
8424
8427
  const { store, clock, config } = deps;
@@ -8457,7 +8460,10 @@ function createApply(deps) {
8457
8460
  const ackMismatch = ackIds !== void 0 && (resolved.length !== ackIds.length || resolved.some((target, index) => target.id !== ackIds[index]));
8458
8461
  const targets = resolved.length === 0 ? [{ kind: "missing" }] : ackMismatch ? [...resolved, { kind: "missing" }] : resolved;
8459
8462
  for (const target of targets) {
8460
- const decision = authorize(entry.grants, actor, {
8463
+ const decision = operatorAckRefused(entry, actor, target) ? {
8464
+ status: "denied",
8465
+ hint: "The operator token acks only turns: board inbox ack T<number>."
8466
+ } : authorize(entry.grants, actor, {
8461
8467
  config,
8462
8468
  target,
8463
8469
  ...mode === void 0 ? {} : { mode }
@@ -10582,7 +10588,7 @@ async function ringTask(trx, notificationId, dedupeKey) {
10582
10588
  const owner = notificationId !== void 0 ? trx.selectFrom("notification").select("task_id").where("id", "=", notificationId) : trx.selectFrom("comment").select("task_id").where("id", "=", Number(commentId));
10583
10589
  return trx.selectFrom("task").selectAll().where("id", "in", owner).executeTakeFirst();
10584
10590
  }
10585
- /** Stop notifications acknowledged by the addressed session. */
10591
+ /** Stop notifications acknowledged by the addressed session, or by any actor on a `takeover`. */
10586
10592
  async function acknowledgeNotification(trx, input) {
10587
10593
  let query = trx.selectFrom("notification").selectAll().where("acked_at", "is", null);
10588
10594
  if (input.blockId !== void 0) query = query.where("block_id", "=", input.blockId).where("kind", "=", "block");
@@ -10592,7 +10598,7 @@ async function acknowledgeNotification(trx, input) {
10592
10598
  const notices = await query.orderBy("id", "desc").execute();
10593
10599
  const n = notices[0];
10594
10600
  if (n === void 0) return false;
10595
- if (!await notificationAddressedTo(trx, n, input.actor, input.config)) throw new CommandError("forbidden", "Only the addressed task role can acknowledge.");
10601
+ if (input.takeover !== true && !await notificationAddressedTo(trx, n, input.actor, input.config)) throw new CommandError("forbidden", "Only the addressed task role can acknowledge.");
10596
10602
  for (const notice of notices) {
10597
10603
  await trx.updateTable("notification").set({ acked_at: input.at.toISOString() }).where("id", "=", notice.id).execute();
10598
10604
  if (notice.rings === 0) await releaseAfterCourseNote(trx, notice, input.at);
@@ -11457,6 +11463,7 @@ function listenApiServer(app, port) {
11457
11463
  const handedSchema = z.array(turnHandedSchema);
11458
11464
  const turnItemKey = (turnId) => `turn:${String(turnId)}`;
11459
11465
  const turnRef = (turnId) => `T${String(turnId)}`;
11466
+ const taskProject = async (trx, id) => (await trx.selectFrom("task").select("project").where("id", "=", id).executeTakeFirstOrThrow()).project;
11460
11467
  /**
11461
11468
  * Who executes a column's turn: its orchestrator project, the operator, or for a column with
11462
11469
  * no orchestrator the live worker, else the operator.
@@ -11533,7 +11540,8 @@ async function openTurn(trx, input) {
11533
11540
  /**
11534
11541
  * Takes a turn for `actor`. False for a missing, closed, operator or taken worker turn. An
11535
11542
  * untaken turn needs its unread notification addressed to the actor; a taken orchestrator turn
11536
- * may be taken over by whoever its notification is now addressed to. Others get `forbidden`.
11543
+ * may be taken over by whoever its notification is now addressed to. An operator on the task's
11544
+ * project may take any open orchestrator turn, taken or not. Others get `forbidden`.
11537
11545
  * Every take starts a new ownership episode: an unsent reminder of an earlier one is acked, so
11538
11546
  * `ringStillCurrent` drops its ring.
11539
11547
  */
@@ -11541,15 +11549,16 @@ async function takeTurn(trx, input) {
11541
11549
  const { turnId, actor, at, config } = input;
11542
11550
  const turn = await trx.selectFrom("turn").selectAll().where("id", "=", turnId).executeTakeFirst();
11543
11551
  if (turn === void 0 || turn.closed_at !== null || turn.role === "operator") return false;
11552
+ const project = await taskProject(trx, turn.task_id);
11553
+ const orchestrated = parseAddressee(turn.role).kind === "orchestrator";
11554
+ const takeover = orchestrated && isOperator(actor, config, project);
11544
11555
  if (turn.acked_at === null) {
11545
11556
  if (!await acknowledgeNotification(trx, {
11546
- turnId,
11547
- actor,
11548
- at,
11549
- config
11557
+ ...input,
11558
+ takeover
11550
11559
  })) return false;
11551
- } else {
11552
- if (parseAddressee(turn.role).kind !== "orchestrator") return false;
11560
+ } else if (!orchestrated) return false;
11561
+ else if (!takeover) {
11553
11562
  const notice = await turnNotification(trx, turnId);
11554
11563
  if (notice === void 0 || !await notificationAddressedTo(trx, notice, actor, config)) throw new CommandError("forbidden", "Only the addressed task role can take this turn.");
11555
11564
  }
@@ -11558,7 +11567,7 @@ async function takeTurn(trx, input) {
11558
11567
  acked_at: at.toISOString()
11559
11568
  }).where("id", "=", turnId).execute();
11560
11569
  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();
11561
- await emit(trx, "turn_taken", (await trx.selectFrom("task").select("project").where("id", "=", turn.task_id).executeTakeFirstOrThrow()).project, turn.task_id, at.toISOString(), {
11570
+ await emit(trx, "turn_taken", project, turn.task_id, at.toISOString(), {
11562
11571
  turn: turnRef(turnId),
11563
11572
  taker: actor
11564
11573
  }, actor);
@@ -11566,21 +11575,23 @@ async function takeTurn(trx, input) {
11566
11575
  }
11567
11576
  /**
11568
11577
  * Closes every unclosed turn of a task: its rings stop and its items end as "condition ended".
11569
- * A ring already queued is dropped by the sender (`ringStillCurrent`).
11578
+ * A ring already queued is dropped by the sender (`ringStillCurrent`). `turn_closed` names
11579
+ * `actor` when given, else `system`.
11570
11580
  */
11571
11581
  async function closeTurns(trx, input) {
11572
- const { taskId, reason, at } = input;
11582
+ const { taskId, reason, at, actor } = input;
11573
11583
  const closed = await trx.updateTable("turn").set({
11574
11584
  closed_at: at.toISOString(),
11575
11585
  closed_reason: reason
11576
11586
  }).where("task_id", "=", taskId).where("closed_at", "is", null).returning("id").execute();
11577
11587
  if (closed.length === 0) return;
11578
- const task = await trx.selectFrom("task").select("project").where("id", "=", taskId).executeTakeFirstOrThrow();
11588
+ const project = await taskProject(trx, taskId);
11579
11589
  for (const { id } of closed) {
11580
- await emit(trx, "turn_closed", task.project, taskId, at.toISOString(), {
11590
+ const closedPayload = {
11581
11591
  turn: turnRef(id),
11582
11592
  outcome: reason
11583
- });
11593
+ };
11594
+ await emit(trx, "turn_closed", project, taskId, at.toISOString(), closedPayload, actor);
11584
11595
  await closeTurnNotification(trx, id, at);
11585
11596
  const item = await trx.selectFrom("operator_item").select("id").where("item_key", "=", turnItemKey(id)).where("cleared_at", "is", null).executeTakeFirst();
11586
11597
  if (item !== void 0) await clearItem(trx, item.id, at);
@@ -16513,13 +16524,13 @@ async function voidSubmits(trx, taskId, to, at) {
16513
16524
  /**
16514
16525
  * Moves a task left to `to` as a new visit: bumps `column_epoch` and `left_moves`, voids the
16515
16526
  * submits of `to` and right of it, closes its turns (`returned` for a `task.return` of `turn`,
16516
- * else `moved`) and journals `task_moved`. In `on` mode a counted return that reaches the
16527
+ * else `moved`, named on `turn_closed` as `closedBy` when given) and journals `task_moved`. In `on` mode a counted return that reaches the
16517
16528
  * column's cycle limit raises its cycle-limit block; otherwise one that reaches its course check
16518
16529
  * raises the course check. Either holds the task, and
16519
16530
  * `limitReached` tells the dispatcher to stop the cascade.
16520
16531
  */
16521
16532
  async function moveLeft(trx, input) {
16522
- const { task, to, at, actor, config, turn, block, reason, gate, findings } = input;
16533
+ const { task, to, at, actor, config, turn, block, reason, gate, findings, closedBy } = input;
16523
16534
  const moved = await trx.updateTable("task").set({
16524
16535
  column: to,
16525
16536
  column_epoch: task.column_epoch + 1,
@@ -16530,7 +16541,8 @@ async function moveLeft(trx, input) {
16530
16541
  await closeTurns(trx, {
16531
16542
  taskId: task.id,
16532
16543
  reason: turn === void 0 ? "moved" : "returned",
16533
- at
16544
+ at,
16545
+ actor: closedBy
16534
16546
  });
16535
16547
  await emit(trx, "task_moved", task.project, task.id, at.toISOString(), {
16536
16548
  from: task.column,
@@ -18059,6 +18071,8 @@ function createTurnMutations(deps) {
18059
18071
  });
18060
18072
  return taskById(trx, id);
18061
18073
  }
18074
+ /** The operator who closes a turn is named on `turn_closed`; any other closer stays `system`. */
18075
+ const operatorCloser = (task, actor) => isOperator(actor, config, task.project) ? actor : void 0;
18062
18076
  async function submitShadow(trx, input, ctx) {
18063
18077
  const task = await shadowTask(trx, input.turn, config);
18064
18078
  if (task === void 0) throw new CommandError("not_found", "Check the task key.");
@@ -18112,7 +18126,8 @@ function createTurnMutations(deps) {
18112
18126
  await closeTurns(trx, {
18113
18127
  taskId: task.id,
18114
18128
  reason: "submitted",
18115
- at: new Date(ctx.at)
18129
+ at: new Date(ctx.at),
18130
+ actor: operatorCloser(task, ctx.actor)
18116
18131
  });
18117
18132
  await emit(trx, "task_submitted", task.project, task.id, ctx.at, {
18118
18133
  turn: input.turn,
@@ -18145,7 +18160,8 @@ function createTurnMutations(deps) {
18145
18160
  config,
18146
18161
  turn: turnLabel(turn.id),
18147
18162
  block: `B${String(block.id)}`,
18148
- findings: input.findings
18163
+ findings: input.findings,
18164
+ closedBy: operatorCloser(task, ctx.actor)
18149
18165
  });
18150
18166
  const moved = await dispatched(trx, task.id, ctx.at, ctx.actor);
18151
18167
  return {
package/dist/mcp.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { p as OPERATIONS, rt as ERRORS, v as renderMcpError } from "./chunk-CkMLCW2S.mjs";
2
- import { o as CliError, r as requestOperation } from "./chunk-B1Mpg_7f.mjs";
3
- import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CBZ5yyYo.mjs";
1
+ import { p as OPERATIONS, rt as ERRORS, v as renderMcpError } from "./chunk-CkCVuwFY.mjs";
2
+ import { o as CliError, r as requestOperation } from "./chunk-DLPQMmSY.mjs";
3
+ import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-zj6P829U.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { z } from "zod";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.119.0",
3
+ "version": "0.120.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"
@@ -30,6 +30,9 @@ On `turn_closed`, act only on a turn `board inbox` lists. Shadow mode opens no t
30
30
  edges with no user-visible effect under PR Risk; still fix P0/P1 and user-visible findings.
31
31
  - Column orchestrator: ack, then keyed `board submit <turn> <sha>` for the reviewed head, or
32
32
  `board return <turn> <reason>` to send it to Dev with what to change. Never push.
33
+ - Operator (the operator token, or a session of a Spur project marked operator): keyed
34
+ `board inbox ack <entries>` with the T<number> from `board task <task>` takes over an open
35
+ orchestrator turn, taken or not; then submit or return it as above.
33
36
 
34
37
  ## Worker flow
35
38
 
@@ -46,7 +46,7 @@ Other errors: `wrong_id_kind`, `not_found`, `block_not_open`, `task_archived`, `
46
46
 
47
47
  ### `board submit`
48
48
 
49
- Purpose: Submit the task's pull request head for a turn this session took; the turn closes; a pending result is final.
49
+ Purpose: Submit the task's pull request head for a turn the caller took; the turn closes; a pending result is final.
50
50
  Arguments: `<turn>`, `<sha>`.
51
51
  Flags: `--basis <value>`, `--from <value>`, `--reason <value>`, `--key <key>`, `--json`.
52
52
  Use when: 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.
@@ -56,7 +56,7 @@ Other errors: `wrong_id_kind`, `not_found`, `turn_closed`, `not_turn_taker`, `su
56
56
 
57
57
  ### `board return`
58
58
 
59
- Purpose: Return the task of a turn this session took to Dev; the reason opens a worker code block.
59
+ Purpose: Return the task of a turn the caller took to Dev; the reason opens a worker code block.
60
60
  Arguments: `<turn>`, `<reason>`.
61
61
  Flags: `--findings <value>`, `--key <key>`, `--json`.
62
62
  Use when: Send the task back to Dev when the work needs code changes.
@@ -22,6 +22,9 @@ says what changed:
22
22
  | `block_*`, `comment_*`, `doorbell_*` | the ID with its addressee, outcome, revision or reason |
23
23
  | `turn_opened`, `turn_taken`, `turn_closed` | executor, taker, outcome |
24
24
 
25
+ `turn_closed` names the operator as actor when an operator's submit or return
26
+ closed the turn; every other close names `system`.
27
+
25
28
  Checks count the required ones, else all but skipped. A facts row leaves out what
26
29
  other rows say (head, checks, PR state, mergeability, reviews, ticket status) and
27
30
  update and activity times; with nothing else changed it is not shown.
@@ -45,6 +45,11 @@ act only on a current turn; reread after `turn_closed`.
45
45
  [Task history](how-board-works-history.md#task-history) lists journal events `turn_opened`,
46
46
  `turn_taken` and `turn_closed`: executor, taker, outcome.
47
47
 
48
+ An operator takes over an open orchestrator turn, taken or not, with keyed
49
+ `board inbox ack <entries>`, then submits or returns it. The earlier holder gets
50
+ `not_turn_taker`, then `turn_closed`. The takeover is not sticky: the addressed
51
+ orchestrator can ack the turn back.
52
+
48
53
  Open-turn executors in `needs_input`, `error`, `rate_limited` or `stopped` raise
49
54
  one question after `health.turnStallAfterMs` (default 600000): curator unless self, else
50
55
  operator. Time starts at the later turn/state start; taking never resets it.
@@ -58,7 +58,7 @@ Other errors: `not_found`.
58
58
  Purpose: Mark comments, agent-addressed blocks, turns or doorbell rings as read; acking a turn makes the caller its taker.
59
59
  Arguments: `<entries>`.
60
60
  Flags: `--key <key>`, `--json`.
61
- Use when: Mark handled inbox items or a ring ID like N18-1 read; an item handled before comes back under alreadyHandled.
61
+ Use when: 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.
62
62
  Avoid when: Use `board inbox` to inspect them first.
63
63
  Example: `board inbox ack C3@1 --key inbox-ack-PROJ-123-comment-revision-1432` — Acknowledge a comment revision.
64
64
  Other errors: `wrong_id_kind`, `not_found`, `stale_comment_revision`, `idempotency_key_mismatch`.