@skill-harness/adapters 0.15.0 → 0.17.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.
@@ -0,0 +1,1084 @@
1
+ import { type HypothesisProposal, type Hypothesis, type AdoptionBinding, type AdoptionAuthority, type AdoptionFacts, type RollbackRequest, type ProductionObservation, type BlindQualityChoice } from '@skill-harness/core';
2
+ import { type WorkCaseReviewRequest } from './work-case-review.js';
3
+ import { type LearningCaseReference } from './learning-case.js';
4
+ import { type TrustLifecycleInput } from './trust-lifecycle.js';
5
+ /** Creates only explicitly selected private local directories; never follows a symlink. */
6
+ export declare function prepareLearningDirectory(directory: string): void;
7
+ export interface LearningWorkspaceInput {
8
+ archiveRoot: string;
9
+ scopeDigest: string;
10
+ population: string;
11
+ author: string;
12
+ }
13
+ export interface LearningCaseBinding {
14
+ name: string;
15
+ title: string;
16
+ version: 2 | 3;
17
+ batchId: string;
18
+ }
19
+ export interface LearningComparisonBinding {
20
+ name: string;
21
+ title: string;
22
+ scopeStatement: string;
23
+ comparisonManifestId: string;
24
+ caseReference: LearningCaseReference | null;
25
+ hypothesisManifestId: string | null;
26
+ priorFeedbackManifestIds: string[];
27
+ adoptionBinding: AdoptionBinding | null;
28
+ }
29
+ export interface LearningQualityReview {
30
+ scope: 'full-artifacts';
31
+ note: string;
32
+ reviewedArtifactDigests: string[];
33
+ }
34
+ export interface LearningDecisionRequest {
35
+ disposition: 'adopt' | 'reject' | 'defer';
36
+ note: string;
37
+ priorDecisionId: string | null;
38
+ }
39
+ export interface LearningRegistryReceipt {
40
+ version: 'learning-registry-receipt-v1';
41
+ operation: 'activate' | 'rollback';
42
+ requestId: string;
43
+ adoptionId: string;
44
+ scopeDigest: string;
45
+ candidateDigest: string;
46
+ revision: number;
47
+ /** Exact original registry inspect()/activate()/rollback() response retained by its owner. */
48
+ registryManifestId: string;
49
+ }
50
+ /** Composition over the existing archive and CAS journals. No worker callbacks, model calls,
51
+ * exposure, registry mutation, authentication or hostile-same-UID protection. */
52
+ export declare function createLearningWorkspace(directory: string, input: LearningWorkspaceInput): {
53
+ configuration: () => LearningWorkspaceInput;
54
+ bindSession(raw: {
55
+ name: string;
56
+ title: string;
57
+ manifestId: string;
58
+ }): {
59
+ name: string;
60
+ title: string;
61
+ manifestId: string;
62
+ };
63
+ noteSession(name: string, raw: {
64
+ kind: "finding" | "proposal" | "acceptance" | "context";
65
+ note: string;
66
+ item: number;
67
+ line: number;
68
+ }): {
69
+ author: string;
70
+ kind: "finding" | "proposal" | "acceptance" | "context";
71
+ note: string;
72
+ item: number;
73
+ line: number;
74
+ };
75
+ sessions(): ({
76
+ state: string;
77
+ sessionId: string;
78
+ reason: string;
79
+ name: string;
80
+ title: string;
81
+ manifestId: string;
82
+ } | {
83
+ state: string;
84
+ sessionId: null;
85
+ reason: string;
86
+ name: string;
87
+ title: string;
88
+ manifestId: string;
89
+ })[];
90
+ session(name: string): {
91
+ annotations: {
92
+ kind: string;
93
+ note: string;
94
+ item: number;
95
+ line: number;
96
+ author: string;
97
+ }[];
98
+ acceptance: "not-assessed";
99
+ parent: import("./session-observation.js").SessionObservation;
100
+ children: {
101
+ source: number;
102
+ executionId: string | null;
103
+ session: import("./session-observation.js").SessionObservation;
104
+ }[];
105
+ attempts: import("./session-observation.js").SessionAttempt[];
106
+ gaps: string[];
107
+ version: "retrospective-session-v1";
108
+ manifestId: string;
109
+ selectionDigest: string;
110
+ sources: (import("./session-retention.js").Source & {
111
+ manifestId: string;
112
+ })[];
113
+ name: string;
114
+ title: string;
115
+ };
116
+ dashboardBinding(): {
117
+ trustDirectory: string | null;
118
+ trustPolicyId: string | null;
119
+ };
120
+ preparedAdoption(name: string): Readonly<{
121
+ id: string;
122
+ version: "adoption-receipt-v1";
123
+ bindingId: string;
124
+ authorityId: string;
125
+ hypothesisDigest: string;
126
+ experimentDigest: string;
127
+ candidateDigest: string;
128
+ scopeDigest: string;
129
+ assessmentPolicyDigest: string;
130
+ rollbackCandidateDigest: string;
131
+ activationBoundary: "next-orders";
132
+ grantExpansion: false;
133
+ expiresAt: number;
134
+ }> | null;
135
+ adoptionStatus(name: string): {
136
+ binding: AdoptionBinding | null;
137
+ receipt: Readonly<{
138
+ id: string;
139
+ version: "adoption-receipt-v1";
140
+ bindingId: string;
141
+ authorityId: string;
142
+ hypothesisDigest: string;
143
+ experimentDigest: string;
144
+ candidateDigest: string;
145
+ scopeDigest: string;
146
+ assessmentPolicyDigest: string;
147
+ rollbackCandidateDigest: string;
148
+ activationBoundary: "next-orders";
149
+ grantExpansion: false;
150
+ expiresAt: number;
151
+ }> | null;
152
+ activationManifestId: string | null;
153
+ rollbackManifestId: string | null;
154
+ };
155
+ bindCases(raw: LearningCaseBinding): LearningCaseBinding;
156
+ bindComparison(raw: LearningComparisonBinding): {
157
+ name: string;
158
+ comparisonManifestId: string;
159
+ };
160
+ linkComparisonContext(name: string, context: Pick<LearningComparisonBinding, "caseReference" | "hypothesisManifestId" | "adoptionBinding">): {
161
+ name: string;
162
+ linked: boolean;
163
+ };
164
+ comparisonContext(name: string): {
165
+ caseReference: LearningCaseReference | null;
166
+ hypothesisManifestId: string | null;
167
+ adoptionBinding: AdoptionBinding | null;
168
+ };
169
+ bindTrust(trustDirectory: string): void;
170
+ configureTrust(raw: TrustLifecycleInput, authorizedPolicyDigests: readonly string[]): {
171
+ policyId: string;
172
+ component: import("@skill-harness/core").CalibrationComponent;
173
+ calibration: {
174
+ version: "factory-calibration-v1";
175
+ reports: import("@skill-harness/core").CalibrationReport[];
176
+ excludedTuning: number;
177
+ referenceBasis: "independently-supplied-host-context";
178
+ advisoryOnly: true;
179
+ };
180
+ sampledIncidentIds: string[];
181
+ unflagged: {
182
+ sampled: number;
183
+ resolved: number;
184
+ misses: number;
185
+ unresolved: number;
186
+ conflicted: number;
187
+ };
188
+ attentionUsed: number;
189
+ retired: boolean;
190
+ exposures: {
191
+ mode: "ask" | "silent" | "retire";
192
+ reason: string;
193
+ id: string;
194
+ }[];
195
+ tip: string;
196
+ grantExpansion: false;
197
+ };
198
+ trust(): {
199
+ inspect: (now: number) => {
200
+ policyId: string;
201
+ component: import("@skill-harness/core").CalibrationComponent;
202
+ calibration: {
203
+ version: "factory-calibration-v1";
204
+ reports: import("@skill-harness/core").CalibrationReport[];
205
+ excludedTuning: number;
206
+ referenceBasis: "independently-supplied-host-context";
207
+ advisoryOnly: true;
208
+ };
209
+ sampledIncidentIds: string[];
210
+ unflagged: {
211
+ sampled: number;
212
+ resolved: number;
213
+ misses: number;
214
+ unresolved: number;
215
+ conflicted: number;
216
+ };
217
+ attentionUsed: number;
218
+ retired: boolean;
219
+ exposures: {
220
+ mode: "ask" | "silent" | "retire";
221
+ reason: string;
222
+ id: string;
223
+ }[];
224
+ tip: string;
225
+ grantExpansion: false;
226
+ };
227
+ configuration: () => TrustLifecycleInput;
228
+ previewExposure: (now: number) => {
229
+ mode: "silent" | "ask" | "retire";
230
+ reason: string;
231
+ advisoryOnly: true;
232
+ } | {
233
+ mode: "retire";
234
+ reason: string;
235
+ } | {
236
+ mode: "silent";
237
+ reason: string;
238
+ };
239
+ history: () => import("./learning-journal.js").LearningEvent[];
240
+ previewCaseOutcome: (predictionId: string, reference: LearningCaseReference) => {
241
+ outcome: import("./trust-lifecycle.js").TrustReferenceOutcome;
242
+ caseReference: LearningCaseReference;
243
+ digest: string;
244
+ tip: string;
245
+ };
246
+ linkCaseOutcome(predictionId: string, reference: LearningCaseReference, authorizedDigests: readonly string[], referenceAuthor?: string): void;
247
+ predict(p: import("@skill-harness/core").CalibrationPrediction): void;
248
+ correct(prior: string, p: import("@skill-harness/core").CalibrationPrediction, reason: string): void;
249
+ outcome(value: import("./trust-lifecycle.js").TrustReferenceOutcome, authorizedReferenceDigests: readonly string[], referenceAuthor?: string): void;
250
+ expose(id: string, now: number): {
251
+ replayed: boolean;
252
+ mode: "ask" | "silent" | "retire";
253
+ reason: string;
254
+ } | {
255
+ replayed: boolean;
256
+ mode: "silent" | "ask" | "retire";
257
+ reason: string;
258
+ advisoryOnly: true;
259
+ };
260
+ };
261
+ addUnflagged(raw: {
262
+ name: string;
263
+ title: string;
264
+ manifestId: string;
265
+ split: "calibration" | "heldout" | "tuning";
266
+ }): {
267
+ name: string;
268
+ title: string;
269
+ manifestId: string;
270
+ split: "calibration" | "heldout" | "tuning";
271
+ };
272
+ unflagged(): {
273
+ incidentId: string;
274
+ name: string;
275
+ title: string;
276
+ manifestId: string;
277
+ split: "calibration" | "heldout" | "tuning";
278
+ }[];
279
+ cases(name: string, offset?: number): {
280
+ batchId: string;
281
+ version: 2 | 3;
282
+ observationId: string;
283
+ issues: string[];
284
+ total: number;
285
+ offset: number;
286
+ items: {
287
+ caseManifestId: string;
288
+ candidate: import("@skill-harness/core").WorkCaptureCaseV2 | import("@skill-harness/core").WorkCaptureCaseV3;
289
+ priorDecisionId: string | null;
290
+ disposition: string;
291
+ }[];
292
+ } | {
293
+ batchId: string;
294
+ version: 2 | 3;
295
+ total: number;
296
+ offset: number;
297
+ items: {
298
+ caseManifestId: string;
299
+ candidate: import("@skill-harness/core").WorkCaptureCaseV2;
300
+ priorDecisionId: string | null;
301
+ disposition: string;
302
+ }[];
303
+ };
304
+ caseEvidence(name: string, caseManifestId: string): ({
305
+ status: "missing";
306
+ reason: "manifest" | "content" | "not-retained";
307
+ manifestId: string;
308
+ role: string;
309
+ } | {
310
+ status: "error";
311
+ reason: string;
312
+ manifestId: string;
313
+ role: string;
314
+ } | {
315
+ status: "available";
316
+ reference: import("./evidence-archive.js").ArchiveSourceReference;
317
+ manifestId: string;
318
+ role: string;
319
+ })[];
320
+ readCaseEvidence(name: string, caseManifestId: string, manifestId: string): import("./evidence-archive.js").ArchiveRead;
321
+ decideCase(name: string, request: WorkCaseReviewRequest): {
322
+ current: import("@skill-harness/core").WorkCaseDecision;
323
+ replayed: boolean;
324
+ };
325
+ hypotheses(): {
326
+ hypothesis: Hypothesis;
327
+ name: string;
328
+ manifestId: string;
329
+ }[];
330
+ propose(name: string, proposal: HypothesisProposal, hypothesisName?: string): {
331
+ hypothesis: Hypothesis;
332
+ manifestId: string;
333
+ };
334
+ comparison(name: string): {
335
+ name: string;
336
+ title: string;
337
+ scopeStatement: string;
338
+ mode: "deliberate-review";
339
+ cards: {
340
+ displayLabel: string;
341
+ label: string;
342
+ artifactDigests: string[];
343
+ }[];
344
+ choice: BlindQualityChoice | null;
345
+ qualityScope: string | null;
346
+ priorFeedback: {
347
+ manifestId: string;
348
+ scope: "prior-feedback-only";
349
+ }[];
350
+ decision: {
351
+ disposition: "adopt" | "reject" | "defer";
352
+ note: string;
353
+ priorDecisionId: string | null;
354
+ id: string;
355
+ } | null;
356
+ activation: string;
357
+ rollback: string;
358
+ outcomes: {
359
+ manifestId: unknown;
360
+ classification: Readonly<{
361
+ state: "unknown" | "success" | "out-of-scope" | "changed-requirements" | "changed-artifact" | "caught-defect" | "escape";
362
+ adoptionId: string;
363
+ hypothesisDigest: string;
364
+ experimentDigest: string;
365
+ observationId: string;
366
+ acceptanceDigest: string | null;
367
+ acceptedArtifactDigest: string | null;
368
+ observedArtifactDigest: string;
369
+ automaticRollback: false;
370
+ }>;
371
+ }[];
372
+ adoptionReadiness: {
373
+ state: string;
374
+ reason: string;
375
+ };
376
+ laterOutcomeReadiness: string;
377
+ revealReady: boolean;
378
+ adoptionConfigured: boolean;
379
+ limitations: string[];
380
+ };
381
+ artifact(name: string, label: string, digest: string): Buffer<ArrayBuffer>;
382
+ choose(name: string, raw: BlindQualityChoice, rawReview: LearningQualityReview): Record<string, unknown>;
383
+ reveal(name: string): {
384
+ manifestId: string;
385
+ choice: BlindQualityChoice;
386
+ arms: {
387
+ label: string;
388
+ armId: string;
389
+ configuration: Record<import("@skill-harness/core").InterventionAxis, string>;
390
+ cost: number | null;
391
+ costUnit: string;
392
+ }[];
393
+ routingDefault: null;
394
+ };
395
+ decisionStatus(name: string): {
396
+ name: string;
397
+ title: string;
398
+ scopeStatement: string;
399
+ current: {
400
+ disposition: "adopt" | "reject" | "defer";
401
+ note: string;
402
+ priorDecisionId: string | null;
403
+ id: string;
404
+ } | null;
405
+ };
406
+ decide(name: string, raw: LearningDecisionRequest): {
407
+ disposition: "adopt" | "reject" | "defer";
408
+ note: string;
409
+ priorDecisionId: string | null;
410
+ id: string;
411
+ };
412
+ prepareAdoption(name: string, authority: AdoptionAuthority | null, facts: AdoptionFacts, now: number): Readonly<{
413
+ id: string;
414
+ version: "adoption-receipt-v1";
415
+ bindingId: string;
416
+ authorityId: string;
417
+ hypothesisDigest: string;
418
+ experimentDigest: string;
419
+ candidateDigest: string;
420
+ scopeDigest: string;
421
+ assessmentPolicyDigest: string;
422
+ rollbackCandidateDigest: string;
423
+ activationBoundary: "next-orders";
424
+ grantExpansion: false;
425
+ expiresAt: number;
426
+ }>;
427
+ linkActivation(name: string, manifestId: string, authorizedManifestIds: readonly string[]): LearningRegistryReceipt;
428
+ previewRollback(name: string, reason: RollbackRequest["reason"], evidence: string[], expiresAt?: number): RollbackRequest;
429
+ prepareRollback(name: string, request: RollbackRequest, authority: AdoptionAuthority | null, now: number, current: {
430
+ adoptionId: string;
431
+ candidateDigest: string;
432
+ scopeDigest: string;
433
+ }): Readonly<{
434
+ requestId: string;
435
+ adoptionId: string;
436
+ restoreCandidateDigest: string;
437
+ scopeDigest: string;
438
+ grantExpansion: false;
439
+ application: "not-performed";
440
+ }>;
441
+ linkRollback(name: string, manifestId: string, authorizedManifestIds: readonly string[]): LearningRegistryReceipt;
442
+ previewObservation(name: string, raw: ProductionObservation): {
443
+ observation: ProductionObservation;
444
+ classification: Readonly<{
445
+ state: "unknown" | "success" | "out-of-scope" | "changed-requirements" | "changed-artifact" | "caught-defect" | "escape";
446
+ adoptionId: string;
447
+ hypothesisDigest: string;
448
+ experimentDigest: string;
449
+ observationId: string;
450
+ acceptanceDigest: string | null;
451
+ acceptedArtifactDigest: string | null;
452
+ observedArtifactDigest: string;
453
+ automaticRollback: false;
454
+ }>;
455
+ digest: string;
456
+ };
457
+ observe(name: string, raw: ProductionObservation, authorizedDigests: readonly string[], referenceAuthor?: string): Record<string, unknown>;
458
+ lifecycle(name: string): {
459
+ state: string;
460
+ manifestId: null;
461
+ } | {
462
+ state: string;
463
+ manifestId: string;
464
+ };
465
+ inspect(now: number): {
466
+ version: "learning-workspace-view-v1";
467
+ configuration: LearningWorkspaceInput;
468
+ mode: "deliberate-review";
469
+ sessions: ({
470
+ state: string;
471
+ sessionId: string;
472
+ reason: string;
473
+ name: string;
474
+ title: string;
475
+ manifestId: string;
476
+ } | {
477
+ state: string;
478
+ sessionId: null;
479
+ reason: string;
480
+ name: string;
481
+ title: string;
482
+ manifestId: string;
483
+ })[];
484
+ cases: ({
485
+ name: string;
486
+ title: string;
487
+ state: string;
488
+ total: number;
489
+ reason: string;
490
+ } | {
491
+ name: string;
492
+ title: string;
493
+ state: string;
494
+ total: null;
495
+ reason: string;
496
+ })[];
497
+ comparisons: ({
498
+ name: string;
499
+ title: string;
500
+ scopeStatement: string;
501
+ mode: "deliberate-review";
502
+ cards: {
503
+ displayLabel: string;
504
+ label: string;
505
+ artifactDigests: string[];
506
+ }[];
507
+ choice: BlindQualityChoice | null;
508
+ qualityScope: string | null;
509
+ priorFeedback: {
510
+ manifestId: string;
511
+ scope: "prior-feedback-only";
512
+ }[];
513
+ decision: {
514
+ disposition: "adopt" | "reject" | "defer";
515
+ note: string;
516
+ priorDecisionId: string | null;
517
+ id: string;
518
+ } | null;
519
+ activation: string;
520
+ rollback: string;
521
+ outcomes: {
522
+ manifestId: unknown;
523
+ classification: Readonly<{
524
+ state: "unknown" | "success" | "out-of-scope" | "changed-requirements" | "changed-artifact" | "caught-defect" | "escape";
525
+ adoptionId: string;
526
+ hypothesisDigest: string;
527
+ experimentDigest: string;
528
+ observationId: string;
529
+ acceptanceDigest: string | null;
530
+ acceptedArtifactDigest: string | null;
531
+ observedArtifactDigest: string;
532
+ automaticRollback: false;
533
+ }>;
534
+ }[];
535
+ adoptionReadiness: {
536
+ state: string;
537
+ reason: string;
538
+ };
539
+ laterOutcomeReadiness: string;
540
+ revealReady: boolean;
541
+ adoptionConfigured: boolean;
542
+ limitations: string[];
543
+ state: string;
544
+ reason: string;
545
+ } | {
546
+ name: string;
547
+ title: string;
548
+ state: string;
549
+ reason: string;
550
+ decision: {
551
+ disposition: "adopt" | "reject" | "defer";
552
+ note: string;
553
+ priorDecisionId: string | null;
554
+ id: string;
555
+ } | null;
556
+ })[];
557
+ trust: Record<string, unknown>;
558
+ automaticExposureReserved: boolean;
559
+ delegationStarted: boolean;
560
+ acceptance: "not-assessed";
561
+ };
562
+ };
563
+ export declare function openLearningWorkspace(directory: string): {
564
+ configuration: () => LearningWorkspaceInput;
565
+ bindSession(raw: {
566
+ name: string;
567
+ title: string;
568
+ manifestId: string;
569
+ }): {
570
+ name: string;
571
+ title: string;
572
+ manifestId: string;
573
+ };
574
+ noteSession(name: string, raw: {
575
+ kind: "finding" | "proposal" | "acceptance" | "context";
576
+ note: string;
577
+ item: number;
578
+ line: number;
579
+ }): {
580
+ author: string;
581
+ kind: "finding" | "proposal" | "acceptance" | "context";
582
+ note: string;
583
+ item: number;
584
+ line: number;
585
+ };
586
+ sessions(): ({
587
+ state: string;
588
+ sessionId: string;
589
+ reason: string;
590
+ name: string;
591
+ title: string;
592
+ manifestId: string;
593
+ } | {
594
+ state: string;
595
+ sessionId: null;
596
+ reason: string;
597
+ name: string;
598
+ title: string;
599
+ manifestId: string;
600
+ })[];
601
+ session(name: string): {
602
+ annotations: {
603
+ kind: string;
604
+ note: string;
605
+ item: number;
606
+ line: number;
607
+ author: string;
608
+ }[];
609
+ acceptance: "not-assessed";
610
+ parent: import("./session-observation.js").SessionObservation;
611
+ children: {
612
+ source: number;
613
+ executionId: string | null;
614
+ session: import("./session-observation.js").SessionObservation;
615
+ }[];
616
+ attempts: import("./session-observation.js").SessionAttempt[];
617
+ gaps: string[];
618
+ version: "retrospective-session-v1";
619
+ manifestId: string;
620
+ selectionDigest: string;
621
+ sources: (import("./session-retention.js").Source & {
622
+ manifestId: string;
623
+ })[];
624
+ name: string;
625
+ title: string;
626
+ };
627
+ dashboardBinding(): {
628
+ trustDirectory: string | null;
629
+ trustPolicyId: string | null;
630
+ };
631
+ preparedAdoption(name: string): Readonly<{
632
+ id: string;
633
+ version: "adoption-receipt-v1";
634
+ bindingId: string;
635
+ authorityId: string;
636
+ hypothesisDigest: string;
637
+ experimentDigest: string;
638
+ candidateDigest: string;
639
+ scopeDigest: string;
640
+ assessmentPolicyDigest: string;
641
+ rollbackCandidateDigest: string;
642
+ activationBoundary: "next-orders";
643
+ grantExpansion: false;
644
+ expiresAt: number;
645
+ }> | null;
646
+ adoptionStatus(name: string): {
647
+ binding: AdoptionBinding | null;
648
+ receipt: Readonly<{
649
+ id: string;
650
+ version: "adoption-receipt-v1";
651
+ bindingId: string;
652
+ authorityId: string;
653
+ hypothesisDigest: string;
654
+ experimentDigest: string;
655
+ candidateDigest: string;
656
+ scopeDigest: string;
657
+ assessmentPolicyDigest: string;
658
+ rollbackCandidateDigest: string;
659
+ activationBoundary: "next-orders";
660
+ grantExpansion: false;
661
+ expiresAt: number;
662
+ }> | null;
663
+ activationManifestId: string | null;
664
+ rollbackManifestId: string | null;
665
+ };
666
+ bindCases(raw: LearningCaseBinding): LearningCaseBinding;
667
+ bindComparison(raw: LearningComparisonBinding): {
668
+ name: string;
669
+ comparisonManifestId: string;
670
+ };
671
+ linkComparisonContext(name: string, context: Pick<LearningComparisonBinding, "caseReference" | "hypothesisManifestId" | "adoptionBinding">): {
672
+ name: string;
673
+ linked: boolean;
674
+ };
675
+ comparisonContext(name: string): {
676
+ caseReference: LearningCaseReference | null;
677
+ hypothesisManifestId: string | null;
678
+ adoptionBinding: AdoptionBinding | null;
679
+ };
680
+ bindTrust(trustDirectory: string): void;
681
+ configureTrust(raw: TrustLifecycleInput, authorizedPolicyDigests: readonly string[]): {
682
+ policyId: string;
683
+ component: import("@skill-harness/core").CalibrationComponent;
684
+ calibration: {
685
+ version: "factory-calibration-v1";
686
+ reports: import("@skill-harness/core").CalibrationReport[];
687
+ excludedTuning: number;
688
+ referenceBasis: "independently-supplied-host-context";
689
+ advisoryOnly: true;
690
+ };
691
+ sampledIncidentIds: string[];
692
+ unflagged: {
693
+ sampled: number;
694
+ resolved: number;
695
+ misses: number;
696
+ unresolved: number;
697
+ conflicted: number;
698
+ };
699
+ attentionUsed: number;
700
+ retired: boolean;
701
+ exposures: {
702
+ mode: "ask" | "silent" | "retire";
703
+ reason: string;
704
+ id: string;
705
+ }[];
706
+ tip: string;
707
+ grantExpansion: false;
708
+ };
709
+ trust(): {
710
+ inspect: (now: number) => {
711
+ policyId: string;
712
+ component: import("@skill-harness/core").CalibrationComponent;
713
+ calibration: {
714
+ version: "factory-calibration-v1";
715
+ reports: import("@skill-harness/core").CalibrationReport[];
716
+ excludedTuning: number;
717
+ referenceBasis: "independently-supplied-host-context";
718
+ advisoryOnly: true;
719
+ };
720
+ sampledIncidentIds: string[];
721
+ unflagged: {
722
+ sampled: number;
723
+ resolved: number;
724
+ misses: number;
725
+ unresolved: number;
726
+ conflicted: number;
727
+ };
728
+ attentionUsed: number;
729
+ retired: boolean;
730
+ exposures: {
731
+ mode: "ask" | "silent" | "retire";
732
+ reason: string;
733
+ id: string;
734
+ }[];
735
+ tip: string;
736
+ grantExpansion: false;
737
+ };
738
+ configuration: () => TrustLifecycleInput;
739
+ previewExposure: (now: number) => {
740
+ mode: "silent" | "ask" | "retire";
741
+ reason: string;
742
+ advisoryOnly: true;
743
+ } | {
744
+ mode: "retire";
745
+ reason: string;
746
+ } | {
747
+ mode: "silent";
748
+ reason: string;
749
+ };
750
+ history: () => import("./learning-journal.js").LearningEvent[];
751
+ previewCaseOutcome: (predictionId: string, reference: LearningCaseReference) => {
752
+ outcome: import("./trust-lifecycle.js").TrustReferenceOutcome;
753
+ caseReference: LearningCaseReference;
754
+ digest: string;
755
+ tip: string;
756
+ };
757
+ linkCaseOutcome(predictionId: string, reference: LearningCaseReference, authorizedDigests: readonly string[], referenceAuthor?: string): void;
758
+ predict(p: import("@skill-harness/core").CalibrationPrediction): void;
759
+ correct(prior: string, p: import("@skill-harness/core").CalibrationPrediction, reason: string): void;
760
+ outcome(value: import("./trust-lifecycle.js").TrustReferenceOutcome, authorizedReferenceDigests: readonly string[], referenceAuthor?: string): void;
761
+ expose(id: string, now: number): {
762
+ replayed: boolean;
763
+ mode: "ask" | "silent" | "retire";
764
+ reason: string;
765
+ } | {
766
+ replayed: boolean;
767
+ mode: "silent" | "ask" | "retire";
768
+ reason: string;
769
+ advisoryOnly: true;
770
+ };
771
+ };
772
+ addUnflagged(raw: {
773
+ name: string;
774
+ title: string;
775
+ manifestId: string;
776
+ split: "calibration" | "heldout" | "tuning";
777
+ }): {
778
+ name: string;
779
+ title: string;
780
+ manifestId: string;
781
+ split: "calibration" | "heldout" | "tuning";
782
+ };
783
+ unflagged(): {
784
+ incidentId: string;
785
+ name: string;
786
+ title: string;
787
+ manifestId: string;
788
+ split: "calibration" | "heldout" | "tuning";
789
+ }[];
790
+ cases(name: string, offset?: number): {
791
+ batchId: string;
792
+ version: 2 | 3;
793
+ observationId: string;
794
+ issues: string[];
795
+ total: number;
796
+ offset: number;
797
+ items: {
798
+ caseManifestId: string;
799
+ candidate: import("@skill-harness/core").WorkCaptureCaseV2 | import("@skill-harness/core").WorkCaptureCaseV3;
800
+ priorDecisionId: string | null;
801
+ disposition: string;
802
+ }[];
803
+ } | {
804
+ batchId: string;
805
+ version: 2 | 3;
806
+ total: number;
807
+ offset: number;
808
+ items: {
809
+ caseManifestId: string;
810
+ candidate: import("@skill-harness/core").WorkCaptureCaseV2;
811
+ priorDecisionId: string | null;
812
+ disposition: string;
813
+ }[];
814
+ };
815
+ caseEvidence(name: string, caseManifestId: string): ({
816
+ status: "missing";
817
+ reason: "manifest" | "content" | "not-retained";
818
+ manifestId: string;
819
+ role: string;
820
+ } | {
821
+ status: "error";
822
+ reason: string;
823
+ manifestId: string;
824
+ role: string;
825
+ } | {
826
+ status: "available";
827
+ reference: import("./evidence-archive.js").ArchiveSourceReference;
828
+ manifestId: string;
829
+ role: string;
830
+ })[];
831
+ readCaseEvidence(name: string, caseManifestId: string, manifestId: string): import("./evidence-archive.js").ArchiveRead;
832
+ decideCase(name: string, request: WorkCaseReviewRequest): {
833
+ current: import("@skill-harness/core").WorkCaseDecision;
834
+ replayed: boolean;
835
+ };
836
+ hypotheses(): {
837
+ hypothesis: Hypothesis;
838
+ name: string;
839
+ manifestId: string;
840
+ }[];
841
+ propose(name: string, proposal: HypothesisProposal, hypothesisName?: string): {
842
+ hypothesis: Hypothesis;
843
+ manifestId: string;
844
+ };
845
+ comparison(name: string): {
846
+ name: string;
847
+ title: string;
848
+ scopeStatement: string;
849
+ mode: "deliberate-review";
850
+ cards: {
851
+ displayLabel: string;
852
+ label: string;
853
+ artifactDigests: string[];
854
+ }[];
855
+ choice: BlindQualityChoice | null;
856
+ qualityScope: string | null;
857
+ priorFeedback: {
858
+ manifestId: string;
859
+ scope: "prior-feedback-only";
860
+ }[];
861
+ decision: {
862
+ disposition: "adopt" | "reject" | "defer";
863
+ note: string;
864
+ priorDecisionId: string | null;
865
+ id: string;
866
+ } | null;
867
+ activation: string;
868
+ rollback: string;
869
+ outcomes: {
870
+ manifestId: unknown;
871
+ classification: Readonly<{
872
+ state: "unknown" | "success" | "out-of-scope" | "changed-requirements" | "changed-artifact" | "caught-defect" | "escape";
873
+ adoptionId: string;
874
+ hypothesisDigest: string;
875
+ experimentDigest: string;
876
+ observationId: string;
877
+ acceptanceDigest: string | null;
878
+ acceptedArtifactDigest: string | null;
879
+ observedArtifactDigest: string;
880
+ automaticRollback: false;
881
+ }>;
882
+ }[];
883
+ adoptionReadiness: {
884
+ state: string;
885
+ reason: string;
886
+ };
887
+ laterOutcomeReadiness: string;
888
+ revealReady: boolean;
889
+ adoptionConfigured: boolean;
890
+ limitations: string[];
891
+ };
892
+ artifact(name: string, label: string, digest: string): Buffer<ArrayBuffer>;
893
+ choose(name: string, raw: BlindQualityChoice, rawReview: LearningQualityReview): Record<string, unknown>;
894
+ reveal(name: string): {
895
+ manifestId: string;
896
+ choice: BlindQualityChoice;
897
+ arms: {
898
+ label: string;
899
+ armId: string;
900
+ configuration: Record<import("@skill-harness/core").InterventionAxis, string>;
901
+ cost: number | null;
902
+ costUnit: string;
903
+ }[];
904
+ routingDefault: null;
905
+ };
906
+ decisionStatus(name: string): {
907
+ name: string;
908
+ title: string;
909
+ scopeStatement: string;
910
+ current: {
911
+ disposition: "adopt" | "reject" | "defer";
912
+ note: string;
913
+ priorDecisionId: string | null;
914
+ id: string;
915
+ } | null;
916
+ };
917
+ decide(name: string, raw: LearningDecisionRequest): {
918
+ disposition: "adopt" | "reject" | "defer";
919
+ note: string;
920
+ priorDecisionId: string | null;
921
+ id: string;
922
+ };
923
+ prepareAdoption(name: string, authority: AdoptionAuthority | null, facts: AdoptionFacts, now: number): Readonly<{
924
+ id: string;
925
+ version: "adoption-receipt-v1";
926
+ bindingId: string;
927
+ authorityId: string;
928
+ hypothesisDigest: string;
929
+ experimentDigest: string;
930
+ candidateDigest: string;
931
+ scopeDigest: string;
932
+ assessmentPolicyDigest: string;
933
+ rollbackCandidateDigest: string;
934
+ activationBoundary: "next-orders";
935
+ grantExpansion: false;
936
+ expiresAt: number;
937
+ }>;
938
+ linkActivation(name: string, manifestId: string, authorizedManifestIds: readonly string[]): LearningRegistryReceipt;
939
+ previewRollback(name: string, reason: RollbackRequest["reason"], evidence: string[], expiresAt?: number): RollbackRequest;
940
+ prepareRollback(name: string, request: RollbackRequest, authority: AdoptionAuthority | null, now: number, current: {
941
+ adoptionId: string;
942
+ candidateDigest: string;
943
+ scopeDigest: string;
944
+ }): Readonly<{
945
+ requestId: string;
946
+ adoptionId: string;
947
+ restoreCandidateDigest: string;
948
+ scopeDigest: string;
949
+ grantExpansion: false;
950
+ application: "not-performed";
951
+ }>;
952
+ linkRollback(name: string, manifestId: string, authorizedManifestIds: readonly string[]): LearningRegistryReceipt;
953
+ previewObservation(name: string, raw: ProductionObservation): {
954
+ observation: ProductionObservation;
955
+ classification: Readonly<{
956
+ state: "unknown" | "success" | "out-of-scope" | "changed-requirements" | "changed-artifact" | "caught-defect" | "escape";
957
+ adoptionId: string;
958
+ hypothesisDigest: string;
959
+ experimentDigest: string;
960
+ observationId: string;
961
+ acceptanceDigest: string | null;
962
+ acceptedArtifactDigest: string | null;
963
+ observedArtifactDigest: string;
964
+ automaticRollback: false;
965
+ }>;
966
+ digest: string;
967
+ };
968
+ observe(name: string, raw: ProductionObservation, authorizedDigests: readonly string[], referenceAuthor?: string): Record<string, unknown>;
969
+ lifecycle(name: string): {
970
+ state: string;
971
+ manifestId: null;
972
+ } | {
973
+ state: string;
974
+ manifestId: string;
975
+ };
976
+ inspect(now: number): {
977
+ version: "learning-workspace-view-v1";
978
+ configuration: LearningWorkspaceInput;
979
+ mode: "deliberate-review";
980
+ sessions: ({
981
+ state: string;
982
+ sessionId: string;
983
+ reason: string;
984
+ name: string;
985
+ title: string;
986
+ manifestId: string;
987
+ } | {
988
+ state: string;
989
+ sessionId: null;
990
+ reason: string;
991
+ name: string;
992
+ title: string;
993
+ manifestId: string;
994
+ })[];
995
+ cases: ({
996
+ name: string;
997
+ title: string;
998
+ state: string;
999
+ total: number;
1000
+ reason: string;
1001
+ } | {
1002
+ name: string;
1003
+ title: string;
1004
+ state: string;
1005
+ total: null;
1006
+ reason: string;
1007
+ })[];
1008
+ comparisons: ({
1009
+ name: string;
1010
+ title: string;
1011
+ scopeStatement: string;
1012
+ mode: "deliberate-review";
1013
+ cards: {
1014
+ displayLabel: string;
1015
+ label: string;
1016
+ artifactDigests: string[];
1017
+ }[];
1018
+ choice: BlindQualityChoice | null;
1019
+ qualityScope: string | null;
1020
+ priorFeedback: {
1021
+ manifestId: string;
1022
+ scope: "prior-feedback-only";
1023
+ }[];
1024
+ decision: {
1025
+ disposition: "adopt" | "reject" | "defer";
1026
+ note: string;
1027
+ priorDecisionId: string | null;
1028
+ id: string;
1029
+ } | null;
1030
+ activation: string;
1031
+ rollback: string;
1032
+ outcomes: {
1033
+ manifestId: unknown;
1034
+ classification: Readonly<{
1035
+ state: "unknown" | "success" | "out-of-scope" | "changed-requirements" | "changed-artifact" | "caught-defect" | "escape";
1036
+ adoptionId: string;
1037
+ hypothesisDigest: string;
1038
+ experimentDigest: string;
1039
+ observationId: string;
1040
+ acceptanceDigest: string | null;
1041
+ acceptedArtifactDigest: string | null;
1042
+ observedArtifactDigest: string;
1043
+ automaticRollback: false;
1044
+ }>;
1045
+ }[];
1046
+ adoptionReadiness: {
1047
+ state: string;
1048
+ reason: string;
1049
+ };
1050
+ laterOutcomeReadiness: string;
1051
+ revealReady: boolean;
1052
+ adoptionConfigured: boolean;
1053
+ limitations: string[];
1054
+ state: string;
1055
+ reason: string;
1056
+ } | {
1057
+ name: string;
1058
+ title: string;
1059
+ state: string;
1060
+ reason: string;
1061
+ decision: {
1062
+ disposition: "adopt" | "reject" | "defer";
1063
+ note: string;
1064
+ priorDecisionId: string | null;
1065
+ id: string;
1066
+ } | null;
1067
+ })[];
1068
+ trust: Record<string, unknown>;
1069
+ automaticExposureReserved: boolean;
1070
+ delegationStarted: boolean;
1071
+ acceptance: "not-assessed";
1072
+ };
1073
+ };
1074
+ /** Explicit operator-selected archive inventory, not discovery of private sessions. Names/indices
1075
+ * are presentation only; callers bind the full immutable manifest before any decision. */
1076
+ export interface LearningCatalogItem {
1077
+ kind: 'cases' | 'comparison';
1078
+ manifestId: string;
1079
+ version: 1 | 2 | 3;
1080
+ description: string;
1081
+ scopeDigest?: string;
1082
+ population?: string;
1083
+ }
1084
+ export declare function catalogLearningArchive(root: string, author: string): LearningCatalogItem[];