@yemi33/minions 0.1.2378 → 0.1.2380

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 (100) hide show
  1. package/bin/minions.js +19 -9
  2. package/dashboard/js/refresh.js +2 -3
  3. package/dashboard/js/render-prd.js +1 -1
  4. package/dashboard/js/render-work-items.js +13 -6
  5. package/dashboard.js +393 -721
  6. package/docs/README.md +1 -0
  7. package/docs/architecture-review-2026-07-09.md +2 -4
  8. package/docs/auto-discovery.md +36 -49
  9. package/docs/blog-first-successful-dispatch.md +1 -1
  10. package/docs/branch-derivation.md +2 -2
  11. package/docs/command-center.md +1 -1
  12. package/docs/completion-reports.md +14 -4
  13. package/docs/constellation-bridge.md +59 -10
  14. package/docs/constellation-style-telemetry.md +6 -6
  15. package/docs/cooldown-merge-semantics.md +4 -0
  16. package/docs/copilot-cli-schema.md +3 -3
  17. package/docs/cross-repo-plans.md +17 -17
  18. package/docs/deprecated.json +2 -2
  19. package/docs/design-inbox-entries-schema.md +31 -39
  20. package/docs/design-state-storage.md +1 -1
  21. package/docs/documentation-audit-2026-07-09.md +2 -2
  22. package/docs/engine-restart.md +20 -8
  23. package/docs/harness-mode.md +1 -1
  24. package/docs/managed-spawn.md +4 -4
  25. package/docs/onboarding.md +1 -2
  26. package/docs/pr-comment-followup.md +3 -3
  27. package/docs/pr-review-fix-loop.md +1 -1
  28. package/docs/proposals/repo-pool-for-live-checkout.md +1 -2
  29. package/docs/qa-runbook-lifecycle.md +4 -4
  30. package/docs/qa-runbooks.md +2 -2
  31. package/docs/rfc-completion-json.md +4 -1
  32. package/docs/runtime-adapters.md +1 -1
  33. package/docs/self-improvement.md +4 -5
  34. package/docs/shared-lifecycle-module-map.md +3 -1
  35. package/docs/slim-ux/architecture-suggestions.md +5 -6
  36. package/docs/slim-ux/concepts.md +23 -25
  37. package/docs/watches.md +7 -7
  38. package/docs/workspace-manifests.md +1 -1
  39. package/docs/worktree-lifecycle.md +1 -1
  40. package/engine/abandoned-pr-reconciliation.js +4 -5
  41. package/engine/acp-transport.js +49 -8
  42. package/engine/ado-status.js +5 -5
  43. package/engine/ado.js +20 -25
  44. package/engine/agent-worker-pool.js +124 -15
  45. package/engine/bridge.js +260 -5
  46. package/engine/cleanup.js +48 -131
  47. package/engine/cli.js +125 -83
  48. package/engine/cooldown.js +9 -16
  49. package/engine/db/index.js +22 -9
  50. package/engine/db/migrations/009-qa.js +1 -1
  51. package/engine/db/migrations/020-qa-session-scopes.js +23 -0
  52. package/engine/db/migrations/021-archived-work-items.js +72 -0
  53. package/engine/db/migrations/022-global-cc-session.js +31 -0
  54. package/engine/db/migrations/023-engine-state.js +30 -0
  55. package/engine/db/migrations/024-prd-ghost-collisions.js +53 -0
  56. package/engine/db/migrations/025-malformed-work-item-phantoms.js +33 -0
  57. package/engine/dispatch-store.js +2 -7
  58. package/engine/dispatch.js +34 -41
  59. package/engine/github.js +20 -27
  60. package/engine/lifecycle.js +221 -283
  61. package/engine/llm.js +1 -1
  62. package/engine/logs-store.js +2 -2
  63. package/engine/managed-spawn.js +2 -23
  64. package/engine/meeting.js +6 -6
  65. package/engine/metrics-store.js +2 -2
  66. package/engine/note-link-backfill.js +6 -11
  67. package/engine/pipeline.js +18 -36
  68. package/engine/playbook.js +1 -1
  69. package/engine/pooled-agent-process.js +46 -26
  70. package/engine/prd-store.js +73 -54
  71. package/engine/preflight.js +2 -5
  72. package/engine/projects.js +15 -62
  73. package/engine/pull-requests-store.js +0 -17
  74. package/engine/qa-runbooks.js +2 -2
  75. package/engine/qa-runs.js +1 -8
  76. package/engine/qa-sessions.js +41 -64
  77. package/engine/queries.js +120 -219
  78. package/engine/routing.js +3 -5
  79. package/engine/scheduler.js +0 -4
  80. package/engine/shared-branch-pr-reconcile.js +2 -3
  81. package/engine/shared.js +132 -637
  82. package/engine/small-state-store.js +89 -10
  83. package/engine/state-operations.js +16 -4
  84. package/engine/stdio-timestamps.js +1 -1
  85. package/engine/timeout.js +5 -12
  86. package/engine/watch-actions.js +20 -22
  87. package/engine/watches-store.js +1 -1
  88. package/engine/watches.js +6 -10
  89. package/engine/work-item-validation.js +52 -0
  90. package/engine/work-items-store.js +127 -29
  91. package/engine/worktree-gc.js +2 -2
  92. package/engine/worktree-pool.js +8 -18
  93. package/engine.js +167 -349
  94. package/minions.js +2 -2
  95. package/package.json +1 -1
  96. package/playbooks/plan-to-prd.md +2 -2
  97. package/playbooks/shared-rules.md +3 -3
  98. package/playbooks/templates/followup-dispatch.md +1 -1
  99. package/playbooks/verify.md +1 -1
  100. package/prompts/cc-system.md +2 -2
package/engine/routing.js CHANGED
@@ -8,8 +8,7 @@ const path = require('path');
8
8
  const shared = require('./shared');
9
9
  const queries = require('./queries');
10
10
 
11
- const { safeJson, safeJsonObj, safeRead, log, ts, WORK_TYPE } = shared;
12
- const { ENGINE_DIR, DISPATCH_PATH } = queries;
11
+ const { safeJson, safeRead, log, ts, WORK_TYPE } = shared;
13
12
 
14
13
  const MINIONS_DIR = shared.MINIONS_DIR;
15
14
  const ROUTING_PATH = path.join(MINIONS_DIR, 'routing.md');
@@ -83,8 +82,7 @@ function getMonthlySpend(agentId) {
83
82
  }
84
83
 
85
84
  function getAgentErrorRate(agentId) {
86
- const metricsPath = path.join(ENGINE_DIR, 'metrics.json');
87
- const metrics = safeJsonObj(metricsPath);
85
+ const metrics = queries.getMetrics() || {};
88
86
  const m = metrics[agentId];
89
87
  if (!m) return 0;
90
88
  const total = m.tasksCompleted + m.tasksErrored;
@@ -93,7 +91,7 @@ function getAgentErrorRate(agentId) {
93
91
 
94
92
  function isAgentIdle(agentId) {
95
93
  // Dispatch queue is the single source of truth for agent availability
96
- const dispatch = safeJsonObj(DISPATCH_PATH);
94
+ const dispatch = queries.getDispatch();
97
95
  return !(dispatch.active || []).some(d => d.agent === agentId);
98
96
  }
99
97
 
@@ -22,14 +22,11 @@
22
22
  */
23
23
 
24
24
  const fs = require('fs');
25
- const path = require('path');
26
25
  const shared = require('./shared');
27
26
  const routing = require('./routing');
28
27
  const harness = require('./harness');
29
28
  const { safeJson, safeWrite, mutateJsonFileLocked, mutateScheduleRuns, ts, dateStamp, log, WI_STATUS, WORK_TYPE } = shared;
30
29
 
31
- const SCHEDULE_RUNS_PATH = path.join(shared.MINIONS_DIR, 'engine', 'schedule-runs.json');
32
-
33
30
  /**
34
31
  * Compute the ISO 8601 week of the year for `date` as `YYYY-Www` (e.g.
35
32
  * 2026-W23). Uses the standard ISO algorithm: Thursday of the target week
@@ -467,5 +464,4 @@ module.exports = {
467
464
  resolveScheduleTemplateVars,
468
465
  applyScheduleTemplateVarsRecursive,
469
466
  buildScheduleTemplateVars,
470
- SCHEDULE_RUNS_PATH,
471
467
  };
@@ -116,13 +116,12 @@ async function _reconcilePrdForProject(plan, file, project, planIds) {
116
116
  const remote = await _queryRemoteOpenPr(project, branch, mainRef);
117
117
  if (!remote) return; // no remote PR -> nothing to heal
118
118
 
119
- const prPath = shared.projectPrPath(project);
120
- const { needsHeal } = _evaluateHeal(shared.safeJsonArr(prPath), project, remote, planIds);
119
+ const { needsHeal } = _evaluateHeal(shared.readPullRequests(project), project, remote, planIds);
121
120
  if (!needsHeal) return; // fully-linked -> idempotent no-op
122
121
 
123
122
  // upsertPullRequestRecord MERGES prdItems + calls addPrLink per item, yielding
124
123
  // the aggregate shape (countDistinctPrdItems > 1) the dashboard renders.
125
- const result = shared.upsertPullRequestRecord(prPath, {
124
+ const result = shared.upsertPullRequestRecord(project, {
126
125
  url: remote.url,
127
126
  prNumber: remote.prNumber,
128
127
  branch,