@usine/executor 0.1.0 → 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 (79) hide show
  1. package/README.md +52 -21
  2. package/dist/child-command.d.ts +8 -5
  3. package/dist/child-command.d.ts.map +1 -1
  4. package/dist/child-command.js +10 -7
  5. package/dist/child-command.js.map +1 -1
  6. package/dist/exe-dev/channel.d.ts +7 -4
  7. package/dist/exe-dev/channel.d.ts.map +1 -1
  8. package/dist/exe-dev/channel.js +15 -19
  9. package/dist/exe-dev/channel.js.map +1 -1
  10. package/dist/exe-dev/commands.d.ts +1 -1
  11. package/dist/exe-dev/commands.d.ts.map +1 -1
  12. package/dist/exe-dev/commands.js +7 -8
  13. package/dist/exe-dev/commands.js.map +1 -1
  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 +3 -4
  19. package/dist/exe-dev/grants.d.ts.map +1 -1
  20. package/dist/exe-dev/grants.js +31 -15
  21. package/dist/exe-dev/grants.js.map +1 -1
  22. package/dist/exe-dev/model.d.ts +8 -23
  23. package/dist/exe-dev/model.d.ts.map +1 -1
  24. package/dist/exe-dev/model.js +5 -12
  25. package/dist/exe-dev/model.js.map +1 -1
  26. package/dist/exe-dev/preflight.d.ts +3 -2
  27. package/dist/exe-dev/preflight.d.ts.map +1 -1
  28. package/dist/exe-dev/preflight.js +8 -8
  29. package/dist/exe-dev/preflight.js.map +1 -1
  30. package/dist/exe-dev/shell.d.ts +5 -5
  31. package/dist/exe-dev/shell.d.ts.map +1 -1
  32. package/dist/exe-dev/shell.js +7 -7
  33. package/dist/exe-dev/shell.js.map +1 -1
  34. package/dist/exe-dev/sweep.d.ts +3 -5
  35. package/dist/exe-dev/sweep.d.ts.map +1 -1
  36. package/dist/exe-dev/sweep.js +8 -10
  37. package/dist/exe-dev/sweep.js.map +1 -1
  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 +1 -1
  47. package/dist/invalid-frame.d.ts.map +1 -1
  48. package/dist/invalid-frame.js +2 -1
  49. package/dist/invalid-frame.js.map +1 -1
  50. package/dist/keyed-lock.d.ts +2 -2
  51. package/dist/keyed-lock.js +2 -2
  52. package/dist/local/local.d.ts +20 -0
  53. package/dist/local/local.d.ts.map +1 -0
  54. package/dist/local/{index.js → local.js} +86 -115
  55. package/dist/local/local.js.map +1 -0
  56. package/dist/prepared-attempt.d.ts +5 -0
  57. package/dist/prepared-attempt.d.ts.map +1 -0
  58. package/dist/prepared-attempt.js +40 -0
  59. package/dist/prepared-attempt.js.map +1 -0
  60. package/dist/provision.d.ts +20 -10
  61. package/dist/provision.d.ts.map +1 -1
  62. package/dist/provision.js +94 -23
  63. package/dist/provision.js.map +1 -1
  64. package/dist/run-host-session.d.ts +12 -8
  65. package/dist/run-host-session.d.ts.map +1 -1
  66. package/dist/run-host-session.js +35 -22
  67. package/dist/run-host-session.js.map +1 -1
  68. package/package.json +11 -11
  69. package/dist/exe-dev/index.d.ts +0 -8
  70. package/dist/exe-dev/index.d.ts.map +0 -1
  71. package/dist/exe-dev/index.js +0 -239
  72. package/dist/exe-dev/index.js.map +0 -1
  73. package/dist/index.d.ts +0 -82
  74. package/dist/index.d.ts.map +0 -1
  75. package/dist/index.js +0 -82
  76. package/dist/index.js.map +0 -1
  77. package/dist/local/index.d.ts +0 -15
  78. package/dist/local/index.d.ts.map +0 -1
  79. package/dist/local/index.js.map +0 -1
@@ -0,0 +1,118 @@
1
+ import { Agent } from "@usine/core/agent";
2
+ import { BrainSpec } from "@usine/core/agent/brain";
3
+ import { AttemptId } from "@usine/core/attempt";
4
+ import * as AttemptChannel from "@usine/core/attempt/channel";
5
+ import { AttemptFailure } from "@usine/core/attempt/failure";
6
+ import { RepositoryName } from "@usine/core/repository";
7
+ import { WorkerName, WorkerKind } from "@usine/core/worker";
8
+ import { StepResult } from "@usine/core/step/result";
9
+ import { Context, Effect, Redacted, Schema, Scope } from "effect";
10
+ /** The Worker operation that failed during readiness checks or an Attempt's lifecycle. */
11
+ export declare const ExecutorOperation: Schema.Literals<readonly ["preflight", "prepare", "launch", "cancel", "cleanup"]>;
12
+ export type ExecutorOperation = typeof ExecutorOperation.Type;
13
+ /** A prerequisite a Worker must satisfy before it can accept Attempts. */
14
+ export declare const WorkerCapability: Schema.Literals<readonly ["machine", "toolchain", "run-host", "harness-login", "credentials"]>;
15
+ export type WorkerCapability = typeof WorkerCapability.Type;
16
+ declare const ExecutorOperationError_base: Schema.Class<ExecutorOperationError, Schema.TaggedStruct<"ExecutorOperationError", {
17
+ readonly operation: Schema.Literals<readonly ["preflight", "prepare", "launch", "cancel", "cleanup"]>;
18
+ readonly message: Schema.NonEmptyString;
19
+ readonly cause: Schema.Defect;
20
+ }>, import("effect/Cause").YieldableError>;
21
+ /** A Worker operation failed before its requested work completed. */
22
+ export declare class ExecutorOperationError extends ExecutorOperationError_base {
23
+ }
24
+ declare const CredentialUnavailableError_base: Schema.Class<CredentialUnavailableError, Schema.TaggedStruct<"CredentialUnavailableError", {
25
+ readonly repository: Schema.brand<Schema.String, "RepositoryName">;
26
+ readonly message: Schema.NonEmptyString;
27
+ readonly cause: Schema.Defect;
28
+ }>, import("effect/Cause").YieldableError>;
29
+ /** A Worker could not obtain access to the repository assigned to an Attempt. */
30
+ export declare class CredentialUnavailableError extends CredentialUnavailableError_base {
31
+ }
32
+ declare const WorkerCapabilityError_base: Schema.Class<WorkerCapabilityError, Schema.TaggedStruct<"WorkerCapabilityError", {
33
+ readonly worker: Schema.brand<Schema.String, "WorkerName">;
34
+ readonly capability: Schema.Literals<readonly ["machine", "toolchain", "run-host", "harness-login", "credentials"]>;
35
+ readonly message: Schema.NonEmptyString;
36
+ readonly cause: Schema.Defect;
37
+ }>, import("effect/Cause").YieldableError>;
38
+ /** A verify-only preflight found a Worker capability missing or incompatible. */
39
+ export declare class WorkerCapabilityError extends WorkerCapabilityError_base {
40
+ }
41
+ /** A readiness, access, or lifecycle failure reported by a Worker operation. */
42
+ export declare const ExecutorError: Schema.Union<readonly [typeof ExecutorOperationError, typeof CredentialUnavailableError, typeof WorkerCapabilityError]>;
43
+ export type ExecutorError = typeof ExecutorError.Type;
44
+ /** Logs every preflight refusal so a missing capability is explainable from logs alone. */
45
+ export declare const logPreflightFailure: <A, R>(effect: Effect.Effect<A, ExecutorError, R>) => Effect.Effect<A, ExecutorError, R>;
46
+ /** Process command for a one-shot run host or a preflight capability probe. */
47
+ export interface RunHostCommand {
48
+ readonly command: string;
49
+ readonly args: ReadonlyArray<string>;
50
+ }
51
+ declare const CheckoutRequest_base: Schema.Class<CheckoutRequest, Schema.Struct<{
52
+ readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
53
+ readonly worker: Schema.brand<Schema.String, "WorkerName">;
54
+ readonly repository: Schema.brand<Schema.String, "RepositoryName">;
55
+ readonly revision: Schema.brand<Schema.String, "RepositoryRevision">;
56
+ readonly payload: Schema.Codec<Schema.Json, Schema.Json, never, never>;
57
+ readonly task: Schema.brand<Schema.String, "AttemptTask">;
58
+ readonly agent: typeof Agent;
59
+ readonly parentModel: Schema.Option<Schema.brand<Schema.String, "ModelId">>;
60
+ readonly maxChildren: Schema.brand<Schema.Int, "ChildSessionBudget">;
61
+ /** Maximum minutes of live run-host execution; preparation and resource cleanup are outside this budget. */
62
+ readonly maxAttemptMinutes: Schema.Int;
63
+ readonly parentEffort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
64
+ }>, {}>;
65
+ /** The repository, revision, and Agent task assigned to a Worker for one fresh Attempt checkout. */
66
+ export declare class CheckoutRequest extends CheckoutRequest_base {
67
+ }
68
+ /** One Attempt's disposable checkout directory. */
69
+ export declare const WorktreePath: Schema.brand<Schema.NonEmptyString, "WorktreePath">;
70
+ export type WorktreePath = typeof WorktreePath.Type;
71
+ declare const AttemptWorkspace_base: Schema.Class<AttemptWorkspace, Schema.Struct<{
72
+ readonly worker: Schema.brand<Schema.String, "WorkerName">;
73
+ readonly spec: typeof AttemptChannel.RunSpec;
74
+ readonly worktree: Schema.brand<Schema.NonEmptyString, "WorktreePath">;
75
+ }>, {}>;
76
+ /** The serializable location and RunSpec of an Attempt checkout. Owning this record does not grant access to live resources or credentials. */
77
+ export declare class AttemptWorkspace extends AttemptWorkspace_base {
78
+ }
79
+ /**
80
+ * One prepared Attempt with a scoped checkout and repository access. Use it within
81
+ * the scope that prepared it. Closing that scope stops any active run host before
82
+ * removing the checkout and releasing credentials, including when launch never starts.
83
+ */
84
+ export interface PreparedAttempt {
85
+ /** Checkout metadata suitable for inspection or serialization; contains no credentials. */
86
+ readonly workspace: AttemptWorkspace;
87
+ /**
88
+ * Runs this Attempt once, recording channel activity through `io`. Completion,
89
+ * failure, or interruption releases its resources before returning. Cleanup
90
+ * failures are logged without replacing the agent's outcome or retrying its work.
91
+ * Reusing an Attempt after launch or release fails with an infrastructure error.
92
+ */
93
+ readonly launch: (io: AttemptChannel.Sink) => Effect.Effect<StepResult, AttemptFailure>;
94
+ }
95
+ declare const CredentialProvider_base: Context.ServiceClass<CredentialProvider, "@usine/executor/CredentialProvider", {
96
+ readonly issue: (repository: RepositoryName, attemptId: AttemptId) => Effect.Effect<Redacted.Redacted<string>, CredentialUnavailableError>;
97
+ }>;
98
+ /** Mints exactly one repository-scoped credential for each prepared Attempt. */
99
+ export declare class CredentialProvider extends CredentialProvider_base {
100
+ }
101
+ declare const Executor_base: Context.ServiceClass<Executor, "@usine/executor/Executor", {
102
+ readonly kind: WorkerKind;
103
+ /** Verifies Git, the run host, and each rostered brain in the Worker environment; never installs tools or logs in. */
104
+ readonly preflight: (worker: WorkerName, brains: ReadonlyArray<BrainSpec>) => Effect.Effect<void, ExecutorError>;
105
+ /**
106
+ * Verifies the assigned brain before acquiring a fresh Attempt in the caller's scope. Clone, fetch, and lock waits
107
+ * remain interruptible; partial preparation releases everything already acquired
108
+ * before reporting failure. Each request must identify a fresh Attempt.
109
+ */
110
+ readonly prepare: (request: CheckoutRequest) => Effect.Effect<PreparedAttempt, ExecutorError, Scope.Scope>;
111
+ /** Requests an active Attempt to stop, allowing a grace period before forcing termination. */
112
+ readonly cancel: (attemptId: AttemptId) => Effect.Effect<void, ExecutorError>;
113
+ }>;
114
+ /** Prepares isolated checkouts, runs Attempts on a Worker, and releases their resources (ADR 0006). */
115
+ export declare class Executor extends Executor_base {
116
+ }
117
+ export {};
118
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAmB,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAe,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAsB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAElE,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,mFAM5B,CAAC;AACH,MAA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AAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;CACzF;;oBAMmB,CACd,UAAU,EAAE,cAAc,EAC1B,SAAS,EAAE,SAAS,KACjB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,0BAA0B,CAAC;;AAP7E,gFAAgF;AAChF,qBAAa,kBAAmB,SAAQ,uBAQC;CAAG;;mBAMzB,UAAU;IACzB,sHAAsH;wBAClG,CAClB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC;IACvC;;;;OAIG;sBACe,CAChB,OAAO,EAAE,eAAe,KACrB,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC;IAC/D,8FAA8F;qBAC7E,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC;;AAnBjF,uGAAuG;AACvG,qBAAa,QAAS,SAAQ,aAoBC;CAAG"}
@@ -0,0 +1,98 @@
1
+ import { Agent } from "@usine/core/agent";
2
+ import { BrainSpec, Effort, ModelId } from "@usine/core/agent/brain";
3
+ import { ChildSessionBudget } from "@usine/core/agent/session";
4
+ import { AttemptTask, AttemptId } from "@usine/core/attempt";
5
+ import * as AttemptChannel from "@usine/core/attempt/channel";
6
+ import { AttemptFailure } from "@usine/core/attempt/failure";
7
+ import { RepositoryName, RepositoryRevision } from "@usine/core/repository";
8
+ import { WorkerName, WorkerKind } from "@usine/core/worker";
9
+ import { StepResult } from "@usine/core/step/result";
10
+ import { Context, Effect, Redacted, Schema, Scope } from "effect";
11
+ /** The Worker operation that failed during readiness checks or an Attempt's lifecycle. */
12
+ export const ExecutorOperation = Schema.Literals([
13
+ "preflight",
14
+ "prepare",
15
+ "launch",
16
+ "cancel",
17
+ "cleanup",
18
+ ]);
19
+ /** A prerequisite a Worker must satisfy before it can accept Attempts. */
20
+ export const WorkerCapability = Schema.Literals([
21
+ "machine",
22
+ "toolchain",
23
+ "run-host",
24
+ "harness-login",
25
+ "credentials",
26
+ ]);
27
+ /** A Worker operation failed before its requested work completed. */
28
+ export class ExecutorOperationError extends Schema.TaggedError("@usine/executor/ExecutorOperationError")("ExecutorOperationError", {
29
+ operation: ExecutorOperation,
30
+ message: Schema.NonEmptyString,
31
+ cause: Schema.Defect(),
32
+ }) {
33
+ }
34
+ /** A Worker could not obtain access to the repository assigned to an Attempt. */
35
+ export class CredentialUnavailableError extends Schema.TaggedError("@usine/executor/CredentialUnavailableError")("CredentialUnavailableError", {
36
+ repository: RepositoryName,
37
+ message: Schema.NonEmptyString,
38
+ cause: Schema.Defect(),
39
+ }) {
40
+ }
41
+ /** A verify-only preflight found a Worker capability missing or incompatible. */
42
+ export class WorkerCapabilityError extends Schema.TaggedError("@usine/executor/WorkerCapabilityError")("WorkerCapabilityError", {
43
+ worker: WorkerName,
44
+ capability: WorkerCapability,
45
+ message: Schema.NonEmptyString,
46
+ cause: Schema.Defect(),
47
+ }) {
48
+ }
49
+ /** A readiness, access, or lifecycle failure reported by a Worker operation. */
50
+ export const ExecutorError = Schema.Union([
51
+ ExecutorOperationError,
52
+ CredentialUnavailableError,
53
+ WorkerCapabilityError,
54
+ ]);
55
+ /** Logs every preflight refusal so a missing capability is explainable from logs alone. */
56
+ export const logPreflightFailure = (effect) => Effect.tapError(effect, (error) => error instanceof WorkerCapabilityError
57
+ ? Effect.logError("Worker preflight failed", {
58
+ error: error._tag,
59
+ message: error.message,
60
+ worker: error.worker,
61
+ capability: error.capability,
62
+ })
63
+ : Effect.logError("Worker preflight failed", {
64
+ error: error._tag,
65
+ message: error.message,
66
+ }));
67
+ /** The repository, revision, and Agent task assigned to a Worker for one fresh Attempt checkout. */
68
+ export class CheckoutRequest extends Schema.Class("@usine/executor/CheckoutRequest")({
69
+ attemptId: AttemptId,
70
+ worker: WorkerName,
71
+ repository: RepositoryName,
72
+ revision: RepositoryRevision,
73
+ payload: Schema.Json,
74
+ task: AttemptTask,
75
+ agent: Agent,
76
+ parentModel: Schema.Option(ModelId),
77
+ maxChildren: ChildSessionBudget,
78
+ /** Maximum minutes of live run-host execution; preparation and resource cleanup are outside this budget. */
79
+ maxAttemptMinutes: Schema.Int.check(Schema.isGreaterThan(0)),
80
+ parentEffort: Effort,
81
+ }) {
82
+ }
83
+ /** One Attempt's disposable checkout directory. */
84
+ export const WorktreePath = Schema.NonEmptyString.pipe(Schema.brand("WorktreePath"));
85
+ /** The serializable location and RunSpec of an Attempt checkout. Owning this record does not grant access to live resources or credentials. */
86
+ export class AttemptWorkspace extends Schema.Class("@usine/executor/AttemptWorkspace")({
87
+ worker: WorkerName,
88
+ spec: AttemptChannel.RunSpec,
89
+ worktree: WorktreePath,
90
+ }) {
91
+ }
92
+ /** Mints exactly one repository-scoped credential for each prepared Attempt. */
93
+ export class CredentialProvider extends Context.Service()("@usine/executor/CredentialProvider") {
94
+ }
95
+ /** Prepares isolated checkouts, runs Attempts on a Worker, and releases their resources (ADR 0006). */
96
+ export class Executor extends Context.Service()("@usine/executor/Executor") {
97
+ }
98
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,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Aa,CAAC,CAAC,CAAC,CAAC;IAC5D,YAAY,EAAE,MAAM;CACrB,CAAC;CAAG;AAEL,mDAAmD;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAGrF,+IAA+I;AAC/I,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,KAAK,CAChD,kCAAkC,CACnC,CAAC;IACA,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,QAAQ,EAAE,YAAY;CACvB,CAAC;CAAG;AAmBL,gFAAgF;AAChF,MAAM,OAAO,kBAAmB,SAAQ,OAAO,CAAC,OAAO,EAQpD,CAAC,oCAAoC,CAAC;CAAG;AAE5C,uGAAuG;AACvG,MAAM,OAAO,QAAS,SAAQ,OAAO,CAAC,OAAO,EAoB1C,CAAC,0BAA0B,CAAC;CAAG"}
@@ -0,0 +1,6 @@
1
+ import { BrainSpec } from "@usine/core/agent/brain";
2
+ import { Effect } from "effect";
3
+ import { ExecutorOperationError, type RunHostCommand, WorkerCapabilityError } from "./executor.ts";
4
+ /** Uses the installed run host so both adapters check the same worker-side harness contract. */
5
+ export declare const verifyHarnesses: (worker: string & import("effect/Brand").Brand<"WorkerName">, brains: readonly BrainSpec[], runHost: RunHostCommand, execute: (command: string, args: ReadonlyArray<string>) => Effect.Effect<string, ExecutorOperationError>) => Effect.Effect<undefined, import("./executor.ts").CredentialUnavailableError | ExecutorOperationError | WorkerCapabilityError, never>;
6
+ //# sourceMappingURL=harness-preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-preflight.d.ts","sourceRoot":"","sources":["../src/harness-preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAgB,MAAM,EAAU,MAAM,QAAQ,CAAC;AACtD,OAAO,EAEL,sBAAsB,EACtB,KAAK,cAAc,EACnB,qBAAqB,EACtB,MAAM,eAAe,CAAC;AAEvB,gGAAgG;AAChG,eAAO,MAAM,eAAe,0IAKf,MAAM,QACT,aAAa,CAAC,MAAM,CAAC,KACxB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,yIA2D7B,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { BrainSpec } from "@usine/core/agent/brain";
2
+ import { HarnessReadiness } from "@usine/core/agent/capability";
3
+ import { Array as Arr, Effect, Schema } from "effect";
4
+ import { logPreflightFailure, ExecutorOperationError, WorkerCapabilityError, } from "./executor.js";
5
+ /** Uses the installed run host so both adapters check the same worker-side harness contract. */
6
+ export const verifyHarnesses = Effect.fn("Executor.verifyHarnesses")(function* (worker, brains, runHost, execute) {
7
+ yield* Effect.annotateCurrentSpan({ worker });
8
+ const distinct = Arr.dedupe(brains);
9
+ for (const brain of distinct) {
10
+ // Only a worker's readiness report proves a capability gap. Transport
11
+ // failures and timeouts remain infrastructure failures eligible for retry.
12
+ const response = yield* execute(runHost.command, [
13
+ ...runHost.args,
14
+ "--preflight",
15
+ Schema.encodeSync(Schema.fromJsonString(BrainSpec))(brain),
16
+ ]).pipe(Effect.timeout("75 seconds"), Effect.catchTag("TimeoutError", (cause) => new ExecutorOperationError({
17
+ operation: "preflight",
18
+ message: `Worker ${worker} did not finish probing ${brain.harness} readiness`,
19
+ cause,
20
+ })));
21
+ const result = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(HarnessReadiness))(response, { onExcessProperty: "error" }).pipe(Effect.mapError(() => new WorkerCapabilityError({
22
+ worker,
23
+ capability: "run-host",
24
+ message: `Worker ${worker} returned an invalid harness preflight response; update its run host`,
25
+ cause: new Error("invalid harness readiness response"),
26
+ })));
27
+ if (result.harness !== brain.harness)
28
+ return yield* new WorkerCapabilityError({
29
+ worker,
30
+ capability: "run-host",
31
+ message: `Worker ${worker} returned readiness for the wrong harness`,
32
+ cause: new Error("harness readiness mismatch"),
33
+ });
34
+ if (result._tag === "HarnessUnavailableError")
35
+ return yield* new WorkerCapabilityError({
36
+ worker,
37
+ capability: result.capability === "login" ? "harness-login" : "toolchain",
38
+ message: result.message,
39
+ cause: result,
40
+ });
41
+ yield* Effect.logInfo("Worker harness preflight verified", {
42
+ worker,
43
+ harness: brain.harness,
44
+ model: brain.model,
45
+ });
46
+ }
47
+ if (distinct.length === 0)
48
+ yield* Effect.logDebug("No rostered harnesses to preflight", { worker });
49
+ }, logPreflightFailure);
50
+ //# sourceMappingURL=harness-preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-preflight.js","sourceRoot":"","sources":["../src/harness-preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,KAAK,IAAI,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EAEtB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,gGAAgG;AAChG,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,EAC5E,MAAkB,EAClB,MAAgC,EAChC,OAAuB,EACvB,OAGkD;IAElD,KAAK,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,sEAAsE;QACtE,2EAA2E;QAC3E,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE;YAC/C,GAAG,OAAO,CAAC,IAAI;YACf,aAAa;YACb,MA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AAO,EAAE,MAAM,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM;aACd,CAAC,CAAC;QACL,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,mCAAmC,EAAE;YACzD,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC;IACL,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QACvB,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,oCAAoC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC7E,CAAC,EAAE,mBAAmB,CAAC,CAAC"}
@@ -10,7 +10,7 @@ export interface InvalidFrameDiagnostic {
10
10
  readonly source: FrameSource;
11
11
  readonly version: number | undefined;
12
12
  }
13
- /** Redacted frame diagnostics: shape and schema metadata only, never frame content. */
13
+ /** Describes an invalid frame by shape and schema metadata only, never by its content. */
14
14
  export declare const invalidFrameDiagnostic: (line: string, cause: unknown) => InvalidFrameDiagnostic;
15
15
  export declare const invalidFrameMessage: (diagnostic: InvalidFrameDiagnostic) => string;
16
16
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-frame.d.ts","sourceRoot":"","sources":["../src/invalid-frame.ts"],"names":[],"mappings":"AAiEA,KAAK,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;QAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAeD,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAAS,OAAO,KAAG,sBAgCrE,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,sBAAsB,KAAG,MAUxE,CAAC"}
1
+ {"version":3,"file":"invalid-frame.d.ts","sourceRoot":"","sources":["../src/invalid-frame.ts"],"names":[],"mappings":"AAkEA,KAAK,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;QAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAeD,0FAA0F;AAC1F,eAAO,MAAM,sBAAsB,SAAU,MAAM,SAAS,OAAO,KAAG,sBAgCrE,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,sBAAsB,KAAG,MAUxE,CAAC"}
@@ -56,6 +56,7 @@ const SAFE_PATH_SEGMENTS = new Set([
56
56
  "windowDurationMinutes",
57
57
  "resetsAt",
58
58
  "parentModel",
59
+ "parentEffort",
59
60
  "result",
60
61
  "failure",
61
62
  ]);
@@ -66,7 +67,7 @@ const safeIssuePath = (path) => path
66
67
  return SAFE_PATH_SEGMENTS.has(value) ? value : "<unexpected>";
67
68
  })
68
69
  .join(".");
69
- /** Redacted frame diagnostics: shape and schema metadata only, never frame content. */
70
+ /** Describes an invalid frame by shape and schema metadata only, never by its content. */
70
71
  export const invalidFrameDiagnostic = (line, cause) => {
71
72
  const byteLength = encoder.encode(line).byteLength;
72
73
  const parsed = decodeJsonOption(line);
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-frame.js","sourceRoot":"","sources":["../src/invalid-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,eAAe,GAAG;IACtB,SAAS;IACT,cAAc;IACd,OAAO;IACP,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,cAAc;IACd,uBAAuB;IACvB,iBAAiB;CACT,CAAC;AACX,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACtD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC,WAAW,CACzB,MAAM,CAAC,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KACtF,CAAC,CACH;CACF,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxF,MAAM,wBAAwB,GAAG,MAAM,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;AAC1E,MAAM,wBAAwB,GAAG,MA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CAAC,OAAO,EAAE,IAAI,CAAC,CACxC,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QAC7B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;KACnF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAkC,EAAU,EAAE;IAChF,IAAI,UAAU,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,UAAU,CAAC,MAAM,KAAK,YAAY;YACvC,CAAC,CAAC,sDAAsD;YACxD,CAAC,CAAC,qCAAqC,CAAC;IAC5C,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnC,OAAO,KAAK,KAAK,SAAS;QACxB,CAAC,CAAC,6CAA6C;QAC/C,CAAC,CAAC,kDAAkD,KAAK,CAAC,IAAI,IAAI,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;AACnG,CAAC,CAAC"}
@@ -4,8 +4,8 @@ export interface KeyedLock<in K> {
4
4
  }
5
5
  /**
6
6
  * One mutex per key. `PartitionedSemaphore` is not this: its `permits` option
7
- * is a single shared pool and the partition key only orders waiters, so
8
- * `make({ permits: 1 })` serializes every key behind one global permit.
7
+ * is one shared pool and the partition key only orders waiters, so
8
+ * `make({ permits: 1 })` serializes every key behind a single global permit.
9
9
  */
10
10
  export declare const keyedLockFor: <K>() => Effect.Effect<KeyedLock<K>>;
11
11
  //# sourceMappingURL=keyed-lock.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { Effect, Ref, Semaphore } from "effect";
2
2
  /**
3
3
  * One mutex per key. `PartitionedSemaphore` is not this: its `permits` option
4
- * is a single shared pool and the partition key only orders waiters, so
5
- * `make({ permits: 1 })` serializes every key behind one global permit.
4
+ * is one shared pool and the partition key only orders waiters, so
5
+ * `make({ permits: 1 })` serializes every key behind a single global permit.
6
6
  */
7
7
  export const keyedLockFor = () => Effect.map(Ref.make(new Map()), (locks) => ({
8
8
  withLock: (key) => {
@@ -0,0 +1,20 @@
1
+ import { RepositoryName } from "@usine/core/repository";
2
+ import { InstanceDirectory } from "@usine/core/instance";
3
+ import { Effect, FileSystem, Layer, Path } from "effect";
4
+ import { ChildProcessSpawner } from "effect/unstable/process";
5
+ import { CredentialProvider, Executor, type RunHostCommand } from "../executor.ts";
6
+ export type { RunHostCommand } from "../executor.ts";
7
+ /** Storage and run-host settings for Attempts executed on the local machine. */
8
+ export interface LocalExecutorOptions {
9
+ /** Factory folder under which local Worker caches and Attempt checkouts are stored. */
10
+ readonly instanceDirectory: InstanceDirectory;
11
+ /** How to launch the one-shot run host; the composition root resolves it. */
12
+ readonly runHost: RunHostCommand;
13
+ /** Repository fetch URL override, for example a local mirror; defaults to the GitHub HTTPS clone URL. */
14
+ readonly repositoryUrl?: (repository: RepositoryName) => string;
15
+ /** Grace for delivering a stop request, then for the run host to exit; each wait is bounded separately. Defaults to two seconds. */
16
+ readonly interruptGrace?: Parameters<typeof Effect.timeoutOption>[1];
17
+ }
18
+ /** Runs Attempts in isolated checkouts on the local machine. Requires Node; worker contracts are platform-free. */
19
+ export declare const layer: (options: LocalExecutorOptions) => Layer.Layer<Executor, never, CredentialProvider | FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner>;
20
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/local/local.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,IAAI,EAML,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAEL,kBAAkB,EAClB,QAAQ,EAKR,KAAK,cAAc,EAGpB,MAAM,gBAAgB,CAAC;AAaxB,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,uFAAuF;IACvF,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,yGAAyG;IACzG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,MAAM,CAAC;IAChE,oIAAoI;IACpI,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;CACtE;AAmVD,mHAAmH;AACnH,eAAO,MAAM,KAAK,YACP,oBAAoB,KAC5B,KAAK,CAAC,KAAK,CACZ,QAAQ,EACR,KAAK,EACL,kBAAkB,GAAG,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,mBAAmB,CAC3C,CAAC"}