@usine/orchestrator 0.2.0 → 0.3.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 (173) hide show
  1. package/README.md +151 -50
  2. package/dist/board/items.d.ts +9 -1
  3. package/dist/board/items.d.ts.map +1 -1
  4. package/dist/board/items.js +16 -4
  5. package/dist/board/items.js.map +1 -1
  6. package/dist/board/projection.d.ts +7 -1
  7. package/dist/board/projection.d.ts.map +1 -1
  8. package/dist/board/projection.js +53 -14
  9. package/dist/board/projection.js.map +1 -1
  10. package/dist/board/tasks.d.ts +14 -2
  11. package/dist/board/tasks.d.ts.map +1 -1
  12. package/dist/board/tasks.js +23 -8
  13. package/dist/board/tasks.js.map +1 -1
  14. package/dist/credentials.d.ts +5 -6
  15. package/dist/credentials.d.ts.map +1 -1
  16. package/dist/credentials.js +22 -15
  17. package/dist/credentials.js.map +1 -1
  18. package/dist/current-instance/changes.d.ts +87 -0
  19. package/dist/current-instance/changes.d.ts.map +1 -0
  20. package/dist/current-instance/changes.js +138 -0
  21. package/dist/current-instance/changes.js.map +1 -0
  22. package/dist/current-instance/current-instance.d.ts +89 -0
  23. package/dist/current-instance/current-instance.d.ts.map +1 -0
  24. package/dist/current-instance/current-instance.js +163 -0
  25. package/dist/current-instance/current-instance.js.map +1 -0
  26. package/dist/exe-dev.d.ts +6 -2
  27. package/dist/exe-dev.d.ts.map +1 -1
  28. package/dist/exe-dev.js +7 -8
  29. package/dist/exe-dev.js.map +1 -1
  30. package/dist/idle-triggers.d.ts +1 -1
  31. package/dist/idle-triggers.d.ts.map +1 -1
  32. package/dist/idle-triggers.js +1 -1
  33. package/dist/idle-triggers.js.map +1 -1
  34. package/dist/label-reconciler.d.ts +5 -2
  35. package/dist/label-reconciler.d.ts.map +1 -1
  36. package/dist/label-reconciler.js.map +1 -1
  37. package/dist/local.d.ts +4 -18
  38. package/dist/local.d.ts.map +1 -1
  39. package/dist/local.js +7 -45
  40. package/dist/local.js.map +1 -1
  41. package/dist/loop-matches.d.ts +28 -0
  42. package/dist/loop-matches.d.ts.map +1 -0
  43. package/dist/loop-matches.js +74 -0
  44. package/dist/loop-matches.js.map +1 -0
  45. package/dist/operator/attempt.d.ts +60 -10
  46. package/dist/operator/attempt.d.ts.map +1 -1
  47. package/dist/operator/attempt.js +54 -11
  48. package/dist/operator/attempt.js.map +1 -1
  49. package/dist/operator/board.d.ts +43 -16
  50. package/dist/operator/board.d.ts.map +1 -1
  51. package/dist/operator/board.js +43 -16
  52. package/dist/operator/board.js.map +1 -1
  53. package/dist/operator/configuration.d.ts +258 -0
  54. package/dist/operator/configuration.d.ts.map +1 -0
  55. package/dist/operator/configuration.js +410 -0
  56. package/dist/operator/configuration.js.map +1 -0
  57. package/dist/operator/desk.d.ts +181 -0
  58. package/dist/operator/desk.d.ts.map +1 -0
  59. package/dist/operator/desk.js +463 -0
  60. package/dist/operator/desk.js.map +1 -0
  61. package/dist/operator/github-changes.d.ts +88 -0
  62. package/dist/operator/github-changes.d.ts.map +1 -0
  63. package/dist/operator/github-changes.js +266 -0
  64. package/dist/operator/github-changes.js.map +1 -0
  65. package/dist/operator/http.d.ts +191 -30
  66. package/dist/operator/http.d.ts.map +1 -1
  67. package/dist/operator/http.js +153 -23
  68. package/dist/operator/http.js.map +1 -1
  69. package/dist/operator/need.d.ts +44 -11
  70. package/dist/operator/need.d.ts.map +1 -1
  71. package/dist/operator/need.js +46 -9
  72. package/dist/operator/need.js.map +1 -1
  73. package/dist/operator/operator.d.ts +111 -27
  74. package/dist/operator/operator.d.ts.map +1 -1
  75. package/dist/operator/operator.js +286 -45
  76. package/dist/operator/operator.js.map +1 -1
  77. package/dist/operator/overview.d.ts +7 -7
  78. package/dist/operator/overview.d.ts.map +1 -1
  79. package/dist/operator/overview.js +5 -5
  80. package/dist/operator/overview.js.map +1 -1
  81. package/dist/operator/projection.d.ts +56 -4
  82. package/dist/operator/projection.d.ts.map +1 -1
  83. package/dist/operator/projection.js +125 -15
  84. package/dist/operator/projection.js.map +1 -1
  85. package/dist/operator/run.d.ts +92 -3
  86. package/dist/operator/run.d.ts.map +1 -1
  87. package/dist/operator/run.js +87 -4
  88. package/dist/operator/run.js.map +1 -1
  89. package/dist/operator/task.d.ts +93 -0
  90. package/dist/operator/task.d.ts.map +1 -0
  91. package/dist/operator/task.js +204 -0
  92. package/dist/operator/task.js.map +1 -0
  93. package/dist/operator/transcript.d.ts +14 -12
  94. package/dist/operator/transcript.d.ts.map +1 -1
  95. package/dist/operator/transcript.js +18 -9
  96. package/dist/operator/transcript.js.map +1 -1
  97. package/dist/operator/usage.d.ts +111 -0
  98. package/dist/operator/usage.d.ts.map +1 -0
  99. package/dist/operator/usage.js +219 -0
  100. package/dist/operator/usage.js.map +1 -0
  101. package/dist/orchestrator.d.ts +8 -5
  102. package/dist/orchestrator.d.ts.map +1 -1
  103. package/dist/orchestrator.js +4 -2
  104. package/dist/orchestrator.js.map +1 -1
  105. package/dist/polling/cycle.d.ts +28 -10
  106. package/dist/polling/cycle.d.ts.map +1 -1
  107. package/dist/polling/cycle.js +20 -6
  108. package/dist/polling/cycle.js.map +1 -1
  109. package/dist/polling/evaluation-failures.d.ts +42 -0
  110. package/dist/polling/evaluation-failures.d.ts.map +1 -0
  111. package/dist/polling/evaluation-failures.js +103 -0
  112. package/dist/polling/evaluation-failures.js.map +1 -0
  113. package/dist/polling/hints.d.ts +2 -2
  114. package/dist/polling/hints.d.ts.map +1 -1
  115. package/dist/polling/hints.js +2 -2
  116. package/dist/polling/hints.js.map +1 -1
  117. package/dist/polling/loop-evaluation.d.ts +21 -11
  118. package/dist/polling/loop-evaluation.d.ts.map +1 -1
  119. package/dist/polling/loop-evaluation.js +70 -27
  120. package/dist/polling/loop-evaluation.js.map +1 -1
  121. package/dist/polling/open-issues.d.ts +23 -0
  122. package/dist/polling/open-issues.d.ts.map +1 -0
  123. package/dist/polling/open-issues.js +77 -0
  124. package/dist/polling/open-issues.js.map +1 -0
  125. package/dist/polling/polling.d.ts +20 -11
  126. package/dist/polling/polling.d.ts.map +1 -1
  127. package/dist/polling/polling.js +201 -51
  128. package/dist/polling/polling.js.map +1 -1
  129. package/dist/polling/repository-sync.d.ts +20 -14
  130. package/dist/polling/repository-sync.d.ts.map +1 -1
  131. package/dist/polling/repository-sync.js +34 -27
  132. package/dist/polling/repository-sync.js.map +1 -1
  133. package/dist/polling-triggers.d.ts +1 -1
  134. package/dist/polling-triggers.d.ts.map +1 -1
  135. package/dist/polling-triggers.js +1 -1
  136. package/dist/polling-triggers.js.map +1 -1
  137. package/dist/reloads.d.ts +14 -0
  138. package/dist/reloads.d.ts.map +1 -0
  139. package/dist/reloads.js +7 -0
  140. package/dist/reloads.js.map +1 -0
  141. package/dist/runtime.d.ts +24 -0
  142. package/dist/runtime.d.ts.map +1 -0
  143. package/dist/runtime.js +58 -0
  144. package/dist/runtime.js.map +1 -0
  145. package/dist/schedule-triggers.d.ts +14 -10
  146. package/dist/schedule-triggers.d.ts.map +1 -1
  147. package/dist/schedule-triggers.js +36 -31
  148. package/dist/schedule-triggers.js.map +1 -1
  149. package/dist/scheduler.d.ts +35 -4
  150. package/dist/scheduler.d.ts.map +1 -1
  151. package/dist/scheduler.js +327 -40
  152. package/dist/scheduler.js.map +1 -1
  153. package/dist/ssh.d.ts +39 -0
  154. package/dist/ssh.d.ts.map +1 -0
  155. package/dist/ssh.js +75 -0
  156. package/dist/ssh.js.map +1 -0
  157. package/dist/trigger-condition.d.ts +12 -0
  158. package/dist/trigger-condition.d.ts.map +1 -0
  159. package/dist/trigger-condition.js +88 -0
  160. package/dist/trigger-condition.js.map +1 -0
  161. package/dist/trigger-submission.d.ts +16 -13
  162. package/dist/trigger-submission.d.ts.map +1 -1
  163. package/dist/trigger-submission.js +21 -26
  164. package/dist/trigger-submission.js.map +1 -1
  165. package/dist/worker-engine.d.ts +10 -0
  166. package/dist/worker-engine.d.ts.map +1 -0
  167. package/dist/worker-engine.js +25 -0
  168. package/dist/worker-engine.js.map +1 -0
  169. package/dist/worker-status.d.ts +70 -0
  170. package/dist/worker-status.d.ts.map +1 -0
  171. package/dist/worker-status.js +55 -0
  172. package/dist/worker-status.js.map +1 -0
  173. package/package.json +31 -10
@@ -1,15 +1,26 @@
1
+ import { FileStage, InstancePath } from "@usine/config/file";
1
2
  import { AttemptId } from "@usine/core/attempt";
3
+ import { AgentName } from "@usine/core/agent";
2
4
  import { CycleBudgetAskId } from "@usine/core/cycle-budget";
3
5
  import { ItemNumber } from "@usine/core/item";
4
6
  import { LoopName } from "@usine/core/loop";
7
+ import { RepositoryName } from "@usine/core/repository";
5
8
  import { RunId } from "@usine/core/run";
9
+ import { WorkerName } from "@usine/core/worker";
10
+ import { RunAgainResult } from "@usine/engine/engine";
6
11
  import { TranscriptSequence } from "@usine/engine/transcript";
7
- import { Record, Schema, SchemaTransformation } from "effect";
12
+ import { ExecutorOperation, WorkerCapability } from "@usine/executor";
13
+ import { Match, Record, Schema, SchemaTransformation } from "effect";
8
14
  import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware } from "effect/unstable/httpapi";
15
+ import { InstanceReload, RestartBlock } from "../current-instance/changes.js";
9
16
  import { BoardLaneId } from "./board.js";
10
17
  import { ColdTranscriptRequest, EarlierTranscriptRequest, TailTranscriptRequest, } from "./transcript.js";
11
18
  import { FactoryOverview } from "./overview.js";
12
- import { RunDetailView } from "./run.js";
19
+ import { RunDetailView, EditAndRetry, SessionIntervention } from "./run.js";
20
+ import { RunGitHubChangesView } from "./github-changes.js";
21
+ import { TaskView } from "./task.js";
22
+ import { ConfigurationView } from "./configuration.js";
23
+ import { DeskView } from "./desk.js";
13
24
  const errorStatuses = {
14
25
  SchemaError: 400,
15
26
  InvalidRequestError: 400,
@@ -19,9 +30,18 @@ const errorStatuses = {
19
30
  BoardProjectNotFoundError: 404,
20
31
  BoardItemNotFoundError: 404,
21
32
  BoardLaneNotFoundError: 404,
33
+ GitHubItemNotFoundError: 404,
22
34
  RunOperationRejectedError: 409,
35
+ RunRetryBlockedError: 409,
36
+ RunInterventionRejectedError: 409,
37
+ LeftoversDiscardRejectedError: 409,
38
+ RosterAgentNotFoundError: 404,
39
+ LoopNotFoundError: 404,
23
40
  CycleBudgetResetRejectedError: 409,
24
41
  BoardLaneReadOnlyError: 409,
42
+ RestartRequiredError: 409,
43
+ ReloadPreflightError: 409,
44
+ FactoryConfigError: 422,
25
45
  EnginePersistenceError: 500,
26
46
  AttemptCancellationError: 500,
27
47
  HttpBodyError: 500,
@@ -33,31 +53,109 @@ const errorStatuses = {
33
53
  GitHubRateLimitError: 503,
34
54
  };
35
55
  /**
36
- * An operator request that could not be fulfilled. `error` preserves the domain
37
- * failure's identity and `message` is safe to show to the operator; persistence
38
- * details, credentials, and defect causes never travel in this envelope.
56
+ * A failed operator request. `error` is the domain failure's tag and `message` is safe to show;
57
+ * persistence details, credentials, and defect causes are never included.
39
58
  */
40
59
  export class OperatorHttpError extends Schema.Error("@usine/orchestrator/OperatorHttpError")({ error: Schema.Literals(Record.keys(errorStatuses)), message: Schema.String }) {
41
- /** The existing HTTP status associated with this refusal or failure. */
60
+ /** The HTTP status for this error. */
42
61
  get status() {
43
62
  return errorStatuses[this.error];
44
63
  }
45
64
  }
46
- // The established envelope uses `error` as its discriminator. Schema.Error keeps
47
- // that wire shape while giving browser callers an Error with a validated identity.
65
+ // The envelope uses `error` as its discriminator; `Schema.Error` keeps that wire shape and gives
66
+ // browser callers a validated Error.
48
67
  const errors = [...new Set(Object.values(errorStatuses))].map((status) => OperatorHttpError.check(Schema.makeFilter((error) => error.status === status)).annotate({
49
68
  httpApiStatus: status,
50
69
  }));
51
70
  /**
52
- * Server policy for the operator transport: refuse cross-site origins before
53
- * decoding or executing requests, and translate failures into operator envelopes.
54
- * A server must supply this middleware; generated clients need no middleware layer.
71
+ * Server middleware for the operator API that refuses cross-site origins before decoding requests
72
+ * and maps failures to operator envelopes. Servers must provide it; generated clients don't need
73
+ * it.
55
74
  */
56
75
  export class OperatorHttpPolicy extends HttpApiMiddleware.Service()("@usine/orchestrator/OperatorHttpPolicy", { error: errors }) {
57
76
  }
77
+ /**
78
+ * The Worker preflight failure behind a refused reload. The check's observation isn't sent to the
79
+ * client.
80
+ */
81
+ export const ReloadPreflightFailure = Schema.Union([
82
+ Schema.TaggedStruct("WorkerCapabilityError", {
83
+ worker: WorkerName,
84
+ capability: WorkerCapability,
85
+ message: Schema.String,
86
+ }),
87
+ Schema.TaggedStruct("ExecutorOperationError", {
88
+ operation: ExecutorOperation,
89
+ message: Schema.String,
90
+ }),
91
+ Schema.TaggedStruct("CredentialUnavailableError", {
92
+ repository: RepositoryName,
93
+ message: Schema.String,
94
+ }),
95
+ ]);
96
+ /** A reload refused because `usine.yaml` changed in a way that needs a restart of `usine up`. */
97
+ export class RestartRequiredRefusal extends Schema.Error("@usine/orchestrator/RestartRequiredRefusal")({
98
+ error: Schema.Literal("RestartRequiredError"),
99
+ message: Schema.String,
100
+ /** The `usine.yaml` blocks that contain the changed fields. */
101
+ blocks: Schema.NonEmptyArray(RestartBlock),
102
+ /**
103
+ * The changed fields as paths into `usine.yaml`, such as `webhooks` or
104
+ * `workers.build-1.destination`.
105
+ */
106
+ fields: Schema.NonEmptyArray(Schema.NonEmptyString),
107
+ }, { httpApiStatus: 409 }) {
108
+ }
109
+ /** A reload refused because Worker preflight failed for the Agents and Workers it adds. */
110
+ export class ReloadPreflightRefusal extends Schema.Error("@usine/orchestrator/ReloadPreflightRefusal")({
111
+ error: Schema.Literal("ReloadPreflightError"),
112
+ message: Schema.String,
113
+ /** The reloaded Agents whose brains preflight checked on every Worker. */
114
+ agents: Schema.Array(AgentName),
115
+ /** The Workers added or given more slots by the reload, which preflight checked. */
116
+ workers: Schema.Array(WorkerName),
117
+ cause: ReloadPreflightFailure,
118
+ }, { httpApiStatus: 409 }) {
119
+ }
120
+ /** A reload refused because `usine.yaml` or a file it depends on couldn't be loaded. */
121
+ export class FactoryConfigRefusal extends Schema.Error("@usine/orchestrator/FactoryConfigRefusal")({
122
+ error: Schema.Literal("FactoryConfigError"),
123
+ message: Schema.String,
124
+ file: InstancePath,
125
+ stage: FileStage,
126
+ }, { httpApiStatus: 422 }) {
127
+ }
128
+ /** Returns the reload endpoint's refusal for `error`, with `message` for the operator. */
129
+ export const reloadRefusal = (error, message) => Match.valueTags(error, {
130
+ RestartRequiredError: ({ _tag, blocks, fields }) => new RestartRequiredRefusal({ error: _tag, message, blocks, fields }),
131
+ ReloadPreflightError: ({ _tag, agents, workers, cause }) => new ReloadPreflightRefusal({
132
+ error: _tag,
133
+ message,
134
+ agents,
135
+ workers,
136
+ cause: Match.valueTags(cause, {
137
+ WorkerCapabilityError: (failure) => ({
138
+ _tag: failure._tag,
139
+ worker: failure.worker,
140
+ capability: failure.capability,
141
+ message: failure.message,
142
+ }),
143
+ ExecutorOperationError: (failure) => ({
144
+ _tag: failure._tag,
145
+ operation: failure.operation,
146
+ message: failure.message,
147
+ }),
148
+ CredentialUnavailableError: (failure) => ({
149
+ _tag: failure._tag,
150
+ repository: failure.repository,
151
+ message: failure.message,
152
+ }),
153
+ }),
154
+ }),
155
+ FactoryConfigError: ({ _tag, file, stage }) => new FactoryConfigRefusal({ error: _tag, message, file, stage }),
156
+ });
58
157
  const absent = Schema.optionalKey(Schema.Never);
59
- // URLSearchParams.get previously selected the first occurrence of a query key.
60
- // Preserve that convention when HttpApi supplies repeated keys as arrays.
158
+ // Use the first occurrence of a repeated query key, as `URLSearchParams.get` did.
61
159
  const queryValue = Schema.Union([
62
160
  Schema.String,
63
161
  Schema.NonEmptyArray(Schema.String).pipe(Schema.decodeTo(Schema.String, SchemaTransformation.transform({
@@ -66,8 +164,8 @@ const queryValue = Schema.Union([
66
164
  }))),
67
165
  ]);
68
166
  const sequence = queryValue.pipe(Schema.decodeTo(Schema.FiniteFromString), Schema.decodeTo(TranscriptSequence));
69
- // Each wire variant rules out the other cursors before decoding into the existing
70
- // domain request. Unknown search keys remain ignored, as in the original API.
167
+ // Each wire variant rules out the other cursors before decoding into the domain request. Unknown
168
+ // search keys are ignored.
71
169
  const transcriptQuery = Schema.Union([
72
170
  Schema.Struct({ after: absent, before: absent, attempt: absent }).pipe(Schema.decodeTo(Schema.toType(ColdTranscriptRequest), SchemaTransformation.transform({
73
171
  decode: () => new ColdTranscriptRequest(),
@@ -91,16 +189,23 @@ const acknowledged = Schema.Struct({ ok: Schema.Literal(true) });
91
189
  const runParams = { runId: RunId };
92
190
  const loopParams = { loop: LoopName };
93
191
  /**
94
- * The operator's HTTP reads and interventions. Server handlers and generated
95
- * clients derive URLs, request codecs, successful responses, and typed failures
96
- * from this contract. Action acknowledgement means the request was accepted;
97
- * subsequent observation reports execution and GitHub polling progress.
98
- *
99
- * This capability is platform-free (ADRs 0012 and 0020). Library consumers can
100
- * continue using Operator directly without an HTTP server or client.
192
+ * The operator's HTTP API contract for reads and interventions, shared by server handlers and
193
+ * generated clients. An action's acknowledgement only means the request was accepted.
101
194
  */
102
195
  export const OperatorApi = HttpApi.make("OperatorApi").add(HttpApiGroup.make("operator")
103
- .add(HttpApiEndpoint.get("overview", "/api/overview", { success: FactoryOverview }), HttpApiEndpoint.post("resetCycleBudget", "/api/cycle-budgets/reset", {
196
+ .add(HttpApiEndpoint.get("overview", "/api/overview", { success: FactoryOverview }), HttpApiEndpoint.get("agents", "/api/agents", { success: Schema.Array(AgentName) }), HttpApiEndpoint.post("editAndRetry", "/api/runs/:runId/edit-and-retry", {
197
+ params: runParams,
198
+ payload: EditAndRetry.annotate({ parseOptions: { onExcessProperty: "error" } }),
199
+ success: acknowledged,
200
+ }), HttpApiEndpoint.post("runAgain", "/api/runs/:runId/run-again", {
201
+ params: runParams,
202
+ payload: EditAndRetry.annotate({ parseOptions: { onExcessProperty: "error" } }),
203
+ success: RunAgainResult,
204
+ }), HttpApiEndpoint.post("intervene", "/api/runs/:runId/intervene", {
205
+ params: runParams,
206
+ payload: SessionIntervention.annotate({ parseOptions: { onExcessProperty: "error" } }),
207
+ success: acknowledged,
208
+ }), HttpApiEndpoint.post("resetCycleBudget", "/api/cycle-budgets/reset", {
104
209
  payload: Schema.Struct({ askId: CycleBudgetAskId }).annotate({
105
210
  parseOptions: { onExcessProperty: "error" },
106
211
  }),
@@ -109,9 +214,18 @@ export const OperatorApi = HttpApi.make("OperatorApi").add(HttpApiGroup.make("op
109
214
  params: runParams,
110
215
  query: transcriptQuery,
111
216
  success: RunDetailView,
217
+ }), HttpApiEndpoint.get("githubChanges", "/api/runs/:runId/github-changes", {
218
+ params: runParams,
219
+ success: RunGitHubChangesView,
112
220
  }), HttpApiEndpoint.post("approve", "/api/runs/:runId/approve", {
113
221
  params: runParams,
114
222
  success: acknowledged,
223
+ }), HttpApiEndpoint.post("resolveFailure", "/api/runs/:runId/resolve-failure", {
224
+ params: runParams,
225
+ payload: Schema.Struct({ attemptId: AttemptId }).annotate({
226
+ parseOptions: { onExcessProperty: "error" },
227
+ }),
228
+ success: acknowledged,
115
229
  }), HttpApiEndpoint.post("retry", "/api/runs/:runId/retry", {
116
230
  params: runParams,
117
231
  success: acknowledged,
@@ -128,12 +242,28 @@ export const OperatorApi = HttpApi.make("OperatorApi").add(HttpApiGroup.make("op
128
242
  parseOptions: { onExcessProperty: "error" },
129
243
  }),
130
244
  success: acknowledged,
245
+ }), HttpApiEndpoint.post("discardLeftovers", "/api/workers/:worker/discard-leftovers", {
246
+ params: { worker: WorkerName },
247
+ success: acknowledged,
131
248
  }), HttpApiEndpoint.post("pause", "/api/loops/:loop/pause", {
132
249
  params: loopParams,
133
250
  success: acknowledged,
134
251
  }), HttpApiEndpoint.post("unpause", "/api/loops/:loop/unpause", {
135
252
  params: loopParams,
136
253
  success: acknowledged,
254
+ }), HttpApiEndpoint.post("reload", "/api/instance/reload", {
255
+ success: InstanceReload,
256
+ error: [RestartRequiredRefusal, ReloadPreflightRefusal, FactoryConfigRefusal],
257
+ }))
258
+ .add(HttpApiEndpoint.get("task", "/api/projects/:owner/:repository/tasks/:item", {
259
+ params: {
260
+ owner: repositoryPart,
261
+ repository: repositoryPart,
262
+ item: Schema.FiniteFromString.pipe(Schema.decodeTo(ItemNumber)),
263
+ },
264
+ success: TaskView,
137
265
  }))
266
+ .add(HttpApiEndpoint.get("configuration", "/api/configuration", { success: ConfigurationView }))
267
+ .add(HttpApiEndpoint.get("desk", "/api/desk", { success: DeskView }))
138
268
  .middleware(OperatorHttpPolicy));
139
269
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/operator/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,aAAa,GAAG;IACpB,WAAW,EAAE,GAAG;IAChB,mBAAmB,EAAE,GAAG;IACxB,qBAAqB,EAAE,GAAG;IAC1B,gBAAgB,EAAE,GAAG;IACrB,8BAA8B,EAAE,GAAG;IACnC,yBAAyB,EAAE,GAAG;IAC9B,sBAAsB,EA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AAgB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;KAChE;IACD,OAAO,EAAE,QAAQ;CAClB,CAAC,CACH;KACA,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,eAAe,EAAE,oBAAoB,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;KAC/F,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;KACpE,UAAU,CAAC,kBAAkB,CAAC,CAClC,CAAC"}
@@ -1,15 +1,21 @@
1
+ import { ConfigFileError } from "@usine/config/file";
1
2
  import { CycleBudgetAsk } from "@usine/core/cycle-budget";
2
3
  import { Schema } from "effect";
3
4
  import { LabelPreflightFinding } from "../label-reconciler.ts";
4
5
  import { RepositoryPollFailure } from "../polling-triggers.ts";
5
- import { BoardProjectionError } from "./board.ts";
6
+ import { BoardItemLink, BoardProjectionError } from "./board.ts";
6
7
  declare const ApprovalNeed_base: Schema.Class<ApprovalNeed, Schema.TaggedStruct<"ApprovalNeed", {
7
8
  readonly id: Schema.String;
8
9
  readonly repository: Schema.brand<Schema.String, "RepositoryName">;
9
10
  readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
10
11
  readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
12
+ /**
13
+ * The Run's Item as its Board card shows it, or null if no card on the Board has that Item, such
14
+ * as for a schedule Run.
15
+ */
16
+ readonly item: Schema.NullOr<typeof BoardItemLink>;
11
17
  }>, {}>;
12
- /** An operator approval is required before this Run can proceed. */
18
+ /** A Run that needs operator approval before it can proceed. */
13
19
  export declare class ApprovalNeed extends ApprovalNeed_base {
14
20
  }
15
21
  declare const RunFailureNeed_base: Schema.Class<RunFailureNeed, Schema.TaggedStruct<"RunFailureNeed", {
@@ -17,50 +23,77 @@ declare const RunFailureNeed_base: Schema.Class<RunFailureNeed, Schema.TaggedStr
17
23
  readonly repository: Schema.brand<Schema.String, "RepositoryName">;
18
24
  readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
19
25
  readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
20
- readonly failure: Schema.Union<readonly [typeof import("./attempt.ts").InfraFailureView, typeof import("./attempt.ts").DefectFailureView, typeof import("./attempt.ts").AgentFailureView, typeof import("./attempt.ts").RunawayFailureView, typeof import("./attempt.ts").ChildSessionBudgetFailureView]>;
26
+ readonly failure: Schema.Union<readonly [typeof import("./attempt.ts").InfraFailureView, typeof import("./attempt.ts").DefectFailureView, typeof import("./attempt.ts").AgentFailureView, typeof import("./attempt.ts").BlockedFailureView, typeof import("./attempt.ts").QuestionFailureView, typeof import("./attempt.ts").RunawayFailureView, typeof import("./attempt.ts").ChildSessionBudgetFailureView]>;
21
27
  }>, {}>;
22
- /** A failed Run requires an operator decision, with its displayable failure details. */
28
+ /**
29
+ * A failed Run that needs an operator decision. After a `QuestionFailure` or `BlockedFailure`, the
30
+ * Item's next state opens no Run of the Loop (ADR 0017).
31
+ */
23
32
  export declare class RunFailureNeed extends RunFailureNeed_base {
24
33
  }
25
34
  declare const PollFailureNeed_base: Schema.Class<PollFailureNeed, Schema.TaggedStruct<"PollFailureNeed", {
26
35
  readonly id: Schema.String;
27
36
  readonly failure: typeof RepositoryPollFailure;
28
37
  }>, {}>;
29
- /** Repository polling failed and needs operator attention. */
38
+ /** A repository poll failure that needs operator attention. */
30
39
  export declare class PollFailureNeed extends PollFailureNeed_base {
31
40
  }
32
41
  declare const PreflightFindingNeed_base: Schema.Class<PreflightFindingNeed, Schema.TaggedStruct<"PreflightFindingNeed", {
33
42
  readonly id: Schema.String;
34
43
  readonly finding: typeof LabelPreflightFinding;
35
44
  }>, {}>;
36
- /** A declared repository label could not be provisioned or confirmed. */
45
+ /** A declared repository label that couldn't be created or confirmed. */
37
46
  export declare class PreflightFindingNeed extends PreflightFindingNeed_base {
38
47
  }
39
48
  declare const BoardProjectionNeed_base: Schema.Class<BoardProjectionNeed, Schema.TaggedStruct<"BoardProjectionNeed", {
40
49
  readonly id: Schema.String;
41
50
  readonly failure: typeof BoardProjectionError;
42
51
  }>, {}>;
43
- /** An Item could not be displayed on its Board and needs operator attention. */
52
+ /** An Item that couldn't be shown on its Board. */
44
53
  export declare class BoardProjectionNeed extends BoardProjectionNeed_base {
45
54
  }
46
55
  declare const ScheduleFailureNeed_base: Schema.Class<ScheduleFailureNeed, Schema.TaggedStruct<"ScheduleFailureNeed", {
47
56
  readonly id: Schema.String;
48
57
  readonly failure: Schema.Union<readonly [typeof import("../schedule-triggers.ts").ScheduleAgentFailure, typeof import("../schedule-triggers.ts").ScheduleCronFailure, typeof import("../schedule-triggers.ts").ScheduleTickFailure]>;
49
58
  }>, {}>;
50
- /** A scheduled Loop could not evaluate or submit its work. */
59
+ /** A schedule Loop that couldn't evaluate or submit its work. */
51
60
  export declare class ScheduleFailureNeed extends ScheduleFailureNeed_base {
52
61
  }
62
+ declare const ConfigFileNeed_base: Schema.Class<ConfigFileNeed, Schema.TaggedStruct<"ConfigFileNeed", {
63
+ readonly id: Schema.String;
64
+ readonly kind: Schema.Literals<readonly ["loop", "agent"]>;
65
+ readonly error: typeof ConfigFileError;
66
+ }>, {}>;
67
+ /**
68
+ * An authored file that failed to load at startup and was left out: a quarantined Loop opens no
69
+ * Runs, and an invalid Agent isn't in the roster. A fix takes effect at the next `usine up`.
70
+ */
71
+ export declare class ConfigFileNeed extends ConfigFileNeed_base {
72
+ }
73
+ declare const UnconfiguredWorkerNeed_base: Schema.Class<UnconfiguredWorkerNeed, Schema.Struct<{
74
+ readonly _tag: Schema.tag<"UnconfiguredWorkerNeed">;
75
+ readonly id: Schema.String;
76
+ readonly worker: Schema.brand<Schema.String, "WorkerName">;
77
+ readonly attempts: Schema.Int;
78
+ readonly running: Schema.Int;
79
+ }>, {}>;
80
+ /**
81
+ * Attempts recorded on a Worker that `usine.yaml` no longer declares, which startup doesn't
82
+ * reconcile. Discarding their leftovers fails while `running` is above 0.
83
+ */
84
+ export declare class UnconfiguredWorkerNeed extends UnconfiguredWorkerNeed_base {
85
+ }
53
86
  declare const CycleBudgetNeed_base: Schema.Class<CycleBudgetNeed, Schema.TaggedStruct<"CycleBudgetNeed", {
54
87
  readonly id: Schema.String;
55
88
  readonly ask: typeof CycleBudgetAsk;
56
89
  readonly itemLabel: Schema.String;
57
90
  readonly itemUrl: Schema.NullOr<Schema.String>;
58
91
  }>, {}>;
59
- /** An Item stopped opening Runs and requires an explicit reset of its shared cycle budget. */
92
+ /** An Item that stopped opening Runs until the operator resets its cycle budget. */
60
93
  export declare class CycleBudgetNeed extends CycleBudgetNeed_base {
61
94
  }
62
- /** One reason the factory asks for operator attention in the overview. */
63
- export declare const NeedView: Schema.Union<readonly [typeof CycleBudgetNeed, typeof ApprovalNeed, typeof BoardProjectionNeed, typeof RunFailureNeed, typeof PollFailureNeed, typeof PreflightFindingNeed, typeof ScheduleFailureNeed]>;
95
+ /** One reason the overview asks for operator attention. */
96
+ export declare const NeedView: Schema.Union<readonly [typeof CycleBudgetNeed, typeof ApprovalNeed, typeof BoardProjectionNeed, typeof RunFailureNeed, typeof PollFailureNeed, typeof PreflightFindingNeed, typeof ScheduleFailureNeed, typeof ConfigFileNeed, typeof UnconfiguredWorkerNeed]>;
64
97
  export type NeedView = typeof NeedView.Type;
65
98
  export {};
66
99
  //# sourceMappingURL=need.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"need.d.ts","sourceRoot":"","sources":["../../src/operator/need.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;;;;;;;AAEl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ACnD,qBAAa,mBAAoB,SAAQ,wBAKvC;CAAG;;;;;AAEL,iEAAiE;AACjE,qBAAa,mBAAoB,SAAQ,wBAKvC;CAAG;;;;;;AAEL;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAMlC;CAAG;;;;;;;;AAEL;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,2BAgB3C;CAAG;;;;;;;AAEJ,oFAAoF;AACpF,qBAAa,eAAgB,SAAQ,oBAQpC;CAAG;AAEJ,2DAA2D;AAC3D,eAAO,MAAM,QAAQ,gQAUnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC"}
@@ -1,22 +1,32 @@
1
+ import { ConfigFileError } from "@usine/config/file";
1
2
  import { LoopName } from "@usine/core/loop";
2
3
  import { CycleBudgetAsk } from "@usine/core/cycle-budget";
3
4
  import { RepositoryName } from "@usine/core/repository";
4
5
  import { RunId } from "@usine/core/run";
6
+ import { WorkerName } from "@usine/core/worker";
5
7
  import { Schema } from "effect";
6
8
  import { LabelPreflightFinding } from "../label-reconciler.js";
7
9
  import { RepositoryPollFailure } from "../polling-triggers.js";
8
10
  import { ScheduleFailure } from "../schedule-triggers.js";
9
11
  import { FailureView } from "./attempt.js";
10
- import { BoardProjectionError } from "./board.js";
11
- /** An operator approval is required before this Run can proceed. */
12
+ import { BoardItemLink, BoardProjectionError } from "./board.js";
13
+ /** A Run that needs operator approval before it can proceed. */
12
14
  export class ApprovalNeed extends Schema.TaggedClass("@usine/orchestrator/ApprovalNeed")("ApprovalNeed", {
13
15
  id: Schema.String,
14
16
  repository: RepositoryName,
15
17
  runId: RunId,
16
18
  loop: LoopName,
19
+ /**
20
+ * The Run's Item as its Board card shows it, or null if no card on the Board has that Item, such
21
+ * as for a schedule Run.
22
+ */
23
+ item: Schema.NullOr(BoardItemLink),
17
24
  }) {
18
25
  }
19
- /** A failed Run requires an operator decision, with its displayable failure details. */
26
+ /**
27
+ * A failed Run that needs an operator decision. After a `QuestionFailure` or `BlockedFailure`, the
28
+ * Item's next state opens no Run of the Loop (ADR 0017).
29
+ */
20
30
  export class RunFailureNeed extends Schema.TaggedClass("@usine/orchestrator/RunFailureNeed")("RunFailureNeed", {
21
31
  id: Schema.String,
22
32
  repository: RepositoryName,
@@ -25,31 +35,56 @@ export class RunFailureNeed extends Schema.TaggedClass("@usine/orchestrator/RunF
25
35
  failure: FailureView,
26
36
  }) {
27
37
  }
28
- /** Repository polling failed and needs operator attention. */
38
+ /** A repository poll failure that needs operator attention. */
29
39
  export class PollFailureNeed extends Schema.TaggedClass("@usine/orchestrator/PollFailureNeed")("PollFailureNeed", {
30
40
  id: Schema.String,
31
41
  failure: RepositoryPollFailure,
32
42
  }) {
33
43
  }
34
- /** A declared repository label could not be provisioned or confirmed. */
44
+ /** A declared repository label that couldn't be created or confirmed. */
35
45
  export class PreflightFindingNeed extends Schema.TaggedClass("@usine/orchestrator/PreflightFindingNeed")("PreflightFindingNeed", {
36
46
  id: Schema.String,
37
47
  finding: LabelPreflightFinding,
38
48
  }) {
39
49
  }
40
- /** An Item could not be displayed on its Board and needs operator attention. */
50
+ /** An Item that couldn't be shown on its Board. */
41
51
  export class BoardProjectionNeed extends Schema.TaggedClass("@usine/orchestrator/BoardProjectionNeed")("BoardProjectionNeed", {
42
52
  id: Schema.String,
43
53
  failure: BoardProjectionError,
44
54
  }) {
45
55
  }
46
- /** A scheduled Loop could not evaluate or submit its work. */
56
+ /** A schedule Loop that couldn't evaluate or submit its work. */
47
57
  export class ScheduleFailureNeed extends Schema.TaggedClass("@usine/orchestrator/ScheduleFailureNeed")("ScheduleFailureNeed", {
48
58
  id: Schema.String,
49
59
  failure: ScheduleFailure,
50
60
  }) {
51
61
  }
52
- /** An Item stopped opening Runs and requires an explicit reset of its shared cycle budget. */
62
+ /**
63
+ * An authored file that failed to load at startup and was left out: a quarantined Loop opens no
64
+ * Runs, and an invalid Agent isn't in the roster. A fix takes effect at the next `usine up`.
65
+ */
66
+ export class ConfigFileNeed extends Schema.TaggedClass("@usine/orchestrator/ConfigFileNeed")("ConfigFileNeed", {
67
+ id: Schema.String,
68
+ kind: Schema.Literals(["loop", "agent"]),
69
+ error: ConfigFileError,
70
+ }) {
71
+ }
72
+ /**
73
+ * Attempts recorded on a Worker that `usine.yaml` no longer declares, which startup doesn't
74
+ * reconcile. Discarding their leftovers fails while `running` is above 0.
75
+ */
76
+ export class UnconfiguredWorkerNeed extends Schema.TaggedClass("@usine/orchestrator/UnconfiguredWorkerNeed")("UnconfiguredWorkerNeed", Schema.Struct({
77
+ id: Schema.String,
78
+ worker: WorkerName,
79
+ /** The number of Attempts recorded on the Worker that startup would otherwise reconcile. */
80
+ attempts: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
81
+ /** The number of `attempts` with no recorded outcome yet. */
82
+ running: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
83
+ }).check(Schema.makeFilter(({ attempts, running }) => running <= attempts, {
84
+ message: "Expected no more open attempts than attempts",
85
+ }))) {
86
+ }
87
+ /** An Item that stopped opening Runs until the operator resets its cycle budget. */
53
88
  export class CycleBudgetNeed extends Schema.TaggedClass("CycleBudgetNeed")("CycleBudgetNeed", {
54
89
  id: Schema.String,
55
90
  ask: CycleBudgetAsk,
@@ -57,7 +92,7 @@ export class CycleBudgetNeed extends Schema.TaggedClass("CycleBudgetNeed")("Cycl
57
92
  itemUrl: Schema.NullOr(Schema.String),
58
93
  }) {
59
94
  }
60
- /** One reason the factory asks for operator attention in the overview. */
95
+ /** One reason the overview asks for operator attention. */
61
96
  export const NeedView = Schema.Union([
62
97
  CycleBudgetNeed,
63
98
  ApprovalNeed,
@@ -66,5 +101,7 @@ export const NeedView = Schema.Union([
66
101
  PollFailureNeed,
67
102
  PreflightFindingNeed,
68
103
  ScheduleFailureNeed,
104
+ ConfigFileNeed,
105
+ UnconfiguredWorkerNeed,
69
106
  ]);
70
107
  //# sourceMappingURL=need.js.map
@@ -1 +1 @@
1
- {"version":3,"file":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