@usine/core 0.3.0 → 0.5.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 (107) hide show
  1. package/LICENSE +661 -21
  2. package/README.md +43 -18
  3. package/dist/agent/agent.d.ts +12 -8
  4. package/dist/agent/agent.d.ts.map +1 -1
  5. package/dist/agent/agent.js +14 -10
  6. package/dist/agent/agent.js.map +1 -1
  7. package/dist/agent/brain.d.ts +2 -6
  8. package/dist/agent/brain.d.ts.map +1 -1
  9. package/dist/agent/brain.js +3 -7
  10. package/dist/agent/brain.js.map +1 -1
  11. package/dist/agent/capability.d.ts +4 -4
  12. package/dist/agent/capability.d.ts.map +1 -1
  13. package/dist/agent/capability.js +4 -4
  14. package/dist/agent/capability.js.map +1 -1
  15. package/dist/agent/session.d.ts +90 -28
  16. package/dist/agent/session.d.ts.map +1 -1
  17. package/dist/agent/session.js +103 -28
  18. package/dist/agent/session.js.map +1 -1
  19. package/dist/attempt/attempt.d.ts +92 -12
  20. package/dist/attempt/attempt.d.ts.map +1 -1
  21. package/dist/attempt/attempt.js +114 -13
  22. package/dist/attempt/attempt.js.map +1 -1
  23. package/dist/attempt/channel.d.ts +91 -51
  24. package/dist/attempt/channel.d.ts.map +1 -1
  25. package/dist/attempt/channel.js +74 -45
  26. package/dist/attempt/channel.js.map +1 -1
  27. package/dist/attempt/failure.d.ts +27 -14
  28. package/dist/attempt/failure.d.ts.map +1 -1
  29. package/dist/attempt/failure.js +27 -14
  30. package/dist/attempt/failure.js.map +1 -1
  31. package/dist/attempt/outcome.d.ts +3 -5
  32. package/dist/attempt/outcome.d.ts.map +1 -1
  33. package/dist/attempt/outcome.js +2 -4
  34. package/dist/attempt/outcome.js.map +1 -1
  35. package/dist/attempt/salvage.d.ts +77 -0
  36. package/dist/attempt/salvage.d.ts.map +1 -0
  37. package/dist/attempt/salvage.js +49 -0
  38. package/dist/attempt/salvage.js.map +1 -0
  39. package/dist/attempt/start.d.ts +35 -0
  40. package/dist/attempt/start.d.ts.map +1 -0
  41. package/dist/attempt/start.js +30 -0
  42. package/dist/attempt/start.js.map +1 -0
  43. package/dist/closed-struct.d.ts +7 -0
  44. package/dist/closed-struct.d.ts.map +1 -0
  45. package/dist/closed-struct.js +12 -0
  46. package/dist/closed-struct.js.map +1 -0
  47. package/dist/cycle-budget.d.ts +7 -8
  48. package/dist/cycle-budget.d.ts.map +1 -1
  49. package/dist/cycle-budget.js +16 -20
  50. package/dist/cycle-budget.js.map +1 -1
  51. package/dist/event.d.ts +4 -8
  52. package/dist/event.d.ts.map +1 -1
  53. package/dist/event.js +4 -8
  54. package/dist/event.js.map +1 -1
  55. package/dist/instance.d.ts +7 -1
  56. package/dist/instance.d.ts.map +1 -1
  57. package/dist/instance.js +6 -1
  58. package/dist/instance.js.map +1 -1
  59. package/dist/item.d.ts +1 -2
  60. package/dist/item.d.ts.map +1 -1
  61. package/dist/item.js +1 -2
  62. package/dist/item.js.map +1 -1
  63. package/dist/loop.d.ts +10 -2
  64. package/dist/loop.d.ts.map +1 -1
  65. package/dist/loop.js +9 -2
  66. package/dist/loop.js.map +1 -1
  67. package/dist/operator.d.ts +8 -0
  68. package/dist/operator.d.ts.map +1 -0
  69. package/dist/operator.js +9 -0
  70. package/dist/operator.js.map +1 -0
  71. package/dist/repository.d.ts +6 -8
  72. package/dist/repository.d.ts.map +1 -1
  73. package/dist/repository.js +8 -10
  74. package/dist/repository.js.map +1 -1
  75. package/dist/run/again.d.ts +13 -0
  76. package/dist/run/again.d.ts.map +1 -0
  77. package/dist/run/again.js +14 -0
  78. package/dist/run/again.js.map +1 -0
  79. package/dist/run/approval.d.ts +27 -0
  80. package/dist/run/approval.d.ts.map +1 -0
  81. package/dist/run/approval.js +25 -0
  82. package/dist/run/approval.js.map +1 -0
  83. package/dist/run/run.d.ts +2 -2
  84. package/dist/run/run.d.ts.map +1 -1
  85. package/dist/run/run.js +2 -2
  86. package/dist/run/run.js.map +1 -1
  87. package/dist/run/state.d.ts +22 -31
  88. package/dist/run/state.d.ts.map +1 -1
  89. package/dist/run/state.js +23 -36
  90. package/dist/run/state.js.map +1 -1
  91. package/dist/step/harvest.d.ts +44 -0
  92. package/dist/step/harvest.d.ts.map +1 -0
  93. package/dist/step/harvest.js +368 -0
  94. package/dist/step/harvest.js.map +1 -0
  95. package/dist/step/result.d.ts +15 -4
  96. package/dist/step/result.d.ts.map +1 -1
  97. package/dist/step/result.js +14 -4
  98. package/dist/step/result.js.map +1 -1
  99. package/dist/step/step.d.ts +2 -8
  100. package/dist/step/step.d.ts.map +1 -1
  101. package/dist/step/step.js +2 -8
  102. package/dist/step/step.js.map +1 -1
  103. package/dist/worker.d.ts +160 -4
  104. package/dist/worker.d.ts.map +1 -1
  105. package/dist/worker.js +171 -4
  106. package/dist/worker.js.map +1 -1
  107. package/package.json +32 -7
@@ -4,8 +4,8 @@ declare const InfraFailure_base: Schema.Class<InfraFailure, Schema.TaggedStruct<
4
4
  readonly cause: Schema.Defect;
5
5
  }>, import("effect/Cause").YieldableError>;
6
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.
7
+ * An infrastructure failure outside the agent, such as an unreachable Worker or failed checkout.
8
+ * It's the only failure the engine retries automatically, up to the attempt cap.
9
9
  */
10
10
  export declare class InfraFailure extends InfraFailure_base {
11
11
  }
@@ -13,40 +13,53 @@ declare const DefectFailure_base: Schema.Class<DefectFailure, Schema.TaggedStruc
13
13
  readonly message: Schema.String;
14
14
  readonly cause: Schema.Defect;
15
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. */
16
+ /** A programmer defect caught at the durable execution boundary; not retried automatically. */
17
17
  export declare class DefectFailure extends DefectFailure_base {
18
18
  }
19
19
  declare const AgentFailure_base: Schema.Class<AgentFailure, Schema.TaggedStruct<"AgentFailure", {
20
20
  readonly message: Schema.String;
21
21
  }>, import("effect/Cause").YieldableError>;
22
+ /** A task failure reported by the agent; not retried automatically. */
23
+ export declare class AgentFailure extends AgentFailure_base {
24
+ }
25
+ declare const BlockedFailure_base: Schema.Class<BlockedFailure, Schema.TaggedStruct<"BlockedFailure", {
26
+ readonly message: Schema.NonEmptyString;
27
+ }>, import("effect/Cause").YieldableError>;
22
28
  /**
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.
29
+ * A blocker the agent can't resolve, described in `message` with the remaining work. The Loop
30
+ * opens no new Run for the Item until the operator retries or resolves the Run, or the Item
31
+ * changes (ADR 0017).
25
32
  */
26
- export declare class AgentFailure extends AgentFailure_base {
33
+ export declare class BlockedFailure extends BlockedFailure_base {
34
+ }
35
+ declare const QuestionFailure_base: Schema.Class<QuestionFailure, Schema.TaggedStruct<"QuestionFailure", {
36
+ readonly question: Schema.NonEmptyString;
37
+ }>, import("effect/Cause").YieldableError>;
38
+ /**
39
+ * A question that needs an operator decision. The Loop opens no new Run for the Item until the
40
+ * operator answers or the Item changes (ADR 0017).
41
+ */
42
+ export declare class QuestionFailure extends QuestionFailure_base {
27
43
  }
28
- /** Which per-attempt ceiling the runaway guard tripped. */
44
+ /** The runaway guard limit that was exceeded. */
29
45
  export declare const RunawayCeiling: Schema.Literals<readonly ["wall-clock", "tokens"]>;
30
46
  export type RunawayCeiling = typeof RunawayCeiling.Type;
31
47
  declare const RunawayFailure_base: Schema.Class<RunawayFailure, Schema.TaggedStruct<"RunawayFailure", {
32
48
  readonly ceiling: Schema.Literals<readonly ["wall-clock", "tokens"]>;
33
49
  }>, import("effect/Cause").YieldableError>;
34
- /** The runaway guard interrupted an attempt that burned without progress. Never auto-retried (ADR 0013). */
50
+ /** A stop by the runaway guard after the Attempt exceeded `ceiling`; not retried automatically (ADR 0013). */
35
51
  export declare class RunawayFailure extends RunawayFailure_base {
36
52
  }
37
53
  declare const ChildSessionBudgetFailure_base: Schema.Class<ChildSessionBudgetFailure, Schema.TaggedStruct<"ChildSessionBudgetFailure", {
38
54
  readonly maxChildren: Schema.brand<Schema.Int, "ChildSessionBudget">;
39
55
  readonly attemptedChildren: Schema.brand<Schema.Int, "ChildSessionCount">;
40
56
  }>, 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
- */
57
+ /** A parent request for more child sessions than `maxChildren`; not retried automatically. */
45
58
  export declare class ChildSessionBudgetFailure extends ChildSessionBudgetFailure_base {
46
59
  }
47
- export declare const AttemptFailure: Schema.Union<readonly [typeof InfraFailure, typeof DefectFailure, typeof AgentFailure, typeof RunawayFailure, typeof ChildSessionBudgetFailure]>;
60
+ export declare const AttemptFailure: Schema.Union<readonly [typeof InfraFailure, typeof DefectFailure, typeof AgentFailure, typeof BlockedFailure, typeof QuestionFailure, typeof RunawayFailure, typeof ChildSessionBudgetFailure]>;
48
61
  export type AttemptFailure = typeof AttemptFailure.Type;
49
- /** The class half of the auto-retry law: only infra failures qualify. `shouldAutoRetry` adds the attempt cap. */
62
+ /** Returns whether the failure is an `InfraFailure`; `shouldAutoRetry` also applies the attempt cap. */
50
63
  export declare const isAutoRetryableFailure: <I>(input: I) => input is I & InfraFailure;
51
64
  export {};
52
65
  //# sourceMappingURL=failure.d.ts.map
@@ -1 +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"}
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,+FAA+F;AAC/F,qBAAa,aAAc,SAAQ,kBAEmC;CAAG;;;;AAEzE,uEAAuE;AACvE,qBAAa,YAAa,SAAQ,iBAKjC;CAAG;;;;AAEJ;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;AAEL;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,oBAInC;CAAG;AAEL,iDAAiD;AACjD,eAAO,MAAM,cAAc,oDAA4C,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;;;;AAExD,8GAA8G;AAC9G,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;;AAEL,8FAA8F;AAC9F,qBAAa,yBAA0B,SAAQ,8BAK7C;CAAG;AAEL,eAAO,MAAM,cAAc,iMAQzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;AAExD,wGAAwG;AACxG,eAAO,MAAM,sBAAsB,4CAA0B,CAAC"}
@@ -1,36 +1,47 @@
1
1
  import { Schema } from "effect";
2
2
  import { ChildSessionBudget, ChildSessionCount } from "../agent/session.js";
3
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.
4
+ * An infrastructure failure outside the agent, such as an unreachable Worker or failed checkout.
5
+ * It's the only failure the engine retries automatically, up to the attempt cap.
6
6
  */
7
7
  export class InfraFailure extends Schema.TaggedError("AttemptFailure/InfraFailure")("InfraFailure", {
8
8
  message: Schema.String,
9
9
  cause: Schema.Defect(),
10
10
  }) {
11
11
  }
12
- /** A programmer defect captured at the durable execution boundary. Retains its cause for diagnosis and requires an operator retry. */
12
+ /** A programmer defect caught at the durable execution boundary; not retried automatically. */
13
13
  export class DefectFailure extends Schema.TaggedError("AttemptFailure/DefectFailure")("DefectFailure", { message: Schema.String, cause: Schema.Defect() }) {
14
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
- */
15
+ /** A task failure reported by the agent; not retried automatically. */
19
16
  export class AgentFailure extends Schema.TaggedError("AttemptFailure/AgentFailure")("AgentFailure", {
20
17
  message: Schema.String,
21
18
  }) {
22
19
  }
23
- /** Which per-attempt ceiling the runaway guard tripped. */
20
+ /**
21
+ * A blocker the agent can't resolve, described in `message` with the remaining work. The Loop
22
+ * opens no new Run for the Item until the operator retries or resolves the Run, or the Item
23
+ * changes (ADR 0017).
24
+ */
25
+ export class BlockedFailure extends Schema.TaggedError("AttemptFailure/BlockedFailure")("BlockedFailure", {
26
+ message: Schema.NonEmptyString,
27
+ }) {
28
+ }
29
+ /**
30
+ * A question that needs an operator decision. The Loop opens no new Run for the Item until the
31
+ * operator answers or the Item changes (ADR 0017).
32
+ */
33
+ export class QuestionFailure extends Schema.TaggedError("AttemptFailure/QuestionFailure")("QuestionFailure", {
34
+ question: Schema.NonEmptyString,
35
+ }) {
36
+ }
37
+ /** The runaway guard limit that was exceeded. */
24
38
  export const RunawayCeiling = Schema.Literals(["wall-clock", "tokens"]);
25
- /** The runaway guard interrupted an attempt that burned without progress. Never auto-retried (ADR 0013). */
39
+ /** A stop by the runaway guard after the Attempt exceeded `ceiling`; not retried automatically (ADR 0013). */
26
40
  export class RunawayFailure extends Schema.TaggedError("AttemptFailure/RunawayFailure")("RunawayFailure", {
27
41
  ceiling: RunawayCeiling,
28
42
  }) {
29
43
  }
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
- */
44
+ /** A parent request for more child sessions than `maxChildren`; not retried automatically. */
34
45
  export class ChildSessionBudgetFailure extends Schema.TaggedError("AttemptFailure/ChildSessionBudgetFailure")("ChildSessionBudgetFailure", {
35
46
  maxChildren: ChildSessionBudget,
36
47
  attemptedChildren: ChildSessionCount,
@@ -40,9 +51,11 @@ export const AttemptFailure = Schema.Union([
40
51
  InfraFailure,
41
52
  DefectFailure,
42
53
  AgentFailure,
54
+ BlockedFailure,
55
+ QuestionFailure,
43
56
  RunawayFailure,
44
57
  ChildSessionBudgetFailure,
45
58
  ]);
46
- /** The class half of the auto-retry law: only infra failures qualify. `shouldAutoRetry` adds the attempt cap. */
59
+ /** Returns whether the failure is an `InfraFailure`; `shouldAutoRetry` also applies the attempt cap. */
47
60
  export const isAutoRetryableFailure = Schema.is(InfraFailure);
48
61
  //# sourceMappingURL=failure.js.map
@@ -1 +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,CAA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C;CAAG;AAEL,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC;IACzC,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,cAAc;IACd,eAAe;IACf,cAAc;IACd,yBAAyB;CAC1B,CAAC,CAAC;AAGH,wGAAwG;AACxG,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC"}
@@ -1,19 +1,17 @@
1
1
  import { Schema } from "effect";
2
2
  declare const AttemptSucceeded_base: Schema.Class<AttemptSucceeded, Schema.TaggedStruct<"Succeeded", {}>, {}>;
3
- /** The attempt finished; the step result is stored on the Step. */
3
+ /** The outcome of a successful Attempt; the step result is stored on the Step. */
4
4
  export declare class AttemptSucceeded extends AttemptSucceeded_base {
5
5
  }
6
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]>;
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").BlockedFailure, typeof import("./failure.ts").QuestionFailure, typeof import("./failure.ts").RunawayFailure, typeof import("./failure.ts").ChildSessionBudgetFailure]>;
8
8
  }>, {}>;
9
- /** The attempt failed with the typed failure that closed it. */
10
9
  export declare class AttemptFailed extends AttemptFailed_base {
11
10
  }
12
11
  declare const AttemptCanceled_base: Schema.Class<AttemptCanceled, Schema.TaggedStruct<"Canceled", {}>, {}>;
13
- /** The operator canceled the Run during this Attempt. */
12
+ /** The outcome of an Attempt during which the operator canceled the Run. */
14
13
  export declare class AttemptCanceled extends AttemptCanceled_base {
15
14
  }
16
- /** The recorded end of one try; a failed Attempt may still be followed by a retry of the same Step. */
17
15
  export declare const AttemptOutcome: Schema.Union<readonly [typeof AttemptSucceeded, typeof AttemptFailed, typeof AttemptCanceled]>;
18
16
  export type AttemptOutcome = typeof AttemptOutcome.Type;
19
17
  export {};
@@ -1 +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"}
1
+ {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../src/attempt/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;AAGhC,kFAAkF;AAClF,qBAAa,gBAAiB,SAAQ,qBAEpB;CAAG;;;;AAErB,qBAAa,aAAc,SAAQ,kBAKlC;CAAG;;AAEJ,4EAA4E;AAC5E,qBAAa,eAAgB,SAAQ,oBAGpC;CAAG;AAEJ,eAAO,MAAM,cAAc,gGAAmE,CAAC;AAC/F,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC"}
@@ -1,16 +1,14 @@
1
1
  import { Schema } from "effect";
2
2
  import { AttemptFailure } from "./failure.js";
3
- /** The attempt finished; the step result is stored on the Step. */
3
+ /** The outcome of a successful Attempt; the step result is stored on the Step. */
4
4
  export class AttemptSucceeded extends Schema.TaggedClass("AttemptOutcome/Succeeded")("Succeeded", {}) {
5
5
  }
6
- /** The attempt failed with the typed failure that closed it. */
7
6
  export class AttemptFailed extends Schema.TaggedClass("AttemptOutcome/Failed")("Failed", {
8
7
  failure: AttemptFailure,
9
8
  }) {
10
9
  }
11
- /** The operator canceled the Run during this Attempt. */
10
+ /** The outcome of an Attempt during which the operator canceled the Run. */
12
11
  export class AttemptCanceled extends Schema.TaggedClass("AttemptOutcome/Canceled")("Canceled", {}) {
13
12
  }
14
- /** The recorded end of one try; a failed Attempt may still be followed by a retry of the same Step. */
15
13
  export const AttemptOutcome = Schema.Union([AttemptSucceeded, AttemptFailed, AttemptCanceled]);
16
14
  //# sourceMappingURL=outcome.js.map
@@ -1 +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"}
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,kFAAkF;AAClF,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,WAAW,CACtD,0BAA0B,CAC3B,CAAC,WAAW,EAAE,EAAE,CAAC;CAAG;AAErB,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,CAAgB,uBAAuB,CAAC,CAC3F,QAAQ,EACR;IACE,OAAO,EAAE,cAAc;CACxB,CACF;CAAG;AAEJ,4EAA4E;AAC5E,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,CAAkB,yBAAyB,CAAC,CACjG,UAAU,EACV,EAAE,CACH;CAAG;AAEJ,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { type Effect, type Option, Schema } from "effect";
2
+ import type { LoopPermissions } from "../loop.ts";
3
+ import { type RepositoryName } from "../repository.ts";
4
+ import type { RunId } from "../run/run.ts";
5
+ import type { Comment } from "../step/result.ts";
6
+ import type { WorkerName } from "../worker.ts";
7
+ import type { AttemptId, AttemptNumber, AttemptWindows } from "./attempt.ts";
8
+ /** The remote branch `usine/salvage/<run>/<attempt>` with an Attempt's unfinished work. */
9
+ export declare const SalvageRef: Schema.brand<Schema.NonEmptyString, "SalvageRef">;
10
+ export type SalvageRef = typeof SalvageRef.Type;
11
+ export declare const salvageRefFor: (runId: RunId, number: AttemptNumber) => SalvageRef;
12
+ declare const SalvagePushed_base: Schema.Class<SalvagePushed, Schema.TaggedStruct<"Pushed", {
13
+ readonly ref: Schema.brand<Schema.NonEmptyString, "SalvageRef">;
14
+ readonly commit: Schema.brand<Schema.String, "CommitSha">;
15
+ }>, {}>;
16
+ /** Unfinished work committed and pushed to `ref`; `commit` is the pushed head. */
17
+ export declare class SalvagePushed extends SalvagePushed_base {
18
+ }
19
+ declare const SalvagePartlyPushed_base: Schema.Class<SalvagePartlyPushed, Schema.TaggedStruct<"PartlyPushed", {
20
+ readonly ref: Schema.brand<Schema.NonEmptyString, "SalvageRef">;
21
+ readonly commit: Schema.brand<Schema.String, "CommitSha">;
22
+ readonly path: Schema.NonEmptyString;
23
+ readonly message: Schema.String;
24
+ }>, {}>;
25
+ /**
26
+ * Unfinished work pushed to `ref` at `commit`, without files that the salvage can't push, such as
27
+ * a file over GitHub's size limit. The workspace at `path` on the Worker keeps their only copy,
28
+ * and `message` names them.
29
+ */
30
+ export declare class SalvagePartlyPushed extends SalvagePartlyPushed_base {
31
+ }
32
+ declare const SalvageRetained_base: Schema.Class<SalvageRetained, Schema.TaggedStruct<"Retained", {
33
+ readonly path: Schema.NonEmptyString;
34
+ readonly commit: Schema.OptionFromNullOr<Schema.brand<Schema.String, "CommitSha">>;
35
+ readonly message: Schema.String;
36
+ }>, {}>;
37
+ /** A failed salvage that left the workspace at `path` on the Worker. `commit` is `None` if inspection failed. */
38
+ export declare class SalvageRetained extends SalvageRetained_base {
39
+ }
40
+ declare const SalvageRejected_base: Schema.Class<SalvageRejected, Schema.TaggedStruct<"Rejected", {
41
+ readonly path: Schema.NonEmptyString;
42
+ readonly commit: Schema.brand<Schema.String, "CommitSha">;
43
+ readonly message: Schema.String;
44
+ }>, {}>;
45
+ /**
46
+ * A salvage whose push the remote refused for a reason that pushing again can't fix, such as a
47
+ * file over GitHub's size limit. It left the workspace at `path` on the Worker, and recovery
48
+ * doesn't push `commit` again.
49
+ */
50
+ export declare class SalvageRejected extends SalvageRejected_base {
51
+ }
52
+ /** What the executor kept of the workspace of an unsuccessful Attempt. */
53
+ export declare const AttemptSalvage: Schema.Union<readonly [typeof SalvagePushed, typeof SalvagePartlyPushed, typeof SalvageRetained, typeof SalvageRejected]>;
54
+ export type AttemptSalvage = typeof AttemptSalvage.Type;
55
+ /** A persisted Attempt whose checkout can still exist on its Worker. */
56
+ export interface AttemptRecovery {
57
+ readonly attemptId: AttemptId;
58
+ readonly worker: WorkerName;
59
+ readonly repository: RepositoryName;
60
+ readonly ref: SalvageRef;
61
+ /** The Loop permissions; a leftover checkout of a `read` Attempt is removed, not salvaged. */
62
+ readonly permissions: LoopPermissions;
63
+ /** Whether the Attempt succeeded, in which case a leftover checkout is removed, not salvaged. */
64
+ readonly succeeded: boolean;
65
+ /** Whether the Attempt has no outcome yet, so a restart can reattach it if its parent task runs. */
66
+ readonly open: boolean;
67
+ /** The recorded salvage that the remote rejected, whose commit recovery doesn't push again. */
68
+ readonly rejected: Option.Option<SalvageRejected>;
69
+ }
70
+ /** The storage that startup reconciliation uses for a persisted Attempt's salvage, comments, and windows. */
71
+ export interface RecoverySink<E> {
72
+ readonly salvage: (salvage: AttemptSalvage) => Effect.Effect<void, E>;
73
+ readonly comments: (comments: ReadonlyArray<Comment>) => Effect.Effect<void, E>;
74
+ readonly windows: Effect.Effect<AttemptWindows, E>;
75
+ }
76
+ export {};
77
+ //# sourceMappingURL=salvage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"salvage.d.ts","sourceRoot":"","sources":["../../src/attempt/salvage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7E,2FAA2F;AAC3F,eAAO,MAAM,UAAU,mDAAyD,CAAC;AACjF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,eAAO,MAAM,aA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E,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;CACpD"}
@@ -0,0 +1,49 @@
1
+ import { Schema } from "effect";
2
+ import { CommitSha, safeSegment } from "../repository.js";
3
+ /** The remote branch `usine/salvage/<run>/<attempt>` with an Attempt's unfinished work. */
4
+ export const SalvageRef = Schema.NonEmptyString.pipe(Schema.brand("SalvageRef"));
5
+ export const salvageRefFor = (runId, number) => SalvageRef.make(`usine/salvage/${safeSegment(runId)}/${number}`);
6
+ /** Unfinished work committed and pushed to `ref`; `commit` is the pushed head. */
7
+ export class SalvagePushed extends Schema.TaggedClass("AttemptSalvage/Pushed")("Pushed", {
8
+ ref: SalvageRef,
9
+ commit: CommitSha,
10
+ }) {
11
+ }
12
+ /**
13
+ * Unfinished work pushed to `ref` at `commit`, without files that the salvage can't push, such as
14
+ * a file over GitHub's size limit. The workspace at `path` on the Worker keeps their only copy,
15
+ * and `message` names them.
16
+ */
17
+ export class SalvagePartlyPushed extends Schema.TaggedClass("AttemptSalvage/PartlyPushed")("PartlyPushed", {
18
+ ref: SalvageRef,
19
+ commit: CommitSha,
20
+ path: Schema.NonEmptyString,
21
+ message: Schema.String,
22
+ }) {
23
+ }
24
+ /** A failed salvage that left the workspace at `path` on the Worker. `commit` is `None` if inspection failed. */
25
+ export class SalvageRetained extends Schema.TaggedClass("AttemptSalvage/Retained")("Retained", {
26
+ path: Schema.NonEmptyString,
27
+ commit: Schema.OptionFromNullOr(CommitSha),
28
+ message: Schema.String,
29
+ }) {
30
+ }
31
+ /**
32
+ * A salvage whose push the remote refused for a reason that pushing again can't fix, such as a
33
+ * file over GitHub's size limit. It left the workspace at `path` on the Worker, and recovery
34
+ * doesn't push `commit` again.
35
+ */
36
+ export class SalvageRejected extends Schema.TaggedClass("AttemptSalvage/Rejected")("Rejected", {
37
+ path: Schema.NonEmptyString,
38
+ commit: CommitSha,
39
+ message: Schema.String,
40
+ }) {
41
+ }
42
+ /** What the executor kept of the workspace of an unsuccessful Attempt. */
43
+ export const AttemptSalvage = Schema.Union([
44
+ SalvagePushed,
45
+ SalvagePartlyPushed,
46
+ SalvageRetained,
47
+ SalvageRejected,
48
+ ]);
49
+ //# sourceMappingURL=salvage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"salvage.js","sourceRoot":"","sources":["../../src/attempt/salvage.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AAM/E,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AAGjF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,MAAqB,EAAc,EAAE,CAC/E,UAAU,CAAC,IAAI,CAAC,iBAAiB,WAAW,CAAC,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAEnE,kFAAkF;AAClF,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,CAAgB,uBAAuB,CAAC,CAC3F,QAAQ,EACR;IACE,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,SAAS;CAClB,CACF;CAAG;AAEJ;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,CACzD,6BAA6B,CAC9B,CAAC,cAAc,EAAE;IAChB,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC;CAAG;AAEL,iHAAiH;AACjH,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,CAAkB,yBAAyB,CAAC,CACjG,UAAU,EACV;IACE,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,CAAkB,yBAAyB,CAAC,CACjG,UAAU,EACV;IACE,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC;IACzC,aAAa;IACb,mBAAmB;IACnB,eAAe;IACf,eAAe;CAChB,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { Schema } from "effect";
2
+ declare const StartedByEvent_base: Schema.Class<StartedByEvent, Schema.TaggedStruct<"Event", {}>, {}>;
3
+ /** A start by the Run's Event, as for every Run's first Attempt. */
4
+ export declare class StartedByEvent extends StartedByEvent_base {
5
+ }
6
+ declare const StartedByRetry_base: Schema.Class<StartedByRetry, Schema.TaggedStruct<"OperatorRetry", {
7
+ readonly operator: Schema.OptionFromNullOr<Schema.brand<Schema.String, "OperatorLogin">>;
8
+ }>, {}>;
9
+ /** An operator retry of the failed Run; `operator` is `None` if `usine.yaml` sets no operator login. */
10
+ export declare class StartedByRetry extends StartedByRetry_base {
11
+ }
12
+ declare const StartedByEditAndRetry_base: Schema.Class<StartedByEditAndRetry, Schema.TaggedStruct<"EditAndRetry", {
13
+ readonly operator: Schema.OptionFromNullOr<Schema.brand<Schema.String, "OperatorLogin">>;
14
+ }>, {}>;
15
+ /**
16
+ * An operator retry of the failed Run with a changed task or Agent (ADR 0018). `operator` is
17
+ * `None` if `usine.yaml` sets no operator login.
18
+ */
19
+ export declare class StartedByEditAndRetry extends StartedByEditAndRetry_base {
20
+ }
21
+ declare const StartedByInfraRetry_base: Schema.Class<StartedByInfraRetry, Schema.TaggedStruct<"InfraRetry", {}>, {}>;
22
+ /** An automatic retry after the previous Attempt's `InfraFailure` (ADR 0002). */
23
+ export declare class StartedByInfraRetry extends StartedByInfraRetry_base {
24
+ }
25
+ declare const StartedAfterRestart_base: Schema.Class<StartedAfterRestart, Schema.TaggedStruct<"AfterRestart", {}>, {}>;
26
+ /** A start after an orchestrator restart interrupted the previous Attempt without a reattach. */
27
+ export declare class StartedAfterRestart extends StartedAfterRestart_base {
28
+ }
29
+ export declare const OperatorRetryStart: Schema.Union<readonly [typeof StartedByRetry, typeof StartedByEditAndRetry]>;
30
+ export type OperatorRetryStart = typeof OperatorRetryStart.Type;
31
+ /** The reason an Attempt started; a reattached Attempt keeps its original reason. */
32
+ export declare const AttemptStart: Schema.Union<readonly [typeof StartedByEvent, typeof StartedByRetry, typeof StartedByEditAndRetry, typeof StartedByInfraRetry, typeof StartedAfterRestart]>;
33
+ export type AttemptStart = typeof AttemptStart.Type;
34
+ export {};
35
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/attempt/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;AAGhC,oEAAoE;AACpE,qBAAa,cAAe,SAAQ,mBAGnC;CAAG;;;;AAEJ,wGAAwG;AACxG,qBAAa,cAAe,SAAQ,mBAGnC;CAAG;;;;AAEJ;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,0BAE4B;CAAG;;AAE1E,iFAAiF;AACjF,qBAAa,mBAAoB,SAAQ,wBAEtB;CAAG;;AAEtB,iGAAiG;AACjG,qBAAa,mBAAoB,SAAQ,wBAEpB;CAAG;AAExB,eAAO,MAAM,kBAAkB,8EAAwD,CAAC;AACxF,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAC;AAEhE,qFAAqF;AACrF,eAAO,MAAM,YAAY,6JAMvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { Schema } from "effect";
2
+ import { OperatorLogin } from "../operator.js";
3
+ /** A start by the Run's Event, as for every Run's first Attempt. */
4
+ export class StartedByEvent extends Schema.TaggedClass("AttemptStart/Event")("Event", {}) {
5
+ }
6
+ /** An operator retry of the failed Run; `operator` is `None` if `usine.yaml` sets no operator login. */
7
+ export class StartedByRetry extends Schema.TaggedClass("AttemptStart/Retry")("OperatorRetry", { operator: Schema.OptionFromNullOr(OperatorLogin) }) {
8
+ }
9
+ /**
10
+ * An operator retry of the failed Run with a changed task or Agent (ADR 0018). `operator` is
11
+ * `None` if `usine.yaml` sets no operator login.
12
+ */
13
+ export class StartedByEditAndRetry extends Schema.TaggedClass("AttemptStart/EditAndRetry")("EditAndRetry", { operator: Schema.OptionFromNullOr(OperatorLogin) }) {
14
+ }
15
+ /** An automatic retry after the previous Attempt's `InfraFailure` (ADR 0002). */
16
+ export class StartedByInfraRetry extends Schema.TaggedClass("AttemptStart/InfraRetry")("InfraRetry", {}) {
17
+ }
18
+ /** A start after an orchestrator restart interrupted the previous Attempt without a reattach. */
19
+ export class StartedAfterRestart extends Schema.TaggedClass("AttemptStart/AfterRestart")("AfterRestart", {}) {
20
+ }
21
+ export const OperatorRetryStart = Schema.Union([StartedByRetry, StartedByEditAndRetry]);
22
+ /** The reason an Attempt started; a reattached Attempt keeps its original reason. */
23
+ export const AttemptStart = Schema.Union([
24
+ StartedByEvent,
25
+ StartedByRetry,
26
+ StartedByEditAndRetry,
27
+ StartedByInfraRetry,
28
+ StartedAfterRestart,
29
+ ]);
30
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/attempt/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,oEAAoE;AACpE,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,CAAiB,oBAAoB,CAAC,CAC1F,OAAO,EACP,EAAE,CACH;CAAG;AAEJ,wGAAwG;AACxG,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,CAAiB,oBAAoB,CAAC,CAC1F,eAAe,EACf,EAAE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CACrD;CAAG;AAEJ;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,CAC3D,2BAA2B,CAC5B,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC;CAAG;AAE1E,iFAAiF;AACjF,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,CACzD,yBAAyB,CAC1B,CAAC,YAAY,EAAE,EAAE,CAAC;CAAG;AAEtB,iGAAiG;AACjG,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,CACzD,2BAA2B,CAC5B,CAAC,cAAc,EAAE,EAAE,CAAC;CAAG;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAGxF,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC;IACvC,cAAc;IACd,cAAc;IACd,qBAAqB;IACrB,mBAAmB;IACnB,mBAAmB;CACpB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Returns `Schema.Struct(fields)` that fails with "Unexpected key" on any key `fields` doesn't
4
+ * declare, whatever `onExcessProperty` the decode site passes.
5
+ */
6
+ export declare const closedStruct: <const Fields extends Schema.Struct.Fields>(fields: Fields) => Schema.Struct<Fields>;
7
+ //# sourceMappingURL=closed-struct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closed-struct.d.ts","sourceRoot":"","sources":["../src/closed-struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,UAC5D,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,MAAM,CAQtB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Returns `Schema.Struct(fields)` that fails with "Unexpected key" on any key `fields` doesn't
4
+ * declare, whatever `onExcessProperty` the decode site passes.
5
+ */
6
+ export const closedStruct = (fields) => {
7
+ const struct = Schema.Struct(fields);
8
+ const declared = new Set(Object.keys(fields));
9
+ const undeclared = Schema.Record(Schema.String.check(Schema.makeFilter((key) => !declared.has(key))), Schema.Never.annotate({ message: "Unexpected key" }));
10
+ return struct.rebuild(Schema.StructWithRest(struct, [undeclared]).ast);
11
+ };
12
+ //# sourceMappingURL=closed-struct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closed-struct.js","sourceRoot":"","sources":["../src/closed-struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,MAAc,EACS,EAAE;IACzB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAC9B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EACnE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CACrD,CAAC;IACF,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACzE,CAAC,CAAC"}
@@ -1,13 +1,12 @@
1
1
  import { Schema } from "effect";
2
- /** Maximum Runs one Loop may open for an Item between operator resets. */
2
+ /** The maximum number of Runs one Loop can open for an Item between operator resets. */
3
3
  export declare const CycleLimit: Schema.brand<Schema.Int, "CycleLimit">;
4
4
  export type CycleLimit = typeof CycleLimit.Type;
5
- /** Identifies one Item allowance between explicit operator resets. */
5
+ /** The ID of the period between two operator resets of an Item's cycle budget. */
6
6
  export declare const CycleGeneration: Schema.brand<Schema.Int, "CycleGeneration">;
7
7
  export type CycleGeneration = typeof CycleGeneration.Type;
8
- /** The safe default for unattended rounds on an Item. */
9
8
  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. */
9
+ /** The number of admitted or completed Runs of one Loop on an Item. */
11
10
  export declare const CycleCount: Schema.brand<Schema.Int, "CycleCount">;
12
11
  export type CycleCount = typeof CycleCount.Type;
13
12
  declare const LoopCycleCount_base: Schema.Class<LoopCycleCount, Schema.Struct<{
@@ -15,10 +14,10 @@ declare const LoopCycleCount_base: Schema.Class<LoopCycleCount, Schema.Struct<{
15
14
  readonly admitted: Schema.brand<Schema.Int, "CycleCount">;
16
15
  readonly completed: Schema.brand<Schema.Int, "CycleCount">;
17
16
  }>, {}>;
18
- /** A Loop's charged Runs and settled Runs in the current cycle budget. */
17
+ /** The admitted and completed Runs of one Loop in the current cycle generation. */
19
18
  export declare class LoopCycleCount extends LoopCycleCount_base {
20
19
  }
21
- /** Identifies the Event and budget generation that first exhausted an Item's allowance. */
20
+ /** The ID of the Event and cycle generation that first exhausted an Item's budget. */
22
21
  export declare const CycleBudgetAskId: Schema.brand<Schema.brand<Schema.NonEmptyString, "EventId">, "CycleBudgetAskId">;
23
22
  export type CycleBudgetAskId = typeof CycleBudgetAskId.Type;
24
23
  declare const CycleBudgetAsk_base: Schema.Class<CycleBudgetAsk, Schema.Struct<{
@@ -29,9 +28,9 @@ declare const CycleBudgetAsk_base: Schema.Class<CycleBudgetAsk, Schema.Struct<{
29
28
  readonly limit: Schema.brand<Schema.Int, "CycleLimit">;
30
29
  readonly counts: Schema.NonEmptyArray<typeof LoopCycleCount>;
31
30
  }>, {}>;
32
- /** An Item-level request for an operator reset before further Runs can open. */
31
+ /** An Ask for the operator to reset an Item's cycle budget; no Runs open until the reset. */
33
32
  export declare class CycleBudgetAsk extends CycleBudgetAsk_base {
34
- /** The furthest completed round; each Loop participates at most once per round. */
33
+ /** The highest `completed` count across Loops; each Loop runs at most once per round. */
35
34
  get completedCycles(): CycleCount;
36
35
  }
37
36
  export {};
@@ -1 +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"}
1
+ {"version":3,"file":"cycle-budget.d.ts","sourceRoot":"","sources":["../src/cycle-budget.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wFAAwF;AACxF,eAAO,MAAM,UAAU,wCAEtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,kFAAkF;AAClF,eAAO,MAAM,eAAe,6CAE3B,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,eAAO,MAAM,mBAAmB,qDAAqB,CAAC;AAEtD,uEAAuE;AACvE,eAAO,MAAM,UAAU,wCAEtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;;;;;;AAEhD,mFAAmF;AACnF,qBAAa,cAAe,SAAQ,mBAUnC;CAAG;AAEJ,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,kFAAiD,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAC;;;;;;;;;AAE5D,6FAA6F;AAC7F,qBAAa,cAAe,SAAQ,mBAkBnC;IACC,yFAAyF;IACzF,IAAI,eAAe,IAAI,UAAU,CAEhC;CACF"}
@@ -1,44 +1,40 @@
1
+ import { closedStruct } from "./closed-struct.js";
1
2
  import { EventId } from "./event.js";
2
3
  import { ItemKey } from "./item.js";
3
4
  import { LoopName } from "./loop.js";
4
5
  import { RepositoryName } from "./repository.js";
5
6
  import { Schema } from "effect";
6
- /** Maximum Runs one Loop may open for an Item between operator resets. */
7
+ /** The maximum number of Runs one Loop can open for an Item between operator resets. */
7
8
  export const CycleLimit = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("CycleLimit"));
8
- /** Identifies one Item allowance between explicit operator resets. */
9
+ /** The ID of the period between two operator resets of an Item's cycle budget. */
9
10
  export const CycleGeneration = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("CycleGeneration"));
10
- /** The safe default for unattended rounds on an Item. */
11
11
  export const DEFAULT_CYCLE_LIMIT = CycleLimit.make(3);
12
- /** Number of admitted or completed rounds for one Loop on an Item. */
12
+ /** The number of admitted or completed Runs of one Loop on an Item. */
13
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({
14
+ /** The admitted and completed Runs of one Loop in the current cycle generation. */
15
+ export class LoopCycleCount extends Schema.Class("LoopCycleCount")(closedStruct({
16
16
  loop: LoopName,
17
17
  admitted: CycleCount,
18
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" } })) {
19
+ }).check(Schema.makeFilter(({ admitted, completed }) => completed <= admitted, {
20
+ message: "Completed runs can't exceed admitted runs",
21
+ }))) {
24
22
  }
25
- /** Identifies the Event and budget generation that first exhausted an Item's allowance. */
23
+ /** The ID of the Event and cycle generation that first exhausted an Item's budget. */
26
24
  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({
25
+ /** An Ask for the operator to reset an Item's cycle budget; no Runs open until the reset. */
26
+ export class CycleBudgetAsk extends Schema.Class("CycleBudgetAsk")(closedStruct({
29
27
  id: CycleBudgetAskId,
30
28
  itemKey: ItemKey,
31
29
  repository: RepositoryName,
32
30
  loop: LoopName,
33
31
  limit: CycleLimit,
34
32
  counts: Schema.NonEmptyArray(LoopCycleCount),
35
- })
36
- .check(Schema.makeFilter(({ loop, limit, counts }) => new Set(counts.map((count) => count.loop)).size === counts.length &&
33
+ }).check(Schema.makeFilter(({ loop, limit, counts }) => new Set(counts.map((count) => count.loop)).size === counts.length &&
37
34
  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. */
35
+ message: "Expected unique participating loops, including the exhausted loop at its limit",
36
+ }))) {
37
+ /** The highest `completed` count across Loops; each Loop runs at most once per round. */
42
38
  get completedCycles() {
43
39
  return CycleCount.make(Math.max(...this.counts.map(({ completed }) => completed)));
44
40
  }
@@ -1 +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,MA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