@openwop/openwop-conformance 1.48.0 → 1.52.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 +2 -2
- package/coverage.md +1 -1
- package/fixtures/pack-manifests/workflow-chain-sample.pack.json +129 -0
- package/fixtures.md +5 -4
- package/package.json +1 -1
- package/schemas/capabilities.schema.json +16 -0
- package/schemas/orchestrator-decision.schema.json +5 -0
- package/schemas/workflow-chain-pack-manifest.schema.json +22 -2
- package/src/lib/workflow-chain-expansion.ts +287 -2
- package/src/scenarios/dispatch-per-item-input.test.ts +198 -0
- package/src/scenarios/fixtures-valid.test.ts +16 -5
- package/src/scenarios/workflow-chain-deferred-parameters.test.ts +298 -0
- package/src/scenarios/workflow-chain-expansion.test.ts +49 -0
- package/src/scenarios/workflow-chain-host-expansion.test.ts +123 -100
- package/src/scenarios/workflow-chain-pack-manifest-validation.test.ts +59 -0
|
@@ -104,6 +104,65 @@ describe('category: workflow-chain-pack manifest validation', () => {
|
|
|
104
104
|
).toBe(true);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
+
it('positive: a FragmentEdge condition takes the top-level EdgeCondition shape (RFC 0013 safety-fix 2026-07-03)', () => {
|
|
108
|
+
// §edges: "Same shape as in a top-level workflow definition." An edge
|
|
109
|
+
// condition therefore MUST be the EdgeCondition object {type,left,right},
|
|
110
|
+
// not a bare string — this is what lets a chain express content routing.
|
|
111
|
+
const conditionalChain = {
|
|
112
|
+
name: 'vendor.acme.router',
|
|
113
|
+
version: '1.0.0',
|
|
114
|
+
kind: 'workflow-chain',
|
|
115
|
+
engines: { openwop: '>=1.0.0' },
|
|
116
|
+
chains: [
|
|
117
|
+
{
|
|
118
|
+
chainId: 'vendor.acme.route',
|
|
119
|
+
version: '1.0.0',
|
|
120
|
+
label: 'Route',
|
|
121
|
+
description: 'Router with a conditional branch.',
|
|
122
|
+
parameters: { type: 'object', properties: {} },
|
|
123
|
+
dag: {
|
|
124
|
+
nodes: [
|
|
125
|
+
{ id: 'route', typeId: 'core.flow.router' },
|
|
126
|
+
{ id: 'urgent', typeId: 'core.identity' },
|
|
127
|
+
],
|
|
128
|
+
edges: [
|
|
129
|
+
{ from: 'route', to: 'urgent', condition: { type: 'contains', left: 'branches', right: 'urgent' } },
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
const ok = validate(conditionalChain);
|
|
136
|
+
const errs = (validate.errors ?? []).map((e: ErrorObject) => `${e.instancePath || '/'}: ${e.message}`).join('\n');
|
|
137
|
+
expect(ok, `Object-shaped edge condition MUST validate — got:\n${errs}`).toBe(true);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('negative: a bare-string FragmentEdge condition is rejected (the pre-2026-07-03 shape)', () => {
|
|
141
|
+
const stringCondition = {
|
|
142
|
+
name: 'vendor.acme.legacy',
|
|
143
|
+
version: '1.0.0',
|
|
144
|
+
kind: 'workflow-chain',
|
|
145
|
+
engines: { openwop: '>=1.0.0' },
|
|
146
|
+
chains: [
|
|
147
|
+
{
|
|
148
|
+
chainId: 'vendor.acme.legacy',
|
|
149
|
+
version: '1.0.0',
|
|
150
|
+
label: 'Legacy',
|
|
151
|
+
description: 'x',
|
|
152
|
+
parameters: { type: 'object', properties: {} },
|
|
153
|
+
dag: {
|
|
154
|
+
nodes: [
|
|
155
|
+
{ id: 'a', typeId: 'core.identity' },
|
|
156
|
+
{ id: 'b', typeId: 'core.identity' },
|
|
157
|
+
],
|
|
158
|
+
edges: [{ from: 'a', to: 'b', condition: 'output.approved == true' }],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
expect(validate(stringCondition), 'A string edge condition MUST NOT validate under the corrected schema').toBe(false);
|
|
164
|
+
});
|
|
165
|
+
|
|
107
166
|
it('negative: manifest mixing chains[] AND nodes[] is rejected (pack_kind_invalid)', () => {
|
|
108
167
|
// Per workflow-chain-packs.md §Pack kind discriminator: "Manifests MUST
|
|
109
168
|
// have exactly one of nodes[] (kind=node) OR chains[] (kind=workflow-chain).
|