@substrate-ai/sdlc 0.19.54

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 (166) hide show
  1. package/dist/events.d.ts +336 -0
  2. package/dist/events.d.ts.map +1 -0
  3. package/dist/events.js +11 -0
  4. package/dist/events.js.map +1 -0
  5. package/dist/gating/conflict-detector.d.ts +59 -0
  6. package/dist/gating/conflict-detector.d.ts.map +1 -0
  7. package/dist/gating/conflict-detector.js +101 -0
  8. package/dist/gating/conflict-detector.js.map +1 -0
  9. package/dist/gating/dispatch-gate.d.ts +42 -0
  10. package/dist/gating/dispatch-gate.d.ts.map +1 -0
  11. package/dist/gating/dispatch-gate.js +197 -0
  12. package/dist/gating/dispatch-gate.js.map +1 -0
  13. package/dist/gating/index.d.ts +9 -0
  14. package/dist/gating/index.d.ts.map +1 -0
  15. package/dist/gating/index.js +8 -0
  16. package/dist/gating/index.js.map +1 -0
  17. package/dist/gating/types.d.ts +98 -0
  18. package/dist/gating/types.d.ts.map +1 -0
  19. package/dist/gating/types.js +8 -0
  20. package/dist/gating/types.js.map +1 -0
  21. package/dist/handlers/event-bridge.d.ts +56 -0
  22. package/dist/handlers/event-bridge.d.ts.map +1 -0
  23. package/dist/handlers/event-bridge.js +140 -0
  24. package/dist/handlers/event-bridge.js.map +1 -0
  25. package/dist/handlers/index.d.ts +15 -0
  26. package/dist/handlers/index.d.ts.map +1 -0
  27. package/dist/handlers/index.js +14 -0
  28. package/dist/handlers/index.js.map +1 -0
  29. package/dist/handlers/sdlc-code-review-handler.d.ts +119 -0
  30. package/dist/handlers/sdlc-code-review-handler.d.ts.map +1 -0
  31. package/dist/handlers/sdlc-code-review-handler.js +131 -0
  32. package/dist/handlers/sdlc-code-review-handler.js.map +1 -0
  33. package/dist/handlers/sdlc-create-story-handler.d.ts +97 -0
  34. package/dist/handlers/sdlc-create-story-handler.d.ts.map +1 -0
  35. package/dist/handlers/sdlc-create-story-handler.js +91 -0
  36. package/dist/handlers/sdlc-create-story-handler.js.map +1 -0
  37. package/dist/handlers/sdlc-dev-story-handler.d.ts +121 -0
  38. package/dist/handlers/sdlc-dev-story-handler.d.ts.map +1 -0
  39. package/dist/handlers/sdlc-dev-story-handler.js +288 -0
  40. package/dist/handlers/sdlc-dev-story-handler.js.map +1 -0
  41. package/dist/handlers/sdlc-phase-handler.d.ts +32 -0
  42. package/dist/handlers/sdlc-phase-handler.d.ts.map +1 -0
  43. package/dist/handlers/sdlc-phase-handler.js +166 -0
  44. package/dist/handlers/sdlc-phase-handler.js.map +1 -0
  45. package/dist/handlers/types.d.ts +132 -0
  46. package/dist/handlers/types.d.ts.map +1 -0
  47. package/dist/handlers/types.js +10 -0
  48. package/dist/handlers/types.js.map +1 -0
  49. package/dist/index.d.ts +8 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +14 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/learning/failure-classifier.d.ts +23 -0
  54. package/dist/learning/failure-classifier.d.ts.map +1 -0
  55. package/dist/learning/failure-classifier.js +75 -0
  56. package/dist/learning/failure-classifier.js.map +1 -0
  57. package/dist/learning/finding-classifier.d.ts +25 -0
  58. package/dist/learning/finding-classifier.d.ts.map +1 -0
  59. package/dist/learning/finding-classifier.js +37 -0
  60. package/dist/learning/finding-classifier.js.map +1 -0
  61. package/dist/learning/finding-lifecycle.d.ts +69 -0
  62. package/dist/learning/finding-lifecycle.d.ts.map +1 -0
  63. package/dist/learning/finding-lifecycle.js +162 -0
  64. package/dist/learning/finding-lifecycle.js.map +1 -0
  65. package/dist/learning/finding-store.d.ts +16 -0
  66. package/dist/learning/finding-store.d.ts.map +1 -0
  67. package/dist/learning/finding-store.js +26 -0
  68. package/dist/learning/finding-store.js.map +1 -0
  69. package/dist/learning/findings-injector.d.ts +34 -0
  70. package/dist/learning/findings-injector.d.ts.map +1 -0
  71. package/dist/learning/findings-injector.js +140 -0
  72. package/dist/learning/findings-injector.js.map +1 -0
  73. package/dist/learning/index.d.ts +8 -0
  74. package/dist/learning/index.d.ts.map +1 -0
  75. package/dist/learning/index.js +10 -0
  76. package/dist/learning/index.js.map +1 -0
  77. package/dist/learning/relevance-scorer.d.ts +25 -0
  78. package/dist/learning/relevance-scorer.d.ts.map +1 -0
  79. package/dist/learning/relevance-scorer.js +49 -0
  80. package/dist/learning/relevance-scorer.js.map +1 -0
  81. package/dist/learning/types.d.ts +55 -0
  82. package/dist/learning/types.d.ts.map +1 -0
  83. package/dist/learning/types.js +36 -0
  84. package/dist/learning/types.js.map +1 -0
  85. package/dist/orchestrator/graph-orchestrator.d.ts +208 -0
  86. package/dist/orchestrator/graph-orchestrator.d.ts.map +1 -0
  87. package/dist/orchestrator/graph-orchestrator.js +213 -0
  88. package/dist/orchestrator/graph-orchestrator.js.map +1 -0
  89. package/dist/run-manifest/cli-flags.d.ts +11 -0
  90. package/dist/run-manifest/cli-flags.d.ts.map +1 -0
  91. package/dist/run-manifest/cli-flags.js +10 -0
  92. package/dist/run-manifest/cli-flags.js.map +1 -0
  93. package/dist/run-manifest/index.d.ts +10 -0
  94. package/dist/run-manifest/index.d.ts.map +1 -0
  95. package/dist/run-manifest/index.js +10 -0
  96. package/dist/run-manifest/index.js.map +1 -0
  97. package/dist/run-model/cli-flags.d.ts +27 -0
  98. package/dist/run-model/cli-flags.d.ts.map +1 -0
  99. package/dist/run-model/cli-flags.js +31 -0
  100. package/dist/run-model/cli-flags.js.map +1 -0
  101. package/dist/run-model/index.d.ts +21 -0
  102. package/dist/run-model/index.d.ts.map +1 -0
  103. package/dist/run-model/index.js +19 -0
  104. package/dist/run-model/index.js.map +1 -0
  105. package/dist/run-model/per-story-state.d.ts +62 -0
  106. package/dist/run-model/per-story-state.d.ts.map +1 -0
  107. package/dist/run-model/per-story-state.js +70 -0
  108. package/dist/run-model/per-story-state.js.map +1 -0
  109. package/dist/run-model/recovery-history.d.ts +56 -0
  110. package/dist/run-model/recovery-history.d.ts.map +1 -0
  111. package/dist/run-model/recovery-history.js +83 -0
  112. package/dist/run-model/recovery-history.js.map +1 -0
  113. package/dist/run-model/run-manifest.d.ts +146 -0
  114. package/dist/run-model/run-manifest.d.ts.map +1 -0
  115. package/dist/run-model/run-manifest.js +481 -0
  116. package/dist/run-model/run-manifest.js.map +1 -0
  117. package/dist/run-model/schemas.d.ts +117 -0
  118. package/dist/run-model/schemas.d.ts.map +1 -0
  119. package/dist/run-model/schemas.js +83 -0
  120. package/dist/run-model/schemas.js.map +1 -0
  121. package/dist/run-model/supervisor-lock.d.ts +104 -0
  122. package/dist/run-model/supervisor-lock.d.ts.map +1 -0
  123. package/dist/run-model/supervisor-lock.js +284 -0
  124. package/dist/run-model/supervisor-lock.js.map +1 -0
  125. package/dist/run-model/types.d.ts +74 -0
  126. package/dist/run-model/types.d.ts.map +1 -0
  127. package/dist/run-model/types.js +8 -0
  128. package/dist/run-model/types.js.map +1 -0
  129. package/dist/run-model/verification-result.d.ts +60 -0
  130. package/dist/run-model/verification-result.d.ts.map +1 -0
  131. package/dist/run-model/verification-result.js +55 -0
  132. package/dist/run-model/verification-result.js.map +1 -0
  133. package/dist/verification/checks/acceptance-criteria-evidence-check.d.ts +21 -0
  134. package/dist/verification/checks/acceptance-criteria-evidence-check.d.ts.map +1 -0
  135. package/dist/verification/checks/acceptance-criteria-evidence-check.js +159 -0
  136. package/dist/verification/checks/acceptance-criteria-evidence-check.js.map +1 -0
  137. package/dist/verification/checks/build-check.d.ts +52 -0
  138. package/dist/verification/checks/build-check.d.ts.map +1 -0
  139. package/dist/verification/checks/build-check.js +160 -0
  140. package/dist/verification/checks/build-check.js.map +1 -0
  141. package/dist/verification/checks/index.d.ts +15 -0
  142. package/dist/verification/checks/index.d.ts.map +1 -0
  143. package/dist/verification/checks/index.js +15 -0
  144. package/dist/verification/checks/index.js.map +1 -0
  145. package/dist/verification/checks/phantom-review-check.d.ts +29 -0
  146. package/dist/verification/checks/phantom-review-check.d.ts.map +1 -0
  147. package/dist/verification/checks/phantom-review-check.js +70 -0
  148. package/dist/verification/checks/phantom-review-check.js.map +1 -0
  149. package/dist/verification/checks/trivial-output-check.d.ts +47 -0
  150. package/dist/verification/checks/trivial-output-check.d.ts.map +1 -0
  151. package/dist/verification/checks/trivial-output-check.js +72 -0
  152. package/dist/verification/checks/trivial-output-check.js.map +1 -0
  153. package/dist/verification/index.d.ts +13 -0
  154. package/dist/verification/index.d.ts.map +1 -0
  155. package/dist/verification/index.js +13 -0
  156. package/dist/verification/index.js.map +1 -0
  157. package/dist/verification/types.d.ts +149 -0
  158. package/dist/verification/types.d.ts.map +1 -0
  159. package/dist/verification/types.js +12 -0
  160. package/dist/verification/types.js.map +1 -0
  161. package/dist/verification/verification-pipeline.d.ts +65 -0
  162. package/dist/verification/verification-pipeline.d.ts.map +1 -0
  163. package/dist/verification/verification-pipeline.js +149 -0
  164. package/dist/verification/verification-pipeline.js.map +1 -0
  165. package/graphs/sdlc-pipeline.dot +42 -0
  166. package/package.json +22 -0
@@ -0,0 +1,213 @@
1
+ /**
2
+ * GraphOrchestrator — drives the SDLC pipeline as a factory graph.
3
+ *
4
+ * Story 43-7: GraphOrchestrator multi-story orchestration.
5
+ * Story 43-8: applyConfigToGraph config-to-graph mapping (duck-typed, ADR-003 compliant).
6
+ * Story 43-10: resolveGraphPath helper; eventBus/pipelineRunId/maxReviewCycles in config;
7
+ * per-story outcome tracking in GraphRunSummary.
8
+ *
9
+ * ADR-003: NO imports from @substrate-ai/factory in this file.
10
+ * All factory-side types are accepted via locally-defined duck-typed
11
+ * interfaces injected through GraphOrchestratorConfig.
12
+ */
13
+ import { EventEmitter } from 'node:events';
14
+ import { createRequire } from 'node:module';
15
+ import { dirname, join } from 'node:path';
16
+ import { existsSync } from 'node:fs';
17
+ import { fileURLToPath } from 'node:url';
18
+ import { createSdlcEventBridge } from '../handlers/event-bridge.js';
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
20
+ // ---------------------------------------------------------------------------
21
+ // Story 43-10: resolveGraphPath helper
22
+ // ---------------------------------------------------------------------------
23
+ /**
24
+ * Returns the absolute path to the bundled SDLC pipeline DOT file.
25
+ *
26
+ * Resolution order:
27
+ * 1. Relative to __dirname (works in source/unbundled: __dirname = packages/sdlc/src/orchestrator/)
28
+ * 2. Via createRequire to locate @substrate-ai/sdlc package.json, then graphs/ relative to it
29
+ * (works when bundled: __dirname points to dist/ but createRequire finds the real package)
30
+ *
31
+ * @throws {Error} if the DOT file cannot be found by any method.
32
+ */
33
+ export function resolveGraphPath() {
34
+ const candidates = [
35
+ // Method 1: relative to source file (works in unbundled / workspace mode)
36
+ join(__dirname, '../../graphs/sdlc-pipeline.dot'),
37
+ // Method 2: relative to dist/ directory (works when bundled via tsdown postbuild copy)
38
+ join(__dirname, '../graphs/sdlc-pipeline.dot'),
39
+ join(__dirname, 'graphs/sdlc-pipeline.dot'),
40
+ ];
41
+ // Method 3: resolve via createRequire (works in npm-installed mode)
42
+ try {
43
+ const require = createRequire(import.meta.url);
44
+ const sdlcPkgPath = require.resolve('@substrate-ai/sdlc/package.json');
45
+ candidates.push(join(dirname(sdlcPkgPath), 'graphs', 'sdlc-pipeline.dot'));
46
+ }
47
+ catch {
48
+ // createRequire resolution failed — continue with other candidates
49
+ }
50
+ for (const candidate of candidates) {
51
+ if (existsSync(candidate))
52
+ return candidate;
53
+ }
54
+ throw new Error(`Cannot locate sdlc-pipeline.dot. Searched:\n${candidates.map((c) => ` ${c}`).join('\n')}`);
55
+ }
56
+ /** Thrown by `createGraphOrchestrator` when the supplied graph is structurally invalid. */
57
+ export class GraphOrchestratorInitError extends Error {
58
+ constructor(message) {
59
+ super(message);
60
+ this.name = 'GraphOrchestratorInitError';
61
+ }
62
+ }
63
+ // ---------------------------------------------------------------------------
64
+ // Story 43-7/43-10: Factory function
65
+ // ---------------------------------------------------------------------------
66
+ /**
67
+ * Creates a `GraphOrchestrator` that runs one graph executor instance per
68
+ * concurrent story slot, with conflict-group serialization and bounded concurrency.
69
+ *
70
+ * When `config.eventBus` is provided, a per-story SDLC event bridge is created
71
+ * to translate factory `graph:*` events into `orchestrator:story-*` events (AC4,
72
+ * story 43-10).
73
+ *
74
+ * @throws {GraphOrchestratorInitError} if `config.graph` is missing `nodes` or `edges`.
75
+ */
76
+ export function createGraphOrchestrator(config) {
77
+ if (!config.graph?.nodes || !config.graph?.edges) {
78
+ throw new GraphOrchestratorInitError('Invalid graph: missing nodes or edges arrays');
79
+ }
80
+ const gcPauseMs = config.gcPauseMs ?? 2000;
81
+ async function runStoryGraph(storyKey, summary) {
82
+ // Derive epicId from story key (e.g. "48-1" → "48")
83
+ const epicId = storyKey.split('-')[0] ?? '';
84
+ const initialContext = {
85
+ storyKey,
86
+ epicId,
87
+ projectRoot: config.projectRoot,
88
+ methodologyPack: config.methodologyPack,
89
+ ...(config.pipelineRunId !== undefined ? { runId: config.pipelineRunId, pipelineRunId: config.pipelineRunId } : {}),
90
+ };
91
+ // Create a per-story factory event bus so each story's graph events are scoped
92
+ // to its own execution. The executor emits graph:* events on this bus.
93
+ const factoryBus = new EventEmitter();
94
+ // Wire up the SDLC event bridge if an SDLC event bus has been provided (story 43-9).
95
+ // The bridge translates factory graph:* events into orchestrator:story-* events.
96
+ const bridge = config.eventBus != null
97
+ ? createSdlcEventBridge({
98
+ storyKey,
99
+ ...(config.pipelineRunId !== undefined ? { pipelineRunId: config.pipelineRunId } : {}),
100
+ sdlcBus: config.eventBus,
101
+ graphEvents: factoryBus,
102
+ })
103
+ : undefined;
104
+ // Track whether the executor escalated this story (goal gate unsatisfied after max retries)
105
+ let escalated = false;
106
+ factoryBus.on('graph:goal-gate-unsatisfied', () => { escalated = true; });
107
+ let result;
108
+ try {
109
+ result = await config.executor.run(config.graph, {
110
+ runId: `${config.runId}:${storyKey}`,
111
+ logsRoot: config.logsRoot,
112
+ handlerRegistry: config.handlerRegistry,
113
+ initialContext,
114
+ eventBus: factoryBus,
115
+ });
116
+ }
117
+ catch (err) {
118
+ // Record failure — bridge teardown happens in finally
119
+ const errMsg = err instanceof Error ? err.message : String(err);
120
+ process.stderr.write(`[graph-orchestrator] Story ${storyKey} failed: ${errMsg}\n`);
121
+ summary.stories[storyKey] = { outcome: escalated ? 'ESCALATED' : 'FAILED', error: errMsg };
122
+ summary.f++;
123
+ }
124
+ finally {
125
+ // Always teardown the bridge to remove graph event listeners (AC7)
126
+ bridge?.teardown();
127
+ }
128
+ if (result === undefined) {
129
+ // Executor threw — outcome already recorded in catch block
130
+ return;
131
+ }
132
+ if (result.status === 'SUCCESS') {
133
+ summary.stories[storyKey] = { outcome: 'SUCCESS' };
134
+ summary.s++;
135
+ }
136
+ else if (escalated) {
137
+ summary.stories[storyKey] = { outcome: 'ESCALATED' };
138
+ summary.f++;
139
+ }
140
+ else {
141
+ const reason = result.failureReason ?? `status=${result.status}`;
142
+ process.stderr.write(`[graph-orchestrator] Story ${storyKey} failed: ${reason}\n`);
143
+ summary.stories[storyKey] = { outcome: 'FAILED', error: reason };
144
+ summary.f++;
145
+ }
146
+ }
147
+ async function runGroup(group, summary) {
148
+ for (const storyKey of group) {
149
+ await runStoryGraph(storyKey, summary);
150
+ if (gcPauseMs > 0)
151
+ await new Promise((r) => setTimeout(r, gcPauseMs));
152
+ }
153
+ }
154
+ async function runBatch(groups, summary) {
155
+ const queue = [...groups];
156
+ const active = [];
157
+ while (queue.length > 0 || active.length > 0) {
158
+ while (active.length < config.maxConcurrency && queue.length > 0) {
159
+ const group = queue.shift();
160
+ const p = runGroup(group, summary).finally(() => {
161
+ active.splice(active.indexOf(p), 1);
162
+ });
163
+ active.push(p);
164
+ }
165
+ if (active.length > 0)
166
+ await Promise.race(active);
167
+ }
168
+ }
169
+ return {
170
+ async run(storyKeys) {
171
+ const grouper = config.conflictGrouper ?? ((keys) => [keys.map((k) => [k])]);
172
+ const batches = grouper(storyKeys);
173
+ const summary = {
174
+ s: 0,
175
+ f: 0,
176
+ stories: {},
177
+ };
178
+ for (const batchGroups of batches) {
179
+ await runBatch(batchGroups, summary);
180
+ }
181
+ return {
182
+ successCount: summary.s,
183
+ failureCount: summary.f,
184
+ totalStories: storyKeys.length,
185
+ stories: summary.stories,
186
+ };
187
+ },
188
+ };
189
+ }
190
+ /**
191
+ * Patches the loaded SDLC pipeline graph to reflect runtime configuration.
192
+ *
193
+ * Currently maps `maxReviewCycles` → `dev_story.maxRetries` (1:1 mapping).
194
+ * Both values represent the number of *additional* retry attempts (not total).
195
+ *
196
+ * Must be called after parseGraph() and before any story graph instance runs.
197
+ *
198
+ * @param graph A factory Graph (Map-based nodes) duck-typed as PatchableGraph.
199
+ * @param options Runtime configuration to apply.
200
+ * @throws {Error} if the graph does not contain a `dev_story` node.
201
+ */
202
+ export function applyConfigToGraph(graph, options) {
203
+ const devStoryNode = graph.nodes.get('dev_story');
204
+ if (!devStoryNode) {
205
+ throw new Error("applyConfigToGraph: graph does not contain a 'dev_story' node");
206
+ }
207
+ devStoryNode.maxRetries = options.maxReviewCycles;
208
+ // Also set graph-level defaultMaxRetries so the executor's failRouteCount safeguard
209
+ // (which bounds conditional edge loops like code_review → dev_story) respects
210
+ // the --max-review-cycles value instead of using a hardcoded default.
211
+ graph.defaultMaxRetries = options.maxReviewCycles;
212
+ }
213
+ //# sourceMappingURL=graph-orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-orchestrator.js","sourceRoot":"","sources":["../../src/orchestrator/graph-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC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G,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACjD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;IAClF,CAAC;IACD,YAAY,CAAC,UAAU,GAAG,OAAO,CAAC,eAAe,CAAA;IACjD,oFAAoF;IACpF,8EAA8E;IAC9E,sEAAsE;IACtE,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAA;AACnD,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * run-manifest/cli-flags.ts — alias path for architectural spec conformance.
3
+ *
4
+ * Story 52-3 specified CliFlags at packages/sdlc/src/run-manifest/cli-flags.ts.
5
+ * The implementation lives at ../run-model/cli-flags.ts (established by Story 52-1
6
+ * which used run-model/ as the module namespace). This file re-exports from there
7
+ * so both import paths work.
8
+ */
9
+ export { CliFlagsSchema } from '../run-model/cli-flags.js';
10
+ export type { CliFlags } from '../run-model/cli-flags.js';
11
+ //# sourceMappingURL=cli-flags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-flags.d.ts","sourceRoot":"","sources":["../../src/run-manifest/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * run-manifest/cli-flags.ts — alias path for architectural spec conformance.
3
+ *
4
+ * Story 52-3 specified CliFlags at packages/sdlc/src/run-manifest/cli-flags.ts.
5
+ * The implementation lives at ../run-model/cli-flags.ts (established by Story 52-1
6
+ * which used run-model/ as the module namespace). This file re-exports from there
7
+ * so both import paths work.
8
+ */
9
+ export { CliFlagsSchema } from '../run-model/cli-flags.js';
10
+ //# sourceMappingURL=cli-flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-flags.js","sourceRoot":"","sources":["../../src/run-manifest/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * run-manifest/index.ts — alias path for architectural spec conformance.
3
+ *
4
+ * Story 52-3 specified the module barrel at packages/sdlc/src/run-manifest/index.ts.
5
+ * The implementation lives at ../run-model/index.ts (established by Story 52-1
6
+ * which used run-model/ as the module namespace). This file re-exports from there
7
+ * so both import paths work.
8
+ */
9
+ export * from '../run-model/index.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/run-manifest/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * run-manifest/index.ts — alias path for architectural spec conformance.
3
+ *
4
+ * Story 52-3 specified the module barrel at packages/sdlc/src/run-manifest/index.ts.
5
+ * The implementation lives at ../run-model/index.ts (established by Story 52-1
6
+ * which used run-model/ as the module namespace). This file re-exports from there
7
+ * so both import paths work.
8
+ */
9
+ export * from '../run-model/index.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/run-manifest/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * CliFlags — typed schema for CLI flags persisted in the run manifest — Story 52-3.
3
+ *
4
+ * These flags are written to `cli_flags` in the run manifest at run start so that
5
+ * the supervisor can read the original scope on restart.
6
+ */
7
+ import { z } from 'zod';
8
+ /**
9
+ * Zod schema for the CLI flags persisted in the run manifest.
10
+ *
11
+ * All fields are optional — only flags explicitly provided on the CLI are written.
12
+ * `halt_on` defaults to `'none'` at write time; `cost_ceiling` is omitted when not provided.
13
+ */
14
+ export declare const CliFlagsSchema: z.ZodObject<{
15
+ stories: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
+ halt_on: z.ZodOptional<z.ZodEnum<{
17
+ all: "all";
18
+ critical: "critical";
19
+ none: "none";
20
+ }>>;
21
+ cost_ceiling: z.ZodOptional<z.ZodNumber>;
22
+ agent: z.ZodOptional<z.ZodString>;
23
+ skip_verification: z.ZodOptional<z.ZodBoolean>;
24
+ events: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strip>;
26
+ export type CliFlags = z.infer<typeof CliFlagsSchema>;
27
+ //# sourceMappingURL=cli-flags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-flags.d.ts","sourceRoot":"","sources":["../../src/run-model/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;iBAazB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * CliFlags — typed schema for CLI flags persisted in the run manifest — Story 52-3.
3
+ *
4
+ * These flags are written to `cli_flags` in the run manifest at run start so that
5
+ * the supervisor can read the original scope on restart.
6
+ */
7
+ import { z } from 'zod';
8
+ // ---------------------------------------------------------------------------
9
+ // CliFlagsSchema — Zod schema for CLI flags
10
+ // ---------------------------------------------------------------------------
11
+ /**
12
+ * Zod schema for the CLI flags persisted in the run manifest.
13
+ *
14
+ * All fields are optional — only flags explicitly provided on the CLI are written.
15
+ * `halt_on` defaults to `'none'` at write time; `cost_ceiling` is omitted when not provided.
16
+ */
17
+ export const CliFlagsSchema = z.object({
18
+ /** Explicit story keys provided via --stories (e.g. ['51-1', '51-2']). */
19
+ stories: z.array(z.string()).optional(),
20
+ /** Escalation severity level that halts the pipeline (--halt-on). */
21
+ halt_on: z.enum(['all', 'critical', 'none']).optional(),
22
+ /** Maximum spend in USD before the pipeline halts (--cost-ceiling). */
23
+ cost_ceiling: z.number().positive().optional(),
24
+ /** Agent backend ID (--agent), e.g. 'codex' or 'gemini'. */
25
+ agent: z.string().optional(),
26
+ /** When true, the post-dispatch verification pipeline was skipped (--skip-verification). */
27
+ skip_verification: z.boolean().optional(),
28
+ /** When true, NDJSON events were requested (--events). */
29
+ events: z.boolean().optional(),
30
+ });
31
+ //# sourceMappingURL=cli-flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-flags.js","sourceRoot":"","sources":["../../src/run-model/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,8EAA8E;AAC9E,4CAA4C;AAC5C,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,0EAA0E;IAC1E,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC,qEAAqE;IACrE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvD,uEAAuE;IACvE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,4DAA4D;IAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,4FAA4F;IAC5F,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,0DAA0D;IAC1D,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * run-model barrel export — Story 52-1/52-3.
3
+ *
4
+ * Exports RunManifest, RunManifestData, RunManifestSchema, ManifestReadError,
5
+ * CliFlags, CliFlagsSchema, and all sub-types consumed by Epic 52 stories.
6
+ */
7
+ export { RunManifest } from './run-manifest.js';
8
+ export type { IDoltAdapter } from './run-manifest.js';
9
+ export type { RunManifestData, RecoveryEntry, CostAccumulation, Proposal, } from './types.js';
10
+ export { RunManifestSchema, RecoveryEntrySchema, CostAccumulationSchema, ProposalSchema, ManifestReadError, } from './schemas.js';
11
+ export { RecoveryOutcomeSchema } from './recovery-history.js';
12
+ export type { RecoveryOutcome } from './recovery-history.js';
13
+ export { CliFlagsSchema } from './cli-flags.js';
14
+ export type { CliFlags } from './cli-flags.js';
15
+ export { PerStoryStatusSchema, PerStoryStateSchema } from './per-story-state.js';
16
+ export type { PerStoryStatus, PerStoryState } from './per-story-state.js';
17
+ export { StoredVerificationCheckResultSchema, StoredVerificationSummarySchema } from './verification-result.js';
18
+ export type { StoredVerificationCheckResult, StoredVerificationSummary } from './verification-result.js';
19
+ export { SupervisorLock } from './supervisor-lock.js';
20
+ export type { SupervisorLockOptions } from './supervisor-lock.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/run-model/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,YAAY,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,QAAQ,GACT,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,GAClB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAChF,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzE,OAAO,EAAE,mCAAmC,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAC/G,YAAY,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAGxG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * run-model barrel export — Story 52-1/52-3.
3
+ *
4
+ * Exports RunManifest, RunManifestData, RunManifestSchema, ManifestReadError,
5
+ * CliFlags, CliFlagsSchema, and all sub-types consumed by Epic 52 stories.
6
+ */
7
+ export { RunManifest } from './run-manifest.js';
8
+ export { RunManifestSchema, RecoveryEntrySchema, CostAccumulationSchema, ProposalSchema, ManifestReadError, } from './schemas.js';
9
+ // Story 52-8: Recovery history schemas and types (additional exports not covered above)
10
+ export { RecoveryOutcomeSchema } from './recovery-history.js';
11
+ // Story 52-3: CLI flag persistence schema
12
+ export { CliFlagsSchema } from './cli-flags.js';
13
+ // Story 52-4: Per-story lifecycle state schema and types
14
+ export { PerStoryStatusSchema, PerStoryStateSchema } from './per-story-state.js';
15
+ // Story 52-7: Stored verification result schemas and types
16
+ export { StoredVerificationCheckResultSchema, StoredVerificationSummarySchema } from './verification-result.js';
17
+ // Story 52-2: Supervisor locking and ownership
18
+ export { SupervisorLock } from './supervisor-lock.js';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/run-model/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAU/C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,GAClB,MAAM,cAAc,CAAA;AAErB,wFAAwF;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAG7D,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,yDAAyD;AACzD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAGhF,2DAA2D;AAC3D,OAAO,EAAE,mCAAmC,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAG/G,+CAA+C;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * PerStoryState — per-story lifecycle state schema — Story 52-4.
3
+ *
4
+ * Provides the typed schema for individual story lifecycle states tracked
5
+ * in the run manifest's `per_story_state` map. Each entry records both
6
+ * a high-level consumer-facing status and the raw orchestrator phase string.
7
+ */
8
+ import { z } from 'zod';
9
+ /**
10
+ * High-level consumer-facing status for a story in the run manifest.
11
+ *
12
+ * Known literals cover all states defined in Epic 52–54. The trailing
13
+ * `z.string()` fallback (MUST remain last) accommodates states added by
14
+ * later stories (`gated` from 53-9, `skipped` from 53-3, `recovered` from 54-1)
15
+ * and any future extensions without breaking deserialization.
16
+ */
17
+ export declare const PerStoryStatusSchema: z.ZodUnion<readonly [z.ZodLiteral<"pending">, z.ZodLiteral<"dispatched">, z.ZodLiteral<"in-review">, z.ZodLiteral<"complete">, z.ZodLiteral<"failed">, z.ZodLiteral<"escalated">, z.ZodLiteral<"recovered">, z.ZodLiteral<"verification-failed">, z.ZodLiteral<"gated">, z.ZodLiteral<"skipped">, z.ZodString]>;
18
+ export type PerStoryStatus = z.infer<typeof PerStoryStatusSchema>;
19
+ /**
20
+ * Schema for a single per-story state entry in the run manifest.
21
+ *
22
+ * Field semantics:
23
+ * - `status`: High-level consumer-facing status (state-machine value). Use this
24
+ * for state-machine decisions and display.
25
+ * - `phase`: Raw orchestrator `StoryPhase` string (e.g., `'IN_DEV'`, `'IN_REVIEW'`).
26
+ * Informational only — do NOT compare this field in state-machine logic.
27
+ * - `started_at`: ISO-8601 timestamp when the story entered an active phase.
28
+ * - `completed_at`: ISO-8601 timestamp when the story reached a terminal state.
29
+ * - `verification_result`: Verification pipeline result (populated by story 52-7).
30
+ * - `cost_usd`: Accumulated cost in USD (populated at terminal transition).
31
+ */
32
+ export declare const PerStoryStateSchema: z.ZodObject<{
33
+ status: z.ZodUnion<readonly [z.ZodLiteral<"pending">, z.ZodLiteral<"dispatched">, z.ZodLiteral<"in-review">, z.ZodLiteral<"complete">, z.ZodLiteral<"failed">, z.ZodLiteral<"escalated">, z.ZodLiteral<"recovered">, z.ZodLiteral<"verification-failed">, z.ZodLiteral<"gated">, z.ZodLiteral<"skipped">, z.ZodString]>;
34
+ phase: z.ZodString;
35
+ started_at: z.ZodString;
36
+ completed_at: z.ZodOptional<z.ZodString>;
37
+ verification_result: z.ZodOptional<z.ZodObject<{
38
+ storyKey: z.ZodString;
39
+ checks: z.ZodArray<z.ZodObject<{
40
+ checkName: z.ZodString;
41
+ status: z.ZodEnum<{
42
+ pass: "pass";
43
+ warn: "warn";
44
+ fail: "fail";
45
+ }>;
46
+ details: z.ZodString;
47
+ duration_ms: z.ZodNumber;
48
+ }, z.core.$strip>>;
49
+ status: z.ZodEnum<{
50
+ pass: "pass";
51
+ warn: "warn";
52
+ fail: "fail";
53
+ }>;
54
+ duration_ms: z.ZodNumber;
55
+ }, z.core.$strip>>;
56
+ cost_usd: z.ZodOptional<z.ZodNumber>;
57
+ review_cycles: z.ZodOptional<z.ZodNumber>;
58
+ dispatches: z.ZodOptional<z.ZodNumber>;
59
+ retry_count: z.ZodOptional<z.ZodNumber>;
60
+ }, z.core.$strip>;
61
+ export type PerStoryState = z.infer<typeof PerStoryStateSchema>;
62
+ //# sourceMappingURL=per-story-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-story-state.d.ts","sourceRoot":"","sources":["../../src/run-model/per-story-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,iTAY/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAMjE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmB9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * PerStoryState — per-story lifecycle state schema — Story 52-4.
3
+ *
4
+ * Provides the typed schema for individual story lifecycle states tracked
5
+ * in the run manifest's `per_story_state` map. Each entry records both
6
+ * a high-level consumer-facing status and the raw orchestrator phase string.
7
+ */
8
+ import { z } from 'zod';
9
+ import { StoredVerificationSummarySchema } from './verification-result.js';
10
+ // ---------------------------------------------------------------------------
11
+ // PerStoryStatusSchema — extensible union (v0.19.6 pattern)
12
+ // ---------------------------------------------------------------------------
13
+ /**
14
+ * High-level consumer-facing status for a story in the run manifest.
15
+ *
16
+ * Known literals cover all states defined in Epic 52–54. The trailing
17
+ * `z.string()` fallback (MUST remain last) accommodates states added by
18
+ * later stories (`gated` from 53-9, `skipped` from 53-3, `recovered` from 54-1)
19
+ * and any future extensions without breaking deserialization.
20
+ */
21
+ export const PerStoryStatusSchema = z.union([
22
+ z.literal('pending'),
23
+ z.literal('dispatched'),
24
+ z.literal('in-review'),
25
+ z.literal('complete'),
26
+ z.literal('failed'),
27
+ z.literal('escalated'),
28
+ z.literal('recovered'),
29
+ z.literal('verification-failed'),
30
+ z.literal('gated'),
31
+ z.literal('skipped'),
32
+ z.string(), // extensible fallback — must be last
33
+ ]);
34
+ // ---------------------------------------------------------------------------
35
+ // PerStoryStateSchema
36
+ // ---------------------------------------------------------------------------
37
+ /**
38
+ * Schema for a single per-story state entry in the run manifest.
39
+ *
40
+ * Field semantics:
41
+ * - `status`: High-level consumer-facing status (state-machine value). Use this
42
+ * for state-machine decisions and display.
43
+ * - `phase`: Raw orchestrator `StoryPhase` string (e.g., `'IN_DEV'`, `'IN_REVIEW'`).
44
+ * Informational only — do NOT compare this field in state-machine logic.
45
+ * - `started_at`: ISO-8601 timestamp when the story entered an active phase.
46
+ * - `completed_at`: ISO-8601 timestamp when the story reached a terminal state.
47
+ * - `verification_result`: Verification pipeline result (populated by story 52-7).
48
+ * - `cost_usd`: Accumulated cost in USD (populated at terminal transition).
49
+ */
50
+ export const PerStoryStateSchema = z.object({
51
+ /** High-level consumer-facing status (state-machine value). */
52
+ status: PerStoryStatusSchema,
53
+ /** Raw orchestrator StoryPhase string (informational, for debugging). */
54
+ phase: z.string(),
55
+ /** ISO-8601 timestamp when the story entered an active phase. */
56
+ started_at: z.string(),
57
+ /** ISO-8601 timestamp when the story reached a terminal state. */
58
+ completed_at: z.string().optional(),
59
+ /** Verification pipeline result for this story (populated by story 52-7). */
60
+ verification_result: StoredVerificationSummarySchema.optional(),
61
+ /** Accumulated cost in USD for this story (populated at terminal transition). */
62
+ cost_usd: z.number().nonnegative().optional(),
63
+ /** Number of code review cycles this story went through. */
64
+ review_cycles: z.number().int().nonnegative().optional(),
65
+ /** Number of agent dispatches for this story. */
66
+ dispatches: z.number().int().nonnegative().optional(),
67
+ /** Number of retry attempts for this story (code review retries + recovery-engine retries). Initial dispatch is not counted. */
68
+ retry_count: z.number().int().nonnegative().optional(),
69
+ });
70
+ //# sourceMappingURL=per-story-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-story-state.js","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IACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC7C,4DAA4D;IAC5D,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACxD,iDAAiD;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACrD,gIAAgI;IAChI,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAA"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * RecoveryEntry and CostAccumulation schemas — Story 52-8.
3
+ *
4
+ * Provides Zod schemas and TypeScript types for recovery history and cost
5
+ * accumulation data stored in the run manifest. Consumed by Epic 53 cost
6
+ * governance and Epic 54 recovery engine.
7
+ */
8
+ import { z } from 'zod';
9
+ /**
10
+ * Outcome of a recovery attempt.
11
+ *
12
+ * The string fallback must be last in the union so Zod evaluates the literal
13
+ * variants first — a leading z.string() would swallow all literals. This
14
+ * follows the v0.19.6 extensible union pattern used throughout the codebase.
15
+ */
16
+ export declare const RecoveryOutcomeSchema: z.ZodUnion<readonly [z.ZodLiteral<"retried">, z.ZodLiteral<"escalated">, z.ZodLiteral<"skipped">, z.ZodString]>;
17
+ export type RecoveryOutcome = z.infer<typeof RecoveryOutcomeSchema>;
18
+ /**
19
+ * A single recovery attempt recorded in the run manifest.
20
+ *
21
+ * `attempt_number` is 1-indexed: 1 = first retry, NOT the initial dispatch.
22
+ * The initial dispatch of a story is never recorded as a RecoveryEntry.
23
+ *
24
+ * `strategy` is free-form (e.g., `'retry-with-context'`, `'re-scope'`).
25
+ *
26
+ * `cost_usd` is the cost of THIS single retry attempt only — NOT cumulative.
27
+ * Cumulative per-story retry cost is tracked in `CostAccumulation.per_story`.
28
+ */
29
+ export declare const RecoveryEntrySchema: z.ZodObject<{
30
+ story_key: z.ZodString;
31
+ attempt_number: z.ZodNumber;
32
+ strategy: z.ZodString;
33
+ root_cause: z.ZodString;
34
+ outcome: z.ZodUnion<readonly [z.ZodLiteral<"retried">, z.ZodLiteral<"escalated">, z.ZodLiteral<"skipped">, z.ZodString]>;
35
+ cost_usd: z.ZodNumber;
36
+ timestamp: z.ZodString;
37
+ }, z.core.$strip>;
38
+ export type RecoveryEntry = z.infer<typeof RecoveryEntrySchema>;
39
+ /**
40
+ * Accumulated retry cost data for a pipeline run.
41
+ *
42
+ * `per_story` maps story_key → sum of all RecoveryEntry.cost_usd for that
43
+ * story. It does NOT include the initial dispatch cost, which is tracked in
44
+ * `PerStoryState.cost_usd`.
45
+ *
46
+ * `run_total` is the sum of all RecoveryEntry.cost_usd values in the run
47
+ * (i.e., total retry cost only, not total run cost).
48
+ *
49
+ * An empty `{ per_story: {}, run_total: 0 }` is the valid initial value.
50
+ */
51
+ export declare const CostAccumulationSchema: z.ZodObject<{
52
+ per_story: z.ZodRecord<z.ZodString, z.ZodNumber>;
53
+ run_total: z.ZodNumber;
54
+ }, z.core.$strip>;
55
+ export type CostAccumulation = z.infer<typeof CostAccumulationSchema>;
56
+ //# sourceMappingURL=recovery-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recovery-history.d.ts","sourceRoot":"","sources":["../../src/run-model/recovery-history.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,iHAKhC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAMnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;iBAe9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAM/D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;iBAYjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}