@arke-institute/rhiza 0.1.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/README.md +106 -0
- package/dist/__tests__/fixtures/index.d.ts +9 -0
- package/dist/__tests__/fixtures/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/index.js +12 -0
- package/dist/__tests__/fixtures/index.js.map +1 -0
- package/dist/__tests__/fixtures/kladoi/index.d.ts +165 -0
- package/dist/__tests__/fixtures/kladoi/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/kladoi/index.js +270 -0
- package/dist/__tests__/fixtures/kladoi/index.js.map +1 -0
- package/dist/__tests__/fixtures/logs/index.d.ts +19 -0
- package/dist/__tests__/fixtures/logs/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/logs/index.js +545 -0
- package/dist/__tests__/fixtures/logs/index.js.map +1 -0
- package/dist/__tests__/fixtures/mock-client.d.ts +127 -0
- package/dist/__tests__/fixtures/mock-client.d.ts.map +1 -0
- package/dist/__tests__/fixtures/mock-client.js +415 -0
- package/dist/__tests__/fixtures/mock-client.js.map +1 -0
- package/dist/__tests__/fixtures/rhizai/index.d.ts +54 -0
- package/dist/__tests__/fixtures/rhizai/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/rhizai/index.js +283 -0
- package/dist/__tests__/fixtures/rhizai/index.js.map +1 -0
- package/dist/__tests__/unit/fixtures.test.d.ts +10 -0
- package/dist/__tests__/unit/fixtures.test.d.ts.map +1 -0
- package/dist/__tests__/unit/fixtures.test.js +275 -0
- package/dist/__tests__/unit/fixtures.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/gather.test.d.ts +8 -0
- package/dist/__tests__/unit/handoff/gather.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/gather.test.js +176 -0
- package/dist/__tests__/unit/handoff/gather.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/interpret.test.d.ts +9 -0
- package/dist/__tests__/unit/handoff/interpret.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/interpret.test.js +370 -0
- package/dist/__tests__/unit/handoff/interpret.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/route.test.d.ts +8 -0
- package/dist/__tests__/unit/handoff/route.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/route.test.js +271 -0
- package/dist/__tests__/unit/handoff/route.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/scatter.test.d.ts +7 -0
- package/dist/__tests__/unit/handoff/scatter.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/scatter.test.js +54 -0
- package/dist/__tests__/unit/handoff/scatter.test.js.map +1 -0
- package/dist/__tests__/unit/resume.test.d.ts +8 -0
- package/dist/__tests__/unit/resume.test.d.ts.map +1 -0
- package/dist/__tests__/unit/resume.test.js +134 -0
- package/dist/__tests__/unit/resume.test.js.map +1 -0
- package/dist/__tests__/unit/status.test.d.ts +8 -0
- package/dist/__tests__/unit/status.test.d.ts.map +1 -0
- package/dist/__tests__/unit/status.test.js +164 -0
- package/dist/__tests__/unit/status.test.js.map +1 -0
- package/dist/__tests__/unit/target.test.d.ts +8 -0
- package/dist/__tests__/unit/target.test.d.ts.map +1 -0
- package/dist/__tests__/unit/target.test.js +116 -0
- package/dist/__tests__/unit/target.test.js.map +1 -0
- package/dist/__tests__/unit/traverse.test.d.ts +8 -0
- package/dist/__tests__/unit/traverse.test.d.ts.map +1 -0
- package/dist/__tests__/unit/traverse.test.js +143 -0
- package/dist/__tests__/unit/traverse.test.js.map +1 -0
- package/dist/__tests__/unit/validation/klados.test.d.ts +16 -0
- package/dist/__tests__/unit/validation/klados.test.d.ts.map +1 -0
- package/dist/__tests__/unit/validation/klados.test.js +275 -0
- package/dist/__tests__/unit/validation/klados.test.js.map +1 -0
- package/dist/__tests__/unit/validation/rhiza.test.d.ts +16 -0
- package/dist/__tests__/unit/validation/rhiza.test.d.ts.map +1 -0
- package/dist/__tests__/unit/validation/rhiza.test.js +612 -0
- package/dist/__tests__/unit/validation/rhiza.test.js.map +1 -0
- package/dist/__tests__/unit/validation/runtime.test.d.ts +11 -0
- package/dist/__tests__/unit/validation/runtime.test.d.ts.map +1 -0
- package/dist/__tests__/unit/validation/runtime.test.js +553 -0
- package/dist/__tests__/unit/validation/runtime.test.js.map +1 -0
- package/dist/__tests__/unit/worker/errors.test.d.ts +2 -0
- package/dist/__tests__/unit/worker/errors.test.d.ts.map +1 -0
- package/dist/__tests__/unit/worker/errors.test.js +226 -0
- package/dist/__tests__/unit/worker/errors.test.js.map +1 -0
- package/dist/__tests__/unit/worker/job.test.d.ts +2 -0
- package/dist/__tests__/unit/worker/job.test.d.ts.map +1 -0
- package/dist/__tests__/unit/worker/job.test.js +233 -0
- package/dist/__tests__/unit/worker/job.test.js.map +1 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +8 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/interface.d.ts +142 -0
- package/dist/client/interface.d.ts.map +1 -0
- package/dist/client/interface.js +8 -0
- package/dist/client/interface.js.map +1 -0
- package/dist/client/mock.d.ts +95 -0
- package/dist/client/mock.d.ts.map +1 -0
- package/dist/client/mock.js +795 -0
- package/dist/client/mock.js.map +1 -0
- package/dist/client/types.d.ts +344 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +8 -0
- package/dist/client/types.js.map +1 -0
- package/dist/handoff/gather-api.d.ts +60 -0
- package/dist/handoff/gather-api.d.ts.map +1 -0
- package/dist/handoff/gather-api.js +130 -0
- package/dist/handoff/gather-api.js.map +1 -0
- package/dist/handoff/gather.d.ts +59 -0
- package/dist/handoff/gather.d.ts.map +1 -0
- package/dist/handoff/gather.js +134 -0
- package/dist/handoff/gather.js.map +1 -0
- package/dist/handoff/index.d.ts +19 -0
- package/dist/handoff/index.d.ts.map +1 -0
- package/dist/handoff/index.js +25 -0
- package/dist/handoff/index.js.map +1 -0
- package/dist/handoff/interpret.d.ts +79 -0
- package/dist/handoff/interpret.d.ts.map +1 -0
- package/dist/handoff/interpret.js +197 -0
- package/dist/handoff/interpret.js.map +1 -0
- package/dist/handoff/invoke.d.ts +82 -0
- package/dist/handoff/invoke.d.ts.map +1 -0
- package/dist/handoff/invoke.js +196 -0
- package/dist/handoff/invoke.js.map +1 -0
- package/dist/handoff/route.d.ts +25 -0
- package/dist/handoff/route.d.ts.map +1 -0
- package/dist/handoff/route.js +65 -0
- package/dist/handoff/route.js.map +1 -0
- package/dist/handoff/scatter-api.d.ts +62 -0
- package/dist/handoff/scatter-api.d.ts.map +1 -0
- package/dist/handoff/scatter-api.js +81 -0
- package/dist/handoff/scatter-api.js.map +1 -0
- package/dist/handoff/scatter.d.ts +19 -0
- package/dist/handoff/scatter.d.ts.map +1 -0
- package/dist/handoff/scatter.js +27 -0
- package/dist/handoff/scatter.js.map +1 -0
- package/dist/handoff/target.d.ts +16 -0
- package/dist/handoff/target.d.ts.map +1 -0
- package/dist/handoff/target.js +51 -0
- package/dist/handoff/target.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/index.d.ts +4 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +3 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.d.ts +52 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +70 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/writer.d.ts +63 -0
- package/dist/logging/writer.d.ts.map +1 -0
- package/dist/logging/writer.js +160 -0
- package/dist/logging/writer.js.map +1 -0
- package/dist/resume/index.d.ts +77 -0
- package/dist/resume/index.d.ts.map +1 -0
- package/dist/resume/index.js +110 -0
- package/dist/resume/index.js.map +1 -0
- package/dist/status/index.d.ts +54 -0
- package/dist/status/index.d.ts.map +1 -0
- package/dist/status/index.js +107 -0
- package/dist/status/index.js.map +1 -0
- package/dist/traverse/index.d.ts +53 -0
- package/dist/traverse/index.d.ts.map +1 -0
- package/dist/traverse/index.js +142 -0
- package/dist/traverse/index.js.map +1 -0
- package/dist/types/batch.d.ts +53 -0
- package/dist/types/batch.d.ts.map +1 -0
- package/dist/types/batch.js +2 -0
- package/dist/types/batch.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/klados.d.ts +63 -0
- package/dist/types/klados.d.ts.map +1 -0
- package/dist/types/klados.js +2 -0
- package/dist/types/klados.js.map +1 -0
- package/dist/types/log.d.ts +107 -0
- package/dist/types/log.d.ts.map +1 -0
- package/dist/types/log.js +2 -0
- package/dist/types/log.js.map +1 -0
- package/dist/types/refs.d.ts +58 -0
- package/dist/types/refs.d.ts.map +1 -0
- package/dist/types/refs.js +43 -0
- package/dist/types/refs.js.map +1 -0
- package/dist/types/request.d.ts +69 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +2 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/response.d.ts +31 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +2 -0
- package/dist/types/response.js.map +1 -0
- package/dist/types/rhiza.d.ts +100 -0
- package/dist/types/rhiza.d.ts.map +1 -0
- package/dist/types/rhiza.js +2 -0
- package/dist/types/rhiza.js.map +1 -0
- package/dist/types/status.d.ts +84 -0
- package/dist/types/status.d.ts.map +1 -0
- package/dist/types/status.js +2 -0
- package/dist/types/status.js.map +1 -0
- package/dist/utils/id.d.ts +15 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +25 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/validation/index.d.ts +9 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +9 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validate-klados.d.ts +38 -0
- package/dist/validation/validate-klados.d.ts.map +1 -0
- package/dist/validation/validate-klados.js +139 -0
- package/dist/validation/validate-klados.js.map +1 -0
- package/dist/validation/validate-rhiza.d.ts +29 -0
- package/dist/validation/validate-rhiza.d.ts.map +1 -0
- package/dist/validation/validate-rhiza.js +382 -0
- package/dist/validation/validate-rhiza.js.map +1 -0
- package/dist/validation/validate-runtime.d.ts +28 -0
- package/dist/validation/validate-runtime.d.ts.map +1 -0
- package/dist/validation/validate-runtime.js +212 -0
- package/dist/validation/validate-runtime.js.map +1 -0
- package/dist/worker/errors.d.ts +77 -0
- package/dist/worker/errors.d.ts.map +1 -0
- package/dist/worker/errors.js +143 -0
- package/dist/worker/errors.js.map +1 -0
- package/dist/worker/index.d.ts +8 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +8 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/job.d.ts +150 -0
- package/dist/worker/job.d.ts.map +1 -0
- package/dist/worker/job.js +280 -0
- package/dist/worker/job.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gather Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests for gather (fan-in) operations that collect scattered outputs
|
|
5
|
+
* and trigger the aggregator when complete.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, it, expect } from 'vitest';
|
|
8
|
+
import { completeBatchSlot, errorBatchSlot } from '../../../handoff/gather';
|
|
9
|
+
describe('Gather', () => {
|
|
10
|
+
function createTestBatch(total, completedSlots = []) {
|
|
11
|
+
const slots = [];
|
|
12
|
+
for (let i = 0; i < total; i++) {
|
|
13
|
+
if (completedSlots.includes(i)) {
|
|
14
|
+
slots.push({
|
|
15
|
+
index: i,
|
|
16
|
+
status: 'complete',
|
|
17
|
+
output_ids: [`result-${i}`],
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
slots.push({ index: i, status: 'pending' });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
id: 'batch-test',
|
|
26
|
+
type: 'batch',
|
|
27
|
+
properties: {
|
|
28
|
+
rhiza_id: 'II01rhiza_test',
|
|
29
|
+
job_id: 'job-root',
|
|
30
|
+
source_klados: 'II01klados_producer',
|
|
31
|
+
gather_klados: 'II01klados_aggregator',
|
|
32
|
+
total,
|
|
33
|
+
completed: completedSlots.length,
|
|
34
|
+
status: completedSlots.length === total ? 'complete' : 'pending',
|
|
35
|
+
slots,
|
|
36
|
+
created_at: new Date().toISOString(),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
describe('completeBatchSlot', () => {
|
|
41
|
+
it('updates slot to complete', () => {
|
|
42
|
+
const batch = createTestBatch(3);
|
|
43
|
+
const outputIds = ['result-0'];
|
|
44
|
+
const result = completeBatchSlot(batch, 0, outputIds);
|
|
45
|
+
expect(result.batch.properties.slots[0].status).toBe('complete');
|
|
46
|
+
expect(result.batch.properties.slots[0].output_ids).toEqual(['result-0']);
|
|
47
|
+
});
|
|
48
|
+
it('increments completed count', () => {
|
|
49
|
+
const batch = createTestBatch(3);
|
|
50
|
+
const result = completeBatchSlot(batch, 0, ['result-0']);
|
|
51
|
+
expect(result.batch.properties.completed).toBe(1);
|
|
52
|
+
});
|
|
53
|
+
it('returns isLast: false when more slots pending', () => {
|
|
54
|
+
const batch = createTestBatch(3);
|
|
55
|
+
const result = completeBatchSlot(batch, 0, ['result-0']);
|
|
56
|
+
expect(result.isLast).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
it('returns isLast: true when all slots complete', () => {
|
|
59
|
+
const batch = createTestBatch(3, [0, 1]); // 2 already complete
|
|
60
|
+
const result = completeBatchSlot(batch, 2, ['result-2']);
|
|
61
|
+
expect(result.isLast).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
it('collects all outputs in slot order when last', () => {
|
|
64
|
+
const batch = createTestBatch(3, [0, 1]);
|
|
65
|
+
// Slot 0 has result-0, slot 1 has result-1, we're completing slot 2
|
|
66
|
+
const result = completeBatchSlot(batch, 2, ['result-2']);
|
|
67
|
+
expect(result.allOutputs).toBeDefined();
|
|
68
|
+
expect(result.allOutputs).toHaveLength(3);
|
|
69
|
+
// Should be in order
|
|
70
|
+
expect(result.allOutputs[0]).toEqual(['result-0']);
|
|
71
|
+
expect(result.allOutputs[1]).toEqual(['result-1']);
|
|
72
|
+
expect(result.allOutputs[2]).toEqual(['result-2']);
|
|
73
|
+
});
|
|
74
|
+
it('updates batch status to complete when last', () => {
|
|
75
|
+
const batch = createTestBatch(3, [0, 1]);
|
|
76
|
+
const result = completeBatchSlot(batch, 2, ['result-2']);
|
|
77
|
+
expect(result.batch.properties.status).toBe('complete');
|
|
78
|
+
});
|
|
79
|
+
it('handles multiple outputs per slot', () => {
|
|
80
|
+
const batch = createTestBatch(2);
|
|
81
|
+
const outputIds = ['result-0a', 'result-0b', 'result-0c'];
|
|
82
|
+
const result = completeBatchSlot(batch, 0, outputIds);
|
|
83
|
+
expect(result.batch.properties.slots[0].output_ids).toEqual([
|
|
84
|
+
'result-0a',
|
|
85
|
+
'result-0b',
|
|
86
|
+
'result-0c',
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
it('handles slots completing out of order', () => {
|
|
90
|
+
const batch = createTestBatch(3);
|
|
91
|
+
// Complete slot 2 first
|
|
92
|
+
const result1 = completeBatchSlot(batch, 2, ['result-2']);
|
|
93
|
+
expect(result1.isLast).toBe(false);
|
|
94
|
+
// Complete slot 0
|
|
95
|
+
const result2 = completeBatchSlot(result1.batch, 0, ['result-0']);
|
|
96
|
+
expect(result2.isLast).toBe(false);
|
|
97
|
+
// Complete slot 1 (last)
|
|
98
|
+
const result3 = completeBatchSlot(result2.batch, 1, ['result-1']);
|
|
99
|
+
expect(result3.isLast).toBe(true);
|
|
100
|
+
// All outputs should be in slot order
|
|
101
|
+
expect(result3.allOutputs[0]).toEqual(['result-0']);
|
|
102
|
+
expect(result3.allOutputs[1]).toEqual(['result-1']);
|
|
103
|
+
expect(result3.allOutputs[2]).toEqual(['result-2']);
|
|
104
|
+
});
|
|
105
|
+
it('handles single slot batch', () => {
|
|
106
|
+
const batch = createTestBatch(1);
|
|
107
|
+
const result = completeBatchSlot(batch, 0, ['only-result']);
|
|
108
|
+
expect(result.isLast).toBe(true);
|
|
109
|
+
expect(result.batch.properties.completed).toBe(1);
|
|
110
|
+
expect(result.allOutputs).toEqual([['only-result']]);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('errorBatchSlot', () => {
|
|
114
|
+
it('marks slot as error', () => {
|
|
115
|
+
const batch = createTestBatch(3);
|
|
116
|
+
const error = { code: 'PROCESSING_FAILED', message: 'Timeout', retryable: true };
|
|
117
|
+
const result = errorBatchSlot(batch, 1, error);
|
|
118
|
+
expect(result.batch.properties.slots[1].status).toBe('error');
|
|
119
|
+
expect(result.batch.properties.slots[1].error).toEqual({
|
|
120
|
+
code: 'PROCESSING_FAILED',
|
|
121
|
+
message: 'Timeout',
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
it('does not increment completed count', () => {
|
|
125
|
+
const batch = createTestBatch(3);
|
|
126
|
+
const error = { code: 'PROCESSING_FAILED', message: 'Timeout', retryable: true };
|
|
127
|
+
const result = errorBatchSlot(batch, 1, error);
|
|
128
|
+
expect(result.batch.properties.completed).toBe(0);
|
|
129
|
+
});
|
|
130
|
+
it('marks batch as error when all slots terminal with at least one error', () => {
|
|
131
|
+
const batch = createTestBatch(3, [0, 1]); // 2 complete
|
|
132
|
+
const error = { code: 'PROCESSING_FAILED', message: 'Timeout', retryable: true };
|
|
133
|
+
const result = errorBatchSlot(batch, 2, error);
|
|
134
|
+
expect(result.batch.properties.status).toBe('error');
|
|
135
|
+
expect(result.isTerminal).toBe(true);
|
|
136
|
+
});
|
|
137
|
+
it('does not mark batch as terminal when pending slots remain', () => {
|
|
138
|
+
const batch = createTestBatch(3, [0]); // 1 complete
|
|
139
|
+
const error = { code: 'PROCESSING_FAILED', message: 'Timeout', retryable: true };
|
|
140
|
+
const result = errorBatchSlot(batch, 1, error);
|
|
141
|
+
expect(result.batch.properties.status).toBe('pending');
|
|
142
|
+
expect(result.isTerminal).toBe(false);
|
|
143
|
+
});
|
|
144
|
+
it('handles multiple errors across slots', () => {
|
|
145
|
+
const batch = createTestBatch(3);
|
|
146
|
+
// Error on slot 0
|
|
147
|
+
const result1 = errorBatchSlot(batch, 0, {
|
|
148
|
+
code: 'E1',
|
|
149
|
+
message: 'Error 1',
|
|
150
|
+
retryable: true,
|
|
151
|
+
});
|
|
152
|
+
// Error on slot 1
|
|
153
|
+
const result2 = errorBatchSlot(result1.batch, 1, {
|
|
154
|
+
code: 'E2',
|
|
155
|
+
message: 'Error 2',
|
|
156
|
+
retryable: false,
|
|
157
|
+
});
|
|
158
|
+
// Complete slot 2 - batch should be terminal with error status
|
|
159
|
+
const result3 = completeBatchSlot(result2.batch, 2, ['result-2']);
|
|
160
|
+
expect(result3.batch.properties.status).toBe('error');
|
|
161
|
+
expect(result3.batch.properties.slots[0].status).toBe('error');
|
|
162
|
+
expect(result3.batch.properties.slots[1].status).toBe('error');
|
|
163
|
+
expect(result3.batch.properties.slots[2].status).toBe('complete');
|
|
164
|
+
});
|
|
165
|
+
it('collects error information when batch becomes terminal', () => {
|
|
166
|
+
const batch = createTestBatch(2, [0]); // 1 complete
|
|
167
|
+
const error = { code: 'PROCESSING_FAILED', message: 'Timeout', retryable: true };
|
|
168
|
+
const result = errorBatchSlot(batch, 1, error);
|
|
169
|
+
expect(result.errors).toBeDefined();
|
|
170
|
+
expect(result.errors).toHaveLength(1);
|
|
171
|
+
expect(result.errors[0].slotIndex).toBe(1);
|
|
172
|
+
expect(result.errors[0].error.code).toBe('PROCESSING_FAILED');
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
//# sourceMappingURL=gather.test.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AC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handoff Interpretation Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests for interpreting ThenSpec and determining the correct handoff action.
|
|
5
|
+
* The interpreter analyzes the flow step and entity properties to determine
|
|
6
|
+
* whether to pass, scatter, gather, or mark as done.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=interpret.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpret.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/unit/handoff/interpret.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handoff Interpretation Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests for interpreting ThenSpec and determining the correct handoff action.
|
|
5
|
+
* The interpreter analyzes the flow step and entity properties to determine
|
|
6
|
+
* whether to pass, scatter, gather, or mark as done.
|
|
7
|
+
*/
|
|
8
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
9
|
+
import { interpretThen } from '../../../handoff/interpret';
|
|
10
|
+
import { createMockClient } from '../../fixtures/mock-client';
|
|
11
|
+
import { allMockKladoi } from '../../fixtures/kladoi';
|
|
12
|
+
import { allMockRhizai, scatterGatherFlow } from '../../fixtures/rhizai';
|
|
13
|
+
describe('Handoff Interpretation', () => {
|
|
14
|
+
let client;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
client = createMockClient({
|
|
17
|
+
kladoi: allMockKladoi,
|
|
18
|
+
rhizai: allMockRhizai,
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('done handoff', () => {
|
|
22
|
+
it('returns action: done for terminal', async () => {
|
|
23
|
+
const then = { done: true };
|
|
24
|
+
const context = {
|
|
25
|
+
rhizaId: 'II01rhiza_test',
|
|
26
|
+
kladosId: 'II01klados_terminal',
|
|
27
|
+
jobId: 'job-1',
|
|
28
|
+
outputs: ['entity-1'],
|
|
29
|
+
flow: { 'II01klados_terminal': { then: { done: true } } },
|
|
30
|
+
};
|
|
31
|
+
const result = await interpretThen(client, then, context);
|
|
32
|
+
expect(result.action).toBe('done');
|
|
33
|
+
expect(result.target).toBeUndefined();
|
|
34
|
+
});
|
|
35
|
+
it('includes outputs in done result', async () => {
|
|
36
|
+
const then = { done: true };
|
|
37
|
+
const context = {
|
|
38
|
+
rhizaId: 'II01rhiza_test',
|
|
39
|
+
kladosId: 'II01klados_terminal',
|
|
40
|
+
jobId: 'job-1',
|
|
41
|
+
outputs: ['entity-1', 'entity-2'],
|
|
42
|
+
flow: { 'II01klados_terminal': { then: { done: true } } },
|
|
43
|
+
};
|
|
44
|
+
const result = await interpretThen(client, then, context);
|
|
45
|
+
expect(result.outputs).toEqual(['entity-1', 'entity-2']);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('pass handoff', () => {
|
|
49
|
+
it('returns action: pass with target klados', async () => {
|
|
50
|
+
const then = { pass: 'II01klados_worker' };
|
|
51
|
+
const context = {
|
|
52
|
+
rhizaId: 'II01rhiza_test',
|
|
53
|
+
kladosId: 'II01klados_producer',
|
|
54
|
+
jobId: 'job-1',
|
|
55
|
+
outputs: ['entity-1'],
|
|
56
|
+
flow: {
|
|
57
|
+
'II01klados_producer': { then: { pass: 'II01klados_worker' } },
|
|
58
|
+
'II01klados_worker': { then: { done: true } },
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
const result = await interpretThen(client, then, context);
|
|
62
|
+
expect(result.action).toBe('pass');
|
|
63
|
+
expect(result.target).toBe('II01klados_worker');
|
|
64
|
+
expect(result.targetType).toBe('klados');
|
|
65
|
+
});
|
|
66
|
+
it('discovers target type as rhiza for sub-workflow', async () => {
|
|
67
|
+
const then = { pass: 'II01rhiza_linear' };
|
|
68
|
+
const context = {
|
|
69
|
+
rhizaId: 'II01rhiza_test',
|
|
70
|
+
kladosId: 'II01klados_producer',
|
|
71
|
+
jobId: 'job-1',
|
|
72
|
+
outputs: ['entity-1'],
|
|
73
|
+
flow: {
|
|
74
|
+
'II01klados_producer': { then: { pass: 'II01rhiza_linear' } },
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
const result = await interpretThen(client, then, context);
|
|
78
|
+
expect(result.action).toBe('pass');
|
|
79
|
+
expect(result.target).toBe('II01rhiza_linear');
|
|
80
|
+
expect(result.targetType).toBe('rhiza');
|
|
81
|
+
});
|
|
82
|
+
it('includes handoff record for logging', async () => {
|
|
83
|
+
const then = { pass: 'II01klados_worker' };
|
|
84
|
+
const context = {
|
|
85
|
+
rhizaId: 'II01rhiza_test',
|
|
86
|
+
kladosId: 'II01klados_producer',
|
|
87
|
+
jobId: 'job-1',
|
|
88
|
+
outputs: ['entity-1'],
|
|
89
|
+
flow: {
|
|
90
|
+
'II01klados_producer': { then: { pass: 'II01klados_worker' } },
|
|
91
|
+
'II01klados_worker': { then: { done: true } },
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const result = await interpretThen(client, then, context);
|
|
95
|
+
expect(result.handoffRecord).toBeDefined();
|
|
96
|
+
expect(result.handoffRecord?.type).toBe('pass');
|
|
97
|
+
expect(result.handoffRecord?.target).toBe('II01klados_worker');
|
|
98
|
+
});
|
|
99
|
+
it('applies route rules to override default target', async () => {
|
|
100
|
+
const then = {
|
|
101
|
+
pass: 'II01klados_default_handler',
|
|
102
|
+
route: [
|
|
103
|
+
{ where: { property: 'content_type', equals: 'file/pdf' }, target: 'II01klados_pdf_handler' },
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
const context = {
|
|
107
|
+
rhizaId: 'II01rhiza_test',
|
|
108
|
+
kladosId: 'II01klados_classifier',
|
|
109
|
+
jobId: 'job-1',
|
|
110
|
+
outputs: ['entity-1'],
|
|
111
|
+
outputProperties: { content_type: 'file/pdf' },
|
|
112
|
+
flow: {
|
|
113
|
+
'II01klados_classifier': { then },
|
|
114
|
+
'II01klados_pdf_handler': { then: { done: true } },
|
|
115
|
+
'II01klados_default_handler': { then: { done: true } },
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
const result = await interpretThen(client, then, context);
|
|
119
|
+
expect(result.target).toBe('II01klados_pdf_handler');
|
|
120
|
+
});
|
|
121
|
+
it('falls back to default when no route matches', async () => {
|
|
122
|
+
const then = {
|
|
123
|
+
pass: 'II01klados_default_handler',
|
|
124
|
+
route: [
|
|
125
|
+
{ where: { property: 'content_type', equals: 'file/pdf' }, target: 'II01klados_pdf_handler' },
|
|
126
|
+
],
|
|
127
|
+
};
|
|
128
|
+
const context = {
|
|
129
|
+
rhizaId: 'II01rhiza_test',
|
|
130
|
+
kladosId: 'II01klados_classifier',
|
|
131
|
+
jobId: 'job-1',
|
|
132
|
+
outputs: ['entity-1'],
|
|
133
|
+
outputProperties: { content_type: 'file/txt' },
|
|
134
|
+
flow: {
|
|
135
|
+
'II01klados_classifier': { then },
|
|
136
|
+
'II01klados_pdf_handler': { then: { done: true } },
|
|
137
|
+
'II01klados_default_handler': { then: { done: true } },
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
const result = await interpretThen(client, then, context);
|
|
141
|
+
expect(result.target).toBe('II01klados_default_handler');
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
describe('scatter handoff', () => {
|
|
145
|
+
it('returns action: scatter with batch', async () => {
|
|
146
|
+
const then = { scatter: 'II01klados_worker' };
|
|
147
|
+
const context = {
|
|
148
|
+
rhizaId: 'II01rhiza_test',
|
|
149
|
+
kladosId: 'II01klados_producer',
|
|
150
|
+
jobId: 'job-1',
|
|
151
|
+
outputs: ['item-1', 'item-2', 'item-3'],
|
|
152
|
+
flow: scatterGatherFlow,
|
|
153
|
+
};
|
|
154
|
+
const result = await interpretThen(client, then, context);
|
|
155
|
+
expect(result.action).toBe('scatter');
|
|
156
|
+
expect(result.target).toBe('II01klados_worker');
|
|
157
|
+
expect(result.batch).toBeDefined();
|
|
158
|
+
expect(result.batch?.total).toBe(3);
|
|
159
|
+
});
|
|
160
|
+
it('includes invocations for each output', async () => {
|
|
161
|
+
const then = { scatter: 'II01klados_worker' };
|
|
162
|
+
const context = {
|
|
163
|
+
rhizaId: 'II01rhiza_test',
|
|
164
|
+
kladosId: 'II01klados_producer',
|
|
165
|
+
jobId: 'job-1',
|
|
166
|
+
outputs: ['item-1', 'item-2', 'item-3'],
|
|
167
|
+
flow: scatterGatherFlow,
|
|
168
|
+
};
|
|
169
|
+
const result = await interpretThen(client, then, context);
|
|
170
|
+
expect(result.invocations).toBeDefined();
|
|
171
|
+
expect(result.invocations).toHaveLength(3);
|
|
172
|
+
});
|
|
173
|
+
it('identifies gather target from flow', async () => {
|
|
174
|
+
const then = { scatter: 'II01klados_worker' };
|
|
175
|
+
const context = {
|
|
176
|
+
rhizaId: 'II01rhiza_test',
|
|
177
|
+
kladosId: 'II01klados_producer',
|
|
178
|
+
jobId: 'job-1',
|
|
179
|
+
outputs: ['item-1', 'item-2'],
|
|
180
|
+
flow: scatterGatherFlow,
|
|
181
|
+
};
|
|
182
|
+
const result = await interpretThen(client, then, context);
|
|
183
|
+
expect(result.batch?.gatherTargetId).toBe('II01klados_aggregator');
|
|
184
|
+
});
|
|
185
|
+
it('handles empty outputs (no scatter needed)', async () => {
|
|
186
|
+
const then = { scatter: 'II01klados_worker' };
|
|
187
|
+
const context = {
|
|
188
|
+
rhizaId: 'II01rhiza_test',
|
|
189
|
+
kladosId: 'II01klados_producer',
|
|
190
|
+
jobId: 'job-1',
|
|
191
|
+
outputs: [],
|
|
192
|
+
flow: scatterGatherFlow,
|
|
193
|
+
};
|
|
194
|
+
const result = await interpretThen(client, then, context);
|
|
195
|
+
expect(result.action).toBe('scatter');
|
|
196
|
+
expect(result.batch?.total).toBe(0);
|
|
197
|
+
expect(result.batch?.status).toBe('complete');
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
describe('gather handoff', () => {
|
|
201
|
+
it('returns action: gather_wait when not last slot', async () => {
|
|
202
|
+
const then = { gather: 'II01klados_aggregator' };
|
|
203
|
+
const context = {
|
|
204
|
+
rhizaId: 'II01rhiza_test',
|
|
205
|
+
kladosId: 'II01klados_worker',
|
|
206
|
+
jobId: 'job-2',
|
|
207
|
+
outputs: ['result-1'],
|
|
208
|
+
flow: scatterGatherFlow,
|
|
209
|
+
batchContext: {
|
|
210
|
+
batchId: 'batch-1',
|
|
211
|
+
index: 0,
|
|
212
|
+
total: 3,
|
|
213
|
+
},
|
|
214
|
+
batch: {
|
|
215
|
+
id: 'batch-1',
|
|
216
|
+
rhizaId: 'II01rhiza_test',
|
|
217
|
+
sourceKladosId: 'II01klados_producer',
|
|
218
|
+
targetKladosId: 'II01klados_worker',
|
|
219
|
+
gatherTargetId: 'II01klados_aggregator',
|
|
220
|
+
parentJobId: 'job-1',
|
|
221
|
+
total: 3,
|
|
222
|
+
completed: 0,
|
|
223
|
+
status: 'pending',
|
|
224
|
+
slots: [
|
|
225
|
+
{ status: 'pending' },
|
|
226
|
+
{ status: 'pending' },
|
|
227
|
+
{ status: 'pending' },
|
|
228
|
+
],
|
|
229
|
+
createdAt: new Date().toISOString(),
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
const result = await interpretThen(client, then, context);
|
|
233
|
+
expect(result.action).toBe('gather_wait');
|
|
234
|
+
});
|
|
235
|
+
it('returns action: gather_trigger when last slot', async () => {
|
|
236
|
+
const then = { gather: 'II01klados_aggregator' };
|
|
237
|
+
const context = {
|
|
238
|
+
rhizaId: 'II01rhiza_test',
|
|
239
|
+
kladosId: 'II01klados_worker',
|
|
240
|
+
jobId: 'job-4',
|
|
241
|
+
outputs: ['result-3'],
|
|
242
|
+
flow: scatterGatherFlow,
|
|
243
|
+
batchContext: {
|
|
244
|
+
batchId: 'batch-1',
|
|
245
|
+
index: 2,
|
|
246
|
+
total: 3,
|
|
247
|
+
},
|
|
248
|
+
batch: {
|
|
249
|
+
id: 'batch-1',
|
|
250
|
+
rhizaId: 'II01rhiza_test',
|
|
251
|
+
sourceKladosId: 'II01klados_producer',
|
|
252
|
+
targetKladosId: 'II01klados_worker',
|
|
253
|
+
gatherTargetId: 'II01klados_aggregator',
|
|
254
|
+
parentJobId: 'job-1',
|
|
255
|
+
total: 3,
|
|
256
|
+
completed: 2,
|
|
257
|
+
status: 'running',
|
|
258
|
+
slots: [
|
|
259
|
+
{ status: 'complete', outputIds: ['result-1'] },
|
|
260
|
+
{ status: 'complete', outputIds: ['result-2'] },
|
|
261
|
+
{ status: 'pending' },
|
|
262
|
+
],
|
|
263
|
+
createdAt: new Date().toISOString(),
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
const result = await interpretThen(client, then, context);
|
|
267
|
+
expect(result.action).toBe('gather_trigger');
|
|
268
|
+
expect(result.target).toBe('II01klados_aggregator');
|
|
269
|
+
});
|
|
270
|
+
it('includes all outputs when triggering gather', async () => {
|
|
271
|
+
const then = { gather: 'II01klados_aggregator' };
|
|
272
|
+
const context = {
|
|
273
|
+
rhizaId: 'II01rhiza_test',
|
|
274
|
+
kladosId: 'II01klados_worker',
|
|
275
|
+
jobId: 'job-4',
|
|
276
|
+
outputs: ['result-3'],
|
|
277
|
+
flow: scatterGatherFlow,
|
|
278
|
+
batchContext: {
|
|
279
|
+
batchId: 'batch-1',
|
|
280
|
+
index: 2,
|
|
281
|
+
total: 3,
|
|
282
|
+
},
|
|
283
|
+
batch: {
|
|
284
|
+
id: 'batch-1',
|
|
285
|
+
rhizaId: 'II01rhiza_test',
|
|
286
|
+
sourceKladosId: 'II01klados_producer',
|
|
287
|
+
targetKladosId: 'II01klados_worker',
|
|
288
|
+
gatherTargetId: 'II01klados_aggregator',
|
|
289
|
+
parentJobId: 'job-1',
|
|
290
|
+
total: 3,
|
|
291
|
+
completed: 2,
|
|
292
|
+
status: 'running',
|
|
293
|
+
slots: [
|
|
294
|
+
{ status: 'complete', outputIds: ['result-1'] },
|
|
295
|
+
{ status: 'complete', outputIds: ['result-2'] },
|
|
296
|
+
{ status: 'pending' },
|
|
297
|
+
],
|
|
298
|
+
createdAt: new Date().toISOString(),
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
const result = await interpretThen(client, then, context);
|
|
302
|
+
expect(result.allOutputs).toBeDefined();
|
|
303
|
+
expect(result.allOutputs).toHaveLength(3);
|
|
304
|
+
});
|
|
305
|
+
it('updates batch slot on gather', async () => {
|
|
306
|
+
const then = { gather: 'II01klados_aggregator' };
|
|
307
|
+
const context = {
|
|
308
|
+
rhizaId: 'II01rhiza_test',
|
|
309
|
+
kladosId: 'II01klados_worker',
|
|
310
|
+
jobId: 'job-2',
|
|
311
|
+
outputs: ['result-1'],
|
|
312
|
+
flow: scatterGatherFlow,
|
|
313
|
+
batchContext: {
|
|
314
|
+
batchId: 'batch-1',
|
|
315
|
+
index: 0,
|
|
316
|
+
total: 3,
|
|
317
|
+
},
|
|
318
|
+
batch: {
|
|
319
|
+
id: 'batch-1',
|
|
320
|
+
rhizaId: 'II01rhiza_test',
|
|
321
|
+
sourceKladosId: 'II01klados_producer',
|
|
322
|
+
targetKladosId: 'II01klados_worker',
|
|
323
|
+
gatherTargetId: 'II01klados_aggregator',
|
|
324
|
+
parentJobId: 'job-1',
|
|
325
|
+
total: 3,
|
|
326
|
+
completed: 0,
|
|
327
|
+
status: 'pending',
|
|
328
|
+
slots: [
|
|
329
|
+
{ status: 'pending' },
|
|
330
|
+
{ status: 'pending' },
|
|
331
|
+
{ status: 'pending' },
|
|
332
|
+
],
|
|
333
|
+
createdAt: new Date().toISOString(),
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
const result = await interpretThen(client, then, context);
|
|
337
|
+
expect(result.updatedBatch).toBeDefined();
|
|
338
|
+
expect(result.updatedBatch?.slots[0].status).toBe('complete');
|
|
339
|
+
expect(result.updatedBatch?.slots[0].outputIds).toEqual(['result-1']);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
describe('error handling', () => {
|
|
343
|
+
it('throws when target not found', async () => {
|
|
344
|
+
const then = { pass: 'nonexistent_klados' };
|
|
345
|
+
const context = {
|
|
346
|
+
rhizaId: 'II01rhiza_test',
|
|
347
|
+
kladosId: 'II01klados_producer',
|
|
348
|
+
jobId: 'job-1',
|
|
349
|
+
outputs: ['entity-1'],
|
|
350
|
+
flow: {
|
|
351
|
+
'II01klados_producer': { then: { pass: 'nonexistent_klados' } },
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
await expect(interpretThen(client, then, context)).rejects.toThrow(/not found/);
|
|
355
|
+
});
|
|
356
|
+
it('throws when gather called without batch context', async () => {
|
|
357
|
+
const then = { gather: 'II01klados_aggregator' };
|
|
358
|
+
const context = {
|
|
359
|
+
rhizaId: 'II01rhiza_test',
|
|
360
|
+
kladosId: 'II01klados_worker',
|
|
361
|
+
jobId: 'job-2',
|
|
362
|
+
outputs: ['result-1'],
|
|
363
|
+
flow: scatterGatherFlow,
|
|
364
|
+
// Missing batchContext
|
|
365
|
+
};
|
|
366
|
+
await expect(interpretThen(client, then, context)).rejects.toThrow(/batch context/i);
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
//# sourceMappingURL=interpret.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpret.test.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/handoff/interpret.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAyB,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,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