omp-conductor 0.18.1 → 0.19.0

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 (69) hide show
  1. package/README.md +106 -41
  2. package/REFERENCE.md +866 -31
  3. package/agents/to-spec.md +6 -2
  4. package/package.json +1 -1
  5. package/schema/config.schema.json +32 -1
  6. package/src/admission.ts +212 -26
  7. package/src/arm-challenge.ts +250 -57
  8. package/src/ask.ts +288 -1
  9. package/src/briefs/orchestrator.md +27 -13
  10. package/src/briefs/to-spec.md +6 -2
  11. package/src/cli.ts +127 -2
  12. package/src/command-help.ts +9 -1
  13. package/src/command-manifest.ts +52 -8
  14. package/src/commands/arm.ts +6 -2
  15. package/src/commands/context.ts +2 -0
  16. package/src/commands/intake.ts +4 -19
  17. package/src/commands/message.ts +26 -2
  18. package/src/commands/reconcile-units.ts +104 -0
  19. package/src/commands/release-composition.ts +232 -0
  20. package/src/commands/resume.ts +2 -27
  21. package/src/commands/setup.ts +101 -16
  22. package/src/commands/stats.ts +11 -30
  23. package/src/commands/tail.ts +31 -1
  24. package/src/commands/upgrade.ts +20 -3
  25. package/src/commands/verb.ts +2 -1
  26. package/src/commands/watch.ts +4 -17
  27. package/src/config-schema.ts +38 -6
  28. package/src/config.ts +103 -8
  29. package/src/credential-class.ts +366 -0
  30. package/src/daemon.ts +1368 -529
  31. package/src/dashboard/app.js +504 -2
  32. package/src/dashboard/controls.ts +336 -0
  33. package/src/dashboard/index.html +30 -0
  34. package/src/dashboard/server.ts +271 -30
  35. package/src/dashboard/style.css +116 -0
  36. package/src/dashboard/transcript.ts +173 -0
  37. package/src/decisions.ts +19 -11
  38. package/src/doctor.ts +431 -148
  39. package/src/escalate.ts +22 -11
  40. package/src/failure-class.ts +59 -0
  41. package/src/fleet.ts +587 -230
  42. package/src/host.ts +6 -455
  43. package/src/omp-settings.ts +19 -0
  44. package/src/omp.ts +40 -56
  45. package/src/orchestrator-tick.ts +564 -121
  46. package/src/pause.ts +233 -0
  47. package/src/session-host.ts +6 -41
  48. package/src/settlement.ts +159 -2
  49. package/src/setup-answers.ts +97 -0
  50. package/src/setup-host.ts +343 -1160
  51. package/src/setup-install.ts +204 -27
  52. package/src/setup-wizard.ts +252 -51
  53. package/src/setup.ts +87 -4
  54. package/src/spend-telemetry.ts +117 -0
  55. package/src/stats.ts +35 -0
  56. package/src/status-render.ts +485 -19
  57. package/src/store.ts +1229 -55
  58. package/src/telegram-freshness.ts +269 -0
  59. package/src/to-spec.ts +50 -2
  60. package/src/types.ts +759 -10
  61. package/src/unblock.ts +22 -0
  62. package/src/unit-reconcile.ts +303 -0
  63. package/src/upgrade-verify.ts +8 -1
  64. package/src/upgrade.ts +299 -12
  65. package/src/verbs/actions.ts +124 -10
  66. package/src/verbs/protocol.ts +70 -2
  67. package/src/verbs/server.ts +485 -11
  68. package/src/wake.ts +48 -0
  69. package/src/worker.ts +401 -14
package/src/decisions.ts CHANGED
@@ -79,14 +79,21 @@ export const PR_LOOKUP_WINDOW_MS = 30 * 24 * 60 * 60_000;
79
79
  * read by both `conductor_pr_review` and the `pr-review-ready` watch so they
80
80
  * cannot drift.
81
81
  *
82
- * Ownership is the same newest-first resolution the review verb uses: the
83
- * newest attempt of this project that recorded the PR within the
84
- * recent-history window (`runsForProjectPr`), never the issue's newest row
85
- * a requeued continuation must not hide the PR its predecessor opened
86
- * (#434), and a newer live owner hides an older settled one. That older
87
- * settled row is exactly the shape dogfood #844 started from: PR #838 was
88
- * green while its newest owner was still `running`, and a watch keyed only to
89
- * checks woke the orchestrator before `conductor_pr_review` was actionable.
82
+ * Ownership is the newest attempt of this project that recorded the PR within
83
+ * the recent-history window (`runsForProjectPr`), never the issue's newest
84
+ * row a requeued continuation must not hide the PR its predecessor opened
85
+ * (#434). A `stopped` row is transparent to that selection (#870): stopping
86
+ * is terminal and the attempt will never touch the PR again, so a stopped
87
+ * duplicate must not shadow the older revisable owner of the same PR the
88
+ * row ordering that stranded PR #870's blocking findings. Every other
89
+ * non-revisable state still decides as the newest owner: a live row
90
+ * (`running` / `claimed`) hides an older settled one because a worker is in
91
+ * flight (#844 — PR #838 was green while its newest owner was still
92
+ * `running`, and a watch keyed only to checks woke the orchestrator before
93
+ * `conductor_pr_review` was actionable), `pushed-pending` checks are still
94
+ * settling, `blocked` may resume, `orphaned` is reconciled back to live at
95
+ * startup, and `merged` means the PR lifecycle is over. When every row is
96
+ * `stopped`, the newest one answers and the predicate fails closed.
90
97
  *
91
98
  * `no-owner` and `not-revisable` both fail closed: a review can never act, so
92
99
  * a watch must not wake, even when the checks are green.
@@ -97,9 +104,10 @@ export type PrReviewReadiness =
97
104
  | { kind: "not-revisable"; run: RunRecord };
98
105
 
99
106
  export function prReviewReadiness(store: Store, project: string, prUrl: string, now: number): PrReviewReadiness {
100
- const run = store.runsForProjectPr(project, prUrl, now - PR_LOOKUP_WINDOW_MS)[0];
101
- if (run === undefined) return { kind: "no-owner" };
102
- return REVISABLE_RUN_STATES[run.state] === true ? { kind: "ready", run } : { kind: "not-revisable", run };
107
+ const runs = store.runsForProjectPr(project, prUrl, now - PR_LOOKUP_WINDOW_MS);
108
+ const owner = runs.find((attempt) => attempt.state !== "stopped") ?? runs.at(0);
109
+ if (owner === undefined) return { kind: "no-owner" };
110
+ return REVISABLE_RUN_STATES[owner.state] === true ? { kind: "ready", run: owner } : { kind: "not-revisable", run: owner };
103
111
  }
104
112
 
105
113
  /**