benignswarm 0.12.74 → 0.12.75

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/args.js CHANGED
@@ -3,7 +3,7 @@ import { CliError } from "./errors.js";
3
3
  // These options accept comma-separated collections, so repeating them should
4
4
  // append another collection instead of discarding earlier values.
5
5
  export const LIST_FLAGS = ["tags", "projects", "evidence", "statuses", "depends-on", "units", "waits-on", "needs", "exclude", "remove", "post", "harness", "variant"];
6
- export const STRING_FLAGS = ["as", "admin", "key", "url", "label", "model", "since", "limit", "after", "topic", "goal", "task", "state", "blocked-on", "tags", "custom", "vendor", "role", "description", "permissions", "cardinality", "machine", "dir", "confirm", "type", "name", "out", "token", "prefix", "uses", "expires-hours", "skill-dir", "harness", "reply-to", "event", "project", "projects", "post", "title", "body", "body-file", "handoff-to", "evidence", "agent", "parent", "parent-item", "channel", "statuses", "assign", "if-status", "status", "exec", "interval", "requeue-after", "unacked-after", "category", "command", "follow-delay", "env", "scope", "pr", "note", "add", "remove", "merged", "tag", "activity", "max-unanswered", "to", "replay-of", "branch", "effort", "by", "target", "milestone", "file", "exit", "depends-on", "source", "by", "on", "question", "ruling", "gaps", "unit", "units", "blocks", "sla", "takeover", "max-open", "max-in-progress", "require-scope", "require-evidence", "default-approver", "merged-by", "integrator-role", "require-rebased", "require-merge-commit", "require-pushed", "quiet", "summary", "meaning", "expert-role", "reviews", "works", "trials", "email", "repeat", "summary-minutes", "churn", "unmet", "require-cited-changes", "checks-every", "propose", "waits-on", "sandbox", "thread", "turn-timeout", "session", "plain", "if-yes", "if-no", "ssh", "variant", "count", "needs", "min-ram", "exclude", "carry", "from", "to-ssh", "wait", "writable", "for", "until", "reason", "at"];
6
+ export const STRING_FLAGS = ["as", "admin", "key", "url", "label", "model", "since", "limit", "after", "topic", "goal", "task", "state", "blocked-on", "tags", "custom", "vendor", "role", "description", "permissions", "cardinality", "machine", "dir", "confirm", "type", "name", "out", "token", "prefix", "uses", "expires-hours", "skill-dir", "harness", "reply-to", "event", "project", "projects", "post", "title", "body", "body-file", "handoff-to", "evidence", "agent", "parent", "parent-item", "channel", "statuses", "assign", "if-status", "status", "exec", "interval", "requeue-after", "unacked-after", "category", "command", "follow-delay", "env", "scope", "pr", "note", "add", "remove", "merged", "tag", "activity", "max-unanswered", "to", "replay-of", "branch", "effort", "by", "target", "milestone", "file", "exit", "depends-on", "source", "by", "on", "question", "ruling", "gaps", "unit", "units", "blocks", "sla", "takeover", "max-open", "max-in-progress", "require-scope", "require-evidence", "default-approver", "merged-by", "integrator-role", "require-rebased", "require-merge-commit", "require-pushed", "quiet", "summary", "meaning", "expert-role", "reviews", "works", "trials", "email", "repeat", "summary-minutes", "churn", "unmet", "require-cited-changes", "checks-every", "propose", "waits-on", "sandbox", "thread", "turn-timeout", "session", "plain", "if-yes", "if-no", "ssh", "variant", "count", "needs", "min-ram", "exclude", "carry", "from", "to-ssh", "wait", "writable", "for", "until", "reason", "at", "priority"];
7
7
  export const BOOL_FLAGS = ["latest", "no-restart", "json", "follow", "account", "help", "version", "broadcast", "create-channels", "read-account-status", "replace-key", "mentions-me", "no-skill", "replace", "unread", "force", "no-hooks", "yes", "open", "bind-here", "peek", "once", "launchd", "full", "no-bind", "all", "here", "keep-worktree", "prune", "abandon", "defer", "hold", "clear", "met", "shared", "archive", "approve", "turn", "service", "print-hooks", "create", "rotate", "codex-userns", "bwrap-userns", "print-apparmor", "cancel"];
