ushman-ledger 0.3.0 → 1.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +4 -14
  2. package/README.md +8 -56
  3. package/dist/archive-journal.d.ts +29 -18
  4. package/dist/archive-journal.d.ts.map +1 -1
  5. package/dist/archive-journal.js +17 -17
  6. package/dist/builders.d.ts +52 -374
  7. package/dist/builders.d.ts.map +1 -1
  8. package/dist/builders.js +10 -60
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/cli.js +8 -14
  11. package/dist/handle.d.ts +2 -2
  12. package/dist/handle.d.ts.map +1 -1
  13. package/dist/handle.js +1 -14
  14. package/dist/index.d.ts +3 -5
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -4
  17. package/dist/lab-min.d.ts +7 -7
  18. package/dist/lab-min.d.ts.map +1 -1
  19. package/dist/lab-min.js +7 -9
  20. package/dist/list.d.ts +84 -325
  21. package/dist/list.d.ts.map +1 -1
  22. package/dist/read-index.d.ts +45 -57
  23. package/dist/read-index.d.ts.map +1 -1
  24. package/dist/read-index.js +16 -34
  25. package/dist/record.d.ts.map +1 -1
  26. package/dist/record.js +27 -114
  27. package/dist/recovery.d.ts +19 -8
  28. package/dist/recovery.d.ts.map +1 -1
  29. package/dist/recovery.js +13 -13
  30. package/dist/render/retro.d.ts.map +1 -1
  31. package/dist/render/retro.js +1 -4
  32. package/dist/schema/entry.d.ts +1365 -3291
  33. package/dist/schema/entry.d.ts.map +1 -1
  34. package/dist/schema/entry.js +184 -516
  35. package/dist/schema/manifest.d.ts +28 -41
  36. package/dist/schema/manifest.d.ts.map +1 -1
  37. package/dist/schema/manifest.js +20 -24
  38. package/dist/schema/note.d.ts +3 -9
  39. package/dist/schema/note.d.ts.map +1 -1
  40. package/dist/schema/note.js +2 -2
  41. package/dist/storage/filesystem.d.ts +0 -1
  42. package/dist/storage/filesystem.d.ts.map +1 -1
  43. package/dist/storage/filesystem.js +4 -4
  44. package/package.json +3 -4
@@ -2,130 +2,26 @@ import { type LedgerRecord } from './schema/entry.ts';
2
2
  type BuildRecordInput<TRecord extends LedgerRecord> = Omit<TRecord, 'kind'> & {
3
3
  readonly kind?: TRecord['kind'];
4
4
  };
5
- /** Build an `agent-patch` record, deriving structured payload fields later if only `diffPath` is supplied. */
6
- export declare const buildAgentPatchRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
7
- kind: "agent-patch";
5
+ /** Build an `operator-decision` record with a validated structured payload. */
6
+ export declare const buildOperatorDecisionRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
7
+ kind: "operator-decision";
8
8
  }>>) => {
9
- emitter: {
10
- tool: string;
11
- version: string;
12
- user?: string | undefined;
13
- };
14
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
15
- summary: string;
16
- rationale: string;
17
- agent: {
18
- name: string;
19
- sessionId?: string | undefined;
9
+ kind: "operator-decision";
10
+ payload: {
11
+ action: "bypass-doctor" | "skip-check" | "override-strip-decision" | "override-ship-state" | "manual-parity-assertion" | "ledger-hand-edit" | "escalation";
12
+ checkId?: string | undefined;
13
+ rationale: string;
20
14
  };
21
- kind: "agent-patch";
22
- details?: Record<string, unknown> | undefined;
23
- idempotencyKey?: string | undefined;
24
- links?: {
15
+ details?: {
25
16
  [x: string]: unknown;
26
- affectedFiles?: string[] | undefined;
27
- blobs?: string[] | undefined;
28
- briefId?: string | undefined;
29
- correctsLedgerId?: string | undefined;
30
- gitRef?: string | undefined;
31
- idempotencyKey?: string | undefined;
32
- stripDecisionId?: string | undefined;
33
- supersedesLedgerId?: string | undefined;
34
- validatorVerdictId?: string | undefined;
35
17
  } | undefined;
36
- diff?: {
37
- addedLines: number;
38
- blobSha256: string;
39
- bytes: number;
40
- removedLines: number;
41
- } | undefined;
42
- diffPath?: string | undefined;
43
- payload?: {
44
- diff?: string | undefined;
45
- diffSha256?: string | undefined;
46
- fileSha256After?: Record<string, string> | undefined;
47
- fileSha256Before?: Record<string, string> | undefined;
48
- hunks?: {
49
- endLine: number;
50
- path: string;
51
- startLine: number;
52
- }[] | undefined;
53
- touchedPaths?: string[] | undefined;
54
- } | undefined;
55
- };
56
- /** Build an `operator-patch` record, deriving structured payload fields later if only `diffPath` is supplied. */
57
- export declare const buildOperatorPatchRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
58
- kind: "operator-patch";
59
- }>>) => {
60
18
  emitter: {
61
19
  tool: string;
62
- version: string;
63
20
  user?: string | undefined;
64
- };
65
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
66
- summary: string;
67
- rationale: string;
68
- kind: "operator-patch";
69
- operator: {
70
- name: string;
71
- };
72
- details?: Record<string, unknown> | undefined;
73
- idempotencyKey?: string | undefined;
74
- links?: {
75
- [x: string]: unknown;
76
- affectedFiles?: string[] | undefined;
77
- blobs?: string[] | undefined;
78
- briefId?: string | undefined;
79
- correctsLedgerId?: string | undefined;
80
- gitRef?: string | undefined;
81
- idempotencyKey?: string | undefined;
82
- stripDecisionId?: string | undefined;
83
- supersedesLedgerId?: string | undefined;
84
- validatorVerdictId?: string | undefined;
85
- } | undefined;
86
- diff?: {
87
- addedLines: number;
88
- blobSha256: string;
89
- bytes: number;
90
- removedLines: number;
91
- } | undefined;
92
- diffPath?: string | undefined;
93
- payload?: {
94
- diff?: string | undefined;
95
- diffSha256?: string | undefined;
96
- fileSha256After?: Record<string, string> | undefined;
97
- fileSha256Before?: Record<string, string> | undefined;
98
- hunks?: {
99
- endLine: number;
100
- path: string;
101
- startLine: number;
102
- }[] | undefined;
103
- touchedPaths?: string[] | undefined;
104
- } | undefined;
105
- };
106
- /** Build a `stage-transition` record with a validated structured payload. */
107
- export declare const buildStageTransitionRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
108
- kind: "stage-transition";
109
- }>>) => {
110
- emitter: {
111
- tool: string;
112
21
  version: string;
113
- user?: string | undefined;
114
22
  };
115
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
116
- summary: string;
117
- kind: "stage-transition";
118
- payload: {
119
- endedAt: string;
120
- exitCode: number;
121
- stage: "seed" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize";
122
- startedAt: string;
123
- doctorBaselineId?: string | undefined;
124
- };
125
- details?: Record<string, unknown> | undefined;
126
23
  idempotencyKey?: string | undefined;
127
- links?: {
128
- [x: string]: unknown;
24
+ links?: ({
129
25
  affectedFiles?: string[] | undefined;
130
26
  blobs?: string[] | undefined;
131
27
  briefId?: string | undefined;
@@ -135,159 +31,33 @@ export declare const buildStageTransitionRecord: (input: BuildRecordInput<Extrac
135
31
  stripDecisionId?: string | undefined;
136
32
  supersedesLedgerId?: string | undefined;
137
33
  validatorVerdictId?: string | undefined;
138
- } | undefined;
139
- };
140
- /** Build an `operator-decision` record using the required structured payload shape. */
141
- export declare const buildOperatorDecisionRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
142
- kind: "operator-decision";
143
- }>>) => {
144
- emitter: {
145
- tool: string;
146
- version: string;
147
- user?: string | undefined;
148
- };
149
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
34
+ } & {
35
+ [key: string]: unknown;
36
+ }) | undefined;
37
+ phase: "capture" | "intake" | "seed" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
150
38
  summary: string;
151
- kind: "operator-decision";
152
- payload: {
153
- action: "bypass-doctor" | "skip-check" | "override-strip-decision" | "override-ship-state" | "manual-parity-assertion" | "ledger-hand-edit" | "escalation";
154
- rationale: string;
155
- checkId?: string | undefined;
156
- };
157
- details?: Record<string, unknown> | undefined;
158
- idempotencyKey?: string | undefined;
159
- links?: {
160
- [x: string]: unknown;
161
- affectedFiles?: string[] | undefined;
162
- blobs?: string[] | undefined;
163
- briefId?: string | undefined;
164
- correctsLedgerId?: string | undefined;
165
- gitRef?: string | undefined;
166
- idempotencyKey?: string | undefined;
167
- stripDecisionId?: string | undefined;
168
- supersedesLedgerId?: string | undefined;
169
- validatorVerdictId?: string | undefined;
170
- } | undefined;
171
39
  };
172
- /** Build a `validator-result` record and synthesize `payload.id` only when the caller omits it. */
40
+ /** Build a `validator-result` record. */
173
41
  export declare const buildValidatorResultRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
174
42
  kind: "validator-result";
175
43
  }>>) => {
176
- emitter: {
177
- tool: string;
178
- version: string;
179
- user?: string | undefined;
180
- };
181
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
182
- summary: string;
183
44
  kind: "validator-result";
184
- validator: "parity" | "characterize" | "equiv" | "verify" | "doctor";
185
- verdict: "green" | "yellow" | "red";
186
- details?: Record<string, unknown> | undefined;
187
- idempotencyKey?: string | undefined;
188
- links?: {
45
+ metrics?: {
189
46
  [x: string]: unknown;
190
- affectedFiles?: string[] | undefined;
191
- blobs?: string[] | undefined;
192
- briefId?: string | undefined;
193
- correctsLedgerId?: string | undefined;
194
- gitRef?: string | undefined;
195
- idempotencyKey?: string | undefined;
196
- stripDecisionId?: string | undefined;
197
- supersedesLedgerId?: string | undefined;
198
- validatorVerdictId?: string | undefined;
199
- } | undefined;
200
- metrics?: Record<string, unknown> | undefined;
201
- payload?: {
202
- id?: string | undefined;
203
47
  } | undefined;
204
48
  resultPath?: string | undefined;
205
- };
206
- /** Build a `correction` record with validated linkage fields. */
207
- export declare const buildCorrectionRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
208
- kind: "correction";
209
- }>>) => {
210
- emitter: {
211
- tool: string;
212
- version: string;
213
- user?: string | undefined;
214
- };
215
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
216
- summary: string;
217
- kind: "correction";
218
- rationale: string;
219
- details?: Record<string, unknown> | undefined;
220
- idempotencyKey?: string | undefined;
221
- links?: {
49
+ validator: "parity" | "characterize" | "equiv" | "verify" | "doctor";
50
+ verdict: "green" | "yellow" | "red";
51
+ details?: {
222
52
  [x: string]: unknown;
223
- affectedFiles?: string[] | undefined;
224
- blobs?: string[] | undefined;
225
- briefId?: string | undefined;
226
- correctsLedgerId?: string | undefined;
227
- gitRef?: string | undefined;
228
- idempotencyKey?: string | undefined;
229
- stripDecisionId?: string | undefined;
230
- supersedesLedgerId?: string | undefined;
231
- validatorVerdictId?: string | undefined;
232
- } | undefined;
233
- payload?: {
234
- correctsValidatorResultId?: string | undefined;
235
53
  } | undefined;
236
- };
237
- /** Build a `strip-decision-reverted` record. */
238
- export declare const buildStripDecisionRevertedRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
239
- kind: "strip-decision-reverted";
240
- }>>) => {
241
54
  emitter: {
242
55
  tool: string;
243
- version: string;
244
56
  user?: string | undefined;
245
- };
246
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
247
- summary: string;
248
- kind: "strip-decision-reverted";
249
- payload: {
250
- rationale: string;
251
- stripDecisionId: string;
252
- invalidatedStages?: ("seed" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize")[] | undefined;
253
- };
254
- details?: Record<string, unknown> | undefined;
255
- idempotencyKey?: string | undefined;
256
- links?: {
257
- [x: string]: unknown;
258
- affectedFiles?: string[] | undefined;
259
- blobs?: string[] | undefined;
260
- briefId?: string | undefined;
261
- correctsLedgerId?: string | undefined;
262
- gitRef?: string | undefined;
263
- idempotencyKey?: string | undefined;
264
- stripDecisionId?: string | undefined;
265
- supersedesLedgerId?: string | undefined;
266
- validatorVerdictId?: string | undefined;
267
- } | undefined;
268
- };
269
- /** Build a `descope-brief` record. */
270
- export declare const buildDescopeBriefRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
271
- kind: "descope-brief";
272
- }>>) => {
273
- emitter: {
274
- tool: string;
275
57
  version: string;
276
- user?: string | undefined;
277
58
  };
278
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
279
- summary: string;
280
- kind: "descope-brief";
281
- payload: {
282
- briefId: string;
283
- reason?: string | undefined;
284
- round?: number | undefined;
285
- stripDecisionIds?: string[] | undefined;
286
- };
287
- details?: Record<string, unknown> | undefined;
288
59
  idempotencyKey?: string | undefined;
289
- links?: {
290
- [x: string]: unknown;
60
+ links?: ({
291
61
  affectedFiles?: string[] | undefined;
292
62
  blobs?: string[] | undefined;
293
63
  briefId?: string | undefined;
@@ -297,93 +67,28 @@ export declare const buildDescopeBriefRecord: (input: BuildRecordInput<Extract<L
297
67
  stripDecisionId?: string | undefined;
298
68
  supersedesLedgerId?: string | undefined;
299
69
  validatorVerdictId?: string | undefined;
300
- } | undefined;
301
- };
302
- /** Build a `merge-return` record. */
303
- export declare const buildMergeReturnRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
304
- kind: "merge-return";
305
- }>>) => {
306
- emitter: {
307
- tool: string;
308
- version: string;
309
- user?: string | undefined;
310
- };
311
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
70
+ } & {
71
+ [key: string]: unknown;
72
+ }) | undefined;
73
+ phase: "capture" | "intake" | "seed" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
312
74
  summary: string;
313
- kind: "merge-return";
314
- payload: {
315
- returnId: string;
316
- briefId?: string | undefined;
317
- source?: string | undefined;
318
- };
319
- details?: Record<string, unknown> | undefined;
320
- idempotencyKey?: string | undefined;
321
- links?: {
322
- [x: string]: unknown;
323
- affectedFiles?: string[] | undefined;
324
- blobs?: string[] | undefined;
325
- briefId?: string | undefined;
326
- correctsLedgerId?: string | undefined;
327
- gitRef?: string | undefined;
328
- idempotencyKey?: string | undefined;
329
- stripDecisionId?: string | undefined;
330
- supersedesLedgerId?: string | undefined;
331
- validatorVerdictId?: string | undefined;
332
- } | undefined;
333
75
  };
334
- /** Build a `merge-return-rejected` record. */
335
- export declare const buildMergeReturnRejectedRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
336
- kind: "merge-return-rejected";
76
+ /** Build a `correction` record. Requires `links.correctsLedgerId`. */
77
+ export declare const buildCorrectionRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
78
+ kind: "correction";
337
79
  }>>) => {
338
- emitter: {
339
- tool: string;
340
- version: string;
341
- user?: string | undefined;
342
- };
343
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
344
- summary: string;
345
- kind: "merge-return-rejected";
346
- payload: {
347
- returnId: string;
348
- reason: string;
349
- briefId?: string | undefined;
350
- source?: string | undefined;
351
- };
352
- details?: Record<string, unknown> | undefined;
353
- idempotencyKey?: string | undefined;
354
- links?: {
80
+ kind: "correction";
81
+ rationale: string;
82
+ details?: {
355
83
  [x: string]: unknown;
356
- affectedFiles?: string[] | undefined;
357
- blobs?: string[] | undefined;
358
- briefId?: string | undefined;
359
- correctsLedgerId?: string | undefined;
360
- gitRef?: string | undefined;
361
- idempotencyKey?: string | undefined;
362
- stripDecisionId?: string | undefined;
363
- supersedesLedgerId?: string | undefined;
364
- validatorVerdictId?: string | undefined;
365
84
  } | undefined;
366
- };
367
- /** Build a `revert` record. */
368
- export declare const buildRevertRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
369
- kind: "revert";
370
- }>>) => {
371
85
  emitter: {
372
86
  tool: string;
373
- version: string;
374
87
  user?: string | undefined;
88
+ version: string;
375
89
  };
376
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
377
- summary: string;
378
- kind: "revert";
379
- payload: {
380
- reason: string;
381
- targetEntryId?: string | undefined;
382
- };
383
- details?: Record<string, unknown> | undefined;
384
90
  idempotencyKey?: string | undefined;
385
- links?: {
386
- [x: string]: unknown;
91
+ links?: ({
387
92
  affectedFiles?: string[] | undefined;
388
93
  blobs?: string[] | undefined;
389
94
  briefId?: string | undefined;
@@ -393,63 +98,32 @@ export declare const buildRevertRecord: (input: BuildRecordInput<Extract<LedgerR
393
98
  stripDecisionId?: string | undefined;
394
99
  supersedesLedgerId?: string | undefined;
395
100
  validatorVerdictId?: string | undefined;
396
- } | undefined;
101
+ } & {
102
+ [key: string]: unknown;
103
+ }) | undefined;
104
+ phase: "capture" | "intake" | "seed" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
105
+ summary: string;
397
106
  };
398
- /** Build a `rollback` record. */
399
- export declare const buildRollbackRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
400
- kind: "rollback";
107
+ /** Build a `strip-decision-reverted` record. */
108
+ export declare const buildStripDecisionRevertedRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
109
+ kind: "strip-decision-reverted";
401
110
  }>>) => {
402
- emitter: {
403
- tool: string;
404
- version: string;
405
- user?: string | undefined;
406
- };
407
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
408
- summary: string;
409
- kind: "rollback";
111
+ kind: "strip-decision-reverted";
410
112
  payload: {
411
- reason: string;
412
- targetEntryId?: string | undefined;
413
- targetStage?: "seed" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | undefined;
113
+ invalidatedStages?: ("intake" | "seed" | "vendor-extract" | "cleanup" | "parity" | "characterize")[] | undefined;
114
+ rationale: string;
115
+ stripDecisionId: string;
414
116
  };
415
- details?: Record<string, unknown> | undefined;
416
- idempotencyKey?: string | undefined;
417
- links?: {
117
+ details?: {
418
118
  [x: string]: unknown;
419
- affectedFiles?: string[] | undefined;
420
- blobs?: string[] | undefined;
421
- briefId?: string | undefined;
422
- correctsLedgerId?: string | undefined;
423
- gitRef?: string | undefined;
424
- idempotencyKey?: string | undefined;
425
- stripDecisionId?: string | undefined;
426
- supersedesLedgerId?: string | undefined;
427
- validatorVerdictId?: string | undefined;
428
119
  } | undefined;
429
- };
430
- /** Build a `rework.test_retired` record. */
431
- export declare const buildReworkTestRetiredRecord: (input: BuildRecordInput<Extract<LedgerRecord, {
432
- kind: "rework.test_retired";
433
- }>>) => {
434
120
  emitter: {
435
121
  tool: string;
436
- version: string;
437
122
  user?: string | undefined;
123
+ version: string;
438
124
  };
439
- phase: "seed" | "capture" | "intake" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
440
- summary: string;
441
- kind: "rework.test_retired";
442
- payload: {
443
- removedBy: "operator" | "descope" | "decompose";
444
- removedTestPath: string;
445
- removedTestSymbols: string[];
446
- sourceSymbolDeletedFrom: string;
447
- briefId?: string | undefined;
448
- };
449
- details?: Record<string, unknown> | undefined;
450
125
  idempotencyKey?: string | undefined;
451
- links?: {
452
- [x: string]: unknown;
126
+ links?: ({
453
127
  affectedFiles?: string[] | undefined;
454
128
  blobs?: string[] | undefined;
455
129
  briefId?: string | undefined;
@@ -459,7 +133,11 @@ export declare const buildReworkTestRetiredRecord: (input: BuildRecordInput<Extr
459
133
  stripDecisionId?: string | undefined;
460
134
  supersedesLedgerId?: string | undefined;
461
135
  validatorVerdictId?: string | undefined;
462
- } | undefined;
136
+ } & {
137
+ [key: string]: unknown;
138
+ }) | undefined;
139
+ phase: "capture" | "intake" | "seed" | "vendor-extract" | "cleanup" | "parity" | "characterize" | "equiv" | "analyze" | "recover" | "ship" | "migration";
140
+ summary: string;
463
141
  };
464
142
  export {};
465
143
  //# sourceMappingURL=builders.d.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,MAAM,gCAAgC,GACzC,OAAO,gBAAgB,CAAC,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,yBAAyB,CAAA;CAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKjF,CAAC"}
package/dist/builders.js CHANGED
@@ -1,73 +1,23 @@
1
- import { AgentPatchRecordSchema, CorrectionRecordSchema, DescopeBriefRecordSchema, MergeReturnRecordSchema, MergeReturnRejectedRecordSchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, OperatorPatchRecordSchema, PatchPayloadWriteSchema, RevertRecordSchema, ReworkTestRetiredRecordSchema, RollbackRecordSchema, StageTransitionRecordSchema, StripDecisionRevertedRecordSchema, ValidatorResultRecordSchema, } from "./schema/entry.js";
2
- import { generateUuidV7 } from "./uuid.js";
3
- /** Build an `agent-patch` record, deriving structured payload fields later if only `diffPath` is supplied. */
4
- export const buildAgentPatchRecord = (input) => AgentPatchRecordSchema.parse({
5
- ...input,
6
- kind: 'agent-patch',
7
- payload: input.payload ? PatchPayloadWriteSchema.parse(input.payload) : undefined,
8
- });
9
- /** Build an `operator-patch` record, deriving structured payload fields later if only `diffPath` is supplied. */
10
- export const buildOperatorPatchRecord = (input) => OperatorPatchRecordSchema.parse({
11
- ...input,
12
- kind: 'operator-patch',
13
- payload: input.payload ? PatchPayloadWriteSchema.parse(input.payload) : undefined,
14
- });
15
- /** Build a `stage-transition` record with a validated structured payload. */
16
- export const buildStageTransitionRecord = (input) => StageTransitionRecordSchema.parse({
17
- ...input,
18
- kind: 'stage-transition',
19
- });
20
- /** Build an `operator-decision` record using the required structured payload shape. */
21
- export const buildOperatorDecisionRecord = (input) => OperatorDecisionRecordSchema.parse({
1
+ import * as v from 'valibot';
2
+ import { CorrectionRecordSchema, OperatorDecisionPayloadSchema, OperatorDecisionRecordSchema, StripDecisionRevertedRecordSchema, ValidatorResultRecordSchema, } from "./schema/entry.js";
3
+ /** Build an `operator-decision` record with a validated structured payload. */
4
+ export const buildOperatorDecisionRecord = (input) => v.parse(OperatorDecisionRecordSchema, {
22
5
  ...input,
23
6
  kind: 'operator-decision',
24
- payload: OperatorDecisionPayloadSchema.parse(input.payload),
7
+ payload: v.parse(OperatorDecisionPayloadSchema, input.payload),
25
8
  });
26
- /** Build a `validator-result` record and synthesize `payload.id` only when the caller omits it. */
27
- export const buildValidatorResultRecord = (input) => ValidatorResultRecordSchema.parse({
9
+ /** Build a `validator-result` record. */
10
+ export const buildValidatorResultRecord = (input) => v.parse(ValidatorResultRecordSchema, {
28
11
  ...input,
29
12
  kind: 'validator-result',
30
- payload: {
31
- id: input.payload?.id ?? generateUuidV7(),
32
- },
33
13
  });
34
- /** Build a `correction` record with validated linkage fields. */
35
- export const buildCorrectionRecord = (input) => CorrectionRecordSchema.parse({
14
+ /** Build a `correction` record. Requires `links.correctsLedgerId`. */
15
+ export const buildCorrectionRecord = (input) => v.parse(CorrectionRecordSchema, {
36
16
  ...input,
37
17
  kind: 'correction',
38
18
  });
39
19
  /** Build a `strip-decision-reverted` record. */
40
- export const buildStripDecisionRevertedRecord = (input) => StripDecisionRevertedRecordSchema.parse({
20
+ export const buildStripDecisionRevertedRecord = (input) => v.parse(StripDecisionRevertedRecordSchema, {
41
21
  ...input,
42
22
  kind: 'strip-decision-reverted',
43
23
  });
44
- /** Build a `descope-brief` record. */
45
- export const buildDescopeBriefRecord = (input) => DescopeBriefRecordSchema.parse({
46
- ...input,
47
- kind: 'descope-brief',
48
- });
49
- /** Build a `merge-return` record. */
50
- export const buildMergeReturnRecord = (input) => MergeReturnRecordSchema.parse({
51
- ...input,
52
- kind: 'merge-return',
53
- });
54
- /** Build a `merge-return-rejected` record. */
55
- export const buildMergeReturnRejectedRecord = (input) => MergeReturnRejectedRecordSchema.parse({
56
- ...input,
57
- kind: 'merge-return-rejected',
58
- });
59
- /** Build a `revert` record. */
60
- export const buildRevertRecord = (input) => RevertRecordSchema.parse({
61
- ...input,
62
- kind: 'revert',
63
- });
64
- /** Build a `rollback` record. */
65
- export const buildRollbackRecord = (input) => RollbackRecordSchema.parse({
66
- ...input,
67
- kind: 'rollback',
68
- });
69
- /** Build a `rework.test_retired` record. */
70
- export const buildReworkTestRetiredRecord = (input) => ReworkTestRetiredRecordSchema.parse({
71
- ...input,
72
- kind: 'rework.test_retired',
73
- });
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAoBA,KAAK,UAAU,GAAG;IACd,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE;QACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,GAAG,aAAa,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CAC1C,CAAC;AA2jBF,eAAO,MAAM,YAAY,GAAU,MAAM,SAAS,MAAM,EAAE,EAAE,UAAS,OAAO,CAAC,UAAU,CAAM,KAAG,OAAO,CAAC,MAAM,CAqC7G,CAAC;AAEF,eAAO,MAAM,IAAI,GAAU,OAAM,SAAS,MAAM,EAA0B,KAAG,OAAO,CAAC,MAAM,CAE1F,CAAC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAoBA,KAAK,UAAU,GAAG;IACd,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE;QACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CA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