spur-board 0.119.0 → 0.121.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.
@@ -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-w6KrYs3j.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-w6KrYs3j.mjs";
2
+ import { o as CliError, t as fetchCatalogVersion } from "./chunk-DS95rV33.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";
@@ -108,6 +108,17 @@ function isTodoGroupColumn(column) {
108
108
  }
109
109
  /** Columns every project board has, enabled. */
110
110
  const REQUIRED_COLUMN_IDS = COLUMNS.filter((column) => column.required).map((column) => column.id);
111
+ /**
112
+ * The columns `projects[].checksGate` may name: running or missing checks hold a task only at the
113
+ * exit of that column. Each is left of qa and ready-to-merge, so a task never reaches them without
114
+ * green checks.
115
+ */
116
+ const CHECKS_GATE_COLUMNS = [
117
+ "dev",
118
+ "review",
119
+ "product-review",
120
+ "external-review"
121
+ ];
111
122
  /** Where a column's effective orchestrator comes from: its own column entry or top-level `spurProjects`. */
112
123
  const COLUMN_BINDING_SOURCES = ["project", "board-wide"];
113
124
  /**
@@ -202,6 +213,7 @@ const GATE_CONDITIONS = [
202
213
  "pr_open",
203
214
  "not_draft",
204
215
  "checks_green",
216
+ "checks_not_red",
205
217
  "no_conflict",
206
218
  "external_comments_handled",
207
219
  "comment_history_read",
@@ -492,6 +504,7 @@ const projectSchema = z.strictObject({
492
504
  tracker: z.discriminatedUnion("type", [jiraTracker, githubIssuesTracker]),
493
505
  repos: z.array(repoSlugSchema.describe("A repository as owner/name.")).min(1).describe("GitHub repositories as owner/name whose PRs the board polls for this project, one source each. A done task is archived only after every listed repository has a complete poll since its last change."),
494
506
  reposWithoutCi: z.array(repoSlugSchema.describe("A repository from repos as owner/name, in any letter case.")).default([]).describe("Repos from repos that run no CI checks, in any letter case. In a listed repo, a PR whose check list on head is empty passes the Dev gate check condition instead of waiting in Dev. A list of only skipped checks still waits, and red or pending checks still count. A listed repo whose branch protection requires checks that have not reported yet also passes, so list only repos that run no checks. Without this key, a PR with no checks waits in Dev."),
507
+ checksGate: z.enum(CHECKS_GATE_COLUMNS, { error: (issue) => typeof issue.input === "string" ? `checksGate ${JSON.stringify(issue.input)} is not allowed: use one of ${CHECKS_GATE_COLUMNS.join(", ")}` : `checksGate must be one of ${CHECKS_GATE_COLUMNS.join(", ")}` }).default("dev").describe("The column whose exit requires green checks on the PR head: dev (the default), review, product-review or external-review, and the column must be enabled. Running checks, or no checks yet, hold a task only at the exit of this column. Red checks return the task to Dev from any column; a task whose turn is taken returns right after that turn's submit. A task enters ready-to-merge only with green checks. With dev, a cancelled check is red at once. With another column, a cancelled check counts as running until two complete GitHub polls after the one that saw it, about two GitHub poll intervals, and then counts as red; a new run in that window replaces it, and a source whose polls stay incomplete keeps it running. The daemon reads the key at start, so a change takes effect after a restart."),
495
508
  link: z.strictObject({
496
509
  sources: z.array(z.enum(LINK_SOURCES).describe("One place a PR can name its task: closing, branch or title.")).min(1).superRefine((sources, ctx) => {
497
510
  sources.forEach((source, i) => {
@@ -540,6 +553,11 @@ const projectSchema = z.strictObject({
540
553
  message: `Repository ${JSON.stringify(repo)} is not in repos`
541
554
  });
542
555
  });
556
+ if (!project.columns.some((column) => column.id === project.checksGate && column.enabled)) ctx.addIssue({
557
+ code: "custom",
558
+ path: ["checksGate"],
559
+ message: `checksGate ${JSON.stringify(project.checksGate)} names a column that is absent or disabled: use one of ${CHECKS_GATE_COLUMNS.join(", ")} whose column is enabled`
560
+ });
543
561
  const spurNames = new Set(project.spurProjects.filter((p) => p.role === "orchestrator" || p.role === "curator").map((p) => p.name));
544
562
  project.columns.forEach(({ orchestrator }, j) => {
545
563
  if (orchestrator === "none" || orchestrator === "operator" || spurNames.has(orchestrator)) return;
@@ -2819,10 +2837,10 @@ const taskWhySchema = z.strictObject({
2819
2837
  turn: turnViewSchema.nullable().describe("The open turn of the task; null when none is open."),
2820
2838
  moves: z.array(moveViewSchema).describe("The last 5 column moves, oldest first."),
2821
2839
  waiting: z.array(z.strictObject({
2822
- reason: z.enum(GATE_REASONS).describe("The gate reason that waits on the fact."),
2840
+ reason: z.enum(GATE_REASONS).describe("The gate reason that waits on the fact; checks_red only when the project checksGate is not dev."),
2823
2841
  head: commitShaSchema.describe("Head commit of the pull request the fact is about."),
2824
- text: z.string().describe("The fact in one line, e.g. waiting for CI on <sha>.")
2825
- }).describe("One fact the task waits for.")).min(1).optional().describe("Facts the task waits for that GitHub has not settled yet; absent when none.")
2842
+ text: z.string().describe("The fact in one line, e.g. waiting for CI on <sha>. When the project checksGate is not dev, checks_pending reads checks running, exit from <checksGate> waits for green, and checks_red reads checks red.")
2843
+ }).describe("One fact the task waits for.")).min(1).optional().describe("Facts the task waits for that GitHub has not settled yet, plus red checks the task returns to Dev on when the project checksGate is not dev; absent when none.")
2826
2844
  }).describe("Why the task is in its column and what the dispatcher waits for.");
2827
2845
  const itemViewSchema = z.strictObject({
2828
2846
  id: itemIdSchema,
@@ -2999,7 +3017,8 @@ const configViewSchema = z.strictObject({
2999
3017
  role: configSchema.shape.projects.element.shape.spurProjects.unwrap().element.shape.role,
3000
3018
  displayName: z.string().min(1).describe("Configured display name, falling back to project name.")
3001
3019
  })).describe("Effective Spur project bindings."),
3002
- ticketBrowseBase: z.url({ protocol: /^https?$/ }).nullable().describe("Ticket page prefix; append a task key such as PROJ-12. <baseUrl>/browse/ for a Jira project; null when the tracker has none, as for GitHub Issues.")
3020
+ ticketBrowseBase: z.url({ protocol: /^https?$/ }).nullable().describe("Ticket page prefix; append a task key such as PROJ-12. <baseUrl>/browse/ for a Jira project; null when the tracker has none, as for GitHub Issues."),
3021
+ checksGate: z.enum(CHECKS_GATE_COLUMNS).describe("The column whose exit waits for green checks, as the running daemon read it at start; dev when not configured.")
3003
3022
  })).describe("Effective projects visible to this caller."),
3004
3023
  web: z.strictObject({
3005
3024
  publicOrigin: z.url({ protocol: /^https?$/ }).nullable().describe("Origin the board web listener answers on; null when the listener is off or not bound yet."),
@@ -3937,7 +3956,7 @@ const OPERATIONS = [
3937
3956
  kind: "mutation",
3938
3957
  description: "Mark comments, agent-addressed blocks, turns or doorbell rings as read; acking a turn makes the caller its taker.",
3939
3958
  mcp: {
3940
- whenToUse: "Mark handled inbox items or a ring ID like N18-1 read; an item handled before comes back under alreadyHandled.",
3959
+ 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
3960
  whenNotToUse: "Use inbox_get to inspect them first."
3942
3961
  },
3943
3962
  input: z.strictObject({ entries: z.array(z.union([
@@ -3963,7 +3982,7 @@ const OPERATIONS = [
3963
3982
  ringIdSchema
3964
3983
  ])).optional().describe("Entries that were already handled; nothing new was acknowledged for them.")
3965
3984
  }),
3966
- grants: [{ grant: "project-agent" }],
3985
+ grants: [{ grant: "project-agent" }, { grant: "operator" }],
3967
3986
  errors: [
3968
3987
  "wrong_id_kind",
3969
3988
  "not_found",
@@ -4726,7 +4745,7 @@ const OPERATIONS = [
4726
4745
  defineOperation({
4727
4746
  id: "task.submit",
4728
4747
  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.",
4748
+ description: "Submit the task's pull request head for a turn the caller took; the turn closes; a pending result is final.",
4730
4749
  mcp: {
4731
4750
  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
4751
  whenNotToUse: "Use task_return to send the task back to Dev instead."
@@ -4744,7 +4763,11 @@ const OPERATIONS = [
4744
4763
  sha: commitShaSchema.describe("The submitted commit SHA."),
4745
4764
  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
4765
  }),
4747
- grants: [{ grant: "task-worker" }, { grant: "column-orchestrator" }],
4766
+ grants: [
4767
+ { grant: "task-worker" },
4768
+ { grant: "column-orchestrator" },
4769
+ { grant: "operator" }
4770
+ ],
4748
4771
  errors: [
4749
4772
  "wrong_id_kind",
4750
4773
  "not_found",
@@ -4831,7 +4854,7 @@ const OPERATIONS = [
4831
4854
  defineOperation({
4832
4855
  id: "task.return",
4833
4856
  kind: "mutation",
4834
- description: "Return the task of a turn this session took to Dev; the reason opens a worker code block.",
4857
+ description: "Return the task of a turn the caller took to Dev; the reason opens a worker code block.",
4835
4858
  mcp: {
4836
4859
  whenToUse: "Send the task back to Dev when the work needs code changes.",
4837
4860
  whenNotToUse: "Use task_submit to hand in the work instead."
@@ -4845,7 +4868,11 @@ const OPERATIONS = [
4845
4868
  task: taskViewSchema,
4846
4869
  block: blockViewSchema
4847
4870
  }),
4848
- grants: [{ grant: "task-worker" }, { grant: "column-orchestrator" }],
4871
+ grants: [
4872
+ { grant: "task-worker" },
4873
+ { grant: "column-orchestrator" },
4874
+ { grant: "operator" }
4875
+ ],
4849
4876
  errors: [
4850
4877
  "wrong_id_kind",
4851
4878
  "not_found",
@@ -5008,7 +5035,8 @@ const OPERATIONS = [
5008
5035
  role: "worker",
5009
5036
  displayName: "web-worker"
5010
5037
  }],
5011
- ticketBrowseBase: "https://jira.example.com/browse/"
5038
+ ticketBrowseBase: "https://jira.example.com/browse/",
5039
+ checksGate: "dev"
5012
5040
  }],
5013
5041
  web: {
5014
5042
  publicOrigin: "http://127.0.0.1:4778",
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-w6KrYs3j.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-DS95rV33.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-DywuekMO.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";
@@ -921,6 +921,10 @@ async function runDoctor(options = {}) {
921
921
  const range = config.stand.portRange ?? DEFAULT_STAND_PORT_RANGE;
922
922
  const overlaps = [["http.port", config.http.port], ["web.port", config.web.port]].filter(([, port]) => port !== void 0 && port >= range.min && port <= range.max).map(([field, port]) => `${field} ${String(port)}`);
923
923
  checks.push(overlaps.length === 0 ? result("stand.port_range", true, "") : warning("stand.port_range", `Implicit stand port range ${String(range.min)}..${String(range.max)} overlaps ${overlaps.join(", ")}. Set a nonoverlapping stand.portRange. The stand refuses the overlapping ports.`));
924
+ checks.push({
925
+ ...result("projects.checksGate", true, ""),
926
+ present: config.projects.map((project) => `${project.id}=${project.checksGate}`)
927
+ });
924
928
  if (options.offline) return checks;
925
929
  const unitPath = unitFile(env, home);
926
930
  let unit = null;
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-DS95rV33.mjs";