8
8
  export function parse(argv) {
9
9
  const options = {};
@@ -538,7 +538,7 @@ export async function milestones(p, out) {
538
538
  */
539
539
  export async function milestonesWith(client, project, sub, p, out) {
540
540
  if (sub === "export") {
541
- const list = (await client.call("GET", `/projects/${project}/milestones`)).milestones.map((m) => ({ key: m.key, title: m.title, exit: m.exit, ...(m.source ? { source: m.source } : {}), depends_on: m.depends_on }));
541
+ const list = (await client.call("GET", `/projects/${project}/milestones`)).milestones.map((m) => ({ key: m.key, title: m.title, exit: m.exit, ...(m.source ? { source: m.source } : {}), depends_on: m.depends_on, ...(m.priority !== null && m.priority !== undefined ? { priority: m.priority } : {}) }));
542
542
  const text = JSON.stringify(list, null, 2) + "\n";
543
543
  const file = str(p.flags, "out");
544
544
  if (file) {
@@ -566,8 +566,8 @@ export async function milestonesWith(client, project, sub, p, out) {
566
566
  return;
567
567
  }
568
568
  const r = await client.call("GET", `/projects/${project}/milestones`);
569
- const rows = r.milestones.map((m) => ({ key: m.key, status: m.status === "open" ? (m.ready ? "ready" : `waits on ${m.waiting_on.join(",")}`) : m.status, units: `${m.units.done}/${m.units.total}${m.units.queued ? ` (+${m.units.queued} queued)` : ""}`, "depends on": m.depends_on.join(",") || "-", title: m.title.slice(0, 50) }));
570
- out.print(rows.length ? `${table(rows, ["key", "status", "units", "depends on", "title"])}\nbschat milestone show <key> for the exit criterion; wu open/assign --milestone <key> puts a unit on one.` : "(no milestones defined; the operator defines them on the Process page or with bschat-admin milestones <project> set --file plan.json, an assigner with bschat milestones set --file plan.json)", r);
569
+ const rows = r.milestones.map((m) => ({ key: m.key, priority: m.priority ?? "-", status: m.status === "open" ? (m.ready ? "ready" : `waits on ${m.waiting_on.join(",")}`) : m.status, units: `${m.units.done}/${m.units.total}${m.units.queued ? ` (+${m.units.queued} queued)` : ""}`, "depends on": m.depends_on.join(",") || "-", title: m.title.slice(0, 50) }));
570
+ out.print(rows.length ? `${table(rows, ["key", "priority", "status", "units", "depends on", "title"])}\nbschat milestone show <key> for the exit criterion; wu open/assign --milestone <key> puts a unit on one.` : "(no milestones defined; the operator defines them on the Process page or with bschat-admin milestones <project> set --file plan.json, an assigner with bschat milestones set --file plan.json)", r);
571
571
  }
572
572
  /** milestone show <key> | milestone close <key> --note ".." [--evidence a,b] [--abandon | --defer] | milestone reopen <key> */
573
573
  export async function milestone(p, out) {
@@ -583,6 +583,9 @@ export async function milestone(p, out) {
583
583
  export async function milestoneWith(client, project, sub, key, p, out) {
584
584
  if (!key)
585
585
  throw new CliError("usage", 'milestone show <key> | milestone close <key> --note "how the exit criterion was met" [--evidence id,id] [--abandon | --defer] | milestone reopen <key>');
586
+ // "set" is "edit" (bschat milestone set <key> --priority 5): one slice changed, the rest untouched.
587
+ if (sub === "set")
588
+ sub = "edit";
586
589
  if (sub === "add" || sub === "edit") {
587
590
  // One slice in, the rest untouched: fetch the list, add or amend the entry, set it back.
588
591
  const cur = (await client.call("GET", `/projects/${project}/milestones`)).milestones;
@@ -593,15 +596,20 @@ export async function milestoneWith(client, project, sub, key, p, out) {
593
596
  throw new CliError("not_found", `no milestone ${key}; use milestone add ${key} --title "..."`);
594
597
  const title = str(p.flags, "title") ?? existing?.title;
595
598
  if (!title)
596
- throw new CliError("usage", 'milestone add <key> --title "..." [--exit "what done means"] [--source "docs/plan.md#section"] [--depends-on a,b] (no exit and no dependencies = a container for ongoing work)');
599
+ throw new CliError("usage", 'milestone add <key> --title "..." [--exit "what done means"] [--source "docs/plan.md#section"] [--depends-on a,b] [--priority n|none] (no exit and no dependencies = a container for ongoing work)');
597
600
  const deps = str(p.flags, "depends-on") !== undefined ? (str(p.flags, "depends-on") ?? "").split(",").map((s) => s.trim()).filter(Boolean) : existing?.depends_on ?? [];
598
601
  const exit = str(p.flags, "exit") ?? existing?.exit ?? "";
599
602
  const source = str(p.flags, "source") ?? existing?.source ?? "";
600
- const next = cur.map((m) => ({ key: m.key, title: m.title, exit: m.exit, source: m.source ?? "", depends_on: m.depends_on }));
603
+ // --priority <n> (higher first) or none; the steward asks for units only on the highest-priority ready slices.
604
+ const pr = str(p.flags, "priority");
605
+ if (pr !== undefined && pr !== "none" && !/^-?\d+$/.test(pr))
606
+ throw new CliError("usage", "--priority takes a whole number (higher first) or none");
607
+ const priority = pr === undefined ? existing?.priority ?? null : pr === "none" ? null : Number(pr);
608
+ const next = cur.map((m) => ({ key: m.key, title: m.title, exit: m.exit, source: m.source ?? "", depends_on: m.depends_on, priority: m.priority ?? null }));
601
609
  if (existing)
602
- Object.assign(next.find((m) => m.key === key), { title, exit, source, depends_on: deps });
610
+ Object.assign(next.find((m) => m.key === key), { title, exit, source, depends_on: deps, priority });
603
611
  else
604
- next.push({ key, title, exit, source, depends_on: deps });
612
+ next.push({ key, title, exit, source, depends_on: deps, priority });
605
613
  const r = await client.call("PUT", `/projects/${project}/milestones`, { milestones: next });
606
614
  const m = r.milestones.find((x) => x.key === key);
607
615
  out.print(`${sub === "add" ? "Added" : "Updated"} milestone ${m.key}: ${m.title} [${m.ready ? "ready" : `waits on ${m.waiting_on.join(", ")}`}]${!m.exit && !m.depends_on.length ? " (container: never chased)" : ""}`, r);
@@ -611,7 +619,7 @@ export async function milestoneWith(client, project, sub, key, p, out) {
611
619
  const m = (await client.call("GET", `/projects/${project}/milestones`)).milestones.find((x) => x.key === key);
612
620
  if (!m)
613
621
  throw new CliError("not_found", `no milestone ${key}`);
614
- out.print(`${m.key}: ${m.title} [${m.status}${m.status === "open" && !m.ready ? `, waits on ${m.waiting_on.join(", ")}` : ""}]\n depends on: ${m.depends_on.join(", ") || "-"}\n units: ${m.units.done} done, ${m.units.open} open, ${m.units.queued} queued of ${m.units.total}${m.review ? `\n closure review: ${m.review.reviewer_name} (${m.review.source}) since ${m.review.requested_at}` : ""}${m.last_verdict && !m.last_verdict.met ? `\n gaps (${m.last_verdict.by}, ${m.last_verdict.at.slice(0, 16)}): ${m.last_verdict.gaps}` : ""}\n exit: ${m.exit || "(not written)"}${m.source ? `\n source: ${m.source} (the full brief; read it when planning this slice)` : ""}${m.closed_at ? `\n closed ${m.closed_at} by ${m.closed_by}: ${m.closed_note}${m.evidence.length ? ` (${m.evidence.map((e) => `evidence:${e}`).join(" ")})` : ""}` : ""}`, m);
622
+ out.print(`${m.key}: ${m.title} [${m.status}${m.status === "open" && !m.ready ? `, waits on ${m.waiting_on.join(", ")}` : ""}]${m.priority !== null && m.priority !== undefined ? `\n priority: ${m.priority}` : ""}\n depends on: ${m.depends_on.join(", ") || "-"}\n units: ${m.units.done} done, ${m.units.open} open, ${m.units.queued} queued of ${m.units.total}${m.review ? `\n closure review: ${m.review.reviewer_name} (${m.review.source}) since ${m.review.requested_at}` : ""}${m.last_verdict && !m.last_verdict.met ? `\n gaps (${m.last_verdict.by}, ${m.last_verdict.at.slice(0, 16)}): ${m.last_verdict.gaps}` : ""}\n exit: ${m.exit || "(not written)"}${m.source ? `\n source: ${m.source} (the full brief; read it when planning this slice)` : ""}${m.closed_at ? `\n closed ${m.closed_at} by ${m.closed_by}: ${m.closed_note}${m.evidence.length ? ` (${m.evidence.map((e) => `evidence:${e}`).join(" ")})` : ""}` : ""}`, m);
615
623
  return;
616
624
  }
617
625
  if (sub === "close") {
package/dist/help.js CHANGED
@@ -54,9 +54,9 @@ Agent commands
54
54
  bschat milestones the plan's slices: ready or waiting on which, units done/total; wu open|assign --milestone <key>
55
55
  bschat milestones set --file plan.json define or replace the plan (assigner roles or the operator): a JSON list of
56
56
  {key, title, exit, depends_on}; existing keys keep their status; cycles are refused
57
- bschat milestone add <key> --title ".." [--exit ".."] [--source "docs/plan.md#b0"] [--depends-on a,b] add one slice (assigner
57
+ bschat milestone add <key> --title ".." [--exit ".."] [--source "docs/plan.md#b0"] [--depends-on a,b] [--priority n] add one slice (assigner
58
58
  roles or the operator); --source is where the full brief lives, read only when planning the slice;
59
- no exit and no dependencies makes a container for ongoing work; milestone edit <key> amends
59
+ no exit and no dependencies makes a container for ongoing work; milestone edit (or set) <key> amends
60
60
  bschat milestone show <key> exit criterion, dependencies, counts; wu milestone <n> <key|none> moves a unit
61
61
  bschat milestone close <key> --note ".." [--evidence a,b] [--abandon | --defer] the lead closes a slice against its exit criterion
62
62
  bschat milestone verdict <key> --met --note ".." [--evidence a,b] | --gaps ".." [--units n,m] the closure reviewer judges the exit against the evidence; gap units re-trigger the review when they close
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.12.74";
1
+ export const CLI_VERSION = "0.12.75";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.12.74",
3
+ "version": "0.12.75",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {