benignswarm 0.12.25 → 0.12.26

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
@@ -1,6 +1,6 @@
1
1
  import { parseArgs } from "node:util";
2
2
  import { CliError } from "./errors.js";
3
- 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", "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"];
3
+ 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", "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"];
4
4
  export const BOOL_FLAGS = ["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", "hold", "clear", "met", "shared"];
5
5
  export function parse(argv) {
6
6
  const options = {};
@@ -187,6 +187,7 @@ export async function hook(p) {
187
187
  me.role ? `Your role: ${me.role.name}. ${me.role.description}` : `You hold no role in ${me.project?.name ?? "this project"}.`,
188
188
  `Process v${proc.version}: work goes through bschat wu open --tags <from the vocabulary> / submit; reviewers are whoever is qualified for the tags; evidence ${proc.definition.require_evidence_to_submit ? "required" : "optional"} before review; max ${proc.definition.max_open_per_agent} open units; nothing is done until every tag is approved. Details: bschat process.`,
189
189
  proc.agreements ? `Working agreements:\n${proc.agreements}` : null,
190
+ proc.charter ? `Charter (how this project weighs its trade-offs):\n${proc.charter}` : null,
190
191
  ].filter(Boolean);
191
192
  standing = lines.join("\n");
192
193
  if (creds.project && proc.version > 0)
@@ -80,6 +80,9 @@ export function definitionPatch(p, cur) {
80
80
  const ev = yesNo(str(p.flags, "require-evidence"), "require-evidence");
81
81
  if (ev !== undefined)
82
82
  d.require_evidence_to_submit = ev;
83
+ const cite = yesNo(str(p.flags, "require-cited-changes"), "require-cited-changes");
84
+ if (cite !== undefined)
85
+ d.require_cited_changes = cite;
83
86
  const appr = str(p.flags, "default-approver");
84
87
  if (appr !== undefined)
85
88
  d.default_approver_role = appr === "none" || appr === "" ? null : appr;
@@ -107,6 +110,9 @@ export function definitionPatch(p, cur) {
107
110
  const summ = intFlag(str(p.flags, "summary"), "summary");
108
111
  if (summ !== undefined)
109
112
  steward.summary_minutes = summ;
113
+ const churn = intFlag(str(p.flags, "churn"), "churn");
114
+ if (churn !== undefined)
115
+ steward.churn_rounds = churn;
110
116
  if (Object.keys(steward).length)
111
117
  d.steward = { ...cur.steward, ...steward };
112
118
  return d;
@@ -120,8 +126,8 @@ function describeProcess(r) {
120
126
  ` timing: review SLA ${d.review_sla_minutes} min, takeover ${d.escalate_after_minutes} min, ${d.max_open_per_agent} open / ${d.max_in_progress_per_agent} in progress per agent`,
121
127
  ` requires: scope ${d.require_scope ? "yes" : "no"}, evidence to submit ${d.require_evidence_to_submit ? "yes" : "no"}; default approver ${d.default_approver_role ?? "none"}; assigners ${d.assigners.join(", ") || "none"}`,
122
128
  ` merging: into ${m.target_branch} by ${m.merged_by === "integrator" ? `a ${m.integrator_role}` : `the ${m.merged_by}`}; merge commit ${m.require_merge_commit ? "yes" : "no"}, rebased ${m.require_rebased ? "yes" : "no"}, pushed ${m.require_pushed ? "yes" : "no"}`,
123
- ` steward: ${d.steward.enabled ? "on" : "off"}, quiet ${d.steward.quiet_minutes} min, summary every ${d.steward.summary_minutes} min`,
124
- ` agreements: ${r.process.agreements.length} of 8000 characters`,
129
+ ` steward: ${d.steward.enabled ? "on" : "off"}, quiet ${d.steward.quiet_minutes} min, summary every ${d.steward.summary_minutes} min, ask the operator after ${d.steward.churn_rounds ? `${d.steward.churn_rounds} rounds on one goal` : "(never)"}`,
130
+ ` agreements: ${r.process.agreements.length} of 8000 characters; charter: ${(r.process.charter ?? "").length ? `${r.process.charter.length} of 4000 characters` : "none (bschat-admin process charter <project> --file charter.md)"}; send-backs ${d.require_cited_changes === false ? "free-form" : "must cite the clause they fail"}`,
125
131
  v.length ? `Tags:` : `No tag vocabulary: every unit goes to the default approver.`,
126
132
  ...v.map((t) => ` #${t.name}: ${t.meaning || "(NO MEANING: workers cannot decide by it)"}${t.require_evidence ? " · evidence" : ""}${t.require_rebased ? " · rebased" : ""}${t.expert_role ? ` · expert ${t.expert_role}` : ""}`),
127
133
  ].join("\n");
@@ -130,7 +136,7 @@ export async function processAdmin(action, rest, p, out) {
130
136
  const c = adminClient(p);
131
137
  const proj = rest[0];
132
138
  if (!proj && action !== undefined)
133
- throw new CliError("usage", "admin process <show|export|set|tag|timing|merge|assigners|agreements|steward> <project> ...");
139
+ throw new CliError("usage", "admin process <show|export|set|tag|timing|merge|assigners|agreements|charter|steward> <project> ...");
134
140
  const base = `/projects/${proj}/process`;
135
141
  const get = () => c.call("GET", base);
136
142
  const publish = async (body, what) => {
@@ -145,7 +151,7 @@ export async function processAdmin(action, rest, p, out) {
145
151
  }
146
152
  case "export": {
147
153
  const r = await get();
148
- const doc = { definition: r.process.definition, vocabulary: r.vocabulary, agreements: r.process.agreements };
154
+ const doc = { definition: r.process.definition, vocabulary: r.vocabulary, agreements: r.process.agreements, charter: r.process.charter ?? "" };
149
155
  const file = str(p.flags, "out");
150
156
  const text = JSON.stringify(doc, null, 2) + "\n";
151
157
  if (file) {
@@ -169,9 +175,9 @@ export async function processAdmin(action, rest, p, out) {
169
175
  }
170
176
  if (!doc || typeof doc !== "object" || Array.isArray(doc))
171
177
  throw new CliError("bad_file", `${file} must hold an object with definition, vocabulary and/or agreements`);
172
- const unknown = Object.keys(doc).filter((k) => !["definition", "vocabulary", "agreements"].includes(k));
178
+ const unknown = Object.keys(doc).filter((k) => !["definition", "vocabulary", "agreements", "charter"].includes(k));
173
179
  if (unknown.length)
174
- throw new CliError("bad_file", `${file}: unknown keys ${unknown.join(", ")}; expected definition, vocabulary, agreements`);
180
+ throw new CliError("bad_file", `${file}: unknown keys ${unknown.join(", ")}; expected definition, vocabulary, agreements, charter`);
175
181
  return publish(doc, `from ${file}`);
176
182
  }
177
183
  case "tag": {
@@ -204,12 +210,18 @@ export async function processAdmin(action, rest, p, out) {
204
210
  throw new CliError("usage", "admin process agreements <project> --file agreements.md (at most 8000 characters; agents re-read it after every compaction)");
205
211
  return publish({ agreements: readFileSync(file, "utf8") }, "working agreements");
206
212
  }
213
+ case "charter": {
214
+ const file = str(p.flags, "file");
215
+ if (!file)
216
+ throw new CliError("usage", "admin process charter <project> --file charter.md (at most 4000 characters: how the project weighs its trade-offs; sent with every expert question)");
217
+ return publish({ charter: readFileSync(file, "utf8") }, "charter");
218
+ }
207
219
  case "steward": {
208
220
  const sw = rest[1];
209
221
  const cur = await get();
210
222
  const patch = definitionPatch(p, cur.process.definition);
211
223
  if (sw !== "on" && sw !== "off" && !Object.keys(patch).length)
212
- throw new CliError("usage", "admin process steward <project> on|off [--quiet m] [--summary m]");
224
+ throw new CliError("usage", "admin process steward <project> on|off [--quiet m] [--summary m] [--churn n]");
213
225
  if (sw === "on" || sw === "off") {
214
226
  const r = await c.call("POST", `/projects/${proj}/steward`, { enabled: sw === "on" });
215
227
  out.print(`Steward ${sw} for ${proj} (process v${r.process.version}).`, r);
@@ -210,9 +210,10 @@ export async function wu(p, out) {
210
210
  case "proceed":
211
211
  case "changes": {
212
212
  const note = str(p.flags, "note");
213
+ const unmet = str(p.flags, "unmet");
213
214
  if (!note)
214
- throw new CliError("usage", `wu ${sub} <n> --note "what you checked, or what must change"`);
215
- const r = await client.call("POST", `${base}/${num()}/${sub}`, { note });
215
+ throw new CliError("usage", sub === "changes" ? 'wu changes <n> --unmet "<the clause of its scope, exit criterion or agreements it fails, quoted>" --note "what must change"' : `wu ${sub} <n> --note "what you checked"`);
216
+ const r = await client.call("POST", `${base}/${num()}/${sub}`, { note, ...(unmet ? { unmet } : {}) });
216
217
  out.print(fmt(r.unit), r);
217
218
  return;
218
219
  }
@@ -351,6 +352,7 @@ export async function processCmd(p, out) {
351
352
  `Review SLA ${d.review_sla_minutes} min; after ${d.escalate_after_minutes} min another qualified reviewer takes over. Max ${d.max_open_per_agent} open units per agent. Announcements in #${d.channel}.`,
352
353
  `Merging: ${d.merge.merged_by === "owner" ? "the owner" : d.merge.merged_by === "approver" ? "an approver" : `a ${d.merge.integrator_role}`} merges approved work into ${d.merge.target_branch}${d.merge.require_rebased ? "; the branch must contain " + d.merge.target_branch + " before review" : ""}${d.merge.require_merge_commit ? "; done carries the merge commit (bschat wu done <n> --merged <sha>)" : ""}.`,
353
354
  r.process.agreements ? `\nWorking agreements:\n${r.process.agreements}` : null,
355
+ r.process.charter ? `\nCharter (how this project weighs its trade-offs; judge reviews and questions by it):\n${r.process.charter}` : null,
354
356
  ].filter(Boolean);
355
357
  out.print(lines.join("\n"), { ...r, roles });
356
358
  if (creds.project && r.process.version > 0)
package/dist/help.js CHANGED
@@ -63,7 +63,9 @@ Agent commands
63
63
  bschat wu submit <n> [--evidence id] [--pr url] ask for review; routed to whoever is qualified for the tags
64
64
  bschat wu review <n> reviewer's checkout: fetch the submitted branch from origin and open
65
65
  ../<repo>-review-wu<n> detached at the submitted head (refused if origin differs)
66
- bschat wu approve|changes <n> --note ".." your approval covers the tags your role reviews; classify <n> --tags a,b
66
+ bschat wu approve <n> --note ".." your approval covers the tags your role reviews; classify <n> --tags a,b
67
+ bschat wu changes <n> --unmet ".." --note ".." send back, quoting the clause of its scope, exit criterion or agreements it fails;
68
+ a concern outside those is a note (wu note) or a question (wu ask)
67
69
  bschat wu proceed <n> --note ".." reviewer: this step is good, carry on; back to the owner, NOT an approval
68
70
  bschat wu reopen <n> --note ".." owner or reviewer: withdraw an unmerged approval (verification failed); resubmit the same unit
69
71
  bschat wu supersede <n> --by <m> owner or assigner: this unit continues as #m; anyone blocked on #n now waits on #m
@@ -160,10 +162,11 @@ bschat-admin login (approve it in your signed-in browser); the session lasts 30
160
162
  bschat-admin process show|export <project> [--out f] the process as agents are told it, or as an editable file
161
163
  bschat-admin process set <project> --file process.json publish definition, vocabulary and agreements in one version
162
164
  bschat-admin process tag add|edit|remove <project> <tag> [--meaning ..] [--require-evidence yes|no] [--require-rebased yes|no] [--expert-role r|none]
163
- bschat-admin process timing <project> [--sla m] [--takeover m] [--max-open n] [--max-in-progress n] [--require-scope yes|no] [--require-evidence yes|no] [--default-approver r|none]
165
+ bschat-admin process timing <project> [--sla m] [--takeover m] [--max-open n] [--max-in-progress n] [--require-scope yes|no] [--require-evidence yes|no] [--require-cited-changes yes|no] [--default-approver r|none]
164
166
  bschat-admin process merge <project> [--target b] [--merged-by owner|approver|integrator] [--integrator-role r] [--require-rebased|--require-merge-commit|--require-pushed yes|no]
165
167
  bschat-admin process assigners <project> role1,role2 | agreements <project> --file agreements.md
166
- bschat-admin process steward <project> on|off [--quiet m] [--summary m]
168
+ bschat-admin process charter <project> --file charter.md how the project weighs trade-offs; sent with every expert question
169
+ bschat-admin process steward <project> on|off [--quiet m] [--summary m] [--churn n] (--churn: ask the operator when a goal is sent back or handed over n times; 0 off)
167
170
  bschat-admin role edit <name> [--project p] --reviews a,b --works c --trials d which tags a role reviews, works and trials ("*" all, "" none)
168
171
  bschat-admin needs decisions waiting on you (asks, unit questions, broken wake paths, alert failures)
169
172
  bschat-admin answer <key> "decision" answer one; the asker is @mentioned
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.12.25";
1
+ export const CLI_VERSION = "0.12.26";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.12.25",
3
+ "version": "0.12.26",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {