@mmerterden/multi-agent-pipeline 20.42.0 → 20.43.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +7 -5
  3. package/README.tr.md +7 -5
  4. package/docs/architecture.md +3 -3
  5. package/docs/ecosystem.md +6 -6
  6. package/docs/facts.json +5 -5
  7. package/manifest.json +45 -38
  8. package/package.json +1 -1
  9. package/pipeline/commands/multi-agent/clean-disk/SKILL.md +134 -0
  10. package/pipeline/commands/multi-agent/review-priority/SKILL.md +143 -0
  11. package/pipeline/commands/multi-agent/setup/SKILL.md +1 -1
  12. package/pipeline/commands/multi-agent/sync/SKILL.md +4 -4
  13. package/pipeline/commands/multi-agent/update/SKILL.md +21 -8
  14. package/pipeline/lib/low-disk.mjs +6 -5
  15. package/pipeline/multi-agent-refs/cross-cli-contract.md +5 -5
  16. package/pipeline/multi-agent-refs/features/doctor.md +17 -2
  17. package/pipeline/multi-agent-refs/features/review-priority.md +123 -0
  18. package/pipeline/multi-agent-refs/features/usage-reporting.md +45 -5
  19. package/pipeline/multi-agent-refs/help/en.md +2 -0
  20. package/pipeline/multi-agent-refs/help/tr.md +2 -0
  21. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +1 -1
  22. package/pipeline/multi-agent-refs/review-priority/rules/example.md +137 -0
  23. package/pipeline/office/toolkit.json +1 -1
  24. package/pipeline/schemas/prefs.schema.json +19 -1
  25. package/pipeline/schemas/toolkit-path-params.json +1 -1
  26. package/pipeline/scripts/capture-resume.sh +1 -1
  27. package/pipeline/scripts/disk-cleaner.mjs +77 -63
  28. package/pipeline/scripts/doctor.mjs +140 -10
  29. package/pipeline/scripts/priority-review.mjs +912 -0
  30. package/pipeline/scripts/usage-register.mjs +86 -9
  31. package/pipeline/skills/.skill-manifest.json +14 -6
  32. package/pipeline/skills/.skills-index.json +24 -2
  33. package/pipeline/skills/shared/README.md +6 -4
  34. package/pipeline/skills/shared/core/multi-agent-clean-disk/SKILL.md +34 -0
  35. package/pipeline/skills/shared/core/multi-agent-review-priority/SKILL.md +36 -0
  36. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -1
  37. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +4 -4
  38. package/pipeline/skills/shared/core/multi-agent-update/SKILL.md +11 -5
  39. package/pipeline/skills/shared/external/disk-cleaner/SKILL.md +10 -4
  40. package/pipeline/skills/shared/external/disk-cleaner/evals/evals.json +6 -6
  41. package/pipeline/skills/shared/external/disk-cleaner/scripts/disk-cleaner.mjs +77 -63
  42. package/pipeline/skills/skills-index.md +4 -2
@@ -21,11 +21,13 @@
21
21
  * - never a file the user does not own, and never a path an open file
22
22
  * handle or a running command line points into
23
23
  *
24
- * Transcripts and the Trash are opt-in (--transcripts, --trash). Orphaned
25
- * session children are only reported unless --apply --processes is given.
26
- * Unattended runs (--unattended or MULTI_AGENT_UNATTENDED=1) keep to
27
- * UNATTENDED_SAFE and never touch the Trash, transcripts, processes,
28
- * worktrees, archives or device support.
24
+ * The Trash and old session transcripts are opt-in (--trash, --transcripts):
25
+ * the Trash holds the user's own files, and resume and past-session search
26
+ * read the transcripts. Processes are never stopped: orphaned children of
27
+ * ended sessions are listed in the report under `orphans` as information, and
28
+ * nothing here can signal a process. Unattended runs (--unattended or
29
+ * MULTI_AGENT_UNATTENDED=1) keep to UNATTENDED_SAFE and never touch the Trash,
30
+ * transcripts, worktrees, archives or device support.
29
31
  *
30
32
  * Deletion uses fs.rmSync, which unlinks a symlink instead of entering it.
31
33
  * Pipeline scratch under /tmp and per-task pipeline logs are delegated to
@@ -34,11 +36,18 @@
34
36
  *
35
37
  * Usage:
36
38
  * disk-cleaner.mjs [--dry-run] [--apply] [--only=a,b] [--skip=a,b]
37
- * [--trash] [--transcripts] [--processes] [--unattended]
39
+ * [--trash] [--transcripts] [--unattended]
38
40
  * [--log-days=N] [--archive-days=N] [--transcript-days=N]
39
41
  * [--scratch-hours=N] [--build-hours=N] [--orphan-minutes=N]
40
42
  * [--root=DIR]... [--tmp-root=DIR]... [--home=DIR]
41
- * [--report=FILE] [--json] [--list]
43
+ * [--report=FILE] [--json] [--list] [--top=N]
44
+ *
45
+ * Every category in the JSON report carries `top` (its largest items, real
46
+ * paths and sizes, 5 unless --top says otherwise), `more` (how many items
47
+ * `top` leaves out) and `kept` (how many items were kept, per reason). The
48
+ * report also carries `reclaimableBytes` (categories whose tool is running
49
+ * are measured but left out) and `disk.expectedFreeBytes`. --top=N also lists
50
+ * the top items under each row of the text table.
42
51
  *
43
52
  * Exit: 0 done, 1 one or more deletions failed, 2 usage error.
44
53
  *
@@ -61,11 +70,12 @@ import { homedir, tmpdir } from "node:os";
61
70
  import { basename, dirname, join, sep } from "node:path";
62
71
  import { fileURLToPath, pathToFileURL } from "node:url";
63
72
 
64
- export const VERSION = "1.0.0";
73
+ export const VERSION = "1.1.0";
65
74
  const DAY_MS = 86_400_000;
66
75
  const HOUR_MS = 3_600_000;
67
76
  const MAX_WALK_DEPTH = 8;
68
77
  const KEEP_REPORTS = 20;
78
+ const DEFAULT_TOP = 5;
69
79
  const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
70
80
 
71
81
  /** Folders under $HOME that hold the user's own files or secrets. */
@@ -280,7 +290,6 @@ export function makeContext(o = {}) {
280
290
  tmpGraceMinutes: o.tmpGraceMinutes ?? 120,
281
291
  orphanMinutes: o.orphanMinutes ?? 30,
282
292
  run: o.run || realRun,
283
- kill: o.kill || ((pid) => process.kill(pid, "SIGTERM")),
284
293
  du: o.du || duBytes,
285
294
  ps: () => (psCache ??= (o.ps || realPs)()),
286
295
  openPaths: () =>
@@ -706,6 +715,16 @@ function transcriptCandidates(ctx, out) {
706
715
  }
707
716
  }
708
717
 
718
+ /** Orphaned session children, for the report only: pid and command, nothing to act on. */
719
+ export function listOrphans(ctx) {
720
+ const rows = ctx.ps();
721
+ return findOrphans(rows, {
722
+ uid: ctx.uid,
723
+ minAgeSec: ctx.orphanMinutes * 60,
724
+ selfChain: selfChain(rows),
725
+ }).map((r) => ({ pid: r.pid, command: r.command }));
726
+ }
727
+
709
728
  function selfChain(rows) {
710
729
  const parent = new Map(rows.map((r) => [r.pid, r.ppid]));
711
730
  const chain = new Set();
@@ -985,27 +1004,6 @@ export const CATEGORIES = [
985
1004
  optIn: "transcripts",
986
1005
  discover: transcriptCandidates,
987
1006
  },
988
- {
989
- id: "processes",
990
- label: "orphaned children of ended Claude or Codex sessions",
991
- unattended: false,
992
- discover(ctx, out) {
993
- const rows = ctx.ps();
994
- for (const r of findOrphans(rows, {
995
- uid: ctx.uid,
996
- minAgeSec: ctx.orphanMinutes * 60,
997
- selfChain: selfChain(rows),
998
- })) {
999
- out.candidates.push({
1000
- kind: "process",
1001
- pid: r.pid,
1002
- path: `pid ${r.pid}: ${r.command}`,
1003
- command: r.command,
1004
- bytes: 0,
1005
- });
1006
- }
1007
- },
1008
- },
1009
1007
  ];
1010
1008
 
1011
1009
  export const UNATTENDED_SAFE = new Set(CATEGORIES.filter((c) => c.unattended).map((c) => c.id));
@@ -1073,19 +1071,6 @@ function removeWorktree(ctx, c) {
1073
1071
  return r.status === 0 ? { ok: true } : { ok: false, reason: r.stderr.trim() || "git refused" };
1074
1072
  }
1075
1073
 
