graphenix-format 1.2.0 → 1.3.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 +46 -0
- package/dist/examples/validate-minimal.js +37 -0
- package/dist/examples/validate-minimal.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validateWorox.d.ts +22 -0
- package/dist/validateWorox.d.ts.map +1 -0
- package/dist/validateWorox.js +90 -0
- package/dist/validateWorox.js.map +1 -0
- package/docs/interop-worox-graph.md +29 -0
- package/package.json +3 -2
- package/schema/graphenix-format-1.0.0.schema.json +53 -0
package/README.md
CHANGED
|
@@ -267,6 +267,52 @@ The minimal example graph lives in `src/examples/minimal-graph.ts` and mirrors t
|
|
|
267
267
|
|
|
268
268
|
---
|
|
269
269
|
|
|
270
|
+
### Worox-graph alignment (`metadata.graphEntry` / `metadata.graphResponse`)
|
|
271
|
+
|
|
272
|
+
Worox-graph attaches **entry** and **response** contracts to graph JSON; graphenix-format exposes the same shapes as **optional fields on the graph document**:
|
|
273
|
+
|
|
274
|
+
| Field | Type | Role |
|
|
275
|
+
|-------|------|------|
|
|
276
|
+
| `metadata.graphEntry` | `GraphEntryContract` | Entry / execution expectations |
|
|
277
|
+
| `metadata.graphResponse` | `GraphResponseContract` | Final output shape |
|
|
278
|
+
|
|
279
|
+
**`GraphEntryContract`** may include:
|
|
280
|
+
|
|
281
|
+
- `summary` — short description of what the graph expects at entry.
|
|
282
|
+
- `requiredExecutionPaths` / `notableExecutionPaths` — path descriptors (engine-specific item shapes).
|
|
283
|
+
- `executionSchema` — JSON Schema for the merged **execution** object after entry (optional tooling validation only).
|
|
284
|
+
|
|
285
|
+
**`GraphResponseContract`** may include:
|
|
286
|
+
|
|
287
|
+
- `summary` — description of the response.
|
|
288
|
+
- `finalOutputSchema` — JSON Schema for the **final output** value (optional tooling validation only).
|
|
289
|
+
|
|
290
|
+
**I/O visibility layers (single narrative for authors):**
|
|
291
|
+
|
|
292
|
+
- **Layer 01** — **Entry**: what must be satisfied when the graph is invoked; described by `graphEntry` (`summary`, paths, `executionSchema`).
|
|
293
|
+
- **Layer 08** — **Response**: what leaves the graph as the final result; described by `graphResponse` (`summary`, `finalOutputSchema`).
|
|
294
|
+
|
|
295
|
+
Optional **AJV** checks (not required for graphenix planning):
|
|
296
|
+
|
|
297
|
+
```ts
|
|
298
|
+
import {
|
|
299
|
+
validateGraph,
|
|
300
|
+
validateExecutionAgainstContract,
|
|
301
|
+
validateFinalOutputAgainstContract,
|
|
302
|
+
type GraphDocument
|
|
303
|
+
} from "@graphenix/format";
|
|
304
|
+
|
|
305
|
+
const doc: GraphDocument = /* ... with metadata.graphEntry / metadata.graphResponse ... */;
|
|
306
|
+
|
|
307
|
+
validateGraph(doc);
|
|
308
|
+
validateExecutionAgainstContract(doc, mergedExecution);
|
|
309
|
+
validateFinalOutputAgainstContract(doc, finalOutput);
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
For how worox-graph’s task/DAG JSON differs from port-based `Graph`, see [`docs/interop-worox-graph.md`](docs/interop-worox-graph.md).
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
270
316
|
### Notes
|
|
271
317
|
|
|
272
318
|
- The package is **execution-agnostic**: it only knows about the static Graphenix format.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const validate_1 = require("../validate");
|
|
4
|
+
const validateWorox_1 = require("../validateWorox");
|
|
4
5
|
const minimal_graph_1 = require("./minimal-graph");
|
|
5
6
|
const result = (0, validate_1.validateGraph)(minimal_graph_1.minimalGraph);
|
|
6
7
|
if (!result.valid) {
|
|
@@ -10,4 +11,40 @@ if (!result.valid) {
|
|
|
10
11
|
else {
|
|
11
12
|
console.log("Minimal graph is valid according to Graphenix format 1.0.0");
|
|
12
13
|
}
|
|
14
|
+
const withWoroxMetadata = {
|
|
15
|
+
...minimal_graph_1.minimalGraph,
|
|
16
|
+
metadata: {
|
|
17
|
+
graphEntry: {
|
|
18
|
+
summary: "Smoke-test entry contract",
|
|
19
|
+
requiredExecutionPaths: [["node:validate-input"]],
|
|
20
|
+
executionSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: { ok: { type: "boolean" } },
|
|
23
|
+
required: ["ok"]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
graphResponse: {
|
|
27
|
+
summary: "Smoke-test response contract",
|
|
28
|
+
finalOutputSchema: { type: "string", minLength: 1 }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const woroxDoc = (0, validate_1.validateGraph)(withWoroxMetadata);
|
|
33
|
+
if (!woroxDoc.valid) {
|
|
34
|
+
console.error("Worox metadata document is INVALID", woroxDoc.errors);
|
|
35
|
+
process.exitCode = 1;
|
|
36
|
+
}
|
|
37
|
+
const execOk = (0, validateWorox_1.validateExecutionAgainstContract)(withWoroxMetadata, { ok: true });
|
|
38
|
+
const execBad = (0, validateWorox_1.validateExecutionAgainstContract)(withWoroxMetadata, {});
|
|
39
|
+
const outOk = (0, validateWorox_1.validateFinalOutputAgainstContract)(withWoroxMetadata, "done");
|
|
40
|
+
const outBad = (0, validateWorox_1.validateFinalOutputAgainstContract)(withWoroxMetadata, "");
|
|
41
|
+
if (!execOk.valid || execBad.valid || !outOk.valid || outBad.valid) {
|
|
42
|
+
console.error("Worox runtime validation smoke test failed", {
|
|
43
|
+
execOk,
|
|
44
|
+
execBad,
|
|
45
|
+
outOk,
|
|
46
|
+
outBad
|
|
47
|
+
});
|
|
48
|
+
process.exitCode = 1;
|
|
49
|
+
}
|
|
13
50
|
//# sourceMappingURL=validate-minimal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-minimal.js","sourceRoot":"","sources":["../../src/examples/validate-minimal.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAC5C,mDAA+C;AAE/C,MAAM,MAAM,GAAG,IAAA,wBAAa,EAAC,4BAAY,CAAC,CAAC;AAE3C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAClB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;AAC5E,CAAC"}
|
|
1
|
+
{"version":3,"file":"validate-minimal.js","sourceRoot":"","sources":["../../src/examples/validate-minimal.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAC5C,oDAG0B;AAE1B,mDAA+C;AAE/C,MAAM,MAAM,GAAG,IAAA,wBAAa,EAAC,4BAAY,CAAC,CAAC;AAE3C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAClB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,iBAAiB,GAAkB;IACvC,GAAG,4BAAY;IACf,QAAQ,EAAE;QACR,UAAU,EAAE;YACV,OAAO,EAAE,2BAA2B;YACpC,sBAAsB,EAAE,CAAC,CAAC,qBAAqB,CAAC,CAAC;YACjD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;gBACvC,QAAQ,EAAE,CAAC,IAAI,CAAC;aACjB;SACF;QACD,aAAa,EAAE;YACb,OAAO,EAAE,8BAA8B;YACvC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;SACpD;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAA,wBAAa,EAAC,iBAAiB,CAAC,CAAC;AAClD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACpB,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,MAAM,GAAG,IAAA,gDAAgC,EAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACjF,MAAM,OAAO,GAAG,IAAA,gDAAgC,EAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACxE,MAAM,KAAK,GAAG,IAAA,kDAAkC,EAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAC5E,MAAM,MAAM,GAAG,IAAA,kDAAkC,EAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAEzE,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;IACnE,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE;QAC1D,MAAM;QACN,OAAO;QACP,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IACH,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
18
|
__exportStar(require("./validate"), exports);
|
|
19
|
+
__exportStar(require("./validateWorox"), exports);
|
|
19
20
|
__exportStar(require("./crud"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,kDAAgC;AAChC,yCAAuB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -82,15 +82,68 @@ export interface SubgraphDefinition {
|
|
|
82
82
|
metadata?: Record<string, unknown>;
|
|
83
83
|
extensions?: Record<string, unknown>;
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* JSON Schema object (typically draft-07) used by tooling to validate runtime payloads.
|
|
87
|
+
* Kept as a generic object so authors can use `$ref`, `definitions`, etc.
|
|
88
|
+
*/
|
|
89
|
+
export type JsonSchemaObject = Record<string, unknown>;
|
|
90
|
+
/**
|
|
91
|
+
* Worox-graph entry contract: describes expected execution inputs and structure.
|
|
92
|
+
* Aligns with `@woroces/worox-graph` `GraphEntryContract` (I/O visibility **layer 01**).
|
|
93
|
+
*/
|
|
94
|
+
export interface GraphEntryContract {
|
|
95
|
+
/** Short human-readable description of what the graph expects at entry. */
|
|
96
|
+
summary?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Path descriptors for execution branches that must run (shape is engine-specific;
|
|
99
|
+
* often node-id lists or segmented paths).
|
|
100
|
+
*/
|
|
101
|
+
requiredExecutionPaths?: unknown[];
|
|
102
|
+
/**
|
|
103
|
+
* Optional JSON Schema for the merged **execution** object after graph entry
|
|
104
|
+
* (validated separately with `validateExecutionAgainstContract` when tooling enables it).
|
|
105
|
+
*/
|
|
106
|
+
executionSchema?: JsonSchemaObject;
|
|
107
|
+
/** Notable or optional execution paths for diagnostics or docs. */
|
|
108
|
+
notableExecutionPaths?: unknown[];
|
|
109
|
+
[key: string]: unknown;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Worox-graph response contract: describes the final output shape.
|
|
113
|
+
* Aligns with `@woroces/worox-graph` `GraphResponseContract` (I/O visibility **layer 08**).
|
|
114
|
+
*/
|
|
115
|
+
export interface GraphResponseContract {
|
|
116
|
+
summary?: string;
|
|
117
|
+
/**
|
|
118
|
+
* JSON Schema for the graph **final output** value
|
|
119
|
+
* (validated separately with `validateFinalOutputAgainstContract` when tooling enables it).
|
|
120
|
+
*/
|
|
121
|
+
finalOutputSchema?: JsonSchemaObject;
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Optional document-level metadata. Known keys `graphEntry` / `graphResponse` mirror
|
|
126
|
+
* worox-graph graph JSON and are copied to `variables.__graphModel` by consumers.
|
|
127
|
+
*/
|
|
128
|
+
export type GraphDocumentMetadata = {
|
|
129
|
+
graphEntry?: GraphEntryContract;
|
|
130
|
+
graphResponse?: GraphResponseContract;
|
|
131
|
+
} & Record<string, unknown>;
|
|
85
132
|
export interface GraphDocument {
|
|
86
133
|
formatVersion: string;
|
|
87
134
|
id: string;
|
|
88
135
|
name?: string;
|
|
89
136
|
description?: string;
|
|
90
137
|
tags?: string[];
|
|
138
|
+
/** Structural graph (ports, `GraphInput` / `GraphOutput`). */
|
|
91
139
|
graph: Graph;
|
|
92
140
|
types?: TypeDefinition[];
|
|
93
141
|
subgraphs?: SubgraphDefinition[];
|
|
142
|
+
/**
|
|
143
|
+
* Optional worox-graph-aligned contracts for planning and I/O documentation.
|
|
144
|
+
* Prefer this surface over duplicating the same data only under `extensions`.
|
|
145
|
+
*/
|
|
146
|
+
metadata?: GraphDocumentMetadata;
|
|
94
147
|
extensions?: Record<string, unknown>;
|
|
95
148
|
}
|
|
96
149
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,YAAY,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;I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B,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,8DAA8D;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
import type { GraphDocument } from "./types";
|
|
3
|
+
import type { ValidationResult } from "./validate";
|
|
4
|
+
export interface WoroxRuntimeValidationOptions {
|
|
5
|
+
/**
|
|
6
|
+
* AJV instance used to compile `executionSchema` / `finalOutputSchema`.
|
|
7
|
+
* When omitted, a shared default instance (`strict: false`, `allErrors: true`) is used.
|
|
8
|
+
*/
|
|
9
|
+
ajv?: Ajv;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validates `execution` against `document.metadata.graphEntry.executionSchema` when present.
|
|
13
|
+
* If there is no schema, or `graphEntry` is missing, returns `{ valid: true, errors: [] }`.
|
|
14
|
+
* This is optional tooling; graphenix planning does not require it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateExecutionAgainstContract(document: GraphDocument, execution: unknown, options?: WoroxRuntimeValidationOptions): ValidationResult;
|
|
17
|
+
/**
|
|
18
|
+
* Validates `finalOutput` against `document.metadata.graphResponse.finalOutputSchema` when present.
|
|
19
|
+
* If there is no schema, or `graphResponse` is missing, returns `{ valid: true, errors: [] }`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateFinalOutputAgainstContract(document: GraphDocument, finalOutput: unknown, options?: WoroxRuntimeValidationOptions): ValidationResult;
|
|
22
|
+
//# sourceMappingURL=validateWorox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateWorox.d.ts","sourceRoot":"","sources":["../src/validateWorox.ts"],"names":[],"mappings":"AAAA,OAAO,GAAgD,MAAM,KAAK,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAyBpE,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,6BAA6B,GACtC,gBAAgB,CAwBlB;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,OAAO,EACpB,OAAO,CAAC,EAAE,6BAA6B,GACtC,gBAAgB,CAwBlB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validateExecutionAgainstContract = validateExecutionAgainstContract;
|
|
7
|
+
exports.validateFinalOutputAgainstContract = validateFinalOutputAgainstContract;
|
|
8
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
9
|
+
const defaultAjv = new ajv_1.default({
|
|
10
|
+
allErrors: true,
|
|
11
|
+
strict: false
|
|
12
|
+
});
|
|
13
|
+
function normalizeError(error) {
|
|
14
|
+
return {
|
|
15
|
+
message: error.message ?? "Validation error",
|
|
16
|
+
path: error.instancePath || error.schemaPath,
|
|
17
|
+
keyword: error.keyword,
|
|
18
|
+
params: (error.params ?? {})
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function runCompiled(validate, data) {
|
|
22
|
+
const valid = validate(data);
|
|
23
|
+
if (valid) {
|
|
24
|
+
return { valid: true, errors: [] };
|
|
25
|
+
}
|
|
26
|
+
const errors = (validate.errors ?? []).map(normalizeError);
|
|
27
|
+
return { valid: false, errors };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Validates `execution` against `document.metadata.graphEntry.executionSchema` when present.
|
|
31
|
+
* If there is no schema, or `graphEntry` is missing, returns `{ valid: true, errors: [] }`.
|
|
32
|
+
* This is optional tooling; graphenix planning does not require it.
|
|
33
|
+
*/
|
|
34
|
+
function validateExecutionAgainstContract(document, execution, options) {
|
|
35
|
+
const schema = document.metadata?.graphEntry?.executionSchema;
|
|
36
|
+
if (schema === undefined || schema === null || typeof schema !== "object") {
|
|
37
|
+
return { valid: true, errors: [] };
|
|
38
|
+
}
|
|
39
|
+
const ajv = options?.ajv ?? defaultAjv;
|
|
40
|
+
let validate;
|
|
41
|
+
try {
|
|
42
|
+
validate = ajv.compile(schema);
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
46
|
+
return {
|
|
47
|
+
valid: false,
|
|
48
|
+
errors: [
|
|
49
|
+
{
|
|
50
|
+
message: `Invalid executionSchema: ${message}`,
|
|
51
|
+
path: "/metadata/graphEntry/executionSchema",
|
|
52
|
+
keyword: "compile",
|
|
53
|
+
params: {}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return runCompiled(validate, execution);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Validates `finalOutput` against `document.metadata.graphResponse.finalOutputSchema` when present.
|
|
62
|
+
* If there is no schema, or `graphResponse` is missing, returns `{ valid: true, errors: [] }`.
|
|
63
|
+
*/
|
|
64
|
+
function validateFinalOutputAgainstContract(document, finalOutput, options) {
|
|
65
|
+
const schema = document.metadata?.graphResponse?.finalOutputSchema;
|
|
66
|
+
if (schema === undefined || schema === null || typeof schema !== "object") {
|
|
67
|
+
return { valid: true, errors: [] };
|
|
68
|
+
}
|
|
69
|
+
const ajv = options?.ajv ?? defaultAjv;
|
|
70
|
+
let validate;
|
|
71
|
+
try {
|
|
72
|
+
validate = ajv.compile(schema);
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
76
|
+
return {
|
|
77
|
+
valid: false,
|
|
78
|
+
errors: [
|
|
79
|
+
{
|
|
80
|
+
message: `Invalid finalOutputSchema: ${message}`,
|
|
81
|
+
path: "/metadata/graphResponse/finalOutputSchema",
|
|
82
|
+
keyword: "compile",
|
|
83
|
+
params: {}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return runCompiled(validate, finalOutput);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=validateWorox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateWorox.js","sourceRoot":"","sources":["../src/validateWorox.ts"],"names":[],"mappings":";;;;;AAwCA,4EA4BC;AAMD,gFA4BC;AAtGD,8CAAmE;AAInE,MAAM,UAAU,GAAG,IAAI,aAAG,CAAC;IACzB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,KAAkB;IACxC,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,kBAAkB;QAC5C,IAAI,EAAE,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,UAAU;QAC5C,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAA4B;KACxD,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAA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,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,SAAgB,kCAAkC,CAChD,QAAuB,EACvB,WAAoB,EACpB,OAAuC;IAEvC,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,iBAAiB,CAAC;IACnE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACrC,CAAC;IACD,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,UAAU,CAAC;IACvC,IAAI,QAA0B,CAAC;IAC/B,IAAI,CAAC;QACH,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAgB,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE;gBACN;oBACE,OAAO,EAAE,8BAA8B,OAAO,EAAE;oBAChD,IAAI,EAAE,2CAA2C;oBACjD,OAAO,EAAE,SAAS;oBAClB,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Interop: worox-graph JSON and graphenix-format `Graph`
|
|
2
|
+
|
|
3
|
+
This note clarifies how **worox-graph** graph JSON relates to the **port-based** `Graph` type in graphenix-format. It applies to authors using both `@woroces/worox-graph` and `graphenix-format` validation.
|
|
4
|
+
|
|
5
|
+
## Two representations
|
|
6
|
+
|
|
7
|
+
| Area | worox-graph | graphenix-format core `Graph` |
|
|
8
|
+
|------|----------------|--------------------------------|
|
|
9
|
+
| Topology | Task nodes, edges, `outputMapping`, finalizers | Nodes, edges, **ports**, `GraphInput` / `GraphOutput` |
|
|
10
|
+
| Execution shape | Engine-specific (tasks, DAG scheduling) | **Execution-agnostic** static description |
|
|
11
|
+
| I/O contracts | Often embedded in graph JSON and tooling | **Optional** `metadata.graphEntry` / `metadata.graphResponse` on the **document** |
|
|
12
|
+
|
|
13
|
+
worox-graph focuses on runnable task graphs and visibility into execution paths. graphenix-format describes a **static** graph layout (ports, graph-level inputs/outputs) without prescribing how the runtime schedules tasks.
|
|
14
|
+
|
|
15
|
+
## Where worox-graph JSON lives
|
|
16
|
+
|
|
17
|
+
- **Canonical for this package:** optional **`GraphDocument.metadata.graphEntry`** and **`GraphDocument.metadata.graphResponse`** (first-class optional fields). These match the worox contracts used when values are copied to `variables.__graphModel` and keep a single place for validation and docs.
|
|
18
|
+
- **`extensions`:** you may still place namespaced worox-only payloads under `extensions` (e.g. legacy or engine-specific blobs). That does **not** replace `metadata.graphEntry` / `metadata.graphResponse` when you want graphenix-format schema and types to validate the same shapes as worox-graph.
|
|
19
|
+
|
|
20
|
+
FR-GXF-1 does **not** change graphenix-format’s execution model: the core `Graph` remains port-based.
|
|
21
|
+
|
|
22
|
+
## DAG nodes vs ports: is there a converter?
|
|
23
|
+
|
|
24
|
+
**Not in graphenix-format today.** A future **optional** converter could map worox task nodes ↔ port graphs; nothing in the entry/response metadata requires or implies that mapping. Until such a tool exists, treat worox graph JSON and graphenix `Graph` as related **documentation and planning** layers, not automatic transforms of each other.
|
|
25
|
+
|
|
26
|
+
## See also
|
|
27
|
+
|
|
28
|
+
- README: **Worox-graph alignment** (I/O layers 01 / 08).
|
|
29
|
+
- `schema/graphenix-format-1.0.0.schema.json`: `$defs/GraphEntryContract`, `$defs/GraphResponseContract`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphenix-format",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Graphenix graph description format: JSON schema, validation, and CRUD helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
18
|
-
"schema"
|
|
18
|
+
"schema",
|
|
19
|
+
"docs"
|
|
19
20
|
],
|
|
20
21
|
"keywords": [
|
|
21
22
|
"graph",
|
|
@@ -51,6 +51,19 @@
|
|
|
51
51
|
"type": "object",
|
|
52
52
|
"description": "Namespaced extension object. Engines that do not recognize an extension namespace must ignore it.",
|
|
53
53
|
"additionalProperties": true
|
|
54
|
+
},
|
|
55
|
+
"metadata": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"description": "Optional document metadata. `graphEntry` and `graphResponse` align with worox-graph graph JSON contracts (I/O layers 01 and 08); other keys are allowed for tooling.",
|
|
58
|
+
"additionalProperties": true,
|
|
59
|
+
"properties": {
|
|
60
|
+
"graphEntry": {
|
|
61
|
+
"$ref": "#/$defs/GraphEntryContract"
|
|
62
|
+
},
|
|
63
|
+
"graphResponse": {
|
|
64
|
+
"$ref": "#/$defs/GraphResponseContract"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
54
67
|
}
|
|
55
68
|
},
|
|
56
69
|
"$defs": {
|
|
@@ -432,6 +445,46 @@
|
|
|
432
445
|
"additionalProperties": true
|
|
433
446
|
}
|
|
434
447
|
}
|
|
448
|
+
},
|
|
449
|
+
"GraphEntryContract": {
|
|
450
|
+
"type": "object",
|
|
451
|
+
"description": "Worox-graph entry contract: execution inputs and paths (layer 01). Additional properties may be added by worox-graph.",
|
|
452
|
+
"additionalProperties": true,
|
|
453
|
+
"properties": {
|
|
454
|
+
"summary": {
|
|
455
|
+
"type": "string",
|
|
456
|
+
"description": "Human-readable summary of entry expectations."
|
|
457
|
+
},
|
|
458
|
+
"requiredExecutionPaths": {
|
|
459
|
+
"type": "array",
|
|
460
|
+
"description": "Descriptors for execution paths that must be satisfied (engine-specific item shape).",
|
|
461
|
+
"items": {}
|
|
462
|
+
},
|
|
463
|
+
"executionSchema": {
|
|
464
|
+
"type": "object",
|
|
465
|
+
"description": "JSON Schema for the merged execution object (tooling validates at runtime when enabled)."
|
|
466
|
+
},
|
|
467
|
+
"notableExecutionPaths": {
|
|
468
|
+
"type": "array",
|
|
469
|
+
"description": "Notable optional or diagnostic execution paths.",
|
|
470
|
+
"items": {}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
"GraphResponseContract": {
|
|
475
|
+
"type": "object",
|
|
476
|
+
"description": "Worox-graph response contract: final output shape (layer 08). Additional properties may be added by worox-graph.",
|
|
477
|
+
"additionalProperties": true,
|
|
478
|
+
"properties": {
|
|
479
|
+
"summary": {
|
|
480
|
+
"type": "string",
|
|
481
|
+
"description": "Human-readable summary of the response / final output."
|
|
482
|
+
},
|
|
483
|
+
"finalOutputSchema": {
|
|
484
|
+
"type": "object",
|
|
485
|
+
"description": "JSON Schema for the final output value (tooling validates at runtime when enabled)."
|
|
486
|
+
}
|
|
487
|
+
}
|
|
435
488
|
}
|
|
436
489
|
}
|
|
437
490
|
}
|