@usine/core 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 (120) hide show
  1. package/README.md +28 -22
  2. package/dist/agent/agent.d.ts +27 -0
  3. package/dist/agent/agent.d.ts.map +1 -0
  4. package/dist/agent/agent.js +26 -0
  5. package/dist/agent/agent.js.map +1 -0
  6. package/dist/agent/brain.d.ts +24 -0
  7. package/dist/agent/brain.d.ts.map +1 -0
  8. package/dist/agent/brain.js +19 -0
  9. package/dist/agent/brain.js.map +1 -0
  10. package/dist/agent/capability.d.ts +23 -0
  11. package/dist/agent/capability.d.ts.map +1 -0
  12. package/dist/agent/capability.js +19 -0
  13. package/dist/agent/capability.js.map +1 -0
  14. package/dist/{agent.d.ts → agent/session.d.ts} +34 -50
  15. package/dist/agent/session.d.ts.map +1 -0
  16. package/dist/agent/session.js +93 -0
  17. package/dist/agent/session.js.map +1 -0
  18. package/dist/attempt/attempt.d.ts +41 -0
  19. package/dist/attempt/attempt.d.ts.map +1 -0
  20. package/dist/attempt/attempt.js +36 -0
  21. package/dist/attempt/attempt.js.map +1 -0
  22. package/dist/{attempt-channel.d.ts → attempt/channel.d.ts} +28 -32
  23. package/dist/attempt/channel.d.ts.map +1 -0
  24. package/dist/{attempt-channel.js → attempt/channel.js} +25 -26
  25. package/dist/attempt/channel.js.map +1 -0
  26. package/dist/attempt/failure.d.ts +52 -0
  27. package/dist/attempt/failure.d.ts.map +1 -0
  28. package/dist/attempt/failure.js +48 -0
  29. package/dist/attempt/failure.js.map +1 -0
  30. package/dist/attempt/outcome.d.ts +20 -0
  31. package/dist/attempt/outcome.d.ts.map +1 -0
  32. package/dist/attempt/outcome.js +16 -0
  33. package/dist/attempt/outcome.js.map +1 -0
  34. package/dist/cycle-budget.d.ts +38 -0
  35. package/dist/cycle-budget.d.ts.map +1 -0
  36. package/dist/cycle-budget.js +46 -0
  37. package/dist/cycle-budget.js.map +1 -0
  38. package/dist/{lifecycle/event.d.ts → event.d.ts} +6 -11
  39. package/dist/event.d.ts.map +1 -0
  40. package/dist/event.js +21 -0
  41. package/dist/event.js.map +1 -0
  42. package/dist/instance.d.ts +3 -7
  43. package/dist/instance.d.ts.map +1 -1
  44. package/dist/instance.js +2 -6
  45. package/dist/instance.js.map +1 -1
  46. package/dist/item.d.ts +8 -0
  47. package/dist/item.d.ts.map +1 -0
  48. package/dist/item.js +6 -0
  49. package/dist/item.js.map +1 -0
  50. package/dist/loop.d.ts +9 -0
  51. package/dist/loop.d.ts.map +1 -0
  52. package/dist/loop.js +7 -0
  53. package/dist/loop.js.map +1 -0
  54. package/dist/repository.d.ts +12 -17
  55. package/dist/repository.d.ts.map +1 -1
  56. package/dist/repository.js +11 -16
  57. package/dist/repository.js.map +1 -1
  58. package/dist/run/run.d.ts +16 -0
  59. package/dist/run/run.d.ts.map +1 -0
  60. package/dist/run/run.js +16 -0
  61. package/dist/run/run.js.map +1 -0
  62. package/dist/run/state.d.ts +114 -0
  63. package/dist/run/state.d.ts.map +1 -0
  64. package/dist/run/state.js +102 -0
  65. package/dist/run/state.js.map +1 -0
  66. package/dist/{step-result.d.ts → step/result.d.ts} +7 -9
  67. package/dist/step/result.d.ts.map +1 -0
  68. package/dist/{step-result.js → step/result.js} +8 -10
  69. package/dist/step/result.js.map +1 -0
  70. package/dist/step/step.d.ts +21 -0
  71. package/dist/step/step.d.ts.map +1 -0
  72. package/dist/step/step.js +19 -0
  73. package/dist/step/step.js.map +1 -0
  74. package/dist/worker.d.ts +7 -7
  75. package/dist/worker.d.ts.map +1 -1
  76. package/dist/worker.js +5 -5
  77. package/dist/worker.js.map +1 -1
  78. package/package.json +76 -4
  79. package/dist/agent.d.ts.map +0 -1
  80. package/dist/agent.js +0 -105
  81. package/dist/agent.js.map +0 -1
  82. package/dist/attempt-channel.d.ts.map +0 -1
  83. package/dist/attempt-channel.js.map +0 -1
  84. package/dist/index.d.ts +0 -24
  85. package/dist/index.d.ts.map +0 -1
  86. package/dist/index.js +0 -24
  87. package/dist/index.js.map +0 -1
  88. package/dist/lifecycle/attempt-failure.d.ts +0 -51
  89. package/dist/lifecycle/attempt-failure.d.ts.map +0 -1
  90. package/dist/lifecycle/attempt-failure.js +0 -45
  91. package/dist/lifecycle/attempt-failure.js.map +0 -1
  92. package/dist/lifecycle/attempt.d.ts +0 -61
  93. package/dist/lifecycle/attempt.d.ts.map +0 -1
  94. package/dist/lifecycle/attempt.js +0 -52
  95. package/dist/lifecycle/attempt.js.map +0 -1
  96. package/dist/lifecycle/event.d.ts.map +0 -1
  97. package/dist/lifecycle/event.js +0 -26
  98. package/dist/lifecycle/event.js.map +0 -1
  99. package/dist/lifecycle/item.d.ts +0 -11
  100. package/dist/lifecycle/item.d.ts.map +0 -1
  101. package/dist/lifecycle/item.js +0 -9
  102. package/dist/lifecycle/item.js.map +0 -1
  103. package/dist/lifecycle/loop.d.ts +0 -17
  104. package/dist/lifecycle/loop.d.ts.map +0 -1
  105. package/dist/lifecycle/loop.js +0 -15
  106. package/dist/lifecycle/loop.js.map +0 -1
  107. package/dist/lifecycle/run-state.d.ts +0 -133
  108. package/dist/lifecycle/run-state.d.ts.map +0 -1
  109. package/dist/lifecycle/run-state.js +0 -126
  110. package/dist/lifecycle/run-state.js.map +0 -1
  111. package/dist/lifecycle/run.d.ts +0 -22
  112. package/dist/lifecycle/run.d.ts.map +0 -1
  113. package/dist/lifecycle/run.js +0 -22
  114. package/dist/lifecycle/run.js.map +0 -1
  115. package/dist/lifecycle/step.d.ts +0 -23
  116. package/dist/lifecycle/step.d.ts.map +0 -1
  117. package/dist/lifecycle/step.js +0 -21
  118. package/dist/lifecycle/step.js.map +0 -1
  119. package/dist/step-result.d.ts.map +0 -1
  120. package/dist/step-result.js.map +0 -1
@@ -1,52 +1,48 @@
1
1
  import { Result, Schema, type Effect } from "effect";
2
- import { Agent } from "./agent.ts";
3
- import { AttemptId } from "./lifecycle/attempt.ts";
4
- import { AttemptFailure } from "./lifecycle/attempt-failure.ts";
5
- import { StepResult } from "./step-result.ts";
6
- export declare const PROTOCOL_VERSION: 3;
2
+ import { Agent } from "../agent/agent.ts";
3
+ import { AttemptId } from "./attempt.ts";
4
+ import { StepResult } from "../step/result.ts";
5
+ import { AttemptFailure } from "./failure.ts";
6
+ export declare const PROTOCOL_VERSION: 4;
7
7
  /**
8
- * Value object: monotonically increasing per-Attempt, per-direction message
9
- * sequence. Distinct from the engine's transcript sequence, which is the
10
- * global append order of the persisted transcript rows.
8
+ * Per-Attempt, per-direction message sequence, starting at 1. Distinct from the
9
+ * engine's transcript sequence, which orders persisted rows globally.
11
10
  */
12
11
  export declare const Sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
13
12
  export type Sequence = typeof Sequence.Type;
14
13
  /**
15
- * Run-host-relative: `inbound` frames travel orchestrator → run host (Start,
16
- * Steer, Interrupt); `outbound` frames travel run host → orchestrator.
14
+ * Relative to the run host: `inbound` frames go from the orchestrator to the run
15
+ * host (Start, Steer, Interrupt) and `outbound` frames go the other way.
17
16
  */
18
17
  export declare const DIRECTIONS: readonly ["inbound", "outbound"];
19
18
  export declare const Direction: Schema.Literals<readonly ["inbound", "outbound"]>;
20
19
  export type Direction = typeof Direction.Type;
21
- /** Value object: the rendered task text the run host gives the agent. */
22
- export declare const Task: Schema.brand<Schema.String, "AttemptTask">;
23
- export type Task = typeof Task.Type;
24
20
  declare const RunSpec_base: Schema.Class<RunSpec, Schema.Struct<{
25
21
  readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
26
- readonly repository: Schema.brand<Schema.String, "RepoName">;
22
+ readonly repository: Schema.brand<Schema.String, "RepositoryName">;
27
23
  readonly revision: Schema.brand<Schema.String, "RepositoryRevision">;
28
24
  readonly baseCommit: Schema.brand<Schema.String, "CommitSha">;
29
25
  readonly payload: Schema.Codec<Schema.Json, Schema.Json, never, never>;
30
26
  readonly task: Schema.brand<Schema.String, "AttemptTask">;
31
27
  readonly agent: typeof Agent;
32
28
  readonly parentModel: Schema.OptionFromNullOr<Schema.brand<Schema.String, "ModelId">>;
29
+ readonly maxChildren: Schema.brand<Schema.Int, "ChildSessionBudget">;
30
+ readonly parentEffort: Schema.Literals<readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
33
31
  }>, {}>;
34
- /** Secret-free launch input. Worker credentials are deliberately absent. */
32
+ /** Launch input for one Attempt. Worker credentials are never part of it. */
35
33
  export declare class RunSpec extends RunSpec_base {
36
34
  }
37
35
  declare const Started_base: Schema.Class<Started, Schema.TaggedStruct<"Started", {
38
36
  readonly parentModel: Schema.brand<Schema.String, "ModelId">;
39
37
  }>, {}>;
40
38
  /**
41
- * The parent model the SDK actually selected at launch — the one effective
42
- * value the run host knows that the roster may not declare. Child sessions
43
- * spawn later; their effective brains ride the transcript's `SessionStarted`
44
- * events (declare by roster, observe by record).
39
+ * The parent model the SDK selected at launch, which the roster may not declare.
40
+ * Child sessions report their own model in `SessionStarted` events.
45
41
  */
46
42
  export declare class Started extends Started_base {
47
43
  }
48
44
  declare const SessionEvent_base: Schema.Class<SessionEvent, Schema.TaggedStruct<"SessionEvent", {
49
- readonly event: Schema.Union<readonly [typeof import("./agent.ts").SessionStarted, typeof import("./agent.ts").TextOutput, typeof import("./agent.ts").ToolStarted, typeof import("./agent.ts").ToolFinished, typeof import("./agent.ts").PoolRateLimitsUpdated, typeof import("./agent.ts").SessionFinished]>;
45
+ readonly event: Schema.Union<readonly [typeof import("../agent/session.ts").SessionStarted, typeof import("../agent/session.ts").TextOutput, typeof import("../agent/session.ts").ToolStarted, typeof import("../agent/session.ts").ToolFinished, typeof import("../agent/session.ts").PoolRateLimitsUpdated, typeof import("../agent/session.ts").SessionFinished]>;
50
46
  }>, {}>;
51
47
  /** One normalized parent or child session event, persisted in the Attempt transcript. */
52
48
  export declare class SessionEvent extends SessionEvent_base {
@@ -57,12 +53,12 @@ declare const Final_base: Schema.Class<Final, Schema.TaggedStruct<"Final", {
57
53
  export declare class Final extends Final_base {
58
54
  }
59
55
  declare const Failed_base: Schema.Class<Failed, Schema.TaggedStruct<"Failed", {
60
- readonly failure: Schema.Union<readonly [typeof import("./lifecycle/attempt-failure.ts").InfraFailure, typeof import("./lifecycle/attempt-failure.ts").AgentFailure, typeof import("./lifecycle/attempt-failure.ts").RunawayFailure]>;
56
+ readonly failure: Schema.Union<readonly [typeof import("./failure.ts").InfraFailure, typeof import("./failure.ts").DefectFailure, typeof import("./failure.ts").AgentFailure, typeof import("./failure.ts").RunawayFailure, typeof import("./failure.ts").ChildSessionBudgetFailure]>;
61
57
  }>, {}>;
62
58
  export declare class Failed extends Failed_base {
63
59
  }
64
60
  declare const Interrupted_base: Schema.Class<Interrupted, Schema.TaggedStruct<"Interrupted", {}>, {}>;
65
- /** Terminal acknowledgement that the run host stopped on an Interrupt frame. */
61
+ /** The run host stopped on an Interrupt frame. Terminal. */
66
62
  export declare class Interrupted extends Interrupted_base {
67
63
  }
68
64
  export declare const OutboundPayload: Schema.Union<readonly [typeof Started, typeof SessionEvent, typeof Final, typeof Failed, typeof Interrupted]>;
@@ -78,7 +74,7 @@ export declare class Interrupt extends Interrupt_base {
78
74
  export declare const InboundPayload: Schema.Union<readonly [typeof Steer, typeof Interrupt]>;
79
75
  export type InboundPayload = typeof InboundPayload.Type;
80
76
  declare const OutboundEnvelope_base: Schema.Class<OutboundEnvelope, Schema.TaggedStruct<"OutboundEnvelope", {
81
- readonly version: Schema.Literal<3>;
77
+ readonly version: Schema.Literal<4>;
82
78
  readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
83
79
  readonly sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
84
80
  readonly sentAt: Schema.DateTimeUtcFromString;
@@ -87,7 +83,7 @@ declare const OutboundEnvelope_base: Schema.Class<OutboundEnvelope, Schema.Tagge
87
83
  export declare class OutboundEnvelope extends OutboundEnvelope_base {
88
84
  }
89
85
  declare const InboundEnvelope_base: Schema.Class<InboundEnvelope, Schema.TaggedStruct<"InboundEnvelope", {
90
- readonly version: Schema.Literal<3>;
86
+ readonly version: Schema.Literal<4>;
91
87
  readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
92
88
  readonly sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
93
89
  readonly sentAt: Schema.DateTimeUtcFromString;
@@ -98,10 +94,10 @@ export declare class InboundEnvelope extends InboundEnvelope_base {
98
94
  export declare const Envelope: Schema.Union<readonly [typeof OutboundEnvelope, typeof InboundEnvelope]>;
99
95
  export type Envelope = typeof Envelope.Type;
100
96
  declare const Start_base: Schema.Class<Start, Schema.TaggedStruct<"Start", {
101
- readonly version: Schema.Literal<3>;
97
+ readonly version: Schema.Literal<4>;
102
98
  readonly spec: typeof RunSpec;
103
99
  }>, {}>;
104
- /** First framed stdin message; later frames are inbound envelopes. */
100
+ /** The first framed stdin message. Later frames are inbound envelopes. */
105
101
  export declare class Start extends Start_base {
106
102
  }
107
103
  export declare const InputFrame: Schema.Union<readonly [typeof Start, typeof InboundEnvelope]>;
@@ -109,7 +105,7 @@ export type InputFrame = typeof InputFrame.Type;
109
105
  export declare const EnvelopeFromJson: Schema.fromJsonString<Schema.Union<readonly [typeof OutboundEnvelope, typeof InboundEnvelope]>>;
110
106
  export declare const InputFrameFromJson: Schema.fromJsonString<Schema.Union<readonly [typeof Start, typeof InboundEnvelope]>>;
111
107
  export declare const OutboundEnvelopeFromJson: Schema.fromJsonString<typeof OutboundEnvelope>;
112
- /** The transcript append seam a channel consumer persists envelopes through. */
108
+ /** Where a channel consumer persists envelopes. */
113
109
  export interface Sink {
114
110
  readonly append: (direction: Direction, envelope: Envelope) => Effect.Effect<void, AttemptFailure>;
115
111
  }
@@ -119,16 +115,16 @@ export interface Progress {
119
115
  readonly nextSequence: number;
120
116
  }
121
117
  export declare const initialProgress: Progress;
122
- /** One protocol violation, described for the infra-failure that reports it. */
118
+ /** One protocol violation, described for the infra failure that reports it. */
123
119
  export interface Violation {
124
120
  readonly message: string;
125
121
  readonly detail: string;
126
122
  }
127
123
  /**
128
- * Pure outbound protocol reducer: admits one envelope
129
- * against the progress so far, or names the violation. Owning it here keeps
130
- * every transport adapter folding the same state machine.
124
+ * Checks one outbound envelope against the progress so far and returns the next
125
+ * progress, or the violation. Every transport adapter folds the same state
126
+ * machine through it.
131
127
  */
132
128
  export declare const admit: (progress: Progress, attemptId: AttemptId, envelope: OutboundEnvelope) => Result.Result<Progress, Violation>;
133
129
  export {};
134
- //# sourceMappingURL=attempt-channel.d.ts.map
130
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/attempt/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAe,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,QAAQ,oDAEpB,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,UAAU,YAAI,SAAS,EAAE,UAAU,CAAU,CAAC;AAC3D,eAAO,MAAM,SAAS,mDAA8B,CAAC;AACrD,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;;;;;;;;;;;;;AAE9C,6EAA6E;AAC7E,qBAAa,OAAQ,SAAQ,YAW3B;CAAG;;;;AAEL;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAE3B;CAAG;;;;AAEL,yFAAyF;AACzF,qBAAa,YAAa,SAAQ,iBAGjC;CAAG;;;;AA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YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,EAAE,QAAwD,CAAC;AAEvF,+EAA+E;AAC/E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAKD;;;;GAIG;AACH,eAAO,MAAM,KAAK,aACN,QAAQ,aACP,SAAS,YACV,gBAAgB,KACzB,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAuCnC,CAAC"}
@@ -1,41 +1,40 @@
1
1
  import { Result, Schema } from "effect";
2
- import { SessionEvent as AgentSessionEvent, Agent, ModelId } from "./agent.js";
3
- import { AttemptId } from "./lifecycle/attempt.js";
4
- import { AttemptFailure } from "./lifecycle/attempt-failure.js";
5
- import { CommitSha, Name as RepositoryName, Revision } from "./repository.js";
6
- import { StepResult } from "./step-result.js";
7
- export const PROTOCOL_VERSION = 3;
2
+ import { Agent } from "../agent/agent.js";
3
+ import { Effort, ModelId } from "../agent/brain.js";
4
+ import { AgentSessionEvent, ChildSessionBudget } from "../agent/session.js";
5
+ import { AttemptId, AttemptTask } from "./attempt.js";
6
+ import { RepositoryName, CommitSha, RepositoryRevision } from "../repository.js";
7
+ import { StepResult } from "../step/result.js";
8
+ import { AttemptFailure } from "./failure.js";
9
+ export const PROTOCOL_VERSION = 4;
8
10
  /**
9
- * Value object: monotonically increasing per-Attempt, per-direction message
10
- * sequence. Distinct from the engine's transcript sequence, which is the
11
- * global append order of the persisted transcript rows.
11
+ * Per-Attempt, per-direction message sequence, starting at 1. Distinct from the
12
+ * engine's transcript sequence, which orders persisted rows globally.
12
13
  */
13
14
  export const Sequence = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("AttemptChannelSequence"));
14
15
  /**
15
- * Run-host-relative: `inbound` frames travel orchestrator → run host (Start,
16
- * Steer, Interrupt); `outbound` frames travel run host → orchestrator.
16
+ * Relative to the run host: `inbound` frames go from the orchestrator to the run
17
+ * host (Start, Steer, Interrupt) and `outbound` frames go the other way.
17
18
  */
18
19
  export const DIRECTIONS = ["inbound", "outbound"];
19
20
  export const Direction = Schema.Literals(DIRECTIONS);
20
- /** Value object: the rendered task text the run host gives the agent. */
21
- export const Task = Schema.String.check(Schema.isPattern(/\S/u, { message: "Expected non-blank task text" })).pipe(Schema.brand("AttemptTask"));
22
- /** Secret-free launch input. Worker credentials are deliberately absent. */
21
+ /** Launch input for one Attempt. Worker credentials are never part of it. */
23
22
  export class RunSpec extends Schema.Class("AttemptChannel/RunSpec")({
24
23
  attemptId: AttemptId,
25
24
  repository: RepositoryName,
26
- revision: Revision,
25
+ revision: RepositoryRevision,
27
26
  baseCommit: CommitSha,
28
27
  payload: Schema.Json,
29
- task: Task,
28
+ task: AttemptTask,
30
29
  agent: Agent,
31
30
  parentModel: Schema.OptionFromNullOr(ModelId),
31
+ maxChildren: ChildSessionBudget,
32
+ parentEffort: Effort,
32
33
  }) {
33
34
  }
34
35
  /**
35
- * The parent model the SDK actually selected at launch — the one effective
36
- * value the run host knows that the roster may not declare. Child sessions
37
- * spawn later; their effective brains ride the transcript's `SessionStarted`
38
- * events (declare by roster, observe by record).
36
+ * The parent model the SDK selected at launch, which the roster may not declare.
37
+ * Child sessions report their own model in `SessionStarted` events.
39
38
  */
40
39
  export class Started extends Schema.TaggedClass("AttemptChannel/Started")("Started", {
41
40
  parentModel: ModelId,
@@ -52,7 +51,7 @@ export class Failed extends Schema.TaggedClass("AttemptChannel/Failed")("Failed"
52
51
  failure: AttemptFailure,
53
52
  }) {
54
53
  }
55
- /** Terminal acknowledgement that the run host stopped on an Interrupt frame. */
54
+ /** The run host stopped on an Interrupt frame. Terminal. */
56
55
  export class Interrupted extends Schema.TaggedClass("AttemptChannel/Interrupted")("Interrupted", {}) {
57
56
  }
58
57
  export const OutboundPayload = Schema.Union([Started, SessionEvent, Final, Failed, Interrupted]);
@@ -80,7 +79,7 @@ export class InboundEnvelope extends Schema.TaggedClass("AttemptChannel/InboundE
80
79
  }) {
81
80
  }
82
81
  export const Envelope = Schema.Union([OutboundEnvelope, InboundEnvelope]);
83
- /** First framed stdin message; later frames are inbound envelopes. */
82
+ /** The first framed stdin message. Later frames are inbound envelopes. */
84
83
  export class Start extends Schema.TaggedClass("AttemptChannel/Start")("Start", {
85
84
  version: Schema.Literal(PROTOCOL_VERSION),
86
85
  spec: RunSpec,
@@ -93,9 +92,9 @@ export const OutboundEnvelopeFromJson = Schema.fromJsonString(OutboundEnvelope);
93
92
  export const initialProgress = { state: "AwaitingStarted", nextSequence: 1 };
94
93
  const isTerminal = (payload) => payload._tag === "Final" || payload._tag === "Failed" || payload._tag === "Interrupted";
95
94
  /**
96
- * Pure outbound protocol reducer: admits one envelope
97
- * against the progress so far, or names the violation. Owning it here keeps
98
- * every transport adapter folding the same state machine.
95
+ * Checks one outbound envelope against the progress so far and returns the next
96
+ * progress, or the violation. Every transport adapter folds the same state
97
+ * machine through it.
99
98
  */
100
99
  export const admit = (progress, attemptId, envelope) => {
101
100
  if (envelope.attemptId !== attemptId) {
@@ -135,4 +134,4 @@ export const admit = (progress, attemptId, envelope) => {
135
134
  nextSequence: progress.nextSequence + 1,
136
135
  });
137
136
  };
138
- //# sourceMappingURL=attempt-channel.js.map
137
+ //# sourceMappingURL=channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/attempt/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO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AC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAC5D,YAAY,EAAE,QAAQ,CAAC,YAAY,GAAG,CAAC;KACxC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { Schema } from "effect";
2
+ declare const InfraFailure_base: Schema.Class<InfraFailure, Schema.TaggedStruct<"InfraFailure", {
3
+ readonly message: Schema.String;
4
+ readonly cause: Schema.Defect;
5
+ }>, import("effect/Cause").YieldableError>;
6
+ /**
7
+ * Infrastructure failed around the agent: worker unreachable, checkout failed,
8
+ * run host died. The only class the engine retries on its own, capped.
9
+ */
10
+ export declare class InfraFailure extends InfraFailure_base {
11
+ }
12
+ declare const DefectFailure_base: Schema.Class<DefectFailure, Schema.TaggedStruct<"DefectFailure", {
13
+ readonly message: Schema.String;
14
+ readonly cause: Schema.Defect;
15
+ }>, import("effect/Cause").YieldableError>;
16
+ /** A programmer defect captured at the durable execution boundary. Retains its cause for diagnosis and requires an operator retry. */
17
+ export declare class DefectFailure extends DefectFailure_base {
18
+ }
19
+ declare const AgentFailure_base: Schema.Class<AgentFailure, Schema.TaggedStruct<"AgentFailure", {
20
+ readonly message: Schema.String;
21
+ }>, import("effect/Cause").YieldableError>;
22
+ /**
23
+ * The agent ran and failed the work itself. Never auto-retried, since the same
24
+ * agent would fail the same way; the operator decides what changes first.
25
+ */
26
+ export declare class AgentFailure extends AgentFailure_base {
27
+ }
28
+ /** Which per-attempt ceiling the runaway guard tripped. */
29
+ export declare const RunawayCeiling: Schema.Literals<readonly ["wall-clock", "tokens"]>;
30
+ export type RunawayCeiling = typeof RunawayCeiling.Type;
31
+ declare const RunawayFailure_base: Schema.Class<RunawayFailure, Schema.TaggedStruct<"RunawayFailure", {
32
+ readonly ceiling: Schema.Literals<readonly ["wall-clock", "tokens"]>;
33
+ }>, import("effect/Cause").YieldableError>;
34
+ /** The runaway guard interrupted an attempt that burned without progress. Never auto-retried (ADR 0013). */
35
+ export declare class RunawayFailure extends RunawayFailure_base {
36
+ }
37
+ declare const ChildSessionBudgetFailure_base: Schema.Class<ChildSessionBudgetFailure, Schema.TaggedStruct<"ChildSessionBudgetFailure", {
38
+ readonly maxChildren: Schema.brand<Schema.Int, "ChildSessionBudget">;
39
+ readonly attemptedChildren: Schema.brand<Schema.Int, "ChildSessionCount">;
40
+ }>, import("effect/Cause").YieldableError>;
41
+ /**
42
+ * The parent tried to spawn more child sessions than the Attempt allows. Never
43
+ * auto-retried, since the same parent would exhaust the same budget again.
44
+ */
45
+ export declare class ChildSessionBudgetFailure extends ChildSessionBudgetFailure_base {
46
+ }
47
+ export declare const AttemptFailure: Schema.Union<readonly [typeof InfraFailure, typeof DefectFailure, typeof AgentFailure, typeof RunawayFailure, typeof ChildSessionBudgetFailure]>;
48
+ export type AttemptFailure = typeof AttemptFailure.Type;
49
+ /** The class half of the auto-retry law: only infra failures qualify. `shouldAutoRetry` adds the attempt cap. */
50
+ export declare const isAutoRetryableFailure: <I>(input: I) => input is I & InfraFailure;
51
+ export {};
52
+ //# sourceMappingURL=failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../../src/attempt/failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAGhC;;;GAGG;AACH,qBAAa,YAAa,SAAQ,iBAMjC;CAAG;;;;;AAEJ,sIAAsI;AACtI,qBAAa,aAAc,SAAQ,kBAEmC;CAAG;;;;AAEzE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,iBAKjC;CAAG;AAEJ,2DAA2D;AAC3D,eAAO,MAAM,cAAc,oDAA4C,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;;;;AAExD,4GAA4G;AAC5G,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;;AAEL;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,8BAK7C;CAAG;AAEL,eAAO,MAAM,cAAc,kJAMzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;AAExD,iHAAiH;AACjH,eAAO,MAAM,sBAAsB,4CAA0B,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { Schema } from "effect";
2
+ import { ChildSessionBudget, ChildSessionCount } from "../agent/session.js";
3
+ /**
4
+ * Infrastructure failed around the agent: worker unreachable, checkout failed,
5
+ * run host died. The only class the engine retries on its own, capped.
6
+ */
7
+ export class InfraFailure extends Schema.TaggedError("AttemptFailure/InfraFailure")("InfraFailure", {
8
+ message: Schema.String,
9
+ cause: Schema.Defect(),
10
+ }) {
11
+ }
12
+ /** A programmer defect captured at the durable execution boundary. Retains its cause for diagnosis and requires an operator retry. */
13
+ export class DefectFailure extends Schema.TaggedError("AttemptFailure/DefectFailure")("DefectFailure", { message: Schema.String, cause: Schema.Defect() }) {
14
+ }
15
+ /**
16
+ * The agent ran and failed the work itself. Never auto-retried, since the same
17
+ * agent would fail the same way; the operator decides what changes first.
18
+ */
19
+ export class AgentFailure extends Schema.TaggedError("AttemptFailure/AgentFailure")("AgentFailure", {
20
+ message: Schema.String,
21
+ }) {
22
+ }
23
+ /** Which per-attempt ceiling the runaway guard tripped. */
24
+ export const RunawayCeiling = Schema.Literals(["wall-clock", "tokens"]);
25
+ /** The runaway guard interrupted an attempt that burned without progress. Never auto-retried (ADR 0013). */
26
+ export class RunawayFailure extends Schema.TaggedError("AttemptFailure/RunawayFailure")("RunawayFailure", {
27
+ ceiling: RunawayCeiling,
28
+ }) {
29
+ }
30
+ /**
31
+ * The parent tried to spawn more child sessions than the Attempt allows. Never
32
+ * auto-retried, since the same parent would exhaust the same budget again.
33
+ */
34
+ export class ChildSessionBudgetFailure extends Schema.TaggedError("AttemptFailure/ChildSessionBudgetFailure")("ChildSessionBudgetFailure", {
35
+ maxChildren: ChildSessionBudget,
36
+ attemptedChildren: ChildSessionCount,
37
+ }) {
38
+ }
39
+ export const AttemptFailure = Schema.Union([
40
+ InfraFailure,
41
+ DefectFailure,
42
+ AgentFailure,
43
+ RunawayFailure,
44
+ ChildSessionBudgetFailure,
45
+ ]);
46
+ /** The class half of the auto-retry law: only infra failures qualify. `shouldAutoRetry` adds the attempt cap. */
47
+ export const isAutoRetryableFailure = Schema.is(InfraFailure);
48
+ //# sourceMappingURL=failure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure.js","sourceRoot":"","sources":["../../src/attempt/failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE5E;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM,CAAC,WAAW,CAAe,6BAA6B,CAAC,CAC/F,cAAc,EACd;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;CACvB,CACF;CAAG;AAEJ,sIAAsI;AACtI,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,CACnD,8BAA8B,CAC/B,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;CAAG;AAEzE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM,CAAC,WAAW,CAAe,6BAA6B,CAAC,CAC/F,cAAc,EACd;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGxE,4GAA4G;AAC5G,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,CACpD,+BAA+B,CAChC,CAAC,gBAAgB,EAAE;IAClB,OAAO,EAAE,cAAc;CACxB,CAAC;CAAG;AAEL;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,MAAM,CAAC,WAAW,CAC/D,0CAA0C,CAC3C,CAAC,2BAA2B,EAAE;IAC7B,WAAW,EAAE,kBAAkB;IAC/B,iBAAiB,EAAE,iBAAiB;CACrC,CAAC;CAAG;AAEL,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC;IACzC,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,cAAc;IACd,yBAAyB;CAC1B,CAAC,CAAC;AAGH,iHAAiH;AACjH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Schema } from "effect";
2
+ declare const AttemptSucceeded_base: Schema.Class<AttemptSucceeded, Schema.TaggedStruct<"Succeeded", {}>, {}>;
3
+ /** The attempt finished; the step result is stored on the Step. */
4
+ export declare class AttemptSucceeded extends AttemptSucceeded_base {
5
+ }
6
+ declare const AttemptFailed_base: Schema.Class<AttemptFailed, Schema.TaggedStruct<"Failed", {
7
+ readonly failure: Schema.Union<readonly [typeof import("./failure.ts").InfraFailure, typeof import("./failure.ts").DefectFailure, typeof import("./failure.ts").AgentFailure, typeof import("./failure.ts").RunawayFailure, typeof import("./failure.ts").ChildSessionBudgetFailure]>;
8
+ }>, {}>;
9
+ /** The attempt failed with the typed failure that closed it. */
10
+ export declare class AttemptFailed extends AttemptFailed_base {
11
+ }
12
+ declare const AttemptCanceled_base: Schema.Class<AttemptCanceled, Schema.TaggedStruct<"Canceled", {}>, {}>;
13
+ /** The operator canceled the Run during this Attempt. */
14
+ export declare class AttemptCanceled extends AttemptCanceled_base {
15
+ }
16
+ /** The recorded end of one try; a failed Attempt may still be followed by a retry of the same Step. */
17
+ export declare const AttemptOutcome: Schema.Union<readonly [typeof AttemptSucceeded, typeof AttemptFailed, typeof AttemptCanceled]>;
18
+ export type AttemptOutcome = typeof AttemptOutcome.Type;
19
+ export {};
20
+ //# sourceMappingURL=outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../src/attempt/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;AAGhC,mEAAmE;AACnE,qBAAa,gBAAiB,SAAQ,qBAEpB;CAAG;;;;AAErB,gEAAgE;AAChE,qBAAa,aAAc,SAAQ,kBAKlC;CAAG;;AAEJ,yDAAyD;AACzD,qBAAa,eAAgB,SAAQ,oBAGpC;CAAG;AAEJ,uGAAuG;AACvG,eAAO,MAAM,cAAc,gGAAmE,CAAC;AAC/F,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Schema } from "effect";
2
+ import { AttemptFailure } from "./failure.js";
3
+ /** The attempt finished; the step result is stored on the Step. */
4
+ export class AttemptSucceeded extends Schema.TaggedClass("AttemptOutcome/Succeeded")("Succeeded", {}) {
5
+ }
6
+ /** The attempt failed with the typed failure that closed it. */
7
+ export class AttemptFailed extends Schema.TaggedClass("AttemptOutcome/Failed")("Failed", {
8
+ failure: AttemptFailure,
9
+ }) {
10
+ }
11
+ /** The operator canceled the Run during this Attempt. */
12
+ export class AttemptCanceled extends Schema.TaggedClass("AttemptOutcome/Canceled")("Canceled", {}) {
13
+ }
14
+ /** The recorded end of one try; a failed Attempt may still be followed by a retry of the same Step. */
15
+ export const AttemptOutcome = Schema.Union([AttemptSucceeded, AttemptFailed, AttemptCanceled]);
16
+ //# sourceMappingURL=outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../src/attempt/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,mEAAmE;AACnE,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,WAAW,CACtD,0BAA0B,CAC3B,CAAC,WAAW,EAAE,EAAE,CAAC;CAAG;AAErB,gEAAgE;AAChE,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,CAAgB,uBAAuB,CAAC,CAC3F,QAAQ,EACR;IACE,OAAO,EAAE,cAAc;CACxB,CACF;CAAG;AAEJ,yDAAyD;AACzD,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,CAAkB,yBAAyB,CAAC,CACjG,UAAU,EACV,EAAE,CACH;CAAG;AAEJ,uGAAuG;AACvG,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Schema } from "effect";
2
+ /** Maximum Runs one Loop may open for an Item between operator resets. */
3
+ export declare const CycleLimit: Schema.brand<Schema.Int, "CycleLimit">;
4
+ export type CycleLimit = typeof CycleLimit.Type;
5
+ /** Identifies one Item allowance between explicit operator resets. */
6
+ export declare const CycleGeneration: Schema.brand<Schema.Int, "CycleGeneration">;
7
+ export type CycleGeneration = typeof CycleGeneration.Type;
8
+ /** The safe default for unattended rounds on an Item. */
9
+ export declare const DEFAULT_CYCLE_LIMIT: number & import("effect/Brand").Brand<"CycleLimit">;
10
+ /** Number of admitted or completed rounds for one Loop on an Item. */
11
+ export declare const CycleCount: Schema.brand<Schema.Int, "CycleCount">;
12
+ export type CycleCount = typeof CycleCount.Type;
13
+ declare const LoopCycleCount_base: Schema.Class<LoopCycleCount, Schema.Struct<{
14
+ readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
15
+ readonly admitted: Schema.brand<Schema.Int, "CycleCount">;
16
+ readonly completed: Schema.brand<Schema.Int, "CycleCount">;
17
+ }>, {}>;
18
+ /** A Loop's charged Runs and settled Runs in the current cycle budget. */
19
+ export declare class LoopCycleCount extends LoopCycleCount_base {
20
+ }
21
+ /** Identifies the Event and budget generation that first exhausted an Item's allowance. */
22
+ export declare const CycleBudgetAskId: Schema.brand<Schema.brand<Schema.NonEmptyString, "EventId">, "CycleBudgetAskId">;
23
+ export type CycleBudgetAskId = typeof CycleBudgetAskId.Type;
24
+ declare const CycleBudgetAsk_base: Schema.Class<CycleBudgetAsk, Schema.Struct<{
25
+ readonly id: Schema.brand<Schema.brand<Schema.NonEmptyString, "EventId">, "CycleBudgetAskId">;
26
+ readonly itemKey: Schema.brand<Schema.NonEmptyString, "ItemKey">;
27
+ readonly repository: Schema.brand<Schema.String, "RepositoryName">;
28
+ readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
29
+ readonly limit: Schema.brand<Schema.Int, "CycleLimit">;
30
+ readonly counts: Schema.NonEmptyArray<typeof LoopCycleCount>;
31
+ }>, {}>;
32
+ /** An Item-level request for an operator reset before further Runs can open. */
33
+ export declare class CycleBudgetAsk extends CycleBudgetAsk_base {
34
+ /** The furthest completed round; each Loop participates at most once per round. */
35
+ get completedCycles(): CycleCount;
36
+ }
37
+ export {};
38
+ //# sourceMappingURL=cycle-budget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycle-budget.d.ts","sourceRoot":"","sources":["../src/cycle-budget.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,0EAA0E;AAC1E,eAAO,MAAM,UAAU,wCAEtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,sEAAsE;AACtE,eAAO,MAAM,eAAe,6CAE3B,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,qDAAqB,CAAC;AAEtD,sEAAsE;AACtE,eAAO,MAAM,UAAU,wCAEtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;;;;;;AAEhD,0EAA0E;AAC1E,qBAAa,cAAe,SAAQ,mBAYnC;CAAG;AAEJ,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,kFAAiD,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAC;;;;;;;;;AAE5D,gFAAgF;AAChF,qBAAa,cAAe,SAAQ,mBAoBnC;IACC,mFAAmF;IACnF,IAAI,eAAe,IAAI,UAAU,CAEhC;CACF"}
@@ -0,0 +1,46 @@
1
+ import { EventId } from "./event.js";
2
+ import { ItemKey } from "./item.js";
3
+ import { LoopName } from "./loop.js";
4
+ import { RepositoryName } from "./repository.js";
5
+ import { Schema } from "effect";
6
+ /** Maximum Runs one Loop may open for an Item between operator resets. */
7
+ export const CycleLimit = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("CycleLimit"));
8
+ /** Identifies one Item allowance between explicit operator resets. */
9
+ export const CycleGeneration = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("CycleGeneration"));
10
+ /** The safe default for unattended rounds on an Item. */
11
+ export const DEFAULT_CYCLE_LIMIT = CycleLimit.make(3);
12
+ /** Number of admitted or completed rounds for one Loop on an Item. */
13
+ export const CycleCount = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("CycleCount"));
14
+ /** A Loop's charged Runs and settled Runs in the current cycle budget. */
15
+ export class LoopCycleCount extends Schema.Class("LoopCycleCount")(Schema.Struct({
16
+ loop: LoopName,
17
+ admitted: CycleCount,
18
+ completed: CycleCount,
19
+ })
20
+ .check(Schema.makeFilter(({ admitted, completed }) => completed <= admitted, {
21
+ message: "Completed Runs cannot exceed admitted Runs",
22
+ }))
23
+ .annotate({ parseOptions: { onExcessProperty: "error" } })) {
24
+ }
25
+ /** Identifies the Event and budget generation that first exhausted an Item's allowance. */
26
+ export const CycleBudgetAskId = EventId.pipe(Schema.brand("CycleBudgetAskId"));
27
+ /** An Item-level request for an operator reset before further Runs can open. */
28
+ export class CycleBudgetAsk extends Schema.Class("CycleBudgetAsk")(Schema.Struct({
29
+ id: CycleBudgetAskId,
30
+ itemKey: ItemKey,
31
+ repository: RepositoryName,
32
+ loop: LoopName,
33
+ limit: CycleLimit,
34
+ counts: Schema.NonEmptyArray(LoopCycleCount),
35
+ })
36
+ .check(Schema.makeFilter(({ loop, limit, counts }) => new Set(counts.map((count) => count.loop)).size === counts.length &&
37
+ counts.some((count) => count.loop === loop && count.admitted >= limit), {
38
+ message: "Expected unique participating Loops including the exhausted Loop at its limit",
39
+ }))
40
+ .annotate({ parseOptions: { onExcessProperty: "error" } })) {
41
+ /** The furthest completed round; each Loop participates at most once per round. */
42
+ get completedCycles() {
43
+ return CycleCount.make(Math.max(...this.counts.map(({ completed }) => completed)));
44
+ }
45
+ }
46
+ //# sourceMappingURL=cycle-budget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycle-budget.js","sourceRoot":"","sources":["../src/cycle-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAC/E,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAC3B,CAAC;AAGF,sEAAsE;AACtE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC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,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC;CAC7C,CAAC;KACC,KAAK,CACJ,MAAM,CAAC,UAAU,CACf,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAC1B,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM;IACjE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EACxE;IACE,OAAO,EAAE,+EAA+E;CACzF,CACF,CACF;KACA,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC,CAC7D;IACC,mFAAmF;IACnF,IAAI,eAAe;QACjB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -1,13 +1,10 @@
1
1
  import { Schema } from "effect";
2
- /**
3
- * Value object (branded id): identity of one Event in the ledger.
4
- */
2
+ /** Identity of one recorded fact; repeated sightings are matched through its dedup key. */
5
3
  export declare const EventId: Schema.brand<Schema.NonEmptyString, "EventId">;
6
4
  export type EventId = typeof EventId.Type;
7
5
  /**
8
- * Value object: the engine-derived, never-expiring idempotency key — timestamps aside, the
9
- * same watched state is the same Event, forever. Derived per trigger type,
10
- * never authored in a loop file (ADR 0002).
6
+ * Idempotency key the engine derives from watched state, timestamps excluded.
7
+ * The same state is the same Event forever, so a loop file never sets it (ADR 0002).
11
8
  */
12
9
  export declare const DedupKey: Schema.brand<Schema.NonEmptyString, "DedupKey">;
13
10
  export type DedupKey = typeof DedupKey.Type;
@@ -18,11 +15,9 @@ declare const Event_base: Schema.Class<Event, Schema.Struct<{
18
15
  readonly receivedAt: Schema.DateTimeUtc;
19
16
  }>, {}>;
20
17
  /**
21
- * Entity — ledger row: one deduplicated fact the engine may react to — a trigger matching watched
22
- * state, or an operator approval. An Event owns at most one open Run, ever.
23
- *
24
- * The payload is the stream's payload slice — GitHub's own shapes, kept opaque
25
- * here; the expression and loop-file blocks range over it.
18
+ * One deduplicated fact the engine may react to: a trigger match or an operator
19
+ * approval. Trigger payloads retain the snapshot that selection expressions
20
+ * and prompt interpolation use; retries keep that recorded snapshot.
26
21
  */
27
22
  export declare class Event extends Event_base {
28
23
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,2FAA2F;AAC3F,eAAO,MAAM,OAAO,gDAAsD,CAAC;AAE3E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,QAAQ,iDAAuD,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;;;;;;;AAE5C;;;;GAIG;AACH,qBAAa,KAAM,SAAQ,UAKzB;CAAG"}
package/dist/event.js ADDED
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ /** Identity of one recorded fact; repeated sightings are matched through its dedup key. */
3
+ export const EventId = Schema.NonEmptyString.pipe(Schema.brand("EventId"));
4
+ /**
5
+ * Idempotency key the engine derives from watched state, timestamps excluded.
6
+ * The same state is the same Event forever, so a loop file never sets it (ADR 0002).
7
+ */
8
+ export const DedupKey = Schema.NonEmptyString.pipe(Schema.brand("DedupKey"));
9
+ /**
10
+ * One deduplicated fact the engine may react to: a trigger match or an operator
11
+ * approval. Trigger payloads retain the snapshot that selection expressions
12
+ * and prompt interpolation use; retries keep that recorded snapshot.
13
+ */
14
+ export class Event extends Schema.Class("Event")({
15
+ id: EventId,
16
+ dedupKey: DedupKey,
17
+ payload: Schema.Json,
18
+ receivedAt: Schema.DateTimeUtc,
19
+ }) {
20
+ }
21
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAI3E;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAI7E;;;;GAIG;AACH,MAAM,OAAO,KAAM,SAAQ,MAAM,CAAC,KAAK,CAAQ,OAAO,CAAC,CAAC;IACtD,EAAE,EAAE,OAAO;IACX,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,MAAM,CAAC,IAAI;IACpB,UAAU,EAAE,MAAM,CAAC,WAAW;CAC/B,CAAC;CAAG"}
@@ -1,9 +1,5 @@
1
1
  import { Schema } from "effect";
2
- /**
3
- * Value object (branded path): absolute or caller-resolved path to the
4
- * instance folder (ADR 0001). Shared by every package that anchors itself to
5
- * the instance repo — the engine's database adapters and the config loader.
6
- */
7
- export declare const Directory: Schema.brand<Schema.NonEmptyString, "InstanceDirectory">;
8
- export type Directory = typeof Directory.Type;
2
+ /** Root folder containing the factory's `usine.yaml`, Loop files, and Agent roster; the caller resolves its location. */
3
+ export declare const InstanceDirectory: Schema.brand<Schema.NonEmptyString, "InstanceDirectory">;
4
+ export type InstanceDirectory = typeof InstanceDirectory.Type;
9
5
  //# sourceMappingURL=instance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,SAAS,0DAAgE,CAAC;AACvF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,yHAAyH;AACzH,eAAO,MAAM,iBAAiB,0DAAgE,CAAC;AAC/F,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC"}
package/dist/instance.js CHANGED
@@ -1,8 +1,4 @@
1
1
  import { Schema } from "effect";
2
- /**
3
- * Value object (branded path): absolute or caller-resolved path to the
4
- * instance folder (ADR 0001). Shared by every package that anchors itself to
5
- * the instance repo — the engine's database adapters and the config loader.
6
- */
7
- export const Directory = Schema.NonEmptyString.pipe(Schema.brand("InstanceDirectory"));
2
+ /** Root folder containing the factory's `usine.yaml`, Loop files, and Agent roster; the caller resolves its location. */
3
+ export const InstanceDirectory = Schema.NonEmptyString.pipe(Schema.brand("InstanceDirectory"));
8
4
  //# sourceMappingURL=instance.js.map