1076
- function stopProcess(ctx, c) {
1077
- const now = ctx.ps().find((r) => r.pid === c.pid);
1078
- if (!now || now.ppid !== 1 || now.command !== c.command) {
1079
- return { ok: false, reason: "process changed or exited" };
1080
- }
1081
- try {
1082
- ctx.kill(c.pid);
1083
- return { ok: true };
1084
- } catch (e) {
1085
- return { ok: false, reason: e.code || "kill failed" };
1086
- }
1087
- }
1088
-
1089
1074
  function runDelegate(ctx, tool, items) {
1090
1075
  const listFile = join(tmpdir(), `disk-cleaner-${tool}-${process.pid}-${Date.now()}.txt`);
1091
1076
  try {
@@ -1113,12 +1098,11 @@ function runDelegate(ctx, tool, items) {
1113
1098
 
1114
1099
  /**
1115
1100
  * Delete what `planned` lists. Every path passes the guard again first, a
1116
- * worktree is re-checked for changes, and a process is re-read before it is
1117
- * signalled.
1101
+ * worktree is re-checked for changes.
1118
1102
  */
1119
- export function applyPlan(ctx, planned, opts = {}) {
1103
+ export function applyPlan(ctx, planned) {
1120
1104
  ctx.resetProbes?.();
1121
- const result = { removed: 0, failed: 0, stopped: 0, failures: [], held: [] };
1105
+ const result = { removed: 0, failed: 0, failures: [], held: [] };
1122
1106
  for (const cat of planned.categories) {
1123
1107
  const def = CATEGORIES.find((c) => c.id === cat.id);
1124
1108
  if (cat.blocked || (def?.blocker && processRunning(ctx, def.blocker[0]))) {
@@ -1133,13 +1117,6 @@ export function applyPlan(ctx, planned, opts = {}) {
1133
1117
  else if (c.kind === "command") {
1134
1118
  const x = ctx.run(c.cmd, c.args, { timeout: 600_000 });
1135
1119
  r = x.status === 0 ? { ok: true } : { ok: false, reason: `${c.cmd} exited ${x.status}` };
1136
- } else if (c.kind === "process") {
1137
- if (!opts.processes) continue;
1138
- r = stopProcess(ctx, c);
1139
- if (r.ok) {
1140
- result.stopped++;
1141
- continue;
1142
- }
1143
1120
  } else if (c.kind === "delegate") {
1144
1121
  if (!delegates.has(c.tool)) delegates.set(c.tool, []);
1145
1122
  delegates.get(c.tool).push(c);
@@ -1183,7 +1160,6 @@ function parseCli(argv) {
1183
1160
  break;
1184
1161
  case "--trash":
1185
1162
  case "--transcripts":
1186
- case "--processes":
1187
1163
  case "--unattended":
1188
1164
  case "--json":
1189
1165
  case "--list":
@@ -1211,18 +1187,21 @@ function parseCli(argv) {
1211
1187
  case "--archive-days":
1212
1188
  o.archiveDays = num(k, v);
1213
1189
  break;
1214
- case "--transcript-days":
1215
- o.transcriptDays = num(k, v);
1216
- break;
1217
1190
  case "--scratch-hours":
1218
1191
  o.scratchHours = num(k, v);
1219
1192
  break;
1220
1193
  case "--build-hours":
1221
1194
  o.buildHours = num(k, v);
1222
1195
  break;
1196
+ case "--transcript-days":
1197
+ o.transcriptDays = num(k, v);
1198
+ break;
1223
1199
  case "--orphan-minutes":
1224
1200
  o.orphanMinutes = num(k, v);
1225
1201
  break;
1202
+ case "--top":
1203
+ o.top = num(k, v);
1204
+ break;
1226
1205
  case "-h":
1227
1206
  case "--help":
1228
1207
  o.help = true;
@@ -1259,7 +1238,24 @@ function writeReport(file, data) {
1259
1238
  for (const p of old) rmSync(p, { force: true });
1260
1239
  }
1261
1240
 
1262
- function printPlan(p, mode, disk) {
1241
+ /** The largest items of a category, how many are left out, and why items were kept. */
1242
+ export function categorySummary(c, top = DEFAULT_TOP) {
1243
+ const sorted = [...c.candidates].sort((a, b) => (b.bytes || 0) - (a.bytes || 0));
1244
+ const kept = {};
1245
+ for (const k of c.skipped) kept[k.reason] = (kept[k.reason] || 0) + 1;
1246
+ return {
1247
+ top: sorted.slice(0, top).map((x) => ({ path: x.path, bytes: x.bytes, kind: x.kind })),
1248
+ more: Math.max(0, sorted.length - top),
1249
+ kept,
1250
+ };
1251
+ }
1252
+
1253
+ /** What an apply of this plan would free: blocked categories are not applied. */
1254
+ export function reclaimable(p) {
1255
+ return p.categories.filter((c) => !c.blocked).reduce((s, c) => s + c.bytes, 0);
1256
+ }
1257
+
1258
+ function printPlan(p, mode, disk, top = 0) {
1263
1259
  const lines = [];
1264
1260
  const pct = disk.totalBytes ? ((disk.freeBytes / disk.totalBytes) * 100).toFixed(1) : "?";
1265
1261
  lines.push(
@@ -1274,6 +1270,12 @@ function printPlan(p, mode, disk) {
1274
1270
  lines.push(
1275
1271
  `${c.id.padEnd(18)} ${String(c.candidates.length).padStart(6)} ${human(c.bytes).padStart(9)} ${note}`,
1276
1272
  );
1273
+ if (top > 0) {
1274
+ const s = categorySummary(c, top);
1275
+ for (const x of s.top)
1276
+ lines.push(`${"".padEnd(18)} ${human(x.bytes).padStart(16)} ${x.path}`);
1277
+ if (s.more) lines.push(`${"".padEnd(18)} ${"".padStart(16)} + ${s.more} more`);
1278
+ }
1277
1279
  }
1278
1280
  lines.push(`${"total".padEnd(18)} ${"".padStart(6)} ${human(p.totalBytes).padStart(9)}`);
1279
1281
  return lines.join("\n");
@@ -1348,8 +1350,12 @@ export function main(argv, env = process.env) {
1348
1350
  mode,
1349
1351
  unattended,
1350
1352
  startedAt: new Date(ctx.now).toISOString(),
1351
- disk: { before },
1353
+ disk: {
1354
+ before,
1355
+ expectedFreeBytes: before.freeBytes == null ? null : before.freeBytes + reclaimable(planned),
1356
+ },
1352
1357
  totalBytes: planned.totalBytes,
1358
+ reclaimableBytes: reclaimable(planned),
1353
1359
  categories: planned.categories.map((c) => ({
1354
1360
  id: c.id,
1355
1361
  label: c.label,
@@ -1357,11 +1363,14 @@ export function main(argv, env = process.env) {
1357
1363
  note: c.note,
1358
1364
  candidates: c.candidates.map((x) => ({ path: x.path, bytes: x.bytes, kind: x.kind })),
1359
1365
  skipped: c.skipped,
1366
+ blocked: c.blocked || null,
1367
+ ...categorySummary(c, o.top ?? DEFAULT_TOP),
1360
1368
  })),
1369
+ orphans: listOrphans(ctx),
1361
1370
  };
1362
1371
  let applied = null;
1363
1372
  if (o.apply) {
1364
- applied = applyPlan(ctx, planned, { processes: Boolean(o.processes) && !unattended });
1373
+ applied = applyPlan(ctx, planned);
1365
1374
  const after = diskStatus(ctx.home);
1366
1375
  report.disk.after = after;
1367
1376
  report.applied = {
@@ -1389,10 +1398,15 @@ export function main(argv, env = process.env) {
1389
1398
  if (o.json) {
1390
1399
  process.stdout.write(JSON.stringify(report, null, 2) + "\n");
1391
1400
  } else {
1392
- const lines = [printPlan(planned, mode, before), ...summarizeSkips(planned)];
1401
+ const lines = [printPlan(planned, mode, before, o.top || 0), ...summarizeSkips(planned)];
1402
+ if (report.orphans.length) {
1403
+ lines.push(
1404
+ `orphaned session processes: ${report.orphans.length} (information only; never stopped)`,
1405
+ );
1406
+ }
1393
1407
  if (applied) {
1394
1408
  lines.push(
1395
- `removed ${applied.removed}, failed ${applied.failed}, processes stopped ${applied.stopped}; freed ${human(report.applied.freedBytes)} (df before ${human(before.freeBytes)}, after ${human(report.disk.after.freeBytes)})`,
1409
+ `removed ${applied.removed}, failed ${applied.failed}; freed ${human(report.applied.freedBytes)} (df before ${human(before.freeBytes)}, after ${human(report.disk.after.freeBytes)})`,
1396
1410
  );
1397
1411
  for (const f of applied.failures.slice(0, 10)) {
1398
1412
  lines.push(` failed ${f.category}: ${f.path} (${f.reason})`);
@@ -3,7 +3,7 @@
3
3
  > Auto-generated by `pipeline/scripts/build-skills-index.mjs` - do not hand-edit.
4
4
  > Regenerate with `node pipeline/scripts/build-skills-index.mjs`.
5
5
 
6
- **242 skills** across 2 groups.
6
+ **244 skills** across 2 groups.
7
7
 
8
8
  | Group | Name | Platform | Description |
9
9
  |-------|------|----------|-------------|
@@ -57,7 +57,7 @@
57
57
  | external | `debugging-instruments` | - | Xcode debugging and profiling: LLDB, Memory Graph Debugger, Instruments, crashes, leaks and retain cycles, main-thread hangs, slow rendering |
58
58
  | external | `debugging-strategies` | - | Language-neutral debugging method: reproduce, minimise, falsifiable hypotheses, git bisect, instrumentation, production traces, concurrency |
59
59
  | external | `device-integrity` | - | DeviceCheck and App Attest: DCDevice tokens and per-device bits, DCAppAttestService key generation, attestation and assertions. Use when add |
60
- | external | `disk-cleaner` | - | Frees macOS dev disk space by deleting regenerable data only (build output, caches, merged agent worktrees, old logs) after measuring, and s |
60
+ | external | `disk-cleaner` | - | Frees macOS dev disk space by deleting regenerable data only (build output, caches, merged agent worktrees, old logs) after measuring, and l |
61
61
  | external | `docker-expert` | - | Dockerfiles and images: multi-stage builds, BuildKit cache and secret mounts, slim or distroless bases, non-root, healthchecks, scanning, mu |
62
62
  | external | `e2e-testing` | - | Drives a running web or mobile app through the multi-agent-toolkit MCP server: element locators, expect steps with passed / failed / blocked |
63
63
  | external | `energykit` | - | EnergyKit on iOS 26: grid electricity forecasts via ElectricityGuidance, EnergyVenue, EV and HVAC load events, ElectricityInsightService his |
@@ -117,6 +117,7 @@
117
117
  | core | `multi-agent-bug-bash` | - | Bug bash: parallel exploratory sessions by charter and persona, each with a budget; a finding is reported only when a repro test fails for i |
118
118
  | core | `multi-agent-build-optimize` | - | Wrapper that dispatches to build-time-optimizer on iOS repos. Benchmarks the current Xcode build, runs compilation / project / SPM analyzers |
119
119
  | core | `multi-agent-channels` | - | Multi-channel reporter - Jira/Confluence/Wiki/PR description. Multi-select channels + content, humanizer pass, reviewer-preserving Bitbuck |
120
+ | core | `multi-agent-clean-disk` | - | Free disk space with the disk cleaner: measure every category, pick what to delete, apply, report the space freed. Use when the disk is near |
120
121
  | core | `multi-agent-complaint-analysis` | - | Customer-complaint triage. Ingests complaints (paste, csv/xlsx/txt/json file, Jira issue, Confluence URL), fetches Graylog evidence per trx/ |
121
122
  | core | `multi-agent-create-jira` | - | Create a standards-compliant Jira issue (Task / Bug / Story): asks the type, mines project conventions, drafts from a standard template with |
122
123
  | core | `multi-agent-design-check` | - | Mock-mode vs Figma design audit (iOS / Android, local-only). Pick repo + module, gate on mock support, enumerate every state driver into a c |
@@ -152,6 +153,7 @@
152
153
  | core | `multi-agent-review-analysis` | - | Review a written analysis document instead of a diff: resolve it from a path, a Confluence page or a Jira issue, run the deterministic gates |
153
154
  | core | `multi-agent-review-issue` | - | Assess whether a GitHub issue is ready for multi-agent development: fetch it, grade scope / acceptance criteria / repro / design / API / sta |
154
155
  | core | `multi-agent-review-jira` | - | Assess whether a Jira issue is ready for multi-agent development: fetch it, grade scope / acceptance criteria / repro / design / API / stack |
156
+ | core | `multi-agent-review-priority` | - | Review a team's open Jira bug priorities against its rule file: read-only by default, one report per team, one approved change at a time. Us |
155
157
  | core | `multi-agent-route-off` | - | Disable model routing and keep its rules, so turning it back on does not re-ask for the same configuration. Use when asked to turn model rou |
156
158
  | core | `multi-agent-route-on` | - | Enable policy-driven model routing: pick a strategy, a scope, and the rules that say which rung a call lands on. Use when asked to turn mode |
157
159
  | core | `multi-agent-route-status` | - | Report model routing: whether it is armed, which rule applies where, which rung the last dispatches took, and what this run has cost. Use wh |