sdlc-agent-4-enterprise-server 1.37.0 → 1.37.1

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 (88) hide show
  1. package/README.md +2 -1
  2. package/dist/modules/orchestration/parallel/error-isolation.service.d.ts +21 -0
  3. package/dist/modules/orchestration/parallel/error-isolation.service.js +43 -0
  4. package/dist/modules/orchestration/parallel/error-isolation.service.js.map +1 -0
  5. package/dist/modules/orchestration/parallel/fan-out.node.d.ts +22 -0
  6. package/dist/modules/orchestration/parallel/fan-out.node.js +36 -0
  7. package/dist/modules/orchestration/parallel/fan-out.node.js.map +1 -0
  8. package/dist/modules/orchestration/parallel/join.node.d.ts +15 -0
  9. package/dist/modules/orchestration/parallel/join.node.js +30 -0
  10. package/dist/modules/orchestration/parallel/join.node.js.map +1 -0
  11. package/dist/modules/orchestration/parallel/parallel-executor.service.d.ts +21 -0
  12. package/dist/modules/orchestration/parallel/parallel-executor.service.js +81 -0
  13. package/dist/modules/orchestration/parallel/parallel-executor.service.js.map +1 -0
  14. package/dist/modules/orchestration/parallel/phase-identification.service.d.ts +11 -0
  15. package/dist/modules/orchestration/parallel/phase-identification.service.js +32 -0
  16. package/dist/modules/orchestration/parallel/phase-identification.service.js.map +1 -0
  17. package/dist/modules/orchestration/parallel/state-merge.service.d.ts +20 -0
  18. package/dist/modules/orchestration/parallel/state-merge.service.js +98 -0
  19. package/dist/modules/orchestration/parallel/state-merge.service.js.map +1 -0
  20. package/dist/sa4e-190/config/AppConfig.d.ts +7 -0
  21. package/dist/sa4e-190/config/AppConfig.js +7 -0
  22. package/dist/sa4e-190/config/AppConfig.js.map +1 -0
  23. package/dist/sa4e-190/controller/PipelineController.d.ts +17 -0
  24. package/dist/sa4e-190/controller/PipelineController.js +26 -0
  25. package/dist/sa4e-190/controller/PipelineController.js.map +1 -0
  26. package/dist/sa4e-190/dto/GenerateBRDRequest.d.ts +20 -0
  27. package/dist/sa4e-190/dto/GenerateBRDRequest.js +9 -0
  28. package/dist/sa4e-190/dto/GenerateBRDRequest.js.map +1 -0
  29. package/dist/sa4e-190/dto/ResetPipelineRequest.d.ts +35 -0
  30. package/dist/sa4e-190/dto/ResetPipelineRequest.js +14 -0
  31. package/dist/sa4e-190/dto/ResetPipelineRequest.js.map +1 -0
  32. package/dist/sa4e-190/model/BRDDocument.d.ts +7 -0
  33. package/dist/sa4e-190/model/BRDDocument.js +2 -0
  34. package/dist/sa4e-190/model/BRDDocument.js.map +1 -0
  35. package/dist/sa4e-190/model/DiagramArtifact.d.ts +7 -0
  36. package/dist/sa4e-190/model/DiagramArtifact.js +2 -0
  37. package/dist/sa4e-190/model/DiagramArtifact.js.map +1 -0
  38. package/dist/sa4e-190/model/PipelineStatus.d.ts +7 -0
  39. package/dist/sa4e-190/model/PipelineStatus.js +2 -0
  40. package/dist/sa4e-190/model/PipelineStatus.js.map +1 -0
  41. package/dist/sa4e-190/repository/PipelineRepository.d.ts +7 -0
  42. package/dist/sa4e-190/repository/PipelineRepository.js +41 -0
  43. package/dist/sa4e-190/repository/PipelineRepository.js.map +1 -0
  44. package/dist/sa4e-190/service/BAAgentService.d.ts +3 -0
  45. package/dist/sa4e-190/service/BAAgentService.js +38 -0
  46. package/dist/sa4e-190/service/BAAgentService.js.map +1 -0
  47. package/dist/sa4e-190/service/DrawioExporter.d.ts +6 -0
  48. package/dist/sa4e-190/service/DrawioExporter.js +19 -0
  49. package/dist/sa4e-190/service/DrawioExporter.js.map +1 -0
  50. package/dist/sa4e-190/service/StatusManager.d.ts +6 -0
  51. package/dist/sa4e-190/service/StatusManager.js +25 -0
  52. package/dist/sa4e-190/service/StatusManager.js.map +1 -0
  53. package/dist/sa4e-190/test-app.d.ts +3 -0
  54. package/dist/sa4e-190/test-app.js +20 -0
  55. package/dist/sa4e-190/test-app.js.map +1 -0
  56. package/dist/server/routes/sa4e-190.d.ts +2 -0
  57. package/dist/server/routes/sa4e-190.js +35 -0
  58. package/dist/server/routes/sa4e-190.js.map +1 -0
  59. package/documents/SA4E-190/BRD.md +25 -0
  60. package/documents/SA4E-190/STATUS.json +6 -0
  61. package/documents/SA4E-190/diagrams/business-flow.drawio +1 -0
  62. package/documents/SA4E-190/diagrams/business-flow.png +0 -0
  63. package/documents/SA4E-190/diagrams/use-case.drawio +1 -0
  64. package/documents/SA4E-190/diagrams/use-case.png +0 -0
  65. package/package.json +1 -1
  66. package/src/modules/orchestration/parallel/error-isolation.service.ts +51 -0
  67. package/src/modules/orchestration/parallel/fan-out.node.ts +56 -0
  68. package/src/modules/orchestration/parallel/join.node.ts +38 -0
  69. package/src/modules/orchestration/parallel/parallel-executor.service.ts +87 -0
  70. package/src/modules/orchestration/parallel/phase-identification.service.ts +41 -0
  71. package/src/modules/orchestration/parallel/state-merge.service.ts +95 -0
  72. package/src/sa4e-190/__tests__/PipelineController.test.ts +22 -0
  73. package/src/sa4e-190/__tests__/StatusManager.test.ts +17 -0
  74. package/src/sa4e-190/config/AppConfig.ts +13 -0
  75. package/src/sa4e-190/controller/PipelineController.ts +36 -0
  76. package/src/sa4e-190/dto/GenerateBRDRequest.ts +13 -0
  77. package/src/sa4e-190/dto/ResetPipelineRequest.ts +18 -0
  78. package/src/sa4e-190/model/BRDDocument.ts +7 -0
  79. package/src/sa4e-190/model/DiagramArtifact.ts +7 -0
  80. package/src/sa4e-190/model/PipelineStatus.ts +7 -0
  81. package/src/sa4e-190/repository/PipelineRepository.ts +43 -0
  82. package/src/sa4e-190/service/BAAgentService.ts +38 -0
  83. package/src/sa4e-190/service/DrawioExporter.ts +19 -0
  84. package/src/sa4e-190/service/StatusManager.ts +27 -0
  85. package/src/sa4e-190/test-app.ts +23 -0
  86. package/src/server/routes/sa4e-190.ts +37 -0
  87. package/tests/e2e/sa4e-190/pipeline.e2e.test.ts +42 -0
  88. package/tests/integration/sa4e-190/pipeline.it.test.ts +27 -0
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <img src="https://img.shields.io/badge/version-1.37.0-blue?style=for-the-badge" alt="Version">
9
+ <img src="https://img.shields.io/badge/version-1.37.1-blue?style=for-the-badge" alt="Version">
10
10
  <img src="https://img.shields.io/badge/tools-66+-teal?style=for-the-badge" alt="Tools">
11
11
  <img src="https://img.shields.io/badge/node-%3E%3D18-green?style=for-the-badge" alt="Node">
12
12
  </p>
@@ -233,6 +233,7 @@ The embedding model is expected at `.code-intel/models/model.onnx`. Download it:
233
233
 
234
234
  | Version | Date | Ticket | Changes |
235
235
  |---------|------|--------|---------|
236
+ | 1.37.1 | 2026-08-24 | — | Proxy bug fix: global-fetch-patch defensive fallback for curl/powershell mode, cookie jar persistence, followRedirects, workspace-scoped config, PowerShell CLM compat, pwsh binary. SA4E-204/205/206 parallel orchestration docs. |
236
237
  | 1.37.0 | 2026-08-24 | SA4E-193 | Config Commands — 4 slash commands (/create-new-agent, hook, steering, skill) with ValidationGate schema enforcement (closes GAP-01, fixes D-1..D-7), offline-safe template fallback. Consolidated release carrying SA4E-190 content. Ext tests 1621 ✓ · Backend 2621 ✓ |
237
238
  | 1.35.0 | 2026-08-23 | SA4E-190 | SDLC Pipeline Autonomy L3 Reset & Rebuild. New backend module `backend/src/sa4e-190/` with PipelineController, StatusManager, repository, unit/integration/e2e tests. Merge origin/main into dnguyenminh/SA4E-190, lint fixes applied. Tests PASS. |
238
239
  | 1.33.1 | 2026-08-23 | SA4E-189 | Extension hot-reload for .code-intel agentics — no backend changes. ChatStateManager watches agents/steering/hooks/skills with 300ms debounce, recursive patterns. Unit+e2e tests added. |
@@ -0,0 +1,21 @@
1
+ import type { BranchError } from './fan-out.node.js';
2
+ export interface IErrorIsolationPolicy {
3
+ shouldContinue(failures: BranchError[]): boolean;
4
+ }
5
+ export declare class AllSuccessPolicy implements IErrorIsolationPolicy {
6
+ shouldContinue(failures: BranchError[]): boolean;
7
+ }
8
+ export declare class ContinueOnErrorPolicy implements IErrorIsolationPolicy {
9
+ shouldContinue(_failures: BranchError[]): boolean;
10
+ }
11
+ export declare class MajoritySuccessPolicy implements IErrorIsolationPolicy {
12
+ private totalBranches;
13
+ constructor(totalBranches: number);
14
+ shouldContinue(failures: BranchError[]): boolean;
15
+ }
16
+ export declare class ErrorIsolationService {
17
+ private static readonly MAX_ERROR_MESSAGE_LENGTH;
18
+ private sanitizeMessage;
19
+ capture(branchId: string, error: Error): BranchError;
20
+ filterErrors(states: any[]): BranchError[];
21
+ }
@@ -0,0 +1,43 @@
1
+ export class AllSuccessPolicy {
2
+ shouldContinue(failures) {
3
+ return failures.length === 0;
4
+ }
5
+ }
6
+ export class ContinueOnErrorPolicy {
7
+ shouldContinue(_failures) {
8
+ return true;
9
+ }
10
+ }
11
+ export class MajoritySuccessPolicy {
12
+ totalBranches;
13
+ constructor(totalBranches) {
14
+ this.totalBranches = totalBranches;
15
+ }
16
+ shouldContinue(failures) {
17
+ const success = this.totalBranches - failures.length;
18
+ return success > this.totalBranches / 2;
19
+ }
20
+ }
21
+ export class ErrorIsolationService {
22
+ static MAX_ERROR_MESSAGE_LENGTH = 500;
23
+ sanitizeMessage(msg) {
24
+ const cleaned = msg.replace(/[\r\n]+/g, ' ').trim();
25
+ return cleaned.slice(0, ErrorIsolationService.MAX_ERROR_MESSAGE_LENGTH);
26
+ }
27
+ capture(branchId, error) {
28
+ return {
29
+ branch_id: branchId,
30
+ error_code: 'ERR_BRANCH',
31
+ error_message: this.sanitizeMessage(error.message ?? 'Unknown error'),
32
+ };
33
+ }
34
+ filterErrors(states) {
35
+ const errors = [];
36
+ for (const s of states) {
37
+ if (s?.branchErrors)
38
+ errors.push(...s.branchErrors);
39
+ }
40
+ return errors;
41
+ }
42
+ }
43
+ //# sourceMappingURL=error-isolation.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-isolation.service.js","sourceRoot":"","sources":["../../../../src/modules/orchestration/parallel/error-isolation.service.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,gBAAgB;IAC3B,cAAc,CAAC,QAAuB;QAC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
4
+ branchErrors?: BranchError[];
5
+ [key: string]: unknown;
6
+ }
7
+ export interface BranchError {
8
+ branch_id: string;
9
+ error_code?: string;
10
+ error_message?: string;
11
+ }
12
+ export interface FanOutResult {
13
+ branch_id: string;
14
+ state: PipelineState;
15
+ }
16
+ export declare class FanOutNode {
17
+ private static readonly DANGEROUS_KEYS;
18
+ private static readonly BRANCH_ID_PATTERN;
19
+ private static validateBranchId;
20
+ createSnapshots(state: PipelineState, branchIds: string[]): FanOutResult[];
21
+ private cloneState;
22
+ }
@@ -0,0 +1,36 @@
1
+ export class FanOutNode {
2
+ static DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
3
+ static BRANCH_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
4
+ static validateBranchId(branchId) {
5
+ if (!FanOutNode.BRANCH_ID_PATTERN.test(branchId)) {
6
+ throw new Error('Invalid branch_id format');
7
+ }
8
+ if (FanOutNode.DANGEROUS_KEYS.has(branchId)) {
9
+ throw new Error('Invalid branch_id');
10
+ }
11
+ }
12
+ createSnapshots(state, branchIds) {
13
+ if (!Array.isArray(branchIds)) {
14
+ throw new Error('branchIds must be an array');
15
+ }
16
+ return branchIds.map(id => {
17
+ FanOutNode.validateBranchId(id);
18
+ return {
19
+ branch_id: id,
20
+ state: this.cloneState(state, id),
21
+ };
22
+ });
23
+ }
24
+ cloneState(state, branchId) {
25
+ FanOutNode.validateBranchId(branchId);
26
+ const clone = structuredClone(state);
27
+ Object.defineProperty(clone, 'branch_id', {
28
+ value: branchId,
29
+ writable: true,
30
+ enumerable: true,
31
+ configurable: true,
32
+ });
33
+ return clone;
34
+ }
35
+ }
36
+ //# sourceMappingURL=fan-out.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fan-out.node.js","sourceRoot":"","sources":["../../../../src/modules/orchestration/parallel/fan-out.node.ts"],"names":[],"mappings":"AAkBA,MAAM,OAAO,UAAU;IACb,MAAM,CAAU,cAAc,GAAG,IAAI,GAAG,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
+ import type { PipelineState } from './fan-out.node.js';
2
+ import { StateMergeService } from './state-merge.service.js';
3
+ import { ErrorIsolationService, type IErrorIsolationPolicy } from './error-isolation.service.js';
4
+ export interface JoinResult {
5
+ state: PipelineState;
6
+ completed: number;
7
+ failed: number;
8
+ }
9
+ export declare class JoinNode {
10
+ private mergeService;
11
+ private errorService;
12
+ constructor(mergeService: StateMergeService, errorService: ErrorIsolationService);
13
+ join(states: PipelineState[], policy: IErrorIsolationPolicy): Promise<JoinResult>;
14
+ private collectFailures;
15
+ }
@@ -0,0 +1,30 @@
1
+ export class JoinNode {
2
+ mergeService;
3
+ errorService;
4
+ constructor(mergeService, errorService) {
5
+ this.mergeService = mergeService;
6
+ this.errorService = errorService;
7
+ }
8
+ async join(states, policy) {
9
+ const failures = this.collectFailures(states);
10
+ const shouldContinue = policy.shouldContinue(failures);
11
+ if (!shouldContinue) {
12
+ throw new Error('Join policy prevents continuation');
13
+ }
14
+ const merged = this.mergeService.merge(states);
15
+ return {
16
+ state: merged,
17
+ completed: states.length - failures.length,
18
+ failed: failures.length,
19
+ };
20
+ }
21
+ collectFailures(states) {
22
+ const errors = [];
23
+ for (const s of states) {
24
+ if (s.branchErrors)
25
+ errors.push(...s.branchErrors);
26
+ }
27
+ return errors;
28
+ }
29
+ }
30
+ //# sourceMappingURL=join.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join.node.js","sourceRoot":"","sources":["../../../../src/modules/orchestration/parallel/join.node.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,QAAQ;IAET;IACA;IAFV,YACU,YAA+B,EAC/B,YAAmC;QADnC,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,iBAAY,GAAZ,YAAY,CAAuB;IAC1C,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,MAAuB,EAAE,MAA6B;QAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/C,OAAO;YACL,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM;YAC1C,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC;IACJ,CAAC;IAEO,eAAe,CAAC,MAAuB;QAC7C,MAAM,MAAM,GAAkB,EAAE,CAAC;QACjC,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,CAAC,YAAY;gBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ import type { PipelineState } from './fan-out.node.js';
2
+ import { FanOutNode } from './fan-out.node.js';
3
+ export interface BranchExecutor {
4
+ execute(state: PipelineState): Promise<PipelineState>;
5
+ }
6
+ export declare class ParallelExecutor {
7
+ private fanOutNode;
8
+ private concurrency;
9
+ private timeoutMs;
10
+ private static readonly DEFAULT_CONCURRENCY;
11
+ private static readonly DEFAULT_TIMEOUT_MS;
12
+ private static readonly MAX_ERROR_MESSAGE_LENGTH;
13
+ private static readonly MAX_BRANCHES;
14
+ private static readonly MAX_CONCURRENCY;
15
+ private static readonly BRANCH_ID_PATTERN;
16
+ constructor(fanOutNode?: FanOutNode, concurrency?: number, timeoutMs?: number);
17
+ private sanitizeMessage;
18
+ private withTimeout;
19
+ private runWithConcurrency;
20
+ execute(state: PipelineState, branchIds: string[], executor: BranchExecutor): Promise<PipelineState[]>;
21
+ }
@@ -0,0 +1,81 @@
1
+ import { FanOutNode } from './fan-out.node.js';
2
+ export class ParallelExecutor {
3
+ fanOutNode;
4
+ concurrency;
5
+ timeoutMs;
6
+ static DEFAULT_CONCURRENCY = 5;
7
+ static DEFAULT_TIMEOUT_MS = 10000;
8
+ static MAX_ERROR_MESSAGE_LENGTH = 500;
9
+ static MAX_BRANCHES = 100;
10
+ static MAX_CONCURRENCY = 20;
11
+ static BRANCH_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
12
+ constructor(fanOutNode = new FanOutNode(), concurrency = ParallelExecutor.DEFAULT_CONCURRENCY, timeoutMs = ParallelExecutor.DEFAULT_TIMEOUT_MS) {
13
+ this.fanOutNode = fanOutNode;
14
+ this.concurrency = concurrency;
15
+ this.timeoutMs = timeoutMs;
16
+ if (concurrency < 1 || concurrency > ParallelExecutor.MAX_CONCURRENCY) {
17
+ throw new Error(`concurrency must be between 1 and ${ParallelExecutor.MAX_CONCURRENCY}`);
18
+ }
19
+ }
20
+ sanitizeMessage(msg) {
21
+ if (typeof msg !== 'string')
22
+ return 'Unknown error';
23
+ const cleaned = msg.replace(/[\r\n]+/g, ' ').trim();
24
+ return cleaned.slice(0, ParallelExecutor.MAX_ERROR_MESSAGE_LENGTH);
25
+ }
26
+ withTimeout(p, ms) {
27
+ return Promise.race([
28
+ p,
29
+ new Promise((_, reject) => setTimeout(() => reject(new Error('Execution timeout')), ms)),
30
+ ]);
31
+ }
32
+ async runWithConcurrency(tasks, limit) {
33
+ const results = new Array(tasks.length);
34
+ let index = 0;
35
+ const workers = new Array(Math.min(limit, tasks.length)).fill(null).map(async () => {
36
+ while (true) {
37
+ const current = index++;
38
+ if (current >= tasks.length)
39
+ break;
40
+ results[current] = await tasks[current]();
41
+ }
42
+ });
43
+ await Promise.all(workers);
44
+ return results;
45
+ }
46
+ async execute(state, branchIds, executor) {
47
+ if (!Array.isArray(branchIds) || branchIds.length === 0) {
48
+ throw new Error('Invalid branchIds');
49
+ }
50
+ if (branchIds.length > ParallelExecutor.MAX_BRANCHES) {
51
+ throw new Error('branchIds exceeds maximum allowed');
52
+ }
53
+ for (const id of branchIds) {
54
+ if (typeof id !== 'string' || !ParallelExecutor.BRANCH_ID_PATTERN.test(id)) {
55
+ throw new Error('Invalid branch_id format');
56
+ }
57
+ }
58
+ const snapshots = this.fanOutNode.createSnapshots(state, branchIds);
59
+ const tasks = snapshots.map((s, i) => async () => {
60
+ try {
61
+ const execPromise = executor.execute(s.state);
62
+ const value = await this.withTimeout(execPromise, this.timeoutMs);
63
+ // Return immutable clone
64
+ return { status: 'fulfilled', value: structuredClone(value) };
65
+ }
66
+ catch (reason) {
67
+ const errState = structuredClone(snapshots[i].state);
68
+ errState.branchErrors = errState.branchErrors || [];
69
+ errState.branchErrors.push({
70
+ branch_id: snapshots[i].branch_id,
71
+ error_code: 'ERR_EXECUTION',
72
+ error_message: this.sanitizeMessage(reason instanceof Error ? reason.message : String(reason)),
73
+ });
74
+ return { status: 'rejected', value: errState };
75
+ }
76
+ });
77
+ const settled = await this.runWithConcurrency(tasks, this.concurrency);
78
+ return settled.map(r => r.value);
79
+ }
80
+ }
81
+ //# sourceMappingURL=parallel-executor.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel-executor.service.js","sourceRoot":"","sources":["../../../../src/modules/orchestration/parallel/parallel-executor.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM/C,MAAM,OAAO,gBAAgB;IASjB;IACA;IACA;IAVF,MAAM,CAAU,mBAAmB,GAAG,CAAC,CAAC;IACxC,MAAM,CAAU,kBAAkB,GAAG,KAAK,CAAC;IAC3C,MAAM,CAAU,wBAAwB,GAAG,GAAG,CAAC;IAC/C,MAAM,CAAU,YAAY,GAAG,GAAG,CAAC;IACnC,MAAM,CAAU,eAAe,GAAG,EAAE,CAAC;IACrC,MAAM,CAAU,iBAAiB,GAAG,uBAAuB,CAAC;IAEpE,YACU,aAAyB,IAAI,UAAU,EAAE,EACzC,cAAc,gBAAgB,CAAC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M,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBAClE,yBAAyB;gBACzB,OAAO,EAAE,MAAM,EAAE,WAAoB,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YACzE,CAAC;YAAC,OAAO,MAAM,EAAE,CAAC;gBAChB,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAkB,CAAC;gBACtE,QAAQ,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC;gBACpD,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC;oBACzB,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;oBACjC,UAAU,EAAE,eAAe;oBAC3B,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;iBAC/F,CAAC,CAAC;gBACH,OAAO,EAAE,MAAM,EAAE,UAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;YAC1D,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACvE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface PhaseDefinition {
2
+ phase_id: string;
3
+ dependencies: string[];
4
+ can_parallelize: boolean;
5
+ }
6
+ export interface IPhaseIdentificationService {
7
+ identifyParallelizable(phases: PhaseDefinition[]): PhaseDefinition[];
8
+ }
9
+ export declare class PhaseIdentificationService implements IPhaseIdentificationService {
10
+ identifyParallelizable(phases: PhaseDefinition[]): PhaseDefinition[];
11
+ }
@@ -0,0 +1,32 @@
1
+ export class PhaseIdentificationService {
2
+ identifyParallelizable(phases) {
3
+ if (!Array.isArray(phases)) {
4
+ throw new Error('Phases must be an array');
5
+ }
6
+ const ids = new Set();
7
+ for (const p of phases) {
8
+ if (!p || typeof p.phase_id !== 'string' || p.phase_id.trim() === '') {
9
+ throw new Error('Invalid phase definition: phase_id required');
10
+ }
11
+ if (!Array.isArray(p.dependencies)) {
12
+ throw new Error(`Invalid phase definition for ${p.phase_id}: dependencies must be array`);
13
+ }
14
+ if (typeof p.can_parallelize !== 'boolean') {
15
+ throw new Error(`Invalid phase definition for ${p.phase_id}: can_parallelize must be boolean`);
16
+ }
17
+ ids.add(p.phase_id);
18
+ }
19
+ const result = [];
20
+ for (const phase of phases) {
21
+ if (!phase.can_parallelize)
22
+ continue;
23
+ const unresolved = phase.dependencies.filter(dep => !ids.has(dep));
24
+ if (unresolved.length === 0) {
25
+ // Return immutable copy
26
+ result.push(structuredClone(phase));
27
+ }
28
+ }
29
+ return result;
30
+ }
31
+ }
32
+ //# sourceMappingURL=phase-identification.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-identification.service.js","sourceRoot":"","sources":["../../../../src/modules/orchestration/parallel/phase-identification.service.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,0BAA0B;IACrC,sBAAsB,CAAC,MAAyB;QAC9C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;QAC9B,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBACrE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YACjE,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,QAAQ,8BAA8B,CAAC,CAAC;YAC5F,CAAC;YACD,IAAI,OAAO,CAAC,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;gBAC3C,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,QAAQ,mCAAmC,CAAC,CAAC;YACjG,CAAC;YACD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAED,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,KAAK,CAAC,eAAe;gBAAE,SAAS;YACrC,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACnE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5B,wBAAwB;gBACxB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ import type { PipelineState } from './fan-out.node.js';
2
+ export interface IMergeStrategy {
3
+ merge(states: PipelineState[]): PipelineState;
4
+ }
5
+ export declare class DeepMergeStrategy implements IMergeStrategy {
6
+ private static readonly DANGEROUS_KEYS;
7
+ private static readonly MAX_DEPTH;
8
+ merge(states: PipelineState[]): PipelineState;
9
+ private mergeObjects;
10
+ }
11
+ export declare class LastWriteWinsStrategy implements IMergeStrategy {
12
+ private static readonly DANGEROUS_KEYS;
13
+ merge(states: PipelineState[]): PipelineState;
14
+ }
15
+ export declare class StateMergeService {
16
+ private strategy;
17
+ constructor(strategy?: IMergeStrategy);
18
+ setStrategy(strategy: IMergeStrategy): void;
19
+ merge(states: PipelineState[]): PipelineState;
20
+ }
@@ -0,0 +1,98 @@
1
+ export class DeepMergeStrategy {
2
+ static DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
3
+ static MAX_DEPTH = 10;
4
+ merge(states) {
5
+ if (states.length === 0)
6
+ return {};
7
+ let base;
8
+ try {
9
+ base = structuredClone(states[0]);
10
+ }
11
+ catch {
12
+ base = {};
13
+ }
14
+ const seen = new WeakSet();
15
+ for (let i = 1; i < states.length; i++) {
16
+ this.mergeObjects(base, states[i], 0, seen);
17
+ }
18
+ return base;
19
+ }
20
+ mergeObjects(target, source, depth, seen) {
21
+ if (depth > DeepMergeStrategy.MAX_DEPTH)
22
+ return;
23
+ if (!source || typeof source !== 'object')
24
+ return;
25
+ if (seen.has(source))
26
+ return;
27
+ seen.add(source);
28
+ for (const key of Object.keys(source)) {
29
+ if (DeepMergeStrategy.DANGEROUS_KEYS.has(key))
30
+ continue;
31
+ if (key === 'branch_id' || key === 'branchErrors')
32
+ continue;
33
+ const srcVal = source[key];
34
+ if (srcVal && typeof srcVal === 'object' && !Array.isArray(srcVal)) {
35
+ if (!target[key] || typeof target[key] !== 'object' || Array.isArray(target[key])) {
36
+ try {
37
+ target[key] = structuredClone(srcVal);
38
+ }
39
+ catch {
40
+ target[key] = {};
41
+ }
42
+ }
43
+ this.mergeObjects(target[key], srcVal, depth + 1, seen);
44
+ }
45
+ else {
46
+ // Immutable assignment via clone for primitives/arrays
47
+ try {
48
+ target[key] = Array.isArray(srcVal) ? structuredClone(srcVal) : srcVal;
49
+ }
50
+ catch {
51
+ target[key] = srcVal;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ export class LastWriteWinsStrategy {
58
+ static DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
59
+ merge(states) {
60
+ const result = {};
61
+ for (const s of states) {
62
+ if (!s || typeof s !== 'object')
63
+ continue;
64
+ let clone;
65
+ try {
66
+ clone = structuredClone(s);
67
+ }
68
+ catch {
69
+ continue;
70
+ }
71
+ for (const key of Object.keys(clone)) {
72
+ if (LastWriteWinsStrategy.DANGEROUS_KEYS.has(key))
73
+ continue;
74
+ // Assign via structured clone to ensure immutability
75
+ try {
76
+ result[key] = structuredClone(clone[key]);
77
+ }
78
+ catch {
79
+ result[key] = clone[key];
80
+ }
81
+ }
82
+ }
83
+ return result;
84
+ }
85
+ }
86
+ export class StateMergeService {
87
+ strategy;
88
+ constructor(strategy = new DeepMergeStrategy()) {
89
+ this.strategy = strategy;
90
+ }
91
+ setStrategy(strategy) {
92
+ this.strategy = strategy;
93
+ }
94
+ merge(states) {
95
+ return this.strategy.merge(states);
96
+ }
97
+ }
98
+ //# sourceMappingURL=state-merge.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-merge.service.js","sourceRoot":"","sources":["../../../../src/modules/orchestration/parallel/state-merge.service.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAU,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;IACpF,MAAM,CAAU,SAAS,GAAG,EAAE,CAAC;IAEvC,KAAK,CAAC,MAAuB;QAC3B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAmB,CAAC;QACpD,IAAI,IAAmB,CAAC;QACxB,IAAI,CAAC;YACH,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAkB,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,GAAG,EAAmB,CAAC;QAC7B,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,OAAO,EAAU,CAAC;QACnC,KAAK,IAAI,CAAC,GAAG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CAAC;oBACP,MAAM,CAAC,GAAG,CAAC,GAAI,KAAa,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AAGH,MAAM,OAAO,iBAAiB;IACR;IAApB,YAAoB,WAA2B,IAAI,iBAAiB,EAAE;QAAlD,aAAQ,GAAR,QAAQ,CAA0C;IAAG,CAAC;IAE1E,WAAW,CAAC,QAAwB;QAClC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,MAAuB;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ export interface AppConfig {
2
+ statusFilePath: string;
3
+ brdOutputDir: string;
4
+ diagramsDir: string;
5
+ drawioPath: string;
6
+ }
7
+ export declare const defaultConfig: AppConfig;
@@ -0,0 +1,7 @@
1
+ export const defaultConfig = {
2
+ statusFilePath: '../documents/SA4E-190/STATUS.json',
3
+ brdOutputDir: '../documents/SA4E-190',
4
+ diagramsDir: '../documents/SA4E-190/diagrams',
5
+ drawioPath: 'C:\\Program Files\\draw.io\\draw.io.exe'
6
+ };
7
+ //# sourceMappingURL=AppConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../../../src/sa4e-190/config/AppConfig.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,cAAc,EAAE,mCAAmC;IACnD,YAAY,EAAE,uBAAuB;IACrC,WAAW,EAAE,gCAAgC;IAC7C,UAAU,EAAE,yCAAyC;CACtD,CAAC"}
@@ -0,0 +1,17 @@
1
+ export interface ResetResult {
2
+ status: 'success' | 'error';
3
+ ticket: string;
4
+ phase: string;
5
+ autonomyLevel: string;
6
+ completedAt?: string;
7
+ }
8
+ export declare class PipelineController {
9
+ private statusManager;
10
+ private baAgent;
11
+ private drawio;
12
+ resetPipeline(ticket: string, autonomyLevel: 'L1' | 'L2' | 'L3', phase: string): Promise<ResetResult>;
13
+ generateBRD(ticketKey: string): Promise<{
14
+ path: string;
15
+ status: 'success' | 'error';
16
+ }>;
17
+ }
@@ -0,0 +1,26 @@
1
+ import { StatusManager } from '../service/StatusManager.js';
2
+ import { BAAgentService } from '../service/BAAgentService.js';
3
+ import { DrawioExporter } from '../service/DrawioExporter.js';
4
+ export class PipelineController {
5
+ statusManager = new StatusManager();
6
+ baAgent = new BAAgentService();
7
+ drawio = new DrawioExporter();
8
+ async resetPipeline(ticket, autonomyLevel, phase) {
9
+ const status = await this.statusManager.resetStatus(ticket, autonomyLevel, phase);
10
+ return {
11
+ status: 'success',
12
+ ticket: status.ticket,
13
+ phase: status.currentPhase,
14
+ autonomyLevel: status.autonomyLevel,
15
+ completedAt: status.completedAt
16
+ };
17
+ }
18
+ async generateBRD(ticketKey) {
19
+ const path = await this.baAgent.generateBRD(ticketKey);
20
+ // Also generate diagrams for completeness
21
+ await this.drawio.exportDiagram('business-flow');
22
+ await this.drawio.exportDiagram('use-case');
23
+ return { path, status: 'success' };
24
+ }
25
+ }
26
+ //# sourceMappingURL=PipelineController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PipelineController.js","sourceRoot":"","sources":["../../../src/sa4e-190/controller/PipelineController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAU9D,MAAM,OAAO,kBAAkB;IACrB,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IACpC,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;IAC/B,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;IAEtC,KAAK,CAAC,aAAa,CAAC,MAAc,EAAE,aAA6B,EAAE,KAAa;QAC9E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QAClF,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,YAAY;YAC1B,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,SAAiB;QACjC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACvD,0CAA0C;QAC1C,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QACjD,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare const GenerateBRDRequestSchema: z.ZodObject<{
3
+ ticketKey: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ ticketKey: string;
6
+ }, {
7
+ ticketKey: string;
8
+ }>;
9
+ export declare const GenerateBRDResponseSchema: z.ZodObject<{
10
+ path: z.ZodString;
11
+ status: z.ZodEnum<["success", "error"]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ status: "error" | "success";
14
+ path: string;
15
+ }, {
16
+ status: "error" | "success";
17
+ path: string;
18
+ }>;
19
+ export type GenerateBRDRequest = z.infer<typeof GenerateBRDRequestSchema>;
20
+ export type GenerateBRDResponse = z.infer<typeof GenerateBRDResponseSchema>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export const GenerateBRDRequestSchema = z.object({
3
+ ticketKey: z.string().regex(/^[A-Z]+-\d+$/)
4
+ });
5
+ export const GenerateBRDResponseSchema = z.object({
6
+ path: z.string(),
7
+ status: z.enum(['success', 'error'])
8
+ });
9
+ //# sourceMappingURL=GenerateBRDRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerateBRDRequest.js","sourceRoot":"","sources":["../../../src/sa4e-190/dto/GenerateBRDRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;CACpC,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ export declare const ResetPipelineSchema: z.ZodObject<{
3
+ ticket: z.ZodString;
4
+ autonomyLevel: z.ZodEnum<["L1", "L2", "L3"]>;
5
+ phase: z.ZodEnum<["requirements", "specification", "design", "implementation", "testing", "deployment"]>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ ticket: string;
8
+ phase: "testing" | "requirements" | "design" | "implementation" | "deployment" | "specification";
9
+ autonomyLevel: "L1" | "L2" | "L3";
10
+ }, {
11
+ ticket: string;
12
+ phase: "testing" | "requirements" | "design" | "implementation" | "deployment" | "specification";
13
+ autonomyLevel: "L1" | "L2" | "L3";
14
+ }>;
15
+ export declare const ResetPipelineResponseSchema: z.ZodObject<{
16
+ status: z.ZodEnum<["success", "error"]>;
17
+ ticket: z.ZodString;
18
+ phase: z.ZodString;
19
+ autonomyLevel: z.ZodString;
20
+ completedAt: z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ status: "error" | "success";
23
+ ticket: string;
24
+ phase: string;
25
+ autonomyLevel: string;
26
+ completedAt?: string | undefined;
27
+ }, {
28
+ status: "error" | "success";
29
+ ticket: string;
30
+ phase: string;
31
+ autonomyLevel: string;
32
+ completedAt?: string | undefined;
33
+ }>;
34
+ export type ResetPipelineRequest = z.infer<typeof ResetPipelineSchema>;
35
+ export type ResetPipelineResponse = z.infer<typeof ResetPipelineResponseSchema>;