@usine/executor 0.0.1 → 0.2.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 (74) hide show
  1. package/README.md +85 -2
  2. package/dist/child-command.d.ts +21 -0
  3. package/dist/child-command.d.ts.map +1 -0
  4. package/dist/child-command.js +50 -0
  5. package/dist/child-command.js.map +1 -0
  6. package/dist/exe-dev/channel.d.ts +11 -0
  7. package/dist/exe-dev/channel.d.ts.map +1 -0
  8. package/dist/exe-dev/channel.js +41 -0
  9. package/dist/exe-dev/channel.js.map +1 -0
  10. package/dist/exe-dev/commands.d.ts +22 -0
  11. package/dist/exe-dev/commands.d.ts.map +1 -0
  12. package/dist/exe-dev/commands.js +66 -0
  13. package/dist/exe-dev/commands.js.map +1 -0
  14. package/dist/exe-dev/exe-dev.d.ts +8 -0
  15. package/dist/exe-dev/exe-dev.d.ts.map +1 -0
  16. package/dist/exe-dev/exe-dev.js +153 -0
  17. package/dist/exe-dev/exe-dev.js.map +1 -0
  18. package/dist/exe-dev/grants.d.ts +8 -0
  19. package/dist/exe-dev/grants.d.ts.map +1 -0
  20. package/dist/exe-dev/grants.js +104 -0
  21. package/dist/exe-dev/grants.js.map +1 -0
  22. package/dist/exe-dev/model.d.ts +43 -0
  23. package/dist/exe-dev/model.d.ts.map +1 -0
  24. package/dist/exe-dev/model.js +26 -0
  25. package/dist/exe-dev/model.js.map +1 -0
  26. package/dist/exe-dev/preflight.d.ts +10 -0
  27. package/dist/exe-dev/preflight.d.ts.map +1 -0
  28. package/dist/exe-dev/preflight.js +82 -0
  29. package/dist/exe-dev/preflight.js.map +1 -0
  30. package/dist/exe-dev/shell.d.ts +12 -0
  31. package/dist/exe-dev/shell.d.ts.map +1 -0
  32. package/dist/exe-dev/shell.js +31 -0
  33. package/dist/exe-dev/shell.js.map +1 -0
  34. package/dist/exe-dev/sweep.d.ts +10 -0
  35. package/dist/exe-dev/sweep.d.ts.map +1 -0
  36. package/dist/exe-dev/sweep.js +117 -0
  37. package/dist/exe-dev/sweep.js.map +1 -0
  38. package/dist/executor.d.ts +118 -0
  39. package/dist/executor.d.ts.map +1 -0
  40. package/dist/executor.js +98 -0
  41. package/dist/executor.js.map +1 -0
  42. package/dist/harness-preflight.d.ts +6 -0
  43. package/dist/harness-preflight.d.ts.map +1 -0
  44. package/dist/harness-preflight.js +50 -0
  45. package/dist/harness-preflight.js.map +1 -0
  46. package/dist/invalid-frame.d.ts +17 -0
  47. package/dist/invalid-frame.d.ts.map +1 -0
  48. package/dist/invalid-frame.js +111 -0
  49. package/dist/invalid-frame.js.map +1 -0
  50. package/dist/keyed-lock.d.ts +11 -0
  51. package/dist/keyed-lock.d.ts.map +1 -0
  52. package/dist/keyed-lock.js +21 -0
  53. package/dist/keyed-lock.js.map +1 -0
  54. package/dist/local/local.d.ts +20 -0
  55. package/dist/local/local.d.ts.map +1 -0
  56. package/dist/local/local.js +273 -0
  57. package/dist/local/local.js.map +1 -0
  58. package/dist/prepared-attempt.d.ts +5 -0
  59. package/dist/prepared-attempt.d.ts.map +1 -0
  60. package/dist/prepared-attempt.js +40 -0
  61. package/dist/prepared-attempt.js.map +1 -0
  62. package/dist/provision.d.ts +43 -0
  63. package/dist/provision.d.ts.map +1 -0
  64. package/dist/provision.js +147 -0
  65. package/dist/provision.js.map +1 -0
  66. package/dist/run-host-session.d.ts +26 -0
  67. package/dist/run-host-session.d.ts.map +1 -0
  68. package/dist/run-host-session.js +241 -0
  69. package/dist/run-host-session.js.map +1 -0
  70. package/package.json +21 -5
  71. package/dist/index.d.ts +0 -8
  72. package/dist/index.d.ts.map +0 -1
  73. package/dist/index.js +0 -8
  74. package/dist/index.js.map +0 -1
@@ -0,0 +1,241 @@
1
+ import * as AttemptChannel from "@usine/core/attempt/channel";
2
+ import { AgentFailure, AttemptFailure, InfraFailure } from "@usine/core/attempt/failure";
3
+ import { AttemptId } from "@usine/core/attempt";
4
+ import { StepResult } from "@usine/core/step/result";
5
+ import { Cause, DateTime, Effect, Fiber, Option, Queue, Ref, Result, Schema, Scope, Stream, } from "effect";
6
+ import { ExecutorError, ExecutorOperationError } from "./executor.js";
7
+ import { invalidFrameDiagnostic, invalidFrameMessage } from "./invalid-frame.js";
8
+ const STDERR_TAIL_BYTES = 4_096;
9
+ /** Sending SIGKILL is its own bounded step, unrelated to the interrupt grace. */
10
+ const KILL_TIMEOUT = "5 seconds";
11
+ const inputFrameToJson = Schema.encodeSync(AttemptChannel.InputFrameFromJson);
12
+ /** Rejects a frame with any unknown key; the protocol is strict by contract. */
13
+ const decodeOutboundEnvelope = (line) => Schema.decodeUnknownEffect(AttemptChannel.OutboundEnvelopeFromJson)(line, {
14
+ onExcessProperty: "error",
15
+ });
16
+ const isExecutorError = Schema.is(ExecutorError);
17
+ const encoder = new TextEncoder();
18
+ const frame = (input) => encoder.encode(`${inputFrameToJson(input)}\n`);
19
+ const infrastructureFailure = (message, cause) => new InfraFailure({ message, cause });
20
+ const violationFailure = (violation) => infrastructureFailure(violation.message, new Error(violation.detail));
21
+ const cancelError = (attemptId, cause) => new ExecutorOperationError({
22
+ operation: "cancel",
23
+ message: `Could not cancel Attempt ${attemptId}`,
24
+ cause,
25
+ });
26
+ /** The run-host byte-channel session every process-backed Executor shares. */
27
+ export const runHostSessionFor = Effect.fn("RunHostSession.for")(function* (options) {
28
+ const activeAttempts = yield* Ref.make(new Map());
29
+ const hardKill = Effect.fn("RunHostSession.hardKill")(function* (attemptId, active, reason) {
30
+ yield* Effect.logWarning("Hard-killing the run host", {
31
+ attemptId,
32
+ worker: active.worker,
33
+ host: active.host,
34
+ reason,
35
+ });
36
+ // The kill failure is logged, never propagated, so it cannot mask the
37
+ // failure that forced the hard kill.
38
+ yield* active.handle.kill({ killSignal: "SIGKILL" }).pipe(Effect.timeout(KILL_TIMEOUT), Effect.tapError((error) => Effect.logError("Run-host hard kill failed", {
39
+ attemptId,
40
+ worker: active.worker,
41
+ host: active.host,
42
+ reason,
43
+ message: String(error),
44
+ })), Effect.ignore);
45
+ yield* Effect.logWarning("Run-host hard-kill signal sent", {
46
+ attemptId,
47
+ worker: active.worker,
48
+ host: active.host,
49
+ reason,
50
+ });
51
+ });
52
+ const cancelActive = Effect.fn("RunHostSession.cancelActive")(function* (attemptId, active) {
53
+ return yield* Effect.uninterruptible(Effect.gen(function* () {
54
+ yield* Effect.annotateCurrentSpan({
55
+ attemptId,
56
+ worker: active.worker,
57
+ host: active.host,
58
+ });
59
+ const first = yield* Ref.modify(active.cancelStarted, (started) => [!started, true]);
60
+ if (!first) {
61
+ yield* Effect.logDebug("Attempt cancellation was already started", {
62
+ attemptId,
63
+ worker: active.worker,
64
+ host: active.host,
65
+ });
66
+ return;
67
+ }
68
+ yield* Effect.logInfo("Sending the interrupt envelope", {
69
+ attemptId,
70
+ worker: active.worker,
71
+ host: active.host,
72
+ });
73
+ const sequence = yield* Ref.getAndUpdate(active.sequence, (value) => value + 1);
74
+ const envelope = new AttemptChannel.InboundEnvelope({
75
+ version: AttemptChannel.PROTOCOL_VERSION,
76
+ attemptId,
77
+ sequence: AttemptChannel.Sequence.make(sequence),
78
+ sentAt: yield* DateTime.now,
79
+ payload: new AttemptChannel.Interrupt(),
80
+ });
81
+ const delivered = yield* active.io.append("inbound", envelope).pipe(Effect.andThen(Queue.offer(active.input, frame(envelope))),
82
+ // The transcript store sits outside the process adapter and may be
83
+ // parked; the bound keeps the uninterruptible cancellation handshake
84
+ // moving on to the hard kill.
85
+ Effect.timeoutOption(options.interruptGrace), Effect.result);
86
+ if (Result.isFailure(delivered)) {
87
+ yield* Effect.logWarning("Interrupt could not be delivered", {
88
+ attemptId,
89
+ worker: active.worker,
90
+ host: active.host,
91
+ message: String(delivered.failure),
92
+ });
93
+ yield* hardKill(attemptId, active, "delivery-failed");
94
+ return yield* delivered.failure;
95
+ }
96
+ if (Option.isNone(delivered.success)) {
97
+ const cause = new Error("interrupt delivery exceeded the cancellation grace");
98
+ yield* Effect.logWarning("Interrupt delivery timed out", {
99
+ attemptId,
100
+ worker: active.worker,
101
+ host: active.host,
102
+ });
103
+ yield* hardKill(attemptId, active, "delivery-failed");
104
+ return yield* cancelError(attemptId, cause);
105
+ }
106
+ const completed = yield* active.handle.exitCode.pipe(Effect.timeoutOption(options.interruptGrace));
107
+ if (Option.isNone(completed)) {
108
+ yield* Effect.logWarning("Interrupt grace expired", {
109
+ attemptId,
110
+ worker: active.worker,
111
+ host: active.host,
112
+ });
113
+ yield* hardKill(attemptId, active, "grace-expired");
114
+ }
115
+ else {
116
+ yield* Effect.logInfo("Run host stopped within the interrupt grace", {
117
+ attemptId,
118
+ worker: active.worker,
119
+ host: active.host,
120
+ });
121
+ }
122
+ }));
123
+ });
124
+ const cancel = Effect.fn("RunHostSession.cancel")(function* (attemptId) {
125
+ const active = (yield* Ref.get(activeAttempts)).get(attemptId);
126
+ if (active === undefined) {
127
+ yield* Effect.logDebug("Attempt cancellation was a no-op", { attemptId });
128
+ return;
129
+ }
130
+ yield* cancelActive(attemptId, active).pipe(Effect.mapError((cause) => isExecutorError(cause) ? cause : cancelError(attemptId, cause)));
131
+ });
132
+ const launch = Effect.fn("RunHostSession.launch")(function* (prepared, io, spawn) {
133
+ const attemptId = prepared.spec.attemptId;
134
+ yield* Effect.annotateCurrentSpan({ attemptId, worker: prepared.worker });
135
+ const execute = Effect.scoped(Effect.gen(function* () {
136
+ const input = yield* Queue.make();
137
+ const { handle, host, scrub } = yield* spawn(input);
138
+ yield* Effect.annotateCurrentSpan({ host });
139
+ const active = {
140
+ cancelStarted: yield* Ref.make(false),
141
+ handle,
142
+ host,
143
+ input,
144
+ io,
145
+ sequence: yield* Ref.make(1),
146
+ worker: prepared.worker,
147
+ };
148
+ yield* Ref.update(activeAttempts, (current) => {
149
+ const next = new Map(current);
150
+ next.set(attemptId, active);
151
+ return next;
152
+ });
153
+ yield* Queue.offer(input, frame(new AttemptChannel.Start({
154
+ version: AttemptChannel.PROTOCOL_VERSION,
155
+ spec: prepared.spec,
156
+ })));
157
+ const stderr = yield* Ref.make("");
158
+ const stderrFiber = yield* handle.stderr.pipe(Stream.decodeText(), Stream.runForEach((chunk) => Ref.update(stderr, (current) => `${current}${chunk}`.slice(-STDERR_TAIL_BYTES))), Effect.forkChild);
159
+ const terminal = yield* Ref.make(Option.none());
160
+ const progress = yield* Ref.make(AttemptChannel.initialProgress);
161
+ yield* handle.stdout.pipe(Stream.decodeText(), Stream.splitLines, Stream.runForEach((rawLine) => Effect.gen(function* () {
162
+ // Frames include raw tool inputs and outputs; scrub the credential
163
+ // from the line before it is decoded or persisted.
164
+ const line = scrub(rawLine);
165
+ const decoded = yield* decodeOutboundEnvelope(line).pipe(Effect.result);
166
+ if (Result.isFailure(decoded)) {
167
+ const diagnostic = invalidFrameDiagnostic(line, decoded.failure);
168
+ if (diagnostic.source === "effect-log") {
169
+ yield* Effect.logWarning("Dropped a run-host diagnostic from protocol output", {
170
+ attemptId,
171
+ ...diagnostic,
172
+ });
173
+ return;
174
+ }
175
+ yield* Effect.logError("Run host emitted an invalid frame", {
176
+ attemptId,
177
+ ...diagnostic,
178
+ });
179
+ return yield* infrastructureFailure(invalidFrameMessage(diagnostic), decoded.failure);
180
+ }
181
+ const envelope = decoded.success;
182
+ const admitted = AttemptChannel.admit(yield* Ref.get(progress), attemptId, envelope);
183
+ if (Result.isFailure(admitted))
184
+ return yield* violationFailure(admitted.failure);
185
+ yield* Ref.set(progress, admitted.success);
186
+ yield* io.append("outbound", envelope);
187
+ const payload = envelope.payload;
188
+ if (payload._tag === "Final" ||
189
+ payload._tag === "Failed" ||
190
+ payload._tag === "Interrupted") {
191
+ yield* Effect.logInfo("Run host reached its terminal envelope", {
192
+ attemptId,
193
+ terminal: payload._tag,
194
+ sequence: envelope.sequence,
195
+ });
196
+ yield* Ref.set(terminal, Option.some(payload));
197
+ yield* Queue.end(input);
198
+ }
199
+ })), Effect.mapError((error) => Schema.is(AttemptFailure)(error)
200
+ ? error
201
+ : infrastructureFailure("The run-host channel failed", error)));
202
+ const exitCode = yield* handle.exitCode.pipe(Effect.mapError((cause) => infrastructureFailure("Could not read the run-host exit code", cause)));
203
+ yield* Fiber.join(stderrFiber).pipe(Effect.tapError((error) => Effect.logWarning("Could not finish reading run-host stderr", {
204
+ attemptId,
205
+ message: String(error),
206
+ })), Effect.ignore);
207
+ yield* Effect.logInfo("Run host exited", {
208
+ attemptId,
209
+ exitCode: String(exitCode),
210
+ });
211
+ const ended = yield* Ref.get(terminal);
212
+ const errorOutput = scrub((yield* Ref.get(stderr)).trim());
213
+ if (Option.isNone(ended)) {
214
+ return yield* infrastructureFailure("The run-host channel closed without a final envelope", new Error(`run host exited with code ${String(exitCode)}: ${errorOutput}`));
215
+ }
216
+ if (ended.value._tag === "Failed")
217
+ return yield* ended.value.failure;
218
+ if (ended.value._tag === "Interrupted") {
219
+ return yield* new AgentFailure({
220
+ message: "The run host confirmed the interrupt and stopped",
221
+ });
222
+ }
223
+ if (Number(exitCode) !== 0) {
224
+ return yield* infrastructureFailure(`The run host exited with code ${String(exitCode)} after its final envelope`, new Error(errorOutput));
225
+ }
226
+ return ended.value.result;
227
+ }).pipe(Effect.onInterrupt(() => cancel(attemptId).pipe(Effect.tapError((error) => Effect.logWarning("Cancel-on-interrupt failed", {
228
+ attemptId,
229
+ message: String(error),
230
+ })), Effect.ignore))));
231
+ return yield* execute.pipe(Effect.ensuring(Ref.update(activeAttempts, (current) => {
232
+ const next = new Map(current);
233
+ next.delete(attemptId);
234
+ return next;
235
+ })), Effect.mapError((error) => Schema.is(AttemptFailure)(error)
236
+ ? error
237
+ : infrastructureFailure("The executor failed while running the run host", error)));
238
+ });
239
+ return { cancel, launch };
240
+ });
241
+ //# sourceMappingURL=run-host-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-host-session.js","sourceRoot":"","sources":["../src/run-host-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MA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7 +1,7 @@
1
1
  {
2
2
  "name": "@usine/executor",
3
- "version": "0.0.1",
4
- "description": "The usine executor seam: the five-operation worker contract, with local and exe.dev executors.",
3
+ "version": "0.2.0",
4
+ "description": "The usine scoped Worker contract with local and exe.dev adapters.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -15,15 +15,29 @@
15
15
  "sideEffects": false,
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/index.d.ts",
19
- "default": "./dist/index.js"
18
+ "types": "./dist/executor.d.ts",
19
+ "default": "./dist/executor.js"
20
+ },
21
+ "./exe-dev": {
22
+ "types": "./dist/exe-dev/exe-dev.d.ts",
23
+ "default": "./dist/exe-dev/exe-dev.js"
24
+ },
25
+ "./local": {
26
+ "types": "./dist/local/local.d.ts",
27
+ "default": "./dist/local/local.js"
20
28
  }
21
29
  },
22
30
  "publishConfig": {
23
31
  "access": "public"
24
32
  },
33
+ "dependencies": {
34
+ "@usine/core": "0.2.0"
35
+ },
25
36
  "devDependencies": {
37
+ "@effect/vitest": "4.0.0-rc.111",
38
+ "effect": "4.0.0-rc.111",
26
39
  "typescript": "7.0.2",
40
+ "vitest": "4.1.11",
27
41
  "@usine/tsconfig": "0.0.0"
28
42
  },
29
43
  "peerDependencies": {
@@ -33,6 +47,8 @@
33
47
  "node": ">=22"
34
48
  },
35
49
  "scripts": {
36
- "build": "tsc -b"
50
+ "build": "tsc -b",
51
+ "check": "tsc -p tsconfig.check.json",
52
+ "test": "vitest run"
37
53
  }
38
54
  }
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @usine/executor — The usine executor seam: the five-operation worker contract, with local and exe.dev executors.
3
- *
4
- * Not implemented yet: this 0.0.x release reserves the block's seam while the
5
- * engine grows.
6
- */
7
- export {};
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC"}
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @usine/executor — The usine executor seam: the five-operation worker contract, with local and exe.dev executors.
3
- *
4
- * Not implemented yet: this 0.0.x release reserves the block's seam while the
5
- * engine grows.
6
- */
7
- export {};
8
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC"}