rivet-design 0.26.0 → 0.26.1

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.
@@ -103,7 +103,7 @@ export declare const inlineVariantRequestSchema: z.ZodEffects<z.ZodObject<{
103
103
  label?: string | undefined;
104
104
  }[] | undefined;
105
105
  runLabel?: string | undefined;
106
- fidelity?: "low" | "medium" | "high" | undefined;
106
+ fidelity?: "high" | "medium" | "low" | undefined;
107
107
  profile?: "off" | "auto" | undefined;
108
108
  briefs?: {
109
109
  label: string;
@@ -131,7 +131,7 @@ export declare const inlineVariantRequestSchema: z.ZodEffects<z.ZodObject<{
131
131
  label?: string | undefined;
132
132
  }[] | undefined;
133
133
  runLabel?: string | undefined;
134
- fidelity?: "low" | "medium" | "high" | undefined;
134
+ fidelity?: "high" | "medium" | "low" | undefined;
135
135
  profile?: "off" | "auto" | undefined;
136
136
  briefs?: {
137
137
  label: string;
@@ -156,7 +156,7 @@ export declare const inlineVariantRequestSchema: z.ZodEffects<z.ZodObject<{
156
156
  label?: string | undefined;
157
157
  }[] | undefined;
158
158
  runLabel?: string | undefined;
159
- fidelity?: "low" | "medium" | "high" | undefined;
159
+ fidelity?: "high" | "medium" | "low" | undefined;
160
160
  profile?: "off" | "auto" | undefined;
161
161
  briefs?: {
162
162
  label: string;
@@ -184,7 +184,7 @@ export declare const inlineVariantRequestSchema: z.ZodEffects<z.ZodObject<{
184
184
  label?: string | undefined;
185
185
  }[] | undefined;
186
186
  runLabel?: string | undefined;
187
- fidelity?: "low" | "medium" | "high" | undefined;
187
+ fidelity?: "high" | "medium" | "low" | undefined;
188
188
  profile?: "off" | "auto" | undefined;
189
189
  briefs?: {
190
190
  label: string;
@@ -239,7 +239,15 @@ const validateEvidence = async (directory, names) => {
239
239
  const executeGuidanceVerifier = async (args) => {
240
240
  const started = Date.now();
241
241
  let runDirectory = args.runsDirectory;
242
+ let projectPath = args.projectPath;
243
+ const verifier = {
244
+ contextId: args.packet.source.id,
245
+ sourceDigest: args.packet.sourceDigest,
246
+ };
242
247
  const failed = (reason) => ({
248
+ schemaVersion: 1,
249
+ verifier,
250
+ projectPath,
243
251
  execution: 'error',
244
252
  reason,
245
253
  runDirectory,
@@ -261,7 +269,7 @@ const executeGuidanceVerifier = async (args) => {
261
269
  files: executable.files,
262
270
  directory: path_1.default.join(runDirectory, 'package'),
263
271
  });
264
- const projectPath = await promises_1.default.realpath(args.projectPath);
272
+ projectPath = await promises_1.default.realpath(args.projectPath);
265
273
  if (!(await promises_1.default.stat(projectPath)).isDirectory())
266
274
  return failed('setup_failed');
267
275
  const evidenceDirectory = path_1.default.join(runDirectory, 'evidence');
@@ -324,7 +332,7 @@ const executeGuidanceVerifier = async (args) => {
324
332
  return failed('invalid_result');
325
333
  }
326
334
  try {
327
- await validateEvidence(evidenceDirectory, result.checks.flatMap((check) => check.evidence ?? []));
335
+ await validateEvidence(evidenceDirectory, result.checks.flatMap((check) => check.evidence.map((artifact) => artifact.path)));
328
336
  }
329
337
  catch {
330
338
  return failed('invalid_evidence');
@@ -335,6 +343,9 @@ const executeGuidanceVerifier = async (args) => {
335
343
  else if (result.checks.some((check) => check.status === 'blocked'))
336
344
  status = 'blocked';
337
345
  return {
346
+ schemaVersion: 1,
347
+ verifier,
348
+ projectPath,
338
349
  execution: 'completed',
339
350
  status,
340
351
  checks: result.checks,
@@ -7,14 +7,14 @@ declare const PreviewSchema: z.ZodObject<{
7
7
  capturedAt: z.ZodString;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  projectPath: string;
10
- dataUrl: string;
11
10
  label: string;
11
+ dataUrl: string;
12
12
  sourceKey: string;
13
13
  capturedAt: string;
14
14
  }, {
15
15
  projectPath: string;
16
- dataUrl: string;
17
16
  label: string;
17
+ dataUrl: string;
18
18
  sourceKey: string;
19
19
  capturedAt: string;
20
20
  }>;
@@ -50,81 +50,480 @@ export declare const GuidanceVerifierPackageSchema: z.ZodEffects<z.ZodObject<{
50
50
  }>;
51
51
  export type GuidanceVerifierPackage = z.infer<typeof GuidanceVerifierPackageSchema>;
52
52
  export declare const GuidanceVerifierResultSchema: z.ZodEffects<z.ZodObject<{
53
- checks: z.ZodArray<z.ZodObject<{
53
+ checks: z.ZodArray<z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
54
54
  id: z.ZodString;
55
- category: z.ZodString;
56
- status: z.ZodEnum<["pass", "fail", "blocked"]>;
57
- rule: z.ZodString;
58
- target: z.ZodString;
59
- expected: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
60
- observed: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
61
- evidence: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
55
+ priority: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
56
+ currentState: z.ZodString;
57
+ proposedFix: z.ZodNullable<z.ZodString>;
58
+ evidence: z.ZodArray<z.ZodObject<{
59
+ path: z.ZodEffects<z.ZodString, string, string>;
60
+ mediaType: z.ZodString;
61
+ label: z.ZodString;
62
+ role: z.ZodEnum<["observed", "reference"]>;
63
+ }, "strict", z.ZodTypeAny, {
64
+ path: string;
65
+ mediaType: string;
66
+ label: string;
67
+ role: "reference" | "observed";
68
+ }, {
69
+ path: string;
70
+ mediaType: string;
71
+ label: string;
72
+ role: "reference" | "observed";
73
+ }>, "many">;
74
+ comparison: z.ZodOptional<z.ZodObject<{
75
+ expected: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
76
+ observed: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
77
+ unit: z.ZodNullable<z.ZodString>;
78
+ }, "strict", z.ZodTypeAny, {
79
+ unit: string | null;
80
+ expected?: unknown;
81
+ observed?: unknown;
82
+ }, {
83
+ unit: string | null;
84
+ expected?: unknown;
85
+ observed?: unknown;
86
+ }>>;
87
+ location: z.ZodOptional<z.ZodString>;
88
+ } & {
89
+ status: z.ZodLiteral<"pass">;
90
+ problem: z.ZodNull;
62
91
  }, "strict", z.ZodTypeAny, {
63
- status: "pass" | "fail" | "blocked";
92
+ status: "pass";
93
+ id: string;
94
+ priority: "high" | "medium" | "low" | null;
95
+ currentState: string;
96
+ proposedFix: string | null;
97
+ evidence: {
98
+ path: string;
99
+ mediaType: string;
100
+ label: string;
101
+ role: "reference" | "observed";
102
+ }[];
103
+ problem: null;
104
+ comparison?: {
105
+ unit: string | null;
106
+ expected?: unknown;
107
+ observed?: unknown;
108
+ } | undefined;
109
+ location?: string | undefined;
110
+ }, {
111
+ status: "pass";
64
112
  id: string;
65
- category: string;
66
- rule: string;
67
- target: string;
68
- expected?: unknown;
69
- observed?: unknown;
70
- evidence?: string[] | undefined;
113
+ priority: "high" | "medium" | "low" | null;
114
+ currentState: string;
115
+ proposedFix: string | null;
116
+ evidence: {
117
+ path: string;
118
+ mediaType: string;
119
+ label: string;
120
+ role: "reference" | "observed";
121
+ }[];
122
+ problem: null;
123
+ comparison?: {
124
+ unit: string | null;
125
+ expected?: unknown;
126
+ observed?: unknown;
127
+ } | undefined;
128
+ location?: string | undefined;
129
+ }>, z.ZodObject<{
130
+ id: z.ZodString;
131
+ priority: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
132
+ currentState: z.ZodString;
133
+ proposedFix: z.ZodNullable<z.ZodString>;
134
+ evidence: z.ZodArray<z.ZodObject<{
135
+ path: z.ZodEffects<z.ZodString, string, string>;
136
+ mediaType: z.ZodString;
137
+ label: z.ZodString;
138
+ role: z.ZodEnum<["observed", "reference"]>;
139
+ }, "strict", z.ZodTypeAny, {
140
+ path: string;
141
+ mediaType: string;
142
+ label: string;
143
+ role: "reference" | "observed";
144
+ }, {
145
+ path: string;
146
+ mediaType: string;
147
+ label: string;
148
+ role: "reference" | "observed";
149
+ }>, "many">;
150
+ comparison: z.ZodOptional<z.ZodObject<{
151
+ expected: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
152
+ observed: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
153
+ unit: z.ZodNullable<z.ZodString>;
154
+ }, "strict", z.ZodTypeAny, {
155
+ unit: string | null;
156
+ expected?: unknown;
157
+ observed?: unknown;
158
+ }, {
159
+ unit: string | null;
160
+ expected?: unknown;
161
+ observed?: unknown;
162
+ }>>;
163
+ location: z.ZodOptional<z.ZodString>;
164
+ } & {
165
+ status: z.ZodLiteral<"fail">;
166
+ problem: z.ZodString;
167
+ }, "strict", z.ZodTypeAny, {
168
+ status: "fail";
169
+ id: string;
170
+ priority: "high" | "medium" | "low" | null;
171
+ currentState: string;
172
+ proposedFix: string | null;
173
+ evidence: {
174
+ path: string;
175
+ mediaType: string;
176
+ label: string;
177
+ role: "reference" | "observed";
178
+ }[];
179
+ problem: string;
180
+ comparison?: {
181
+ unit: string | null;
182
+ expected?: unknown;
183
+ observed?: unknown;
184
+ } | undefined;
185
+ location?: string | undefined;
186
+ }, {
187
+ status: "fail";
188
+ id: string;
189
+ priority: "high" | "medium" | "low" | null;
190
+ currentState: string;
191
+ proposedFix: string | null;
192
+ evidence: {
193
+ path: string;
194
+ mediaType: string;
195
+ label: string;
196
+ role: "reference" | "observed";
197
+ }[];
198
+ problem: string;
199
+ comparison?: {
200
+ unit: string | null;
201
+ expected?: unknown;
202
+ observed?: unknown;
203
+ } | undefined;
204
+ location?: string | undefined;
205
+ }>, z.ZodObject<{
206
+ id: z.ZodString;
207
+ priority: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
208
+ currentState: z.ZodString;
209
+ proposedFix: z.ZodNullable<z.ZodString>;
210
+ evidence: z.ZodArray<z.ZodObject<{
211
+ path: z.ZodEffects<z.ZodString, string, string>;
212
+ mediaType: z.ZodString;
213
+ label: z.ZodString;
214
+ role: z.ZodEnum<["observed", "reference"]>;
215
+ }, "strict", z.ZodTypeAny, {
216
+ path: string;
217
+ mediaType: string;
218
+ label: string;
219
+ role: "reference" | "observed";
220
+ }, {
221
+ path: string;
222
+ mediaType: string;
223
+ label: string;
224
+ role: "reference" | "observed";
225
+ }>, "many">;
226
+ comparison: z.ZodOptional<z.ZodObject<{
227
+ expected: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
228
+ observed: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, unknown, unknown>;
229
+ unit: z.ZodNullable<z.ZodString>;
230
+ }, "strict", z.ZodTypeAny, {
231
+ unit: string | null;
232
+ expected?: unknown;
233
+ observed?: unknown;
234
+ }, {
235
+ unit: string | null;
236
+ expected?: unknown;
237
+ observed?: unknown;
238
+ }>>;
239
+ location: z.ZodOptional<z.ZodString>;
240
+ } & {
241
+ status: z.ZodLiteral<"blocked">;
242
+ problem: z.ZodString;
243
+ }, "strict", z.ZodTypeAny, {
244
+ status: "blocked";
245
+ id: string;
246
+ priority: "high" | "medium" | "low" | null;
247
+ currentState: string;
248
+ proposedFix: string | null;
249
+ evidence: {
250
+ path: string;
251
+ mediaType: string;
252
+ label: string;
253
+ role: "reference" | "observed";
254
+ }[];
255
+ problem: string;
256
+ comparison?: {
257
+ unit: string | null;
258
+ expected?: unknown;
259
+ observed?: unknown;
260
+ } | undefined;
261
+ location?: string | undefined;
71
262
  }, {
72
- status: "pass" | "fail" | "blocked";
263
+ status: "blocked";
73
264
  id: string;
74
- category: string;
75
- rule: string;
76
- target: string;
77
- expected?: unknown;
78
- observed?: unknown;
79
- evidence?: string[] | undefined;
80
- }>, "many">;
265
+ priority: "high" | "medium" | "low" | null;
266
+ currentState: string;
267
+ proposedFix: string | null;
268
+ evidence: {
269
+ path: string;
270
+ mediaType: string;
271
+ label: string;
272
+ role: "reference" | "observed";
273
+ }[];
274
+ problem: string;
275
+ comparison?: {
276
+ unit: string | null;
277
+ expected?: unknown;
278
+ observed?: unknown;
279
+ } | undefined;
280
+ location?: string | undefined;
281
+ }>]>, "many">;
81
282
  }, "strict", z.ZodTypeAny, {
82
- checks: {
83
- status: "pass" | "fail" | "blocked";
283
+ checks: ({
284
+ status: "pass";
84
285
  id: string;
85
- category: string;
86
- rule: string;
87
- target: string;
88
- expected?: unknown;
89
- observed?: unknown;
90
- evidence?: string[] | undefined;
91
- }[];
286
+ priority: "high" | "medium" | "low" | null;
287
+ currentState: string;
288
+ proposedFix: string | null;
289
+ evidence: {
290
+ path: string;
291
+ mediaType: string;
292
+ label: string;
293
+ role: "reference" | "observed";
294
+ }[];
295
+ problem: null;
296
+ comparison?: {
297
+ unit: string | null;
298
+ expected?: unknown;
299
+ observed?: unknown;
300
+ } | undefined;
301
+ location?: string | undefined;
302
+ } | {
303
+ status: "fail";
304
+ id: string;
305
+ priority: "high" | "medium" | "low" | null;
306
+ currentState: string;
307
+ proposedFix: string | null;
308
+ evidence: {
309
+ path: string;
310
+ mediaType: string;
311
+ label: string;
312
+ role: "reference" | "observed";
313
+ }[];
314
+ problem: string;
315
+ comparison?: {
316
+ unit: string | null;
317
+ expected?: unknown;
318
+ observed?: unknown;
319
+ } | undefined;
320
+ location?: string | undefined;
321
+ } | {
322
+ status: "blocked";
323
+ id: string;
324
+ priority: "high" | "medium" | "low" | null;
325
+ currentState: string;
326
+ proposedFix: string | null;
327
+ evidence: {
328
+ path: string;
329
+ mediaType: string;
330
+ label: string;
331
+ role: "reference" | "observed";
332
+ }[];
333
+ problem: string;
334
+ comparison?: {
335
+ unit: string | null;
336
+ expected?: unknown;
337
+ observed?: unknown;
338
+ } | undefined;
339
+ location?: string | undefined;
340
+ })[];
92
341
  }, {
93
- checks: {
94
- status: "pass" | "fail" | "blocked";
342
+ checks: ({
343
+ status: "pass";
95
344
  id: string;
96
- category: string;
97
- rule: string;
98
- target: string;
99
- expected?: unknown;
100
- observed?: unknown;
101
- evidence?: string[] | undefined;
102
- }[];
345
+ priority: "high" | "medium" | "low" | null;
346
+ currentState: string;
347
+ proposedFix: string | null;
348
+ evidence: {
349
+ path: string;
350
+ mediaType: string;
351
+ label: string;
352
+ role: "reference" | "observed";
353
+ }[];
354
+ problem: null;
355
+ comparison?: {
356
+ unit: string | null;
357
+ expected?: unknown;
358
+ observed?: unknown;
359
+ } | undefined;
360
+ location?: string | undefined;
361
+ } | {
362
+ status: "fail";
363
+ id: string;
364
+ priority: "high" | "medium" | "low" | null;
365
+ currentState: string;
366
+ proposedFix: string | null;
367
+ evidence: {
368
+ path: string;
369
+ mediaType: string;
370
+ label: string;
371
+ role: "reference" | "observed";
372
+ }[];
373
+ problem: string;
374
+ comparison?: {
375
+ unit: string | null;
376
+ expected?: unknown;
377
+ observed?: unknown;
378
+ } | undefined;
379
+ location?: string | undefined;
380
+ } | {
381
+ status: "blocked";
382
+ id: string;
383
+ priority: "high" | "medium" | "low" | null;
384
+ currentState: string;
385
+ proposedFix: string | null;
386
+ evidence: {
387
+ path: string;
388
+ mediaType: string;
389
+ label: string;
390
+ role: "reference" | "observed";
391
+ }[];
392
+ problem: string;
393
+ comparison?: {
394
+ unit: string | null;
395
+ expected?: unknown;
396
+ observed?: unknown;
397
+ } | undefined;
398
+ location?: string | undefined;
399
+ })[];
103
400
  }>, {
104
- checks: {
105
- status: "pass" | "fail" | "blocked";
401
+ checks: ({
402
+ status: "pass";
106
403
  id: string;
107
- category: string;
108
- rule: string;
109
- target: string;
110
- expected?: unknown;
111
- observed?: unknown;
112
- evidence?: string[] | undefined;
113
- }[];
404
+ priority: "high" | "medium" | "low" | null;
405
+ currentState: string;
406
+ proposedFix: string | null;
407
+ evidence: {
408
+ path: string;
409
+ mediaType: string;
410
+ label: string;
411
+ role: "reference" | "observed";
412
+ }[];
413
+ problem: null;
414
+ comparison?: {
415
+ unit: string | null;
416
+ expected?: unknown;
417
+ observed?: unknown;
418
+ } | undefined;
419
+ location?: string | undefined;
420
+ } | {
421
+ status: "fail";
422
+ id: string;
423
+ priority: "high" | "medium" | "low" | null;
424
+ currentState: string;
425
+ proposedFix: string | null;
426
+ evidence: {
427
+ path: string;
428
+ mediaType: string;
429
+ label: string;
430
+ role: "reference" | "observed";
431
+ }[];
432
+ problem: string;
433
+ comparison?: {
434
+ unit: string | null;
435
+ expected?: unknown;
436
+ observed?: unknown;
437
+ } | undefined;
438
+ location?: string | undefined;
439
+ } | {
440
+ status: "blocked";
441
+ id: string;
442
+ priority: "high" | "medium" | "low" | null;
443
+ currentState: string;
444
+ proposedFix: string | null;
445
+ evidence: {
446
+ path: string;
447
+ mediaType: string;
448
+ label: string;
449
+ role: "reference" | "observed";
450
+ }[];
451
+ problem: string;
452
+ comparison?: {
453
+ unit: string | null;
454
+ expected?: unknown;
455
+ observed?: unknown;
456
+ } | undefined;
457
+ location?: string | undefined;
458
+ })[];
114
459
  }, {
115
- checks: {
116
- status: "pass" | "fail" | "blocked";
460
+ checks: ({
461
+ status: "pass";
117
462
  id: string;
118
- category: string;
119
- rule: string;
120
- target: string;
121
- expected?: unknown;
122
- observed?: unknown;
123
- evidence?: string[] | undefined;
124
- }[];
463
+ priority: "high" | "medium" | "low" | null;
464
+ currentState: string;
465
+ proposedFix: string | null;
466
+ evidence: {
467
+ path: string;
468
+ mediaType: string;
469
+ label: string;
470
+ role: "reference" | "observed";
471
+ }[];
472
+ problem: null;
473
+ comparison?: {
474
+ unit: string | null;
475
+ expected?: unknown;
476
+ observed?: unknown;
477
+ } | undefined;
478
+ location?: string | undefined;
479
+ } | {
480
+ status: "fail";
481
+ id: string;
482
+ priority: "high" | "medium" | "low" | null;
483
+ currentState: string;
484
+ proposedFix: string | null;
485
+ evidence: {
486
+ path: string;
487
+ mediaType: string;
488
+ label: string;
489
+ role: "reference" | "observed";
490
+ }[];
491
+ problem: string;
492
+ comparison?: {
493
+ unit: string | null;
494
+ expected?: unknown;
495
+ observed?: unknown;
496
+ } | undefined;
497
+ location?: string | undefined;
498
+ } | {
499
+ status: "blocked";
500
+ id: string;
501
+ priority: "high" | "medium" | "low" | null;
502
+ currentState: string;
503
+ proposedFix: string | null;
504
+ evidence: {
505
+ path: string;
506
+ mediaType: string;
507
+ label: string;
508
+ role: "reference" | "observed";
509
+ }[];
510
+ problem: string;
511
+ comparison?: {
512
+ unit: string | null;
513
+ expected?: unknown;
514
+ observed?: unknown;
515
+ } | undefined;
516
+ location?: string | undefined;
517
+ })[];
125
518
  }>;
126
519
  export type GuidanceVerifierResult = z.infer<typeof GuidanceVerifierResultSchema>;
127
520
  export type GuidanceVerifierRun = {
521
+ schemaVersion: 1;
522
+ verifier: {
523
+ contextId: string;
524
+ sourceDigest: string;
525
+ };
526
+ projectPath: string;
128
527
  runDirectory: string;
129
528
  durationMs: number;
130
529
  } & ({