@auto-engineer/job-graph-processor 1.65.0 → 1.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ketchup-plan.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## TODO
4
4
 
5
+ ### Parallel Dispatch Verification (Burst P-4)
6
+
7
+ - [x] Burst P-4: Test that processJobGraph dispatches ready jobs in parallel [depends: none]
8
+
5
9
  ## DONE
6
10
 
7
11
  - [x] Burst 1: Add `hasFailedJobs` to evolve.ts
package/package.json CHANGED
@@ -7,15 +7,15 @@
7
7
  "dependencies": {
8
8
  "@event-driven-io/emmett": "^0.38.2",
9
9
  "nanoid": "^5.0.0",
10
- "@auto-engineer/message-bus": "1.65.0"
10
+ "@auto-engineer/message-bus": "1.67.0"
11
11
  },
12
12
  "devDependencies": {
13
- "@auto-engineer/pipeline": "1.65.0"
13
+ "@auto-engineer/pipeline": "1.67.0"
14
14
  },
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
- "version": "1.65.0",
18
+ "version": "1.67.0",
19
19
  "scripts": {
20
20
  "build": "tsc && tsx ../../scripts/fix-esm-imports.ts",
21
21
  "test": "vitest run --reporter=dot",
@@ -24,6 +24,36 @@ describe('createGraphProcessor', () => {
24
24
  });
25
25
  });
26
26
 
27
+ it('dispatches ready jobs in parallel', async () => {
28
+ const bus = createMessageBus();
29
+ const dispatchTimes: Array<{ jobId: string; time: number }> = [];
30
+ const dispatch = async (command: { type: string; data: unknown; correlationId: string }) => {
31
+ dispatchTimes.push({ jobId: command.correlationId.split(':')[2], time: Date.now() });
32
+ await new Promise((r) => setTimeout(r, 50));
33
+ };
34
+ const processor = createGraphProcessor(bus, { dispatch });
35
+
36
+ processor.submit({
37
+ type: 'ProcessGraph',
38
+ data: {
39
+ graphId: 'g1',
40
+ jobs: [
41
+ { id: 'a', dependsOn: [], target: 'build-a', payload: {} },
42
+ { id: 'b', dependsOn: [], target: 'build-b', payload: {} },
43
+ { id: 'c', dependsOn: ['a', 'b'], target: 'test', payload: {} },
44
+ ],
45
+ failurePolicy: 'halt',
46
+ },
47
+ });
48
+
49
+ await new Promise((r) => setTimeout(r, 10));
50
+
51
+ const aTime = dispatchTimes.find((d) => d.jobId === 'a')!.time;
52
+ const bTime = dispatchTimes.find((d) => d.jobId === 'b')!.time;
53
+ expect(Math.abs(aTime - bTime)).toBeLessThanOrEqual(5);
54
+ expect(dispatchTimes.find((d) => d.jobId === 'c')).toBeUndefined();
55
+ });
56
+
27
57
  it('rejects invalid graph', () => {
28
58
  const bus = createMessageBus();
29
59
  const processor = createGraphProcessor(bus);