@gtrabanco/agentic-workflow-schema 3.3.0 → 3.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtrabanco/agentic-workflow-schema",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Versioned machine contracts, JSON Schemas, parsers, and deterministic document snapshots for agentic-workflow orchestration.",
5
5
  "keywords": [
6
6
  "agentic-workflow",
@@ -30,7 +30,11 @@
30
30
  "./skill-outcome.schema.json": "./skill-outcome.schema.json",
31
31
  "./workflow-snapshot.schema.json": "./workflow-snapshot.schema.json",
32
32
  "./candidate-snapshot.schema.json": "./candidate-snapshot.schema.json",
33
- "./review-receipt.schema.json": "./review-receipt.schema.json"
33
+ "./review-receipt.schema.json": "./review-receipt.schema.json",
34
+ "./verification-receipt.schema.json": "./verification-receipt.schema.json",
35
+ "./verification-plan.schema.json": "./verification-plan.schema.json",
36
+ "./pre-execution-artifact-snapshot.schema.json": "./pre-execution-artifact-snapshot.schema.json",
37
+ "./pre-execution-review-receipt.schema.json": "./pre-execution-review-receipt.schema.json"
34
38
  },
35
39
  "files": [
36
40
  "dist",
@@ -39,6 +43,10 @@
39
43
  "workflow-snapshot.schema.json",
40
44
  "candidate-snapshot.schema.json",
41
45
  "review-receipt.schema.json",
46
+ "verification-receipt.schema.json",
47
+ "verification-plan.schema.json",
48
+ "pre-execution-artifact-snapshot.schema.json",
49
+ "pre-execution-review-receipt.schema.json",
42
50
  "README.md",
43
51
  "README.es.md",
44
52
  "LICENSE"
@@ -52,7 +60,17 @@
52
60
  "scripts": {
53
61
  "build": "tsc",
54
62
  "test": "tsc && tsc -p tsconfig.test.json && node --test test/*.test.mjs",
55
- "prepublishOnly": "npm test"
63
+ "prepublishOnly": "npm test",
64
+ "check:verification-schemas": "tsc && node scripts/generate-verification-schemas.mjs --check",
65
+ "check:verification-package": "node scripts/check-verification-package.mjs",
66
+ "check:pre-execution-schemas": "tsc && node scripts/generate-pre-execution-schemas.mjs --check",
67
+ "check:pre-execution-package": "node scripts/check-pre-execution-package.mjs",
68
+ "test:pre-execution-docs": "node --test test/pre-execution-docs.test.mjs",
69
+ "bench:verification": "node scripts/bench-verification.mjs",
70
+ "probe:sha256-paths": "node scripts/probe-sha256-paths.mjs",
71
+ "test:verification-docs": "node --test test/verification-docs.test.mjs",
72
+ "gate:verification": "npm test && npm run check:verification-schemas && npm run check:verification-package && npm run test:verification-docs && npm run bench:verification -- --commands 128",
73
+ "gate:pre-execution": "npm test && npm run check:pre-execution-schemas && npm run check:pre-execution-package && npm run test:pre-execution-docs"
56
74
  },
57
75
  "devDependencies": {
58
76
  "ajv": "^8.20.0",
@@ -0,0 +1,383 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$comment": "agentic-workflow generated file - DO NOT HAND-EDIT. | projection: structural-only | authoritative: false | authority: validatePreExecutionArtifactSnapshotV1 | semantic validation: required (a Draft-07 PASS is not contract validity) | runtime-only rules (not expressible in Draft-07): unique-artifact-paths; stage-required-artifacts (stage drives the required artifact set); selector-requires-product-stage (spec-product-v1 requires stage spec on the spec row); artifact-order-is-canonical (artifact rows are ordered by UTF-8 path bytes); one-row-per-kind (each artifact kind appears at most once); context-order-is-canonical (context rows are ordered by kind then identifier); one-context-per-identity (each (kind, identifier) context appears once); fix-has-no-product-stage (unitKind fix cannot carry a SPEC-stage snapshot) | payload budget: runtime-only (canonical snapshot <= 32768 bytes = 32 KiB) | diagnostics: runtime-only (at most 50 redacted code+path rows) | values: never returned (D16 — diagnostics carry a frozen code and an RFC 6901 pointer only) | regenerate with: node scripts/generate-pre-execution-schemas.mjs",
4
+ "title": "PreExecutionArtifactSnapshot v1",
5
+ "description": "The exact artifact set, authoritative contexts, source revision and authoring revision one independent pre-execution reviewer read. This document is a NON-AUTHORITATIVE Draft-07 structural projection generated from the package's canonical pre-execution-contract definition. It is not a semantic authority: a Draft-07 match is not contract validity — use the authoritative runtime entry point named in $comment.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "contract",
10
+ "stage",
11
+ "unitKind",
12
+ "unitId",
13
+ "sourceRevision",
14
+ "artifactRevisionId",
15
+ "artifacts",
16
+ "contexts",
17
+ "parentSpecSnapshotDigest"
18
+ ],
19
+ "properties": {
20
+ "contract": {
21
+ "type": "string",
22
+ "const": "agentic-workflow/pre-execution-artifact-snapshot@1",
23
+ "description": "Contract identifier."
24
+ },
25
+ "stage": {
26
+ "type": "string",
27
+ "enum": [
28
+ "spec",
29
+ "plan"
30
+ ],
31
+ "description": "Reviewed stage."
32
+ },
33
+ "unitKind": {
34
+ "type": "string",
35
+ "enum": [
36
+ "feature",
37
+ "fix"
38
+ ],
39
+ "description": "Unit family."
40
+ },
41
+ "unitId": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "maxLength": 128,
45
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
46
+ "allOf": [
47
+ {
48
+ "description": "[unitId] must not contain NUL characters",
49
+ "pattern": "^[^\\0]*$"
50
+ }
51
+ ],
52
+ "description": "Roadmap or fix-unit identity; at most 128 characters. Opaque: compared, never parsed, and never echoed back by a diagnostic."
53
+ },
54
+ "sourceRevision": {
55
+ "type": "string",
56
+ "minLength": 40,
57
+ "maxLength": 64,
58
+ "pattern": "^[a-f0-9]{40}$|^[a-f0-9]{64}$",
59
+ "allOf": [
60
+ {
61
+ "description": "[sourceRevision] must not contain NUL characters",
62
+ "pattern": "^[^\\0]*$"
63
+ }
64
+ ],
65
+ "description": "Exact repository revision the artifacts were read at (SHA-1 or SHA-256 object id)."
66
+ },
67
+ "artifactRevisionId": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "maxLength": 128,
71
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
72
+ "allOf": [
73
+ {
74
+ "description": "[artifactRevisionId] must not contain NUL characters",
75
+ "pattern": "^[^\\0]*$"
76
+ }
77
+ ],
78
+ "description": "Authoring-owned revision identity; at most 128 characters. Opaque: compared, never parsed, and never echoed back by a diagnostic."
79
+ },
80
+ "artifacts": {
81
+ "type": "array",
82
+ "items": {
83
+ "$ref": "#/$defs/PreExecutionArtifactRowV1"
84
+ },
85
+ "minItems": 1,
86
+ "maxItems": 32,
87
+ "description": "Ordered artifact rows; 1..32, ordered by UTF-8 path bytes."
88
+ },
89
+ "contexts": {
90
+ "type": "array",
91
+ "items": {
92
+ "$ref": "#/$defs/PreExecutionContextBindingV1"
93
+ },
94
+ "maxItems": 16,
95
+ "description": "Authoritative context bindings; 0..16, ordered by kind then identifier."
96
+ },
97
+ "parentSpecSnapshotDigest": {
98
+ "oneOf": [
99
+ {
100
+ "type": "string",
101
+ "minLength": 64,
102
+ "maxLength": 64,
103
+ "pattern": "^[a-f0-9]{64}$",
104
+ "allOf": [
105
+ {
106
+ "description": "[parentSpecSnapshotDigest] must not contain NUL characters",
107
+ "pattern": "^[^\\0]*$"
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "type": "null"
113
+ }
114
+ ],
115
+ "description": "Digest of the reviewed Product snapshot: required for a feature Plan snapshot, exactly null at the SPEC stage and for a fix unit (it has no Product half to bind, D6)."
116
+ }
117
+ },
118
+ "allOf": [
119
+ {
120
+ "description": "[spec-stage-has-no-parent] A SPEC snapshot is the root of its own lineage.",
121
+ "if": {
122
+ "properties": {
123
+ "stage": {
124
+ "const": "spec"
125
+ }
126
+ }
127
+ },
128
+ "then": {
129
+ "properties": {
130
+ "parentSpecSnapshotDigest": {
131
+ "type": "null"
132
+ }
133
+ }
134
+ }
135
+ },
136
+ {
137
+ "description": "[plan-stage-requires-parent] A Plan snapshot of a FEATURE unit binds the exact reviewed Product snapshot.",
138
+ "if": {
139
+ "allOf": [
140
+ {
141
+ "properties": {
142
+ "stage": {
143
+ "const": "plan"
144
+ }
145
+ }
146
+ },
147
+ {
148
+ "properties": {
149
+ "unitKind": {
150
+ "const": "feature"
151
+ }
152
+ }
153
+ }
154
+ ]
155
+ },
156
+ "then": {
157
+ "properties": {
158
+ "parentSpecSnapshotDigest": {
159
+ "not": {
160
+ "type": "null"
161
+ }
162
+ }
163
+ }
164
+ }
165
+ },
166
+ {
167
+ "description": "[fix-unit-has-no-product-parent] A fix unit has no Product snapshot, so its Plan snapshot binds no parent.",
168
+ "if": {
169
+ "properties": {
170
+ "unitKind": {
171
+ "const": "fix"
172
+ }
173
+ }
174
+ },
175
+ "then": {
176
+ "properties": {
177
+ "parentSpecSnapshotDigest": {
178
+ "type": "null"
179
+ }
180
+ }
181
+ }
182
+ }
183
+ ],
184
+ "$defs": {
185
+ "PreExecutionArtifactRowV1": {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": [
189
+ "kind",
190
+ "path",
191
+ "selector",
192
+ "byteLength",
193
+ "digest"
194
+ ],
195
+ "properties": {
196
+ "kind": {
197
+ "type": "string",
198
+ "enum": [
199
+ "spec",
200
+ "acceptance",
201
+ "plan",
202
+ "tasks",
203
+ "testing",
204
+ "decisions",
205
+ "architecture-notes",
206
+ "planning-evidence",
207
+ "obligations"
208
+ ],
209
+ "description": "Artifact role inside the stage's authoritative set."
210
+ },
211
+ "path": {
212
+ "type": "string",
213
+ "maxLength": 1024,
214
+ "allOf": [
215
+ {
216
+ "description": "[path] must not contain NUL characters",
217
+ "pattern": "^[^\\0]*$"
218
+ },
219
+ {
220
+ "description": "[path] must not be empty",
221
+ "pattern": "^(?!$)"
222
+ },
223
+ {
224
+ "description": "[path] must not be an absolute path (leading \"/\")",
225
+ "pattern": "^(?!/)"
226
+ },
227
+ {
228
+ "description": "[path] must not be a Windows drive-letter path",
229
+ "pattern": "^(?![A-Za-z]:)"
230
+ },
231
+ {
232
+ "description": "[path] must not contain backslashes",
233
+ "pattern": "^(?!.*\\\\)"
234
+ },
235
+ {
236
+ "description": "[path] must not contain \".\" or \"..\" segments",
237
+ "pattern": "^(?!.*(\\/|^)\\.\\.?($|\\/))"
238
+ },
239
+ {
240
+ "description": "[path] must not end with a separator",
241
+ "pattern": "^(?!.*\\/$)"
242
+ },
243
+ {
244
+ "description": "[path] must not contain an empty segment",
245
+ "pattern": "^(?!.*//)"
246
+ }
247
+ ],
248
+ "description": "Normalized repository-relative path; at most 1024 characters."
249
+ },
250
+ "selector": {
251
+ "type": "string",
252
+ "enum": [
253
+ "whole-file",
254
+ "spec-product-v1"
255
+ ],
256
+ "description": "How the bound bytes were selected out of the file."
257
+ },
258
+ "byteLength": {
259
+ "type": "integer",
260
+ "minimum": 0,
261
+ "maximum": 4194304,
262
+ "description": "UTF-8 length of the SELECTION (a Product projection is smaller than its file), at most 4194304 bytes."
263
+ },
264
+ "digest": {
265
+ "type": "string",
266
+ "minLength": 64,
267
+ "maxLength": 64,
268
+ "pattern": "^[a-f0-9]{64}$",
269
+ "allOf": [
270
+ {
271
+ "description": "[digest] must not contain NUL characters",
272
+ "pattern": "^[^\\0]*$"
273
+ }
274
+ ],
275
+ "description": "Lowercase SHA-256 of the selected bytes."
276
+ }
277
+ }
278
+ },
279
+ "PreExecutionContextBindingV1": {
280
+ "type": "object",
281
+ "additionalProperties": false,
282
+ "required": [
283
+ "kind",
284
+ "identifier",
285
+ "presence",
286
+ "digest"
287
+ ],
288
+ "properties": {
289
+ "kind": {
290
+ "type": "string",
291
+ "enum": [
292
+ "roadmap-row",
293
+ "governing-issue",
294
+ "normalized-repository-state",
295
+ "architectural-invariants",
296
+ "dependency-unit",
297
+ "project-guide"
298
+ ],
299
+ "description": "Context authority."
300
+ },
301
+ "identifier": {
302
+ "type": "string",
303
+ "minLength": 1,
304
+ "maxLength": 160,
305
+ "pattern": "^[#A-Za-z0-9][A-Za-z0-9._:/#-]*$",
306
+ "allOf": [
307
+ {
308
+ "description": "[identifier] must not contain NUL characters",
309
+ "pattern": "^[^\\0]*$"
310
+ }
311
+ ],
312
+ "description": "Stable identifier (a roadmap row, an issue number such as #146, a snapshot id); at most 160 characters."
313
+ },
314
+ "presence": {
315
+ "type": "string",
316
+ "enum": [
317
+ "present",
318
+ "absent"
319
+ ],
320
+ "description": "Whether the authority exists."
321
+ },
322
+ "digest": {
323
+ "oneOf": [
324
+ {
325
+ "type": "string",
326
+ "minLength": 64,
327
+ "maxLength": 64,
328
+ "pattern": "^[a-f0-9]{64}$",
329
+ "allOf": [
330
+ {
331
+ "description": "[digest] must not contain NUL characters",
332
+ "pattern": "^[^\\0]*$"
333
+ }
334
+ ]
335
+ },
336
+ {
337
+ "type": "null"
338
+ }
339
+ ],
340
+ "description": "Lowercase SHA-256 of the context bytes when present; exactly null when absent."
341
+ }
342
+ },
343
+ "allOf": [
344
+ {
345
+ "description": "[present-context-has-digest] A present context binds a digest.",
346
+ "if": {
347
+ "properties": {
348
+ "presence": {
349
+ "const": "present"
350
+ }
351
+ }
352
+ },
353
+ "then": {
354
+ "properties": {
355
+ "digest": {
356
+ "not": {
357
+ "type": "null"
358
+ }
359
+ }
360
+ }
361
+ }
362
+ },
363
+ {
364
+ "description": "[absent-context-has-null-digest] An absent context binds exactly `null`.",
365
+ "if": {
366
+ "properties": {
367
+ "presence": {
368
+ "const": "absent"
369
+ }
370
+ }
371
+ },
372
+ "then": {
373
+ "properties": {
374
+ "digest": {
375
+ "type": "null"
376
+ }
377
+ }
378
+ }
379
+ }
380
+ ]
381
+ }
382
+ }
383
+ }