@yemi33/minions 0.1.2424 → 0.1.2425

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 (182) hide show
  1. package/bin/install-internal-minions.js +1209 -0
  2. package/bin/minions.js +75 -9
  3. package/dashboard/docs/typography.md +27 -12
  4. package/dashboard/js/command-center.js +13 -11
  5. package/dashboard/js/live-stream.js +1 -1
  6. package/dashboard/js/memory-search.js +388 -43
  7. package/dashboard/js/modal-qa.js +5 -5
  8. package/dashboard/js/qa.js +39 -26
  9. package/dashboard/js/refresh.js +37 -18
  10. package/dashboard/js/render-agents.js +14 -18
  11. package/dashboard/js/render-dispatch.js +14 -74
  12. package/dashboard/js/render-inbox.js +3 -3
  13. package/dashboard/js/render-meetings.js +8 -8
  14. package/dashboard/js/render-other.js +45 -20
  15. package/dashboard/js/render-pipelines.js +6 -6
  16. package/dashboard/js/render-plans.js +14 -14
  17. package/dashboard/js/render-prd.js +46 -46
  18. package/dashboard/js/render-prs.js +9 -65
  19. package/dashboard/js/render-schedules.js +5 -5
  20. package/dashboard/js/render-skills.js +6 -6
  21. package/dashboard/js/render-utils.js +4 -4
  22. package/dashboard/js/render-watches.js +4 -16
  23. package/dashboard/js/render-work-items.js +95 -107
  24. package/dashboard/js/settings.js +175 -74
  25. package/dashboard/layout.html +3 -2
  26. package/dashboard/pages/inbox.html +1 -1
  27. package/dashboard/pages/work.html +1 -1
  28. package/dashboard/shared/model-display.js +9 -0
  29. package/dashboard/shared/watches-source.js +43 -0
  30. package/dashboard/shared/welcome-popup.js +259 -0
  31. package/dashboard/slim/body.html +6 -6
  32. package/dashboard/slim/js/chat.js +4 -2
  33. package/dashboard/slim/js/history.js +10 -3
  34. package/dashboard/slim/js/modals-tiles.js +85 -16
  35. package/dashboard/slim/js/status.js +12 -16
  36. package/dashboard/slim/styles.css +24 -4
  37. package/dashboard/styles.css +62 -27
  38. package/dashboard-build.js +8 -2
  39. package/dashboard.js +3854 -2514
  40. package/docs/README.md +6 -4
  41. package/docs/api-errors.md +144 -0
  42. package/docs/auto-discovery.md +83 -61
  43. package/docs/capture-demos.js +173 -30
  44. package/docs/command-center.md +5 -1
  45. package/docs/completion-reports.md +127 -11
  46. package/docs/constants.md +15 -3
  47. package/docs/constellation-style-telemetry.md +2 -2
  48. package/docs/copilot-cli-schema.md +32 -22
  49. package/docs/cross-repo-plans.md +30 -30
  50. package/docs/demo/memory-system.html +1 -1
  51. package/docs/deprecated.json +132 -18
  52. package/docs/diagnostics-memory.md +8 -4
  53. package/docs/human-vs-automated.md +2 -2
  54. package/docs/internal-install.md +190 -0
  55. package/docs/kb-pr3223-cascade-archiving.md +16 -0
  56. package/docs/kb-pr696-merge-conflict-docs.md +23 -0
  57. package/docs/kb-sweep.md +2 -2
  58. package/docs/keep-processes.md +8 -1
  59. package/docs/live-checkout-mode.md +1 -1
  60. package/docs/managed-spawn.md +21 -3
  61. package/docs/named-agents.md +3 -2
  62. package/docs/plan-lifecycle.md +32 -32
  63. package/docs/pr-screenshots/pr-899/worker-pool-worktrees-AFTER.png +0 -0
  64. package/docs/pr-screenshots/pr-899/worker-pool-worktrees-BEFORE.png +0 -0
  65. package/docs/pr-screenshots/pr-979/auto-fix-pane-AFTER.png +0 -0
  66. package/docs/pr-screenshots/pr-979/auto-fix-pane-BEFORE.png +0 -0
  67. package/docs/pr-screenshots/pr-985/pr-column-em-dash-AFTER.png +0 -0
  68. package/docs/pr-screenshots/pr-985/pr-column-em-dash-BEFORE.png +0 -0
  69. package/docs/qa-runbook-lifecycle.md +67 -51
  70. package/docs/qa-runbooks.md +2 -2
  71. package/docs/runtime-adapters.md +101 -50
  72. package/docs/security.md +28 -0
  73. package/docs/self-improvement.md +47 -13
  74. package/docs/skills.md +29 -0
  75. package/docs/slim-ux/concepts.md +2 -2
  76. package/docs/specs/agent-configurability.md +43 -41
  77. package/docs/specs/agent-rename.md +13 -13
  78. package/docs/team-memory.md +283 -14
  79. package/docs/tutorials/03-plan-driven-feature.md +3 -3
  80. package/docs/tutorials/04-runtimes-and-harness.md +18 -21
  81. package/docs/tutorials/08-operations-and-recovery.md +3 -2
  82. package/docs/tutorials/README.md +4 -3
  83. package/docs/visual-evidence-ci.md +103 -0
  84. package/docs/watches.md +35 -30
  85. package/docs/worktree-lifecycle.md +151 -13
  86. package/engine/acp-transport.js +1 -0
  87. package/engine/ado.js +80 -33
  88. package/engine/agent-api-validation.js +571 -0
  89. package/engine/agent-worker-pool.js +7 -6
  90. package/engine/api-contracts/agent-content.js +761 -0
  91. package/engine/api-contracts/cc-ops.js +219 -0
  92. package/engine/api-contracts/config-runtime.js +419 -0
  93. package/engine/api-contracts/core.js +138 -0
  94. package/engine/api-contracts/index.js +506 -0
  95. package/engine/api-contracts/orchestration.js +602 -0
  96. package/engine/api-contracts/pull-requests.js +323 -0
  97. package/engine/api-contracts/qa-process.js +764 -0
  98. package/engine/api-contracts/work-plan-prd.js +494 -0
  99. package/engine/api-validation.js +543 -0
  100. package/engine/cc-api-validation.js +586 -0
  101. package/engine/cc-worker-pool.js +9 -1
  102. package/engine/cleanup.js +393 -271
  103. package/engine/cli.js +65 -7
  104. package/engine/comment-classifier.js +70 -5
  105. package/engine/consolidation.js +123 -5
  106. package/engine/content-api-validation.js +606 -0
  107. package/engine/create-pr-worktree.js +22 -1
  108. package/engine/db/migrations/027-review-learning-lifecycle.js +162 -0
  109. package/engine/dispatch.js +33 -0
  110. package/engine/distribution.js +189 -0
  111. package/engine/execution-model.js +59 -0
  112. package/engine/features.js +12 -0
  113. package/engine/github.js +67 -25
  114. package/engine/harness-context.js +313 -0
  115. package/engine/inbox-store.js +1 -1
  116. package/engine/kb-sweep.js +161 -38
  117. package/engine/keep-process-sweep.js +43 -3
  118. package/engine/lifecycle.js +1066 -165
  119. package/engine/llm.js +4 -0
  120. package/engine/managed-spawn.js +463 -48
  121. package/engine/meeting.js +197 -34
  122. package/engine/memory-retrieval.js +280 -0
  123. package/engine/memory-store.js +821 -38
  124. package/engine/model-discovery.js +17 -3
  125. package/engine/pipeline.js +802 -14
  126. package/engine/plan-prd-validation.js +745 -0
  127. package/engine/playbook.js +206 -17
  128. package/engine/pooled-agent-process.js +6 -1
  129. package/engine/pr-action.js +1 -1
  130. package/engine/pr-issue-validation.js +653 -0
  131. package/engine/pr-resolve.js +75 -13
  132. package/engine/prd-store.js +39 -6
  133. package/engine/preflight.js +7 -2
  134. package/engine/process-utils.js +79 -31
  135. package/engine/projects.js +198 -12
  136. package/engine/promotion.js +371 -0
  137. package/engine/qa-from-prd.js +3 -0
  138. package/engine/qa-process-validation.js +572 -0
  139. package/engine/qa-runbooks.js +41 -37
  140. package/engine/qa-runners/maestro.js +11 -7
  141. package/engine/qa-runners/playwright.js +37 -14
  142. package/engine/qa-runners.js +9 -10
  143. package/engine/qa-runs.js +124 -11
  144. package/engine/qa-sessions.js +139 -40
  145. package/engine/quarantine-refs.js +81 -11
  146. package/engine/queries.js +163 -9
  147. package/engine/review-learning-backfill.js +482 -0
  148. package/engine/review-learning.js +1236 -0
  149. package/engine/runtimes/claude.js +60 -2
  150. package/engine/runtimes/codex.js +57 -16
  151. package/engine/runtimes/contract.js +21 -0
  152. package/engine/runtimes/copilot.js +51 -3
  153. package/engine/runtimes/index.js +1 -0
  154. package/engine/scheduler.js +201 -32
  155. package/engine/settings-validation.js +909 -0
  156. package/engine/shared.js +705 -208
  157. package/engine/spawn-agent.js +48 -21
  158. package/engine/steering-constraints.js +31 -0
  159. package/engine/steering-store.js +10 -2
  160. package/engine/steering.js +14 -2
  161. package/engine/timeout.js +404 -111
  162. package/engine/untrusted-fence.js +24 -10
  163. package/engine/watch-actions.js +7 -2
  164. package/engine/watches.js +353 -51
  165. package/engine/work-item-validation.js +561 -0
  166. package/engine/work-items-store.js +61 -1
  167. package/engine/worktree-gc.js +656 -37
  168. package/engine/worktree-preflight.js +154 -0
  169. package/engine.js +2068 -342
  170. package/package.json +1 -1
  171. package/playbooks/_pr-description-audit.md +88 -41
  172. package/playbooks/build-fix-complex.md +3 -3
  173. package/playbooks/docs.md +2 -2
  174. package/playbooks/fix.md +18 -18
  175. package/playbooks/implement.md +18 -18
  176. package/playbooks/qa-session-draft.md +10 -12
  177. package/playbooks/qa-session-execute.md +16 -12
  178. package/playbooks/qa-validate.md +8 -7
  179. package/playbooks/shared-rules.md +45 -0
  180. package/playbooks/test.md +4 -0
  181. package/prompts/cc-system.md +1 -1
  182. package/skills/check-self-authored-review-comment/SKILL.md +2 -2
@@ -0,0 +1,154 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ function formatBytes(bytes) {
5
+ const value = Number(bytes);
6
+ if (!Number.isFinite(value) || value < 0) return 'unknown';
7
+ const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB'];
8
+ let amount = value;
9
+ let unit = 0;
10
+ while (amount >= 1024 && unit < units.length - 1) {
11
+ amount /= 1024;
12
+ unit++;
13
+ }
14
+ const digits = unit >= 3 ? 2 : unit === 0 ? 0 : 1;
15
+ return `${amount.toFixed(digits)} ${units[unit]}`;
16
+ }
17
+
18
+ function nearestExistingAncestor(target, existsSync = fs.existsSync) {
19
+ let current;
20
+ try { current = path.resolve(String(target || '')); }
21
+ catch { return null; }
22
+ while (true) {
23
+ try {
24
+ if (existsSync(current)) return current;
25
+ } catch {
26
+ return null;
27
+ }
28
+ const parent = path.dirname(current);
29
+ if (parent === current) return null;
30
+ current = parent;
31
+ }
32
+ }
33
+
34
+ function findConfiguredCheckoutHoldingBranch({
35
+ branch,
36
+ projects = [],
37
+ worktrees = [],
38
+ realPathForComparison = value => path.resolve(String(value)),
39
+ pathsOverlap = (first, second) => first === second,
40
+ } = {}) {
41
+ const targetBranch = typeof branch === 'string' ? branch.trim() : '';
42
+ if (!targetBranch) return null;
43
+
44
+ const configuredPaths = [];
45
+ for (const project of Array.isArray(projects) ? projects : []) {
46
+ if (!project?.localPath) continue;
47
+ try {
48
+ configuredPaths.push({
49
+ project,
50
+ path: realPathForComparison(project.localPath),
51
+ });
52
+ } catch {
53
+ // An unreadable configured path cannot be proven to own this worktree.
54
+ }
55
+ }
56
+
57
+ for (const worktree of Array.isArray(worktrees) ? worktrees : []) {
58
+ if (!worktree?.path || worktree.branch !== targetBranch) continue;
59
+ let holderPath;
60
+ try {
61
+ holderPath = realPathForComparison(worktree.path);
62
+ } catch {
63
+ continue;
64
+ }
65
+ const configured = configuredPaths.find(entry => pathsOverlap(entry.path, holderPath));
66
+ if (!configured) continue;
67
+ return {
68
+ branch: targetBranch,
69
+ holderPath: worktree.path,
70
+ holderProject: configured.project.name || null,
71
+ };
72
+ }
73
+ return null;
74
+ }
75
+
76
+ function checkWorktreeDiskSpace(opts = {}) {
77
+ const worktreeRoot = opts.worktreeRoot ? path.resolve(String(opts.worktreeRoot)) : '';
78
+ const requiredBytes = Math.max(0, Number(opts.minFreeBytes) || 0);
79
+ if (requiredBytes === 0) {
80
+ return {
81
+ ok: true,
82
+ reason: 'disabled',
83
+ worktreeRoot,
84
+ probePath: null,
85
+ requiredBytes,
86
+ availableBytes: null,
87
+ message: 'Worktree free-space preflight is disabled.',
88
+ };
89
+ }
90
+
91
+ const probePath = nearestExistingAncestor(worktreeRoot, opts.existsSync || fs.existsSync);
92
+ if (!probePath) {
93
+ return {
94
+ ok: false,
95
+ reason: 'probe-failed',
96
+ worktreeRoot,
97
+ probePath: null,
98
+ requiredBytes,
99
+ availableBytes: null,
100
+ message: `Cannot find an existing filesystem ancestor for worktree root "${worktreeRoot}".`,
101
+ };
102
+ }
103
+
104
+ const statfsSync = opts.statfsSync || fs.statfsSync;
105
+ let stats;
106
+ try {
107
+ stats = statfsSync(probePath);
108
+ } catch (err) {
109
+ return {
110
+ ok: false,
111
+ reason: 'probe-failed',
112
+ worktreeRoot,
113
+ probePath,
114
+ requiredBytes,
115
+ availableBytes: null,
116
+ message: `Free-space probe failed for "${probePath}": ${err.message}`,
117
+ };
118
+ }
119
+
120
+ const blocks = Number(stats && (stats.bavail ?? stats.bfree));
121
+ const blockSize = Number(stats && (stats.bsize ?? stats.frsize));
122
+ const availableBytes = blocks * blockSize;
123
+ if (!Number.isFinite(availableBytes) || availableBytes < 0) {
124
+ return {
125
+ ok: false,
126
+ reason: 'probe-failed',
127
+ worktreeRoot,
128
+ probePath,
129
+ requiredBytes,
130
+ availableBytes: null,
131
+ message: `Free-space probe returned invalid capacity for "${probePath}".`,
132
+ };
133
+ }
134
+
135
+ const ok = availableBytes >= requiredBytes;
136
+ return {
137
+ ok,
138
+ reason: ok ? 'ok' : 'low-space',
139
+ worktreeRoot,
140
+ probePath,
141
+ requiredBytes,
142
+ availableBytes,
143
+ message: ok
144
+ ? `Worktree filesystem has ${formatBytes(availableBytes)} available (minimum ${formatBytes(requiredBytes)}).`
145
+ : `Worktree checkout requires at least ${formatBytes(requiredBytes)} free, but only ${formatBytes(availableBytes)} is available at "${probePath}".`,
146
+ };
147
+ }
148
+
149
+ module.exports = {
150
+ checkWorktreeDiskSpace,
151
+ findConfiguredCheckoutHoldingBranch,
152
+ formatBytes,
153
+ nearestExistingAncestor,
154
+ };