@yemi33/minions 0.1.2379 → 0.1.2381

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 +3 -4
  3. package/dashboard/js/render-other.js +43 -23
  4. package/dashboard/js/render-prd.js +1 -1
  5. package/dashboard/js/render-work-items.js +13 -6
  6. package/dashboard/js/settings.js +40 -17
  7. package/dashboard.js +435 -768
  8. package/docs/architecture-review-2026-07-09.md +2 -4
  9. package/docs/auto-discovery.md +36 -49
  10. package/docs/blog-first-successful-dispatch.md +1 -1
  11. package/docs/branch-derivation.md +2 -2
  12. package/docs/command-center.md +1 -1
  13. package/docs/completion-reports.md +14 -4
  14. package/docs/constellation-bridge.md +59 -10
  15. package/docs/constellation-style-telemetry.md +6 -6
  16. package/docs/cooldown-merge-semantics.md +4 -0
  17. package/docs/copilot-cli-schema.md +3 -3
  18. package/docs/cross-repo-plans.md +17 -17
  19. package/docs/deprecated.json +2 -2
  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/live-checkout-mode.md +45 -26
  25. package/docs/managed-spawn.md +4 -4
  26. package/docs/onboarding.md +1 -2
  27. package/docs/pr-comment-followup.md +3 -3
  28. package/docs/pr-review-fix-loop.md +1 -1
  29. package/docs/proposals/repo-pool-for-live-checkout.md +1 -2
  30. package/docs/qa-runbook-lifecycle.md +4 -4
  31. package/docs/qa-runbooks.md +2 -2
  32. package/docs/rfc-completion-json.md +4 -1
  33. package/docs/runtime-adapters.md +1 -1
  34. package/docs/self-improvement.md +4 -5
  35. package/docs/shared-lifecycle-module-map.md +3 -1
  36. package/docs/slim-ux/architecture-suggestions.md +5 -6
  37. package/docs/slim-ux/concepts.md +23 -25
  38. package/docs/watches.md +7 -7
  39. package/docs/workspace-manifests.md +1 -1
  40. package/docs/worktree-lifecycle.md +1 -1
  41. package/engine/abandoned-pr-reconciliation.js +4 -5
  42. package/engine/ado-status.js +5 -5
  43. package/engine/ado.js +20 -25
  44. package/engine/agent-worker-pool.js +58 -1
  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 +39 -44
  59. package/engine/github.js +20 -27
  60. package/engine/lifecycle.js +279 -354
  61. package/engine/live-checkout.js +193 -149
  62. package/engine/llm.js +1 -1
  63. package/engine/logs-store.js +2 -2
  64. package/engine/managed-spawn.js +2 -23
  65. package/engine/meeting.js +6 -6
  66. package/engine/metrics-store.js +2 -2
  67. package/engine/note-link-backfill.js +6 -11
  68. package/engine/pipeline.js +18 -36
  69. package/engine/playbook.js +13 -16
  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 +4 -6
  79. package/engine/scheduler.js +0 -4
  80. package/engine/shared-branch-pr-reconcile.js +2 -3
  81. package/engine/shared.js +268 -699
  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 +197 -358
  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 +9 -9
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
 
@@ -120,7 +118,7 @@ function getTempBudget() { return _tempBudget; }
120
118
  function normalizeWorkType(workType, fallback = WORK_TYPE.IMPLEMENT) {
121
119
  const type = String(workType || fallback || '').trim();
122
120
  if (!type) return fallback;
123
- return type;
121
+ return shared.normalizeLiveValidationWorkType(type);
124
122
  }
125
123
 
126
124
  function routeForWorkType(workType) {
@@ -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,