@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,336 @@
1
+ /**
2
+ * SdlcEvents — typed event map for SDLC orchestrator story-lifecycle events.
3
+ *
4
+ * Extends CoreEvents (via intersection) with all SDLC-specific event types:
5
+ * orchestrator:*, plan:*, solutioning:*, story:*, pipeline:*
6
+ *
7
+ * Payload shapes are copied verbatim from src/core/event-bus.types.ts (monolith source).
8
+ * Do NOT modify this file without corresponding changes to the monolith source.
9
+ */
10
+ import type { CoreEvents } from '@substrate-ai/core';
11
+ import type { VerificationSummary } from './verification/types.js';
12
+ /**
13
+ * Structured escalation diagnosis from `orchestrator:story-escalated`.
14
+ * Carries classification and recommended action for the escalation.
15
+ */
16
+ export interface EscalationDiagnosis {
17
+ issueDistribution: 'concentrated' | 'widespread';
18
+ severityProfile: 'blocker-present' | 'major-only' | 'minor-only' | 'no-structured-issues';
19
+ totalIssues: number;
20
+ blockerCount: number;
21
+ majorCount: number;
22
+ minorCount: number;
23
+ affectedFiles: string[];
24
+ reviewCycles: number;
25
+ recommendedAction: 'retry-targeted' | 'split-story' | 'human-intervention';
26
+ rationale: string;
27
+ }
28
+ /**
29
+ * A single finding from `solutioning:readiness-failed`.
30
+ */
31
+ export interface SolutioningFinding {
32
+ category: string;
33
+ severity: string;
34
+ description: string;
35
+ affected_items: string[];
36
+ }
37
+ /**
38
+ * Phase-level timing breakdown from `story:metrics`.
39
+ * Keys are phase names (e.g., "dev-story", "code-review"), values are elapsed milliseconds.
40
+ */
41
+ export type StoryPhaseBreakdown = Record<string, number>;
42
+ /**
43
+ * Complete typed map of all SDLC orchestrator events.
44
+ * Intersection with CoreEvents so TypedEventBus<SdlcEvents> includes all core event keys.
45
+ */
46
+ export type SdlcEvents = CoreEvents & {
47
+ /** Implementation orchestrator has started processing story keys */
48
+ 'orchestrator:started': {
49
+ storyKeys: string[];
50
+ pipelineRunId?: string;
51
+ };
52
+ /** A story phase has started within the implementation orchestrator */
53
+ 'orchestrator:story-phase-start': {
54
+ storyKey: string;
55
+ phase: string;
56
+ pipelineRunId?: string;
57
+ };
58
+ /** A story phase has completed within the implementation orchestrator */
59
+ 'orchestrator:story-phase-complete': {
60
+ storyKey: string;
61
+ phase: string;
62
+ result: unknown;
63
+ pipelineRunId?: string;
64
+ };
65
+ /** A story has completed the full pipeline with SHIP_IT verdict */
66
+ 'orchestrator:story-complete': {
67
+ storyKey: string;
68
+ reviewCycles: number;
69
+ };
70
+ /** A story has been escalated after exceeding max review cycles */
71
+ 'orchestrator:story-escalated': {
72
+ storyKey: string;
73
+ lastVerdict: string;
74
+ reviewCycles: number;
75
+ issues: unknown[];
76
+ /** Structured diagnosis with classification and recommended action (Story 22-3) */
77
+ diagnosis?: EscalationDiagnosis;
78
+ };
79
+ /** A non-fatal warning occurred during story processing */
80
+ 'orchestrator:story-warn': {
81
+ storyKey: string;
82
+ msg: string;
83
+ };
84
+ /** Zero-diff detection gate: dev-story reported COMPLETE but git diff is empty (Story 24-1) */
85
+ 'orchestrator:zero-diff-escalation': {
86
+ storyKey: string;
87
+ reason: string;
88
+ };
89
+ /** Implementation orchestrator has finished all stories */
90
+ 'orchestrator:complete': {
91
+ totalStories: number;
92
+ completed: number;
93
+ escalated: number;
94
+ failed: number;
95
+ };
96
+ /** Implementation orchestrator has been paused */
97
+ 'orchestrator:paused': Record<string, never>;
98
+ /** Implementation orchestrator has been resumed */
99
+ 'orchestrator:resumed': Record<string, never>;
100
+ /** Periodic heartbeat emitted every 30s during pipeline execution */
101
+ 'orchestrator:heartbeat': {
102
+ runId: string;
103
+ activeDispatches: number;
104
+ completedDispatches: number;
105
+ queuedDispatches: number;
106
+ };
107
+ /** Watchdog detected no progress for an extended period */
108
+ 'orchestrator:stall': {
109
+ runId: string;
110
+ storyKey: string;
111
+ phase: string;
112
+ elapsedMs: number;
113
+ /** PIDs of child processes at time of stall detection */
114
+ childPids: number[];
115
+ /** Whether any child process was actively running (not zombie) */
116
+ childActive: boolean;
117
+ };
118
+ /** Plan generation has started */
119
+ 'plan:generating': {
120
+ agent: string;
121
+ description: string;
122
+ };
123
+ /** Plan generation has completed */
124
+ 'plan:generated': {
125
+ taskCount: number;
126
+ estimatedCost: number;
127
+ };
128
+ /** Plan was approved by the user */
129
+ 'plan:approved': {
130
+ taskCount: number;
131
+ };
132
+ /** Plan was rejected by the user */
133
+ 'plan:rejected': {
134
+ reason: string;
135
+ };
136
+ /** Plan is being refined based on feedback */
137
+ 'plan:refining': {
138
+ planId: string;
139
+ feedback: string;
140
+ currentVersion: number;
141
+ };
142
+ /** Plan refinement completed successfully */
143
+ 'plan:refined': {
144
+ planId: string;
145
+ newVersion: number;
146
+ taskCount: number;
147
+ };
148
+ /** Plan was rolled back to a previous version */
149
+ 'plan:rolled-back': {
150
+ planId: string;
151
+ fromVersion: number;
152
+ toVersion: number;
153
+ newVersion: number;
154
+ };
155
+ /** Plan refinement failed */
156
+ 'plan:refinement-failed': {
157
+ planId: string;
158
+ currentVersion: number;
159
+ error: string;
160
+ };
161
+ /** Readiness check has completed — emitted for all verdicts (READY, NEEDS_WORK, NOT_READY) */
162
+ 'solutioning:readiness-check': {
163
+ runId: string;
164
+ verdict: 'READY' | 'NEEDS_WORK' | 'NOT_READY';
165
+ coverageScore: number;
166
+ findingCount: number;
167
+ blockerCount: number;
168
+ };
169
+ /** Readiness check returned NOT_READY — solutioning phase will not proceed to implementation */
170
+ 'solutioning:readiness-failed': {
171
+ runId: string;
172
+ verdict: 'NOT_READY';
173
+ coverageScore: number;
174
+ findings: SolutioningFinding[];
175
+ };
176
+ /**
177
+ * Emitted when a dev-story timeout has partial work on disk and the
178
+ * orchestrator captures it as a checkpoint for retry (Story 39-5).
179
+ */
180
+ 'story:checkpoint-saved': {
181
+ /** Story key that timed out with partial work */
182
+ storyKey: string;
183
+ /** Number of files modified before the timeout */
184
+ filesCount: number;
185
+ /** Approximate byte length of the git diff captured */
186
+ diffSizeBytes: number;
187
+ };
188
+ /**
189
+ * Emitted when the orchestrator dispatches a checkpoint retry for a story
190
+ * that timed out with partial work (Story 39-6).
191
+ */
192
+ 'story:checkpoint-retry': {
193
+ /** Story key being retried */
194
+ storyKey: string;
195
+ /** Number of files modified in the partial work captured at checkpoint */
196
+ filesCount: number;
197
+ /** Retry attempt number (always 2 — first retry after initial timeout) */
198
+ attempt: number;
199
+ };
200
+ /** Build verification command failed with non-zero exit or timeout */
201
+ 'story:build-verification-failed': {
202
+ storyKey: string;
203
+ exitCode: number;
204
+ /** Build output (stdout+stderr), truncated to 2000 chars */
205
+ output: string;
206
+ };
207
+ /** Build verification command exited with code 0 */
208
+ 'story:build-verification-passed': {
209
+ storyKey: string;
210
+ };
211
+ /** Non-blocking warning: modified .ts files export shared interfaces referenced by cross-module tests */
212
+ 'story:interface-change-warning': {
213
+ storyKey: string;
214
+ modifiedInterfaces: string[];
215
+ potentiallyAffectedTests: string[];
216
+ };
217
+ /** Per-story metrics snapshot emitted when a story reaches a terminal state (Story 24-4) */
218
+ 'story:metrics': {
219
+ storyKey: string;
220
+ wallClockMs: number;
221
+ phaseBreakdown: StoryPhaseBreakdown;
222
+ tokens: {
223
+ input: number;
224
+ output: number;
225
+ };
226
+ reviewCycles: number;
227
+ dispatches: number;
228
+ };
229
+ /** A pipeline phase has started (emitted by full pipeline path for NDJSON visibility) */
230
+ 'pipeline:phase-start': {
231
+ phase: string;
232
+ ts: string;
233
+ };
234
+ /** A pipeline phase has completed (emitted by full pipeline path for NDJSON visibility) */
235
+ 'pipeline:phase-complete': {
236
+ phase: string;
237
+ ts: string;
238
+ };
239
+ /** Pre-flight build check failed before any stories were dispatched */
240
+ 'pipeline:pre-flight-failure': {
241
+ exitCode: number;
242
+ /** Build output (stdout+stderr), truncated to 2000 chars */
243
+ output: string;
244
+ };
245
+ /** Contract verification found a mismatch between declared export/import contracts */
246
+ 'pipeline:contract-mismatch': {
247
+ /** Story key that declared the export for this contract */
248
+ exporter: string;
249
+ /** Story key that declared the import for this contract (null if no importer found) */
250
+ importer: string | null;
251
+ /** TypeScript interface or Zod schema name (e.g., "JudgeResult") */
252
+ contractName: string;
253
+ /** Human-readable description of the mismatch */
254
+ mismatchDescription: string;
255
+ };
256
+ /** Consolidated contract verification summary (emitted once per verification pass) */
257
+ 'pipeline:contract-verification-summary': {
258
+ /** Number of contract declarations verified (current sprint only) */
259
+ verified: number;
260
+ /** Number of stale declarations pruned (from previous epics) */
261
+ stalePruned: number;
262
+ /** Number of real mismatches found */
263
+ mismatches: number;
264
+ /** 'pass' if zero mismatches, 'fail' otherwise */
265
+ verdict: 'pass' | 'fail';
266
+ };
267
+ /** Dolt merge conflict detected when merging a story branch into main */
268
+ 'pipeline:state-conflict': {
269
+ storyKey: string;
270
+ conflict: unknown;
271
+ };
272
+ /**
273
+ * Emitted at pipeline startup when the repo-map symbol index is detected as stale.
274
+ */
275
+ 'pipeline:repo-map-stale': {
276
+ /** SHA stored in the repo-map meta (last index update) */
277
+ storedSha: string;
278
+ /** Current HEAD commit SHA */
279
+ headSha: string;
280
+ /** Number of files in the stored index */
281
+ fileCount: number;
282
+ };
283
+ /** Project profile may be outdated relative to the actual project structure */
284
+ 'pipeline:profile-stale': {
285
+ /** Human-readable message describing the staleness indicators found */
286
+ message: string;
287
+ /** List of staleness indicators detected */
288
+ indicators: string[];
289
+ };
290
+ /**
291
+ * Emitted when classifyAndPersist() successfully persists a finding from
292
+ * a failing story. Used by observability and monitoring consumers.
293
+ */
294
+ 'pipeline:finding-captured': {
295
+ storyKey: string;
296
+ runId: string;
297
+ rootCause: string;
298
+ };
299
+ /**
300
+ * Emitted when a file overlap is detected between a pending story and a
301
+ * completed story, but no namespace collision exists. Dispatch proceeds
302
+ * normally after this event (non-blocking warning).
303
+ */
304
+ 'pipeline:dispatch-warn': {
305
+ storyKey: string;
306
+ completedStoryKey: string;
307
+ overlappingFiles: string[];
308
+ };
309
+ /**
310
+ * Emitted when the dispatch gate cannot resolve a conflict and places the
311
+ * story in the `gated` phase for operator review. Dispatch does not proceed.
312
+ */
313
+ 'pipeline:story-gated': {
314
+ storyKey: string;
315
+ conflictType: string;
316
+ reason: string;
317
+ completedStoryKey?: string;
318
+ };
319
+ /**
320
+ * Emitted after each individual verification check completes (pass, warn, or fail).
321
+ * AC5: payload matches VerificationCheckResult fields plus storyKey.
322
+ */
323
+ 'verification:check-complete': {
324
+ storyKey: string;
325
+ checkName: string;
326
+ status: 'pass' | 'warn' | 'fail';
327
+ details: string;
328
+ duration_ms: number;
329
+ };
330
+ /**
331
+ * Emitted once per story after all verification checks have run.
332
+ * AC5: payload is the full VerificationSummary for the story.
333
+ */
334
+ 'verification:story-complete': VerificationSummary;
335
+ };
336
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAMlE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,iBAAiB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,MAAM,CAAA;QACb,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IAMD;;;;OAIG;IACH,wBAAwB,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAA;QAChB,iBAAiB,EAAE,MAAM,CAAA;QACzB,gBAAgB,EAAE,MAAM,EAAE,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,sBAAsB,EAAE;QACtB,QAAQ,EAAE,MAAM,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;QACpB,MAAM,EAAE,MAAM,CAAA;QACd,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAC3B,CAAA;IAMD;;;OAGG;IACH,6BAA6B,EAAE;QAC7B,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;QAChC,OAAO,EAAE,MAAM,CAAA;QACf,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;IAED;;;OAGG;IACH,6BAA6B,EAAE,mBAAmB,CAAA;CACnD,CAAA"}
package/dist/events.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * SdlcEvents — typed event map for SDLC orchestrator story-lifecycle events.
3
+ *
4
+ * Extends CoreEvents (via intersection) with all SDLC-specific event types:
5
+ * orchestrator:*, plan:*, solutioning:*, story:*, pipeline:*
6
+ *
7
+ * Payload shapes are copied verbatim from src/core/event-bus.types.ts (monolith source).
8
+ * Do NOT modify this file without corresponding changes to the monolith source.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * ConflictDetector — file-overlap and namespace-collision detection.
3
+ *
4
+ * Story 53-9: Dispatch Pre-Condition Gating
5
+ *
6
+ * Provides pure utility functions for:
7
+ * - extracting target symbol names from story content
8
+ * - finding file-level overlap between pending and completed story file sets
9
+ * - detecting namespace collisions in overlapping files
10
+ */
11
+ export declare class ConflictDetector {
12
+ /**
13
+ * Extract exported/declared symbol names from story content using regex.
14
+ *
15
+ * Matches the primary pattern for TypeScript exports and class/interface
16
+ * declarations. Returns unique symbol names only.
17
+ *
18
+ * AC3: Symbol extraction uses regex (no AST).
19
+ *
20
+ * @param storyContent - Raw text content of the story file.
21
+ * @returns Unique array of symbol names found in the content.
22
+ */
23
+ static extractTargetSymbols(storyContent: string): string[];
24
+ /**
25
+ * Return the intersection of two file-path arrays.
26
+ *
27
+ * AC2: identifies file-level overlap for the warn path.
28
+ *
29
+ * @param pendingFiles - File paths targeted by the pending story.
30
+ * @param completedFiles - File paths modified by a completed story.
31
+ * @returns Paths present in both arrays.
32
+ */
33
+ static findOverlappingFiles(pendingFiles: string[], completedFiles: string[]): string[];
34
+ /**
35
+ * Search overlapping files for a namespace collision on the given symbol.
36
+ *
37
+ * Reads each file and looks for patterns like:
38
+ * - `class ${symbol}`
39
+ * - `interface ${symbol}`
40
+ * - `export const ${symbol}`
41
+ * - `export class ${symbol}`
42
+ *
43
+ * Returns the first match found, or null if no collision exists.
44
+ * Each file read is wrapped in its own try-catch so a single unreadable
45
+ * file does not abort the entire check.
46
+ *
47
+ * AC3: async file reads; per-file try-catch.
48
+ *
49
+ * @param symbol - Symbol name to search for.
50
+ * @param files - Relative file paths to search.
51
+ * @param projectRoot - Absolute project root directory.
52
+ * @returns First collision found `{ file, symbol }`, or null.
53
+ */
54
+ static detectNamespaceCollision(symbol: string, files: string[], projectRoot: string): Promise<{
55
+ file: string;
56
+ symbol: string;
57
+ } | null>;
58
+ }
59
+ //# sourceMappingURL=conflict-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-detector.d.ts","sourceRoot":"","sources":["../../src/gating/conflict-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAkB3D;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAKvF;;;;;;;;;;;;;;;;;;;OAmBG;WACU,wBAAwB,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CA4BpD"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * ConflictDetector — file-overlap and namespace-collision detection.
3
+ *
4
+ * Story 53-9: Dispatch Pre-Condition Gating
5
+ *
6
+ * Provides pure utility functions for:
7
+ * - extracting target symbol names from story content
8
+ * - finding file-level overlap between pending and completed story file sets
9
+ * - detecting namespace collisions in overlapping files
10
+ */
11
+ import { readFile } from 'node:fs/promises';
12
+ import { join } from 'node:path';
13
+ // ---------------------------------------------------------------------------
14
+ // ConflictDetector
15
+ // ---------------------------------------------------------------------------
16
+ export class ConflictDetector {
17
+ /**
18
+ * Extract exported/declared symbol names from story content using regex.
19
+ *
20
+ * Matches the primary pattern for TypeScript exports and class/interface
21
+ * declarations. Returns unique symbol names only.
22
+ *
23
+ * AC3: Symbol extraction uses regex (no AST).
24
+ *
25
+ * @param storyContent - Raw text content of the story file.
26
+ * @returns Unique array of symbol names found in the content.
27
+ */
28
+ static extractTargetSymbols(storyContent) {
29
+ // Primary extraction pattern from dev notes
30
+ const pattern = /(export\s+(?:class|interface|const|function)|(?:^|\s)class|(?:^|\s)interface)\s+(\w+)/gm;
31
+ const names = new Set();
32
+ let match;
33
+ while ((match = pattern.exec(storyContent)) !== null) {
34
+ const name = match[2];
35
+ if (name !== undefined && name.length > 0) {
36
+ names.add(name);
37
+ }
38
+ }
39
+ return Array.from(names);
40
+ }
41
+ /**
42
+ * Return the intersection of two file-path arrays.
43
+ *
44
+ * AC2: identifies file-level overlap for the warn path.
45
+ *
46
+ * @param pendingFiles - File paths targeted by the pending story.
47
+ * @param completedFiles - File paths modified by a completed story.
48
+ * @returns Paths present in both arrays.
49
+ */
50
+ static findOverlappingFiles(pendingFiles, completedFiles) {
51
+ const completedSet = new Set(completedFiles);
52
+ return pendingFiles.filter((f) => completedSet.has(f));
53
+ }
54
+ /**
55
+ * Search overlapping files for a namespace collision on the given symbol.
56
+ *
57
+ * Reads each file and looks for patterns like:
58
+ * - `class ${symbol}`
59
+ * - `interface ${symbol}`
60
+ * - `export const ${symbol}`
61
+ * - `export class ${symbol}`
62
+ *
63
+ * Returns the first match found, or null if no collision exists.
64
+ * Each file read is wrapped in its own try-catch so a single unreadable
65
+ * file does not abort the entire check.
66
+ *
67
+ * AC3: async file reads; per-file try-catch.
68
+ *
69
+ * @param symbol - Symbol name to search for.
70
+ * @param files - Relative file paths to search.
71
+ * @param projectRoot - Absolute project root directory.
72
+ * @returns First collision found `{ file, symbol }`, or null.
73
+ */
74
+ static async detectNamespaceCollision(symbol, files, projectRoot) {
75
+ // Patterns that indicate the symbol is declared in the file
76
+ const patterns = [
77
+ new RegExp(`export\\s+class\\s+${symbol}\\b`),
78
+ new RegExp(`export\\s+interface\\s+${symbol}\\b`),
79
+ new RegExp(`export\\s+const\\s+${symbol}\\b`),
80
+ new RegExp(`(?:^|\\s)class\\s+${symbol}\\b`),
81
+ new RegExp(`(?:^|\\s)interface\\s+${symbol}\\b`),
82
+ ];
83
+ for (const filePath of files) {
84
+ try {
85
+ const absolutePath = join(projectRoot, filePath);
86
+ const content = await readFile(absolutePath, 'utf-8');
87
+ for (const pattern of patterns) {
88
+ if (pattern.test(content)) {
89
+ return { file: filePath, symbol };
90
+ }
91
+ }
92
+ }
93
+ catch {
94
+ // Non-fatal: unreadable file skipped — proceed to next
95
+ continue;
96
+ }
97
+ }
98
+ return null;
99
+ }
100
+ }
101
+ //# sourceMappingURL=conflict-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-detector.js","sourceRoot":"","sources":["../../src/gating/conflict-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,OAAO,gBAAgB;IAC3B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,oBAAoB,CAAC,YAAoB;QAC9C,4CAA4C;QAC5C,MAAM,OAAO,GACX,yFAAyF,CAAA;QAE3F,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;QAC/B,IAAI,KAA6B,CAAA;QAEjC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACrD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YACrB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1C,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACjB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CAAC,YAAsB,EAAE,cAAwB;QAC1E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,CAAA;QAC5C,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,KAAK,CAAC,wBAAwB,CACnC,MAAc,EACd,KAAe,EACf,WAAmB;QAEnB,4DAA4D;QAC5D,MAAM,QAAQ,GAAG;YACf,IAAI,MAAM,CAAC,sBAAsB,MAAM,KAAK,CAAC;YAC7C,IAAI,MAAM,CAAC,0BAA0B,MAAM,KAAK,CAAC;YACjD,IAAI,MAAM,CAAC,sBAAsB,MAAM,KAAK,CAAC;YAC7C,IAAI,MAAM,CAAC,qBAAqB,MAAM,KAAK,CAAC;YAC5C,IAAI,MAAM,CAAC,yBAAyB,MAAM,KAAK,CAAC;SACjD,CAAA;QAED,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;gBAChD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;gBAErD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;oBAC/B,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC1B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;oBACnC,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,uDAAuD;gBACvD,SAAQ;YACV,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * DispatchGate — pre-dispatch conflict gating for story dispatch.
3
+ *
4
+ * Story 53-9: Dispatch Pre-Condition Gating
5
+ *
6
+ * Evaluates three gating conditions in order:
7
+ * 1. Learning pre-emption (AC6): high-confidence namespace-collision findings
8
+ * from the learning store that overlap with the pending story's files.
9
+ * 2. File-level overlap (AC2): completed-story modified files overlap with
10
+ * the pending story's target files (warn, no block).
11
+ * 3. Namespace collision (AC3): a symbol targeted by the pending story already
12
+ * exists in a file modified by a completed story.
13
+ *
14
+ * All DB and file I/O is wrapped in a single outer try-catch so that gate
15
+ * failures never block the pipeline (AC7 — graceful degradation).
16
+ */
17
+ import type { GateResult, DispatchGateOptions } from './types.js';
18
+ export declare class DispatchGate {
19
+ /**
20
+ * Evaluate all pre-dispatch gating conditions for a pending story.
21
+ *
22
+ * Entry point: called once per story before agent dispatch.
23
+ *
24
+ * Steps (in order):
25
+ * 1. Learning pre-emption check (AC6)
26
+ * 2. Per-completed-story file overlap + collision scan (AC2/AC3)
27
+ * 3. Return proceed if no issues found
28
+ *
29
+ * Outer try-catch ensures any unexpected error returns `{ decision: 'proceed' }`
30
+ * so the pipeline is never blocked by gate failures (AC7).
31
+ */
32
+ static check(options: DispatchGateOptions): Promise<GateResult>;
33
+ /**
34
+ * Attempt to auto-resolve a conflict by appending an extension note to the
35
+ * story content.
36
+ *
37
+ * Returns the modified prompt string on success, or null if the content is
38
+ * empty or the append fails for any reason (AC4/AC5).
39
+ */
40
+ private static attemptAutoResolution;
41
+ }
42
+ //# sourceMappingURL=dispatch-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch-gate.d.ts","sourceRoot":"","sources":["../../src/gating/dispatch-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAQjE,qBAAa,YAAY;IACvB;;;;;;;;;;;;OAYG;WACU,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAgKrE;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAUrC"}