@agentskit/harness 0.1.0 → 0.4.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 (42) hide show
  1. package/CHANGELOG.md +33 -32
  2. package/CONTRIBUTING.md +60 -12
  3. package/MANIFESTO.md +23 -0
  4. package/README.md +276 -144
  5. package/capabilities/public-surface.json +668 -0
  6. package/compatibility/manifest.json +17 -0
  7. package/compatibility/migration.md +10 -0
  8. package/compatibility/report.json +23 -0
  9. package/compatibility/report.md +22 -0
  10. package/compatibility/rollback.md +8 -0
  11. package/dist/cli.js +958 -239
  12. package/dist/cli.js.map +1 -1
  13. package/dist/index.d.ts +1338 -122
  14. package/dist/index.js +2273 -353
  15. package/dist/index.js.map +1 -1
  16. package/docs/ADR-0025-portable-orchestration-controls.md +27 -0
  17. package/docs/ADR-0026-kernel-adapters-boundary.md +82 -0
  18. package/docs/GETTING-STARTED.md +18 -0
  19. package/docs/MODULE-BOUNDARIES.md +143 -0
  20. package/docs/ORGANIZATION.md +46 -0
  21. package/docs/TROUBLESHOOTING.md +24 -0
  22. package/examples/minimum-profile.mjs +27 -0
  23. package/package.json +52 -34
  24. package/release/manifest.json +14 -0
  25. package/release/notes.md +10 -0
  26. package/release/qualification.json +14 -0
  27. package/docs/ADR-0025-ci-dogfood.md +0 -22
  28. package/docs/ADR-0026-ci-evidence-artifact.md +0 -22
  29. package/docs/ADR-0027-portable-evidence.md +0 -19
  30. package/docs/ADR-0028-effective-metrics.md +0 -20
  31. package/docs/ADR-0029-honest-ci-preparation.md +0 -20
  32. package/docs/ADR-0030-agentskit-os-benchmark-bridge.md +0 -20
  33. package/docs/ADR-0031-real-provider-baseline.md +0 -18
  34. package/docs/ADR-0032-harness-equivalent-benchmark.md +0 -25
  35. package/docs/ADR-0033-portable-agent-gate.md +0 -25
  36. package/docs/ADR-0034-measurement-quality-gates.md +0 -25
  37. package/docs/ADR-0035-reproducible-benchmark-samples.md +0 -20
  38. package/docs/ADR-0036-comparable-baseline-samples.md +0 -20
  39. package/docs/ADR-0037-replicated-baseline-collection.md +0 -27
  40. package/docs/ADR-0038-end-to-end-benchmark-boundary.md +0 -28
  41. package/docs/ADR-0039-artifact-and-protocol-metrics.md +0 -39
  42. package/docs/ADR-0040-benchmark-corpus-surfaces.md +0 -32
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ declare const LEGAL_TRANSITIONS: {
3
3
  readonly CLARIFYING: readonly ["PLANNED", "BLOCKED", "CANCELLED"];
4
4
  readonly PLANNED: readonly ["IMPLEMENTING", "CLARIFYING", "STALE", "CANCELLED"];
5
5
  readonly IMPLEMENTING: readonly ["VERIFYING", "CLARIFYING", "STALE", "CANCELLED"];
6
- readonly VERIFYING: readonly ["AWAITING_HUMAN_APPROVAL", "BLOCKED", "STALE", "CANCELLED"];
6
+ readonly VERIFYING: readonly ["AWAITING_HUMAN_APPROVAL", "COMPLETE", "BLOCKED", "STALE", "CANCELLED"];
7
7
  readonly AWAITING_HUMAN_APPROVAL: readonly ["AWAITING_AUTHORIZATION", "COMPLETE", "BLOCKED", "IMPLEMENTING", "STALE", "CANCELLED"];
8
8
  readonly AWAITING_AUTHORIZATION: readonly ["COMPLETE", "BLOCKED", "IMPLEMENTING", "STALE", "CANCELLED"];
9
9
  readonly COMPLETE: readonly ["STALE", "SUPERSEDED"];
@@ -13,12 +13,50 @@ declare const LEGAL_TRANSITIONS: {
13
13
  readonly SUPERSEDED: readonly [];
14
14
  };
15
15
 
16
- type HarnessErrorCode = 'HARNESS_ERROR' | 'INVALID_CONFIG' | 'INVALID_INPUT' | 'INVALID_STATE' | 'POLICY_BLOCKED' | 'CLARIFYING' | 'STALE' | 'WORKTREE_DIRTY' | 'ACTIVE_RUN' | 'NO_RUN' | 'HUMAN_APPROVAL_REQUIRED';
16
+ declare const HARNESS_ERROR_CODES: readonly ["HARNESS_ERROR", "INVALID_CONFIG", "INVALID_INPUT", "INVALID_STATE", "POLICY_BLOCKED", "CLARIFYING", "STALE", "WORKTREE_DIRTY", "ACTIVE_RUN", "NO_RUN", "HUMAN_APPROVAL_REQUIRED", "GIT_REQUIRED"];
17
+ type HarnessErrorCode = typeof HARNESS_ERROR_CODES[number];
17
18
  declare class HarnessError extends Error {
18
19
  readonly code: HarnessErrorCode;
19
20
  constructor(message: string, code?: HarnessErrorCode);
20
21
  }
21
22
 
23
+ type HarnessErrorDisposition = 'retry' | 'block' | 'escalate';
24
+ interface HarnessErrorClassification {
25
+ readonly code: HarnessErrorCode;
26
+ readonly disposition: HarnessErrorDisposition;
27
+ readonly retryable: boolean;
28
+ readonly message: string;
29
+ }
30
+ type ErrorDescriptor = Readonly<Pick<HarnessErrorClassification, 'disposition' | 'retryable'>>;
31
+ declare const HARNESS_ERROR_CATALOG: Readonly<Record<HarnessErrorCode, ErrorDescriptor>>;
32
+ declare const classifyHarnessError: (error: unknown) => HarnessErrorClassification;
33
+ declare const validateHarnessErrorClassification: (value: unknown) => HarnessErrorClassification;
34
+
35
+ declare const ASSURANCE_LEVELS: readonly ["unverified", "contract-tested", "runtime-attested"];
36
+ type AssuranceLevel = typeof ASSURANCE_LEVELS[number];
37
+ interface AdapterTelemetry {
38
+ readonly status: 'measured' | 'unknown';
39
+ readonly durationMs?: number;
40
+ readonly inputTokens?: number;
41
+ readonly outputTokens?: number;
42
+ readonly totalTokens?: number;
43
+ readonly cacheHits?: number;
44
+ readonly cacheMisses?: number;
45
+ readonly memoryReads?: number;
46
+ readonly memoryWrites?: number;
47
+ readonly memoryRelevantHits?: number;
48
+ readonly memoryStaleHits?: number;
49
+ readonly contextReferences?: number;
50
+ readonly contextCostTokens?: number;
51
+ readonly externalMutations?: number;
52
+ }
53
+ interface AdapterMetadata {
54
+ readonly assurance: AssuranceLevel;
55
+ readonly telemetry: AdapterTelemetry;
56
+ }
57
+ declare const validateAdapterMetadata: (value: unknown) => AdapterMetadata;
58
+ declare const unknownTelemetry: () => AdapterTelemetry;
59
+
22
60
  interface ToolExecutionRequest {
23
61
  readonly actionId: string;
24
62
  readonly turnId: string;
@@ -32,6 +70,9 @@ interface ToolDefinition {
32
70
  readonly execute: (request: ToolExecutionRequest) => Promise<unknown> | unknown;
33
71
  }
34
72
  interface ToolRuntime {
73
+ readonly assurance?: AssuranceLevel;
74
+ readonly isolation?: 'none' | 'sandboxed';
75
+ readonly telemetry?: () => AdapterTelemetry;
35
76
  execute(request: Omit<ToolExecutionRequest, 'signal'>): Promise<ToolExecutionResult>;
36
77
  }
37
78
  interface ProcessToolDefinition {
@@ -69,6 +110,11 @@ interface DockerRuntimeEvidence {
69
110
  readonly cpus: string;
70
111
  readonly pidsLimit: number;
71
112
  }
113
+ declare const createConfiguredToolRuntime: ({ runtime, process, docker }: {
114
+ readonly runtime: RuntimeConfig;
115
+ readonly process: Parameters<typeof createProcessToolRuntime>[0];
116
+ readonly docker: Parameters<typeof createDockerToolRuntime>[0];
117
+ }) => ToolRuntime;
72
118
  type ToolExecutionResult = {
73
119
  readonly status: 'completed';
74
120
  readonly resultHash: string;
@@ -103,9 +149,42 @@ declare const createDockerToolRuntime: ({ tools, timeoutMs, maxOutputBytes, dock
103
149
  }) => ToolRuntime;
104
150
 
105
151
  declare const HARNESS_EVENT_SCHEMA_VERSION: 1;
152
+ declare const HARNESS_EVENT_ENVELOPE_SCHEMA_VERSION: 2;
106
153
  declare const EVENT_LOG_GENESIS: "GENESIS";
107
- declare const HARNESS_EVENT_TYPES: readonly ["run.created", "state.transitioned", "context.attached", "verification.completed", "approval.recorded", "authorization.recorded", "session.started", "session.resumed", "agent.turn.started", "policy.evaluated", "tool.approval.requested", "tool.approval.recorded", "tool.requested", "tool.execution.started", "tool.recovery.recorded", "tool.blocked", "tool.completed", "tool.failed", "session.ended"];
154
+ declare const HARNESS_EVENT_TYPES: readonly ["run.created", "state.transitioned", "context.attached", "verification.completed", "artifact.recorded", "approval.recorded", "authorization.recorded", "session.started", "session.resumed", "agent.turn.started", "policy.evaluated", "tool.approval.requested", "tool.approval.recorded", "tool.requested", "tool.execution.started", "tool.recovery.recorded", "tool.blocked", "tool.completed", "tool.failed", "session.ended"];
108
155
  type HarnessEventType = typeof HARNESS_EVENT_TYPES[number];
156
+ interface HarnessEventProvenance {
157
+ readonly source: string;
158
+ readonly component: string;
159
+ readonly version: string;
160
+ readonly actor?: string;
161
+ }
162
+ interface HarnessEventEnvelope {
163
+ readonly eventId: string;
164
+ readonly eventType: string;
165
+ readonly schemaVersion: typeof HARNESS_EVENT_ENVELOPE_SCHEMA_VERSION;
166
+ readonly occurredAt: string;
167
+ readonly runId: string;
168
+ readonly issueRef?: string;
169
+ readonly sourceRevision: string;
170
+ readonly correlationId: string;
171
+ readonly payload: Readonly<Record<string, unknown>>;
172
+ readonly idempotencyKey: string;
173
+ readonly provenance: HarnessEventProvenance;
174
+ }
175
+ type HarnessEventEnvelopeInput = Omit<HarnessEventEnvelope, 'schemaVersion' | 'idempotencyKey'> & {
176
+ readonly idempotencyKey?: string;
177
+ };
178
+ declare const validateHarnessEventEnvelope: (value: unknown) => HarnessEventEnvelope;
179
+ declare const createHarnessEventEnvelope: (input: HarnessEventEnvelopeInput) => HarnessEventEnvelope;
180
+ interface HarnessEventContext {
181
+ readonly operationId: string;
182
+ readonly runId?: string;
183
+ readonly sessionId?: string;
184
+ readonly turnId?: string;
185
+ readonly actionId?: string;
186
+ readonly traceId?: string;
187
+ }
109
188
  interface HarnessEventPayloads {
110
189
  readonly 'run.created': {
111
190
  readonly project: string;
@@ -132,6 +211,14 @@ interface HarnessEventPayloads {
132
211
  readonly totalDurationMs: number;
133
212
  readonly budgetExceeded: boolean;
134
213
  };
214
+ readonly 'artifact.recorded': {
215
+ readonly artifactId: string;
216
+ readonly artifactType: string;
217
+ readonly artifactVersion: number;
218
+ readonly artifactHash: string;
219
+ readonly phase: string;
220
+ readonly representation: 'json+markdown';
221
+ };
135
222
  readonly 'approval.recorded': {
136
223
  readonly decision: 'approved' | 'rejected';
137
224
  readonly resultingState: RunState;
@@ -238,6 +325,7 @@ type HarnessEvent<K extends HarnessEventType = HarnessEventType> = K extends Har
238
325
  readonly at: string;
239
326
  readonly sourceRevision: string;
240
327
  readonly configHash: string;
328
+ readonly correlation?: HarnessEventContext;
241
329
  readonly previousHash?: string;
242
330
  readonly eventHash?: string;
243
331
  readonly sessionId?: string;
@@ -331,6 +419,7 @@ interface ContextReference {
331
419
  readonly title?: string;
332
420
  readonly version?: string;
333
421
  readonly contentHash?: string;
422
+ readonly relevance?: number;
334
423
  }
335
424
  interface ContextSnapshot {
336
425
  readonly providerId: string;
@@ -339,6 +428,8 @@ interface ContextSnapshot {
339
428
  readonly sourceHash: string;
340
429
  readonly snapshotHash: string;
341
430
  readonly resolvedAt: string;
431
+ readonly assurance?: AssuranceLevel;
432
+ readonly telemetry?: AdapterTelemetry;
342
433
  }
343
434
  interface ContextProvider {
344
435
  readonly id: string;
@@ -382,7 +473,9 @@ interface VerificationCheck {
382
473
  readonly category: CheckCategory;
383
474
  readonly command: string;
384
475
  readonly required: boolean;
476
+ readonly reason?: string;
385
477
  readonly timeoutMs: number;
478
+ readonly dependsOn?: readonly string[];
386
479
  readonly execution?: 'real';
387
480
  readonly capabilities?: readonly string[];
388
481
  readonly evidence: 'structured';
@@ -397,16 +490,25 @@ interface BenchmarkBinding {
397
490
  readonly taskId: string;
398
491
  readonly mode: 'harness';
399
492
  }
493
+ interface RuntimeConfig {
494
+ readonly kind: 'process' | 'docker';
495
+ }
496
+ type AutonomyMode = 'controlled' | 'yolo';
400
497
  interface VerificationConfig {
401
498
  readonly schemaVersion: 1;
402
499
  readonly project: string;
403
500
  readonly root?: string;
404
501
  readonly stateDir?: string;
405
502
  readonly profile: string;
503
+ readonly autonomy: AutonomyMode;
504
+ readonly runtime: RuntimeConfig;
406
505
  readonly contract: TaskContract;
407
506
  readonly surfaces: Readonly<Record<SurfaceName, SurfaceRequirement>>;
408
507
  readonly checks: readonly VerificationCheck[];
409
508
  readonly tracking: TrackingConfig;
509
+ readonly verification?: {
510
+ readonly maxConcurrency?: number;
511
+ };
410
512
  readonly budget?: {
411
513
  readonly maxDurationMs?: number;
412
514
  };
@@ -446,14 +548,14 @@ interface StructuredEvidence {
446
548
  interface CheckResult {
447
549
  readonly id: string;
448
550
  readonly category: CheckCategory;
449
- readonly status: 'pending' | 'passed' | 'failed';
551
+ readonly status: 'pending' | 'passed' | 'failed' | 'not-applicable';
450
552
  readonly exitCode?: number;
451
553
  readonly durationMs?: number;
452
554
  readonly evidence?: StructuredEvidence;
453
555
  readonly failures?: readonly string[];
454
556
  }
455
557
  interface RunOutcome extends ContractOutcome {
456
- readonly status: 'pending' | 'passed' | 'failed';
558
+ readonly status: 'pending' | 'passed' | 'failed' | 'not-applicable';
457
559
  }
458
560
  interface EvidenceReference {
459
561
  readonly checkId: string;
@@ -471,18 +573,11 @@ interface VerificationRun {
471
573
  readonly sourceRevision: string;
472
574
  readonly sourceStatusHash: string;
473
575
  readonly baseline: SourceSnapshot;
474
- /** A human-approved plan, retained for backwards compatibility with v1 runs. */
475
- readonly contractApproval?: {
576
+ readonly contractApproval: {
476
577
  readonly actor: 'human';
477
578
  readonly at: string;
478
579
  readonly contractHash: string;
479
580
  };
480
- /** An automated preparation is never an approval and cannot complete a run. */
481
- readonly contractPreparation?: {
482
- readonly actor: 'ci';
483
- readonly at: string;
484
- readonly contractHash: string;
485
- };
486
581
  readonly checks: readonly CheckResult[];
487
582
  readonly outcomes: readonly RunOutcome[];
488
583
  readonly transitions: readonly StateTransition[];
@@ -493,9 +588,13 @@ interface VerificationRun {
493
588
  readonly benchmark?: BenchmarkBinding;
494
589
  readonly supersedes?: string;
495
590
  readonly dirtyBaselineAuthorized?: boolean;
591
+ readonly autonomy: AutonomyMode;
496
592
  readonly metrics?: {
497
593
  readonly totalDurationMs: number;
594
+ readonly wallDurationMs?: number;
595
+ readonly peakConcurrency?: number;
498
596
  readonly budgetExceeded: boolean;
597
+ readonly machine?: MachineMetrics;
499
598
  };
500
599
  readonly humanApproval?: {
501
600
  readonly actor: 'human';
@@ -513,6 +612,27 @@ interface VerificationRun {
513
612
  readonly verificationDigest?: string;
514
613
  };
515
614
  }
615
+ interface MachineSample {
616
+ readonly at: string;
617
+ readonly cpus: number;
618
+ readonly load1: number;
619
+ readonly load1PerCpuPercent: number;
620
+ readonly memoryUsedPercent: number;
621
+ readonly rssBytes: number;
622
+ readonly swapUsedPercent?: number;
623
+ readonly memoryPressure?: 'normal' | 'warning' | 'critical';
624
+ readonly interferingProcesses?: readonly string[];
625
+ }
626
+ interface MachineMetrics {
627
+ readonly sampleIntervalMs: number;
628
+ readonly samples: readonly MachineSample[];
629
+ readonly peakLoad1PerCpuPercent: number;
630
+ readonly peakMemoryUsedPercent: number;
631
+ readonly peakRssBytes: number;
632
+ readonly pressureEvents: number;
633
+ readonly throttleEvents: number;
634
+ readonly minimumEffectiveConcurrency: number;
635
+ }
516
636
  interface RunReconciliation {
517
637
  readonly status: 'verified';
518
638
  readonly runId: string;
@@ -578,60 +698,998 @@ declare const cleanTaskArtifacts: (configPath: string) => {
578
698
  readonly cleaned: readonly string[];
579
699
  };
580
700
 
701
+ declare const CAPABILITY_MANIFEST_SCHEMA_VERSION: 1;
702
+ declare const CAPABILITY_KINDS: readonly ["kernel", "execution", "adapter", "composition"];
703
+ type CapabilityKind = typeof CAPABILITY_KINDS[number];
704
+ interface CapabilityDescriptor {
705
+ readonly id: string;
706
+ readonly version: string;
707
+ readonly kind: CapabilityKind;
708
+ readonly entryPoint: string;
709
+ readonly exports: readonly string[];
710
+ readonly dependencies?: readonly string[];
711
+ }
712
+ interface CapabilityManifest {
713
+ readonly type: 'agentskit-harness-capability-manifest';
714
+ readonly schemaVersion: typeof CAPABILITY_MANIFEST_SCHEMA_VERSION;
715
+ readonly package: string;
716
+ readonly packageVersion: string;
717
+ readonly entryPoint: string;
718
+ readonly sourceDigest: string;
719
+ readonly capabilities: readonly CapabilityDescriptor[];
720
+ readonly digest: string;
721
+ }
722
+ interface CapabilityManifestInput {
723
+ readonly package: string;
724
+ readonly packageVersion: string;
725
+ readonly entryPoint: string;
726
+ readonly sourceDigest: string;
727
+ readonly capabilities: readonly CapabilityDescriptor[];
728
+ }
729
+ declare const createCapabilityManifest: (input: CapabilityManifestInput) => CapabilityManifest;
730
+ declare const validateCapabilityManifest: (value: unknown) => CapabilityManifest;
731
+
581
732
  interface DocBridgeContextProviderOptions {
582
733
  readonly root: string;
583
734
  readonly indexPath?: string;
584
735
  }
585
736
  declare const createDocBridgeContextProvider: ({ root, indexPath }: DocBridgeContextProviderOptions) => ContextProvider;
586
737
 
587
- declare const BENCHMARK_SCHEMA_VERSION: 1;
588
- type BenchmarkObservationStatus = 'passed' | 'failed' | 'blocked' | 'not-run';
589
- type BenchmarkImprovementDirection = 'improved' | 'regressed' | 'unchanged' | 'unavailable';
590
- type BenchmarkConfidence = 'insufficient' | 'directional' | 'reliable';
591
- interface BenchmarkPolicy {
592
- readonly minComparableTasks: number;
593
- readonly maxDurationRegressionRate: number;
594
- readonly minCompletedRunsPerTask: number;
595
- readonly minBaselineSamplesPerTask: number;
596
- readonly requireZeroEscapedIncomplete: boolean;
597
- }
598
- interface BenchmarkQualityGate {
599
- readonly status: 'passed' | 'failed' | 'insufficient-data';
600
- readonly confidence: BenchmarkConfidence;
601
- readonly comparableTaskCount: number;
602
- readonly policy: BenchmarkPolicy;
603
- readonly durationRegressionTaskIds: readonly string[];
604
- readonly escapedIncompleteTaskIds: readonly string[];
738
+ interface DiscoveryOption {
739
+ readonly id: string;
740
+ readonly summary: string;
741
+ readonly impact: string;
742
+ }
743
+ interface DiscoveryAmbiguity {
744
+ readonly id: string;
745
+ readonly question: string;
746
+ readonly material: boolean;
747
+ readonly options: readonly DiscoveryOption[];
748
+ readonly recommendedOptionId: string;
749
+ readonly assumptionId?: string;
750
+ }
751
+ interface ApprovedAssumption {
752
+ readonly id: string;
753
+ readonly policyId: string;
754
+ readonly resolution: string;
755
+ }
756
+ interface DiscoveryInput {
757
+ readonly issueId: string;
758
+ readonly sourceRevision: string;
759
+ readonly contractHash: string;
760
+ readonly contextHash?: string;
761
+ readonly ambiguities: readonly DiscoveryAmbiguity[];
762
+ readonly approvedAssumptions?: readonly ApprovedAssumption[];
763
+ }
764
+ interface DecisionPacket {
765
+ readonly issueId: string;
766
+ readonly contractHash: string;
767
+ readonly sourceRevision: string;
768
+ readonly contextHash?: string;
769
+ readonly decisions: readonly {
770
+ readonly id: string;
771
+ readonly question: string;
772
+ readonly options: readonly DiscoveryOption[];
773
+ readonly recommendedOptionId: string;
774
+ }[];
775
+ }
776
+ interface DiscoveryDecisionLogEntry {
777
+ readonly ambiguityId: string;
778
+ readonly kind: 'human-decision-required' | 'approved-assumption';
779
+ readonly detail: string;
780
+ readonly policyId?: string;
781
+ }
782
+ interface DiscoveryResult {
783
+ readonly version: 1;
784
+ readonly issueId: string;
785
+ readonly sourceRevision: string;
786
+ readonly contractHash: string;
787
+ readonly contextHash?: string;
788
+ readonly status: 'ready' | 'awaiting-decision';
789
+ readonly packet?: DecisionPacket;
790
+ readonly decisionLog: readonly DiscoveryDecisionLogEntry[];
791
+ readonly digest: string;
792
+ }
793
+ interface DiscoveryCurrentInput {
794
+ readonly sourceRevision: string;
795
+ readonly contractHash: string;
796
+ readonly contextHash?: string;
797
+ }
798
+ interface DiscoveryCurrentResult {
799
+ readonly current: boolean;
800
+ readonly reasons: readonly ('source' | 'contract' | 'context')[];
801
+ }
802
+ declare const assessDiscovery: (input: DiscoveryInput) => DiscoveryResult;
803
+ declare const isDiscoveryCurrent: (result: DiscoveryResult, current: DiscoveryCurrentInput) => DiscoveryCurrentResult;
804
+
805
+ declare const WIP_STATES: readonly ["ready", "implementing", "blocked", "awaiting-decision", "awaiting-acceptance", "done", "cancelled"];
806
+ type WipState = typeof WIP_STATES[number];
807
+ interface WipEntry {
808
+ readonly issueId: string;
809
+ readonly state: WipState;
810
+ }
811
+ interface WipAssessmentInput {
812
+ readonly entries: readonly WipEntry[];
813
+ readonly candidate: {
814
+ readonly issueId: string;
815
+ readonly kind: 'new' | 'resume';
816
+ };
817
+ readonly maxInFlight?: number;
818
+ }
819
+ interface WipAssessment {
820
+ readonly decision: 'admit' | 'hold';
821
+ readonly inFlight: readonly WipEntry[];
822
+ readonly counts: Readonly<Record<WipState, number>>;
823
+ readonly reason: string;
824
+ }
825
+ declare const assessWip: ({ entries, candidate, maxInFlight }: WipAssessmentInput) => WipAssessment;
826
+
827
+ interface RuntimeExperimentCandidate {
828
+ readonly runtime: string;
829
+ readonly sourceRevision: string;
830
+ readonly contractHash: string;
831
+ readonly provider: string;
832
+ readonly model: string;
833
+ readonly configurationHash: string;
834
+ readonly hardGatesPassed: boolean;
835
+ readonly humanMinutes: number;
836
+ readonly durationMs: number;
837
+ readonly cost: number;
838
+ }
839
+ interface RuntimeExperimentResult {
840
+ readonly decision: 'selected' | 'blocked';
841
+ readonly selected?: RuntimeExperimentCandidate;
842
+ readonly eligible: readonly RuntimeExperimentCandidate[];
843
+ readonly reason: string;
844
+ }
845
+ declare const selectRuntime: (candidates: readonly RuntimeExperimentCandidate[]) => RuntimeExperimentResult;
846
+
847
+ interface ReviewLens {
848
+ readonly id: string;
849
+ readonly maxAttempts?: number;
850
+ }
851
+ interface ReviewVerdict {
852
+ readonly status: 'pass' | 'finding' | 'unverified';
853
+ readonly reason?: string;
854
+ readonly evidence?: string;
855
+ readonly reproduction?: string;
856
+ readonly retryable?: boolean;
857
+ }
858
+ interface AdversarialReviewResult {
859
+ readonly decision: 'approved' | 'blocked';
860
+ readonly verdicts: Readonly<Record<string, ReviewVerdict>>;
605
861
  readonly reasons: readonly string[];
862
+ readonly binding: GateBinding;
863
+ readonly digest: string;
864
+ readonly peakConcurrency: number;
865
+ }
866
+ declare const runAdversarialReview: ({ lenses, reviewer, binding, maxConcurrency }: {
867
+ readonly lenses: readonly ReviewLens[];
868
+ readonly reviewer: (lens: ReviewLens, attempt: number) => Promise<ReviewVerdict> | ReviewVerdict;
869
+ readonly binding: GateBinding;
870
+ readonly maxConcurrency?: number;
871
+ }) => Promise<AdversarialReviewResult>;
872
+
873
+ type CriterionStatus = 'passed' | 'failed' | 'pending' | 'not-applicable';
874
+ interface GateCriterion {
875
+ readonly id: string;
876
+ readonly gate: 'G2' | 'G3' | 'G4' | 'G5';
877
+ readonly status: CriterionStatus;
878
+ readonly reason?: string;
606
879
  }
607
- interface BenchmarkTask {
880
+ interface GateBinding {
881
+ readonly candidateRevision: string;
882
+ readonly contractHash: string;
883
+ readonly configHash: string;
884
+ }
885
+ interface GateAssessment {
886
+ readonly gate: 'G2' | 'G3' | 'G4' | 'G5';
887
+ readonly decision: 'approved' | 'blocked' | 'awaiting-acceptance';
888
+ readonly reasons: readonly string[];
889
+ readonly binding: GateBinding;
890
+ readonly digest: string;
891
+ }
892
+ declare const assessPreflight: ({ criteria, repairAttempts, implementerId, reviewerId, reviewKind, reviewApproved, binding: current }: {
893
+ readonly criteria: readonly GateCriterion[];
894
+ readonly repairAttempts?: number;
895
+ readonly implementerId: string;
896
+ readonly reviewerId?: string;
897
+ readonly reviewKind?: "adversarial";
898
+ readonly reviewApproved: boolean;
899
+ readonly binding: GateBinding;
900
+ }) => GateAssessment;
901
+ interface PullRequestDraft {
902
+ readonly issueId: string;
903
+ readonly candidateRevision: string;
904
+ readonly contractHash: string;
905
+ readonly configHash: string;
906
+ readonly g2Digest: string;
907
+ readonly evidence: readonly string[];
908
+ readonly documentation: readonly string[];
909
+ readonly risk: string;
910
+ readonly rollback: string;
911
+ readonly pendingCriteria: readonly string[];
912
+ }
913
+ declare const composePullRequest: ({ draft, g2, remote }: {
914
+ readonly draft: PullRequestDraft;
915
+ readonly g2: GateAssessment;
916
+ readonly remote?: {
917
+ readonly state: "missing" | "confirmed" | "uncertain";
918
+ readonly url?: string;
919
+ readonly candidateRevision?: string;
920
+ };
921
+ }) => {
922
+ readonly decision: "create" | "reuse" | "blocked";
923
+ readonly body?: string;
924
+ readonly reason: string;
925
+ readonly idempotencyKey: string;
926
+ };
927
+ interface PullRequestApproval {
928
+ readonly approvedBy: 'human';
929
+ readonly candidateRevision: string;
930
+ readonly contractHash: string;
931
+ readonly configHash: string;
932
+ readonly bodyHash: string;
933
+ readonly metadataHash: string;
934
+ readonly digest: string;
935
+ }
936
+ declare const createPullRequestApproval: ({ body, metadata, approvedBy, candidateRevision, contractHash, configHash }: {
937
+ readonly body: string;
938
+ readonly metadata: Readonly<Record<string, unknown>>;
939
+ readonly approvedBy: "human";
940
+ readonly candidateRevision: string;
941
+ readonly contractHash: string;
942
+ readonly configHash: string;
943
+ }) => PullRequestApproval;
944
+ declare const verifyPullRequestApproval: ({ approval, body, metadata, candidateRevision, contractHash, configHash }: {
945
+ readonly approval: PullRequestApproval;
946
+ readonly body: string;
947
+ readonly metadata: Readonly<Record<string, unknown>>;
948
+ readonly candidateRevision: string;
949
+ readonly contractHash: string;
950
+ readonly configHash: string;
951
+ }) => PullRequestApproval;
952
+ interface QaTransitionAssessment {
953
+ readonly decision: 'move-to-qa' | 'return-to-verification' | 'blocked';
954
+ readonly target: 'qa' | 'verification';
955
+ readonly invalidatesDownstream: boolean;
956
+ readonly reason: string;
957
+ readonly idempotencyKey: string;
958
+ }
959
+ declare const assessQaTransition: ({ featureValidated, g5, qaPassed, issue }: {
960
+ readonly featureValidated: boolean;
961
+ readonly g5: GateAssessment;
962
+ readonly qaPassed: boolean;
963
+ readonly issue: string;
964
+ }) => QaTransitionAssessment;
965
+ declare const assessIntegration: ({ g2, candidateRevision, evidenceRevision, contractHash, configHash, ci }: {
966
+ readonly g2: GateAssessment;
967
+ readonly candidateRevision: string;
968
+ readonly evidenceRevision: string;
969
+ readonly contractHash: string;
970
+ readonly configHash: string;
971
+ readonly ci: CriterionStatus;
972
+ }) => GateAssessment;
973
+ declare const assessWorktreeCleanup: ({ branch, candidateRevision, contractHash, configHash, remoteBranchRevision, remotePr, integration }: {
974
+ readonly branch: string;
975
+ readonly candidateRevision: string;
976
+ readonly contractHash: string;
977
+ readonly configHash: string;
978
+ readonly remoteBranchRevision?: string;
979
+ readonly remotePr: "confirmed" | "missing" | "uncertain";
980
+ readonly integration: GateAssessment;
981
+ }) => {
982
+ readonly decision: "clean" | "preserve";
983
+ readonly reason: string;
984
+ };
985
+ interface RepositoryProfile {
986
+ readonly deploy: string;
987
+ readonly rollback: string;
988
+ readonly urls: readonly string[];
989
+ readonly featureFlag: string;
990
+ readonly syntheticTenant: string;
991
+ readonly observability: readonly string[];
992
+ readonly sensitivePaths: readonly string[];
993
+ readonly owners: readonly string[];
994
+ readonly approvedBy: string;
995
+ }
996
+ interface ProductionEvidence {
997
+ readonly tenant: string;
998
+ readonly realFlow: string;
999
+ readonly logs: readonly string[];
1000
+ readonly metrics: readonly string[];
1001
+ }
1002
+ declare const assessProduction: ({ profile, integration, artifact, isolated, acceptanceArtifact, lowRisk, observationMinutes, technicalPassed, evidence, containmentPreauthorized, containmentAction, linkedDefect }: {
1003
+ readonly profile: RepositoryProfile;
1004
+ readonly integration: GateAssessment;
1005
+ readonly artifact: string;
1006
+ readonly isolated: boolean;
1007
+ readonly acceptanceArtifact?: string;
1008
+ readonly lowRisk?: boolean;
1009
+ readonly observationMinutes: number;
1010
+ readonly technicalPassed: boolean;
1011
+ readonly evidence: ProductionEvidence;
1012
+ readonly containmentPreauthorized: boolean;
1013
+ readonly containmentAction?: string;
1014
+ readonly linkedDefect?: string;
1015
+ }) => GateAssessment;
1016
+ declare const assessAcceptance: ({ production, acceptanceRequired, accepted, notApplicableReason, materialChange }: {
1017
+ readonly production: GateAssessment;
1018
+ readonly acceptanceRequired: boolean;
1019
+ readonly accepted: boolean;
1020
+ readonly notApplicableReason?: string;
1021
+ readonly materialChange: boolean;
1022
+ }) => GateAssessment;
1023
+
1024
+ interface PilotEntry {
1025
+ readonly issueId: string;
1026
+ readonly classification: 'normal' | 'incident' | 'sensitive';
1027
+ readonly status: 'included' | 'excluded' | 'aborted';
1028
+ readonly reason?: string;
1029
+ }
1030
+ interface PilotManifest {
1031
+ readonly policyHash: string;
1032
+ readonly baselineReference: string;
1033
+ readonly entries: readonly PilotEntry[];
1034
+ }
1035
+ interface PilotAssessment {
1036
+ readonly decision: 'ready' | 'blocked';
1037
+ readonly included: readonly string[];
1038
+ readonly reasons: readonly string[];
1039
+ readonly digest: string;
1040
+ }
1041
+ declare const assessPilot: (manifest: PilotManifest) => PilotAssessment;
1042
+
1043
+ declare const IMPROVEMENT_CYCLE_STEPS: readonly ["adversarial-review", "g2-preflight", "baseline-record", "pilot-execution", "comparison"];
1044
+ type ImprovementCycleStep = typeof IMPROVEMENT_CYCLE_STEPS[number];
1045
+ type CycleStepStatus = 'passed' | 'failed' | 'blocked' | 'pending';
1046
+ interface CycleStepResult {
1047
+ readonly step: ImprovementCycleStep;
1048
+ readonly status: CycleStepStatus;
1049
+ readonly reason?: string;
1050
+ }
1051
+ interface CycleIterationMetrics {
1052
+ readonly durationMs?: number;
1053
+ readonly humanMinutes?: number;
1054
+ readonly attempts?: number;
1055
+ readonly escapedIncomplete?: number;
1056
+ }
1057
+ interface ImprovementCycleIteration {
1058
+ readonly iteration: number;
1059
+ readonly steps: readonly CycleStepResult[];
1060
+ readonly adjustment?: string;
1061
+ readonly metrics?: CycleIterationMetrics;
1062
+ }
1063
+ interface ImprovementCycleInput {
1064
+ readonly cycleId: string;
1065
+ readonly maxIterations: number;
1066
+ readonly iterations: readonly ImprovementCycleIteration[];
1067
+ }
1068
+ interface CycleMatrixRow {
1069
+ readonly iteration: number;
1070
+ readonly passedSteps: number;
1071
+ readonly totalSteps: number;
1072
+ readonly passRate: number;
1073
+ readonly statuses: Readonly<Record<ImprovementCycleStep, CycleStepStatus>>;
1074
+ readonly adjustment?: string;
1075
+ readonly metrics?: CycleIterationMetrics;
1076
+ }
1077
+ interface ImprovementCycleAssessment {
1078
+ readonly type: 'agentskit-harness-improvement-cycle';
1079
+ readonly cycleId: string;
1080
+ readonly decision: 'complete' | 'repeat' | 'blocked';
1081
+ readonly nextIteration?: number;
1082
+ readonly reasons: readonly string[];
1083
+ readonly matrix: readonly CycleMatrixRow[];
1084
+ readonly digest: string;
1085
+ }
1086
+ declare const assessImprovementCycle: (input: ImprovementCycleInput) => ImprovementCycleAssessment;
1087
+
1088
+ type EvalExpectation = string | ((output: string) => boolean);
1089
+ interface AgentEvalCase {
608
1090
  readonly id: string;
609
- readonly title: string;
610
- readonly acceptanceCriteria: readonly string[];
611
- /** Product/runtime surfaces exercised by the task. */
612
- readonly surfaces?: readonly SurfaceName[];
613
- readonly kind?: string;
614
- readonly prompt?: BenchmarkTaskFile;
615
- readonly source?: BenchmarkTaskSource;
616
- readonly scope?: BenchmarkTaskScope;
617
- }
618
- interface BenchmarkTaskFile {
619
- readonly path: string;
620
- readonly sha256: string;
1091
+ readonly input: string;
1092
+ readonly expected: EvalExpectation;
621
1093
  }
622
- interface BenchmarkTaskSource {
623
- readonly repository: string;
624
- readonly path: string;
625
- readonly revision: string;
1094
+ interface AgentEvalSuite {
1095
+ readonly name: string;
1096
+ readonly cases: readonly AgentEvalCase[];
1097
+ }
1098
+ interface AgentEvalReport {
1099
+ readonly suite: string;
1100
+ readonly total: number;
1101
+ readonly passed: number;
1102
+ readonly failed: number;
1103
+ readonly accuracy: number;
1104
+ readonly failures: readonly string[];
1105
+ }
1106
+ declare const EVAL_MANIFEST_SCHEMA_VERSION: 1;
1107
+ declare const EVAL_LAYERS: readonly ["contract", "deterministic", "integration", "quality", "regression", "resource"];
1108
+ declare const EVAL_COMPONENTS: readonly ["core", "workflow", "memory", "cache", "doc-bridge", "agent-model", "orca-worktree", "runtime", "code-review", "github-linear", "eval-metrics"];
1109
+ type EvalLayer = typeof EVAL_LAYERS[number];
1110
+ type EvalComponent = typeof EVAL_COMPONENTS[number];
1111
+ type EvalObservationStatus = 'passed' | 'failed' | 'unknown' | 'stale' | 'unverified';
1112
+ interface EvalCaseDefinition {
1113
+ readonly id: string;
1114
+ readonly layer: EvalLayer;
1115
+ readonly components: readonly EvalComponent[];
1116
+ readonly grader: string;
1117
+ readonly input: string;
1118
+ readonly critical?: boolean;
1119
+ readonly subjective?: boolean;
1120
+ readonly baselineScore?: number;
1121
+ }
1122
+ interface EvalManifest {
1123
+ readonly type: 'agentskit-harness-eval-manifest';
1124
+ readonly schemaVersion: typeof EVAL_MANIFEST_SCHEMA_VERSION;
1125
+ readonly suiteId: string;
1126
+ readonly name: string;
1127
+ readonly cases: readonly EvalCaseDefinition[];
1128
+ readonly graders: readonly string[];
1129
+ readonly thresholds: {
1130
+ readonly subjectiveQuality: number;
1131
+ readonly maxRegression: number;
1132
+ };
1133
+ readonly repetitions: number;
1134
+ readonly provider: string;
1135
+ readonly model: string;
1136
+ readonly promptHash: string;
1137
+ readonly toolHash: string;
1138
+ readonly evidenceOutputs: readonly string[];
1139
+ readonly digest: string;
1140
+ }
1141
+ interface EvalObservation {
1142
+ readonly status: EvalObservationStatus;
1143
+ readonly score?: number;
1144
+ readonly evidence?: string;
1145
+ readonly decision?: string;
1146
+ }
1147
+ interface EvalCaseReport {
1148
+ readonly id: string;
1149
+ readonly repetitions: number;
1150
+ readonly min: number | null;
1151
+ readonly median: number | null;
1152
+ readonly max: number | null;
1153
+ readonly statuses: readonly EvalObservationStatus[];
1154
+ readonly blockers: readonly string[];
1155
+ }
1156
+ interface EvalBatteryReport {
1157
+ readonly suiteId: string;
1158
+ readonly repetitions: number;
1159
+ readonly cases: readonly EvalCaseReport[];
1160
+ readonly status: 'passed' | 'blocked';
1161
+ readonly blockers: readonly string[];
1162
+ }
1163
+ declare const createEvalManifest: (input: Omit<EvalManifest, "type" | "schemaVersion" | "digest">) => EvalManifest;
1164
+ declare const validateEvalManifest: (value: unknown) => EvalManifest;
1165
+ declare const runEvalBattery: ({ manifest, evaluate }: {
1166
+ readonly manifest: EvalManifest;
1167
+ readonly evaluate: (testCase: EvalCaseDefinition, repetition: number) => Promise<EvalObservation>;
1168
+ }) => Promise<EvalBatteryReport>;
1169
+ declare const runAgentEval: ({ suite, agent, concurrency }: {
1170
+ readonly suite: AgentEvalSuite;
1171
+ readonly agent: (input: string) => Promise<string>;
1172
+ readonly concurrency?: number;
1173
+ }) => Promise<AgentEvalReport>;
1174
+ declare const assessAgentEval: (report: AgentEvalReport, minimumAccuracy: number) => {
1175
+ readonly status: "passed" | "blocked";
1176
+ readonly reason: string;
1177
+ readonly report: AgentEvalReport;
1178
+ };
1179
+
1180
+ interface LlmCacheKeyInput {
1181
+ readonly sourceRevision: string;
1182
+ readonly contractHash: string;
1183
+ readonly configHash: string;
1184
+ readonly provider: string;
1185
+ readonly model: string;
1186
+ readonly systemPromptHash: string;
1187
+ readonly inputHash: string;
1188
+ readonly contextHash?: string;
1189
+ readonly toolSchemaHash?: string;
1190
+ readonly operation: 'context' | 'read-only';
1191
+ }
1192
+ interface LlmCacheStats {
1193
+ readonly hits: number;
1194
+ readonly misses: number;
1195
+ readonly invalidations: number;
1196
+ }
1197
+ declare const validateCacheableOperation: (operation: unknown) => "context" | "read-only";
1198
+ declare const createLlmCacheKey: (input: LlmCacheKeyInput) => string;
1199
+ interface LlmCache<T> {
1200
+ readonly assurance?: AssuranceLevel;
1201
+ readonly telemetry?: () => AdapterTelemetry;
1202
+ getOrCompute(key: string, compute: () => Promise<T>): Promise<T>;
1203
+ invalidate(key?: string): void;
1204
+ stats(): LlmCacheStats;
1205
+ }
1206
+ declare const createLlmCache: <T>() => LlmCache<T>;
1207
+
1208
+ interface TokenUsage {
1209
+ readonly inputTokens: number;
1210
+ readonly outputTokens: number;
1211
+ readonly totalTokens: number;
1212
+ readonly cacheReadTokens?: number;
1213
+ readonly cacheWriteTokens?: number;
1214
+ }
1215
+ interface MemoryUsage {
1216
+ readonly reads: number;
1217
+ readonly writes: number;
1218
+ readonly relevantHits: number;
1219
+ readonly staleHits: number;
1220
+ }
1221
+ interface CacheUsage {
1222
+ readonly hits: number;
1223
+ readonly misses: number;
1224
+ readonly invalidations: number;
1225
+ readonly tokensSaved?: number;
1226
+ }
1227
+ interface ParallelismUsage {
1228
+ readonly tasks: number;
1229
+ readonly peakConcurrency: number;
1230
+ readonly criticalPathMs: number;
1231
+ readonly queueWaitMs?: number;
1232
+ }
1233
+ interface OptimizationObservation {
1234
+ readonly sourceRevision: string;
1235
+ readonly contractHash: string;
1236
+ readonly configHash: string;
1237
+ readonly provider: string;
1238
+ readonly model: string;
1239
+ readonly durationMs: number;
1240
+ readonly accuracy?: number;
1241
+ readonly tokens?: TokenUsage;
1242
+ readonly memory?: MemoryUsage;
1243
+ readonly cache?: CacheUsage;
1244
+ readonly parallelism?: ParallelismUsage;
1245
+ }
1246
+ declare const validateOptimizationObservation: (observation: OptimizationObservation) => OptimizationObservation;
1247
+ interface OptimizationComparison {
1248
+ readonly comparable: boolean;
1249
+ readonly reason: string;
1250
+ readonly digest: string;
1251
+ readonly durationDeltaMs?: number;
1252
+ readonly tokenDelta?: number;
1253
+ readonly accuracyDelta?: number;
1254
+ readonly cacheHitRateDelta?: number;
1255
+ readonly memoryRelevantHitRateDelta?: number;
1256
+ readonly peakConcurrencyDelta?: number;
626
1257
  }
627
- interface BenchmarkSuiteSource {
628
- readonly repository: string;
1258
+ declare const compareOptimization: (baseline: OptimizationObservation, candidate: OptimizationObservation) => OptimizationComparison;
1259
+
1260
+ declare const MEMORY_SCOPES: readonly ["issue", "project", "global"];
1261
+ type MemoryScope = typeof MEMORY_SCOPES[number];
1262
+ interface AgentMemoryRecord {
1263
+ readonly id: string;
1264
+ readonly scope: MemoryScope;
1265
+ readonly summary: string;
1266
+ readonly source: string;
1267
+ readonly sourceRevision: string;
1268
+ readonly contentHash: string;
1269
+ readonly approved: true;
1270
+ }
1271
+ interface AgentMemoryHit {
1272
+ readonly record: AgentMemoryRecord;
1273
+ readonly relevant: boolean;
1274
+ readonly stale: boolean;
1275
+ }
1276
+ interface AgentMemoryAdapter {
1277
+ readonly id: string;
1278
+ readonly version: string;
1279
+ readonly assurance?: AssuranceLevel;
1280
+ readonly telemetry?: () => AdapterTelemetry;
1281
+ remember(record: AgentMemoryRecord): Promise<void>;
1282
+ recall(input: {
1283
+ readonly query: string;
1284
+ readonly issueId?: string;
1285
+ readonly project?: string;
1286
+ readonly sourceRevision?: string;
1287
+ }): Promise<readonly AgentMemoryHit[]>;
1288
+ }
1289
+ interface AgentMemoryKvStore {
1290
+ get(key: string): Promise<unknown>;
1291
+ set(key: string, value: unknown): Promise<void>;
1292
+ }
1293
+ declare const validateMemoryRecord: (record: AgentMemoryRecord) => AgentMemoryRecord;
1294
+ /** Minimal deterministic adapter for replay/tests; production uses @agentskit/memory through the same seam. */
1295
+ declare const createInMemoryMemoryAdapter: (options?: {
1296
+ readonly id?: string;
1297
+ readonly version?: string;
1298
+ }) => AgentMemoryAdapter;
1299
+ /** Bridges AgentsKit's KV memory stores without making the Harness depend on a backend. */
1300
+ declare const createKvMemoryAdapter: (store: AgentMemoryKvStore, options?: {
1301
+ readonly id?: string;
1302
+ readonly version?: string;
1303
+ }) => AgentMemoryAdapter;
1304
+
1305
+ interface WorkflowNode<T> {
1306
+ readonly id: string;
1307
+ readonly dependsOn?: readonly string[];
1308
+ /** Nodes sharing a mutation key are serialized even when otherwise independent. */
1309
+ readonly mutationKey?: string;
1310
+ readonly run: () => Promise<T>;
1311
+ }
1312
+ interface WorkflowResult<T> {
1313
+ readonly results: Readonly<Record<string, T>>;
1314
+ readonly order: readonly string[];
1315
+ readonly peakConcurrency: number;
1316
+ readonly criticalPathMs: number;
1317
+ }
1318
+ declare const runWorkflow: <T>(nodes: readonly WorkflowNode<T>[], options: {
1319
+ readonly maxConcurrency: number;
1320
+ readonly currentConcurrency?: () => number;
1321
+ }) => Promise<WorkflowResult<T>>;
1322
+
1323
+ declare const PHASE_MODES: readonly ["safe", "yolo", "dry-run"];
1324
+ type PhaseMode = typeof PHASE_MODES[number];
1325
+ declare const PHASE_EFFECTS: readonly ["read", "write", "external"];
1326
+ type PhaseEffect = typeof PHASE_EFFECTS[number];
1327
+ declare const PHASE_EFFECT_ACTIONS: readonly ["allow", "preview", "block", "escalate"];
1328
+ type PhaseEffectAction = typeof PHASE_EFFECT_ACTIONS[number];
1329
+ declare const PHASE_DECISIONS: readonly ["pass", "block", "escalate", "retry", "cancel", "resume"];
1330
+ type PhaseDecision = typeof PHASE_DECISIONS[number];
1331
+ interface PhaseRetryPolicy {
1332
+ readonly maxAttempts: number;
1333
+ }
1334
+ interface PhaseDefinition {
1335
+ readonly id: string;
1336
+ readonly inputs?: readonly string[];
1337
+ readonly outputs?: readonly string[];
1338
+ readonly dependsOn?: readonly string[];
1339
+ readonly gates?: readonly string[];
1340
+ readonly retries?: PhaseRetryPolicy;
1341
+ readonly budgetMs?: number;
1342
+ readonly effect: PhaseEffect;
1343
+ }
1344
+ interface PhaseEffectPolicy {
1345
+ readonly read: PhaseEffectAction;
1346
+ readonly write: PhaseEffectAction;
1347
+ readonly external: PhaseEffectAction;
1348
+ }
1349
+ interface PhaseProfile {
1350
+ readonly id: string;
1351
+ readonly mode: PhaseMode;
1352
+ readonly phases: readonly PhaseDefinition[];
1353
+ readonly effectPolicy?: Partial<PhaseEffectPolicy>;
1354
+ readonly maxConcurrency?: number;
1355
+ readonly budgetMs?: number;
1356
+ }
1357
+ interface NormalizedPhaseProfile extends Omit<PhaseProfile, 'effectPolicy' | 'maxConcurrency'> {
1358
+ readonly effectPolicy: PhaseEffectPolicy;
1359
+ readonly maxConcurrency: number;
1360
+ }
1361
+ interface PhaseRoutePlan {
1362
+ readonly profileId: string;
1363
+ readonly mode: PhaseMode;
1364
+ readonly levels: readonly (readonly string[])[];
1365
+ readonly phases: readonly PhaseDefinition[];
1366
+ readonly effectPolicy: PhaseEffectPolicy;
1367
+ readonly maxConcurrency: number;
1368
+ readonly budgetMs?: number;
1369
+ }
1370
+ interface PhaseAmbiguity {
1371
+ readonly id: string;
1372
+ readonly question: string;
1373
+ readonly options?: readonly string[];
1374
+ readonly suggestion?: string;
1375
+ }
1376
+ interface PhaseDecisionPacket {
1377
+ readonly id: 'phase-preflight';
1378
+ readonly phaseIds: readonly string[];
1379
+ readonly ambiguities: readonly PhaseAmbiguity[];
1380
+ }
1381
+ interface PhaseContext {
1382
+ readonly phase: PhaseDefinition;
1383
+ readonly attempt: number;
1384
+ readonly mode: PhaseMode;
1385
+ readonly inputs: Readonly<Record<string, unknown>>;
1386
+ readonly outputs: Readonly<Record<string, unknown>>;
1387
+ readonly dryRun: boolean;
1388
+ }
1389
+ interface PhaseHandlerResult {
1390
+ readonly decision: PhaseDecision;
1391
+ readonly outputs?: Readonly<Record<string, unknown>>;
1392
+ readonly reason?: string;
1393
+ }
1394
+ type PhaseHandler = (context: PhaseContext) => PhaseHandlerResult | Promise<PhaseHandlerResult>;
1395
+ type PhaseGateResult = boolean | {
1396
+ readonly decision: Exclude<PhaseDecision, 'retry' | 'cancel' | 'resume' | 'pass'> | 'pass';
1397
+ readonly reason?: string;
1398
+ };
1399
+ type PhaseGateEvaluator = (context: PhaseContext) => PhaseGateResult | Promise<PhaseGateResult>;
1400
+ interface PhasePreflightResult {
1401
+ readonly decision?: 'pass' | 'block' | 'escalate';
1402
+ readonly reason?: string;
1403
+ readonly ambiguities?: readonly PhaseAmbiguity[];
1404
+ }
1405
+ type PhasePreflight = (context: PhaseContext) => PhasePreflightResult | Promise<PhasePreflightResult>;
1406
+ interface PhaseExecution {
1407
+ readonly id: string;
1408
+ readonly effect: PhaseEffect;
1409
+ readonly decision: PhaseDecision;
1410
+ readonly attempts: number;
1411
+ readonly skipped: boolean;
1412
+ readonly reason?: string;
1413
+ readonly outputs?: Readonly<Record<string, unknown>>;
1414
+ }
1415
+ interface PhaseResumeState {
1416
+ readonly completed: Readonly<Record<string, Pick<PhaseExecution, 'decision' | 'outputs'>>>;
1417
+ readonly outputs?: Readonly<Record<string, unknown>>;
1418
+ }
1419
+ interface ExecutePhaseProfileOptions {
1420
+ readonly inputs?: Readonly<Record<string, unknown>>;
1421
+ readonly handlers?: Readonly<Record<string, PhaseHandler>>;
1422
+ readonly gates?: Readonly<Record<string, PhaseGateEvaluator>>;
1423
+ readonly preflight?: PhasePreflight;
1424
+ readonly resume?: PhaseResumeState;
1425
+ readonly now?: () => number;
1426
+ }
1427
+ interface PhaseExecutionReport {
1428
+ readonly status: 'passed' | 'blocked' | 'escalated' | 'cancelled' | 'dry-run';
1429
+ readonly plan: PhaseRoutePlan;
1430
+ readonly phases: readonly PhaseExecution[];
1431
+ readonly order: readonly string[];
1432
+ readonly outputs: Readonly<Record<string, unknown>>;
1433
+ readonly resumed: boolean;
1434
+ readonly decisionPacket?: PhaseDecisionPacket;
1435
+ readonly durationMs: number;
1436
+ }
1437
+ declare const createPhaseProfile: (profile: PhaseProfile) => NormalizedPhaseProfile;
1438
+ declare const planPhaseProfile: (profile: PhaseProfile) => PhaseRoutePlan;
1439
+ declare const executePhaseProfile: (profile: PhaseProfile, options?: ExecutePhaseProfileOptions) => Promise<PhaseExecutionReport>;
1440
+
1441
+ declare const ARTIFACT_SCHEMA_VERSION: 1;
1442
+ declare const ARTIFACT_TYPES: readonly ["plan", "finding", "decision", "repair", "blocker", "approval", "phase"];
1443
+ type ArtifactType = typeof ARTIFACT_TYPES[number];
1444
+ interface ArtifactEnvelope<T = unknown> {
1445
+ readonly type: 'agentskit-harness-artifact';
1446
+ readonly schemaVersion: typeof ARTIFACT_SCHEMA_VERSION;
1447
+ readonly artifactId: string;
1448
+ readonly artifactType: ArtifactType;
1449
+ readonly artifactVersion: number;
1450
+ readonly runId: string;
1451
+ readonly issueRef: string;
1452
+ readonly sourceRevision: string;
1453
+ readonly contractHash: string;
1454
+ readonly configHash: string;
1455
+ readonly contextHash: string;
1456
+ readonly phase: string;
1457
+ readonly createdAt: string;
1458
+ readonly payload: T;
1459
+ readonly payloadHash: string;
1460
+ readonly artifactHash: string;
1461
+ }
1462
+ type ArtifactEnvelopeInput<T = unknown> = Omit<ArtifactEnvelope<T>, 'type' | 'schemaVersion' | 'artifactId' | 'createdAt' | 'payloadHash' | 'artifactHash'> & {
1463
+ readonly artifactId?: string;
1464
+ readonly createdAt?: string;
1465
+ readonly payloadHash?: string;
1466
+ readonly artifactHash?: string;
1467
+ };
1468
+ interface ArtifactBinding {
1469
+ readonly runId: string;
1470
+ readonly issueRef: string;
1471
+ readonly sourceRevision: string;
1472
+ readonly contractHash: string;
1473
+ readonly configHash: string;
1474
+ readonly contextHash: string;
1475
+ readonly phase?: string;
1476
+ }
1477
+ declare const validateArtifactEnvelope: <T = unknown>(value: unknown) => ArtifactEnvelope<T>;
1478
+ declare const createArtifactEnvelope: <T>(input: ArtifactEnvelopeInput<T>) => ArtifactEnvelope<T>;
1479
+ declare const renderArtifactMarkdown: (artifact: ArtifactEnvelope) => string;
1480
+ declare const artifactFilePath: (stateDir: string, runId: string, id: string) => string;
1481
+ declare const artifactMarkdownPath: (stateDir: string, runId: string, id: string) => string;
1482
+ declare class FileArtifactStore {
1483
+ private readonly stateDir;
1484
+ constructor(stateDir: string);
1485
+ write<T>(input: ArtifactEnvelope<T>): ArtifactEnvelope<T>;
1486
+ read<T = unknown>(runId: string, id: string): ArtifactEnvelope<T>;
1487
+ list(runId: string): readonly ArtifactEnvelope[];
1488
+ }
1489
+ declare const artifactIsFresh: (artifact: ArtifactEnvelope, binding: ArtifactBinding) => boolean;
1490
+ declare const resumeStateFromArtifacts: (artifacts: readonly ArtifactEnvelope[]) => PhaseResumeState;
1491
+ declare const createPhaseArtifact: (base: Omit<ArtifactEnvelopeInput, "artifactType" | "phase" | "payload">, execution: PhaseExecution) => ArtifactEnvelope;
1492
+ declare const readArtifactFile: (path: string) => ArtifactEnvelope;
1493
+ declare const artifactDigest: (artifact: ArtifactEnvelope) => string;
1494
+
1495
+ declare const QUALITY_DIMENSIONS: readonly ["correctness", "completeness", "speed", "cost", "resource", "reliability"];
1496
+ type QualityDimension = typeof QUALITY_DIMENSIONS[number];
1497
+ type MetricStatus = 'measured' | 'unknown';
1498
+ interface PhaseTokenMetrics {
1499
+ readonly inputTokens?: number;
1500
+ readonly outputTokens?: number;
1501
+ readonly cacheReadTokens?: number;
1502
+ readonly cacheWriteTokens?: number;
1503
+ readonly costUsd?: number;
1504
+ }
1505
+ interface PhaseMachineMetrics {
1506
+ readonly cpuPercent?: number;
1507
+ readonly memoryUsedPercent?: number;
1508
+ readonly peakConcurrency?: number;
1509
+ readonly queueWaitMs?: number;
1510
+ readonly contentionMs?: number;
1511
+ readonly saturationPercent?: number;
1512
+ }
1513
+ interface PhaseTelemetry {
1514
+ readonly phaseId: string;
1515
+ readonly durationMs?: number;
1516
+ readonly attempts?: number;
1517
+ readonly outcome: 'pass' | 'block' | 'escalate' | 'cancel' | 'unknown';
1518
+ readonly failureClass?: string;
1519
+ readonly evidenceCoverage?: number;
1520
+ readonly tokens?: PhaseTokenMetrics;
1521
+ readonly machine?: PhaseMachineMetrics;
1522
+ }
1523
+ interface QualityDimensionScore {
1524
+ readonly score: number | null;
1525
+ readonly status: MetricStatus;
1526
+ readonly baselineDelta: number | null;
1527
+ readonly source: string;
1528
+ }
1529
+ interface QualityMatrix {
1530
+ readonly type: 'agentskit-harness-quality-matrix';
1531
+ readonly schemaVersion: 1;
1532
+ readonly dimensions: Readonly<Record<QualityDimension, QualityDimensionScore>>;
1533
+ readonly overall: QualityDimensionScore;
1534
+ readonly phaseCount: number;
1535
+ readonly unknownMetricCount: number;
1536
+ readonly blockers: readonly WatchdogBlocker[];
1537
+ readonly digest: string;
1538
+ }
1539
+ interface WatchdogBudget {
1540
+ readonly maxDurationMs?: number;
1541
+ readonly maxTotalTokens?: number;
1542
+ readonly maxMemoryUsedPercent?: number;
1543
+ readonly maxSaturationPercent?: number;
1544
+ }
1545
+ interface WatchdogBlocker {
1546
+ readonly class: 'budget' | 'resource' | 'contention';
1547
+ readonly reason: string;
1548
+ readonly phaseId?: string;
1549
+ }
1550
+ interface WatchdogResult {
1551
+ readonly status: 'ok' | 'blocked';
1552
+ readonly blockers: readonly WatchdogBlocker[];
1553
+ }
1554
+ declare const validatePhaseTelemetry: (value: unknown) => PhaseTelemetry;
1555
+ declare const evaluateWatchdog: ({ phases, budget }: {
1556
+ readonly phases: readonly PhaseTelemetry[];
1557
+ readonly budget: WatchdogBudget;
1558
+ }) => WatchdogResult;
1559
+ declare const createQualityMatrix: ({ phases, baseline, budget }: {
1560
+ readonly phases: readonly PhaseTelemetry[];
1561
+ readonly baseline?: readonly PhaseTelemetry[];
1562
+ readonly budget?: WatchdogBudget;
1563
+ }) => QualityMatrix;
1564
+
1565
+ declare const COMPATIBILITY_SCHEMA_VERSION: 1;
1566
+ declare const COMPATIBILITY_COMPONENTS: readonly ["core", "memory", "eval", "doc-bridge", "code-review", "adapter-boundary", "runtime"];
1567
+ type CompatibilityComponentId = typeof COMPATIBILITY_COMPONENTS[number];
1568
+ type CompatibilityStatus = 'passed' | 'failed' | 'unknown';
1569
+ interface CompatibilityComponent {
1570
+ readonly id: CompatibilityComponentId;
1571
+ readonly package: string;
1572
+ readonly version: string;
629
1573
  readonly revision: string;
630
- readonly taskDefinition: string;
1574
+ readonly repository: string;
1575
+ readonly adapterBoundary: 'real-adapter';
1576
+ readonly testCommand: string;
1577
+ readonly evalCommand: string;
1578
+ readonly previousVersion: string;
1579
+ readonly noHarnessBaseline: string;
1580
+ readonly migrationEvidence: string;
1581
+ readonly rollbackEvidence: string;
1582
+ }
1583
+ interface CompatibilityManifest {
1584
+ readonly type: 'agentskit-harness-compatibility-manifest';
1585
+ readonly schemaVersion: typeof COMPATIBILITY_SCHEMA_VERSION;
1586
+ readonly harnessVersion: string;
1587
+ readonly sourceRevision: string;
1588
+ readonly components: readonly CompatibilityComponent[];
1589
+ readonly evidenceOutputs: readonly string[];
1590
+ readonly digest: string;
1591
+ }
1592
+ interface CompatibilityObservation {
1593
+ readonly componentId: CompatibilityComponentId;
1594
+ readonly status: CompatibilityStatus;
1595
+ readonly evidence?: string;
1596
+ readonly previousVersion?: string;
1597
+ readonly noHarnessBaseline?: string;
1598
+ }
1599
+ interface CompatibilityReport {
1600
+ readonly status: 'passed' | 'blocked';
1601
+ readonly componentCount: number;
1602
+ readonly observations: readonly CompatibilityObservation[];
1603
+ readonly blockers: readonly string[];
1604
+ }
1605
+ declare const createCompatibilityManifest: (input: Omit<CompatibilityManifest, "type" | "schemaVersion" | "digest">) => CompatibilityManifest;
1606
+ declare const validateCompatibilityManifest: (value: unknown) => CompatibilityManifest;
1607
+ declare const assessCompatibility: ({ manifest, observations }: {
1608
+ readonly manifest: CompatibilityManifest;
1609
+ readonly observations: readonly CompatibilityObservation[];
1610
+ }) => CompatibilityReport;
1611
+
1612
+ type FailureClass = 'quota' | 'timeout' | 'policy' | 'validation' | 'external' | 'unknown';
1613
+ interface FailureClassification {
1614
+ readonly class: FailureClass;
1615
+ readonly retryable: boolean;
1616
+ readonly reason: string;
1617
+ }
1618
+ interface RecoveryPolicy {
1619
+ readonly maxAttempts: number;
1620
+ readonly baseDelayMs: number;
1621
+ readonly maxDelayMs: number;
1622
+ readonly timeoutMs?: number;
1623
+ }
1624
+ interface RecoveryObservation {
1625
+ readonly attempt: number;
1626
+ readonly failure: FailureClassification;
1627
+ readonly delayMs: number;
1628
+ }
1629
+ interface RecoveryResult<T> {
1630
+ readonly value?: T;
1631
+ readonly status: 'completed' | 'failed';
1632
+ readonly attempts: number;
1633
+ readonly observations: readonly RecoveryObservation[];
1634
+ readonly failure?: FailureClassification;
1635
+ }
1636
+ declare const classifyFailure: (error: unknown) => FailureClassification;
1637
+ declare const recoveryDelayMs: (attempt: number, policy: Pick<RecoveryPolicy, "baseDelayMs" | "maxDelayMs">) => number;
1638
+ declare const runWithRecovery: <T>(operation: (signal: AbortSignal, attempt: number) => Promise<T>, options: RecoveryPolicy & {
1639
+ readonly sleep?: (delayMs: number) => Promise<void>;
1640
+ readonly onObservation?: (observation: RecoveryObservation) => void;
1641
+ }) => Promise<RecoveryResult<T>>;
1642
+
1643
+ interface CodingAgentRequest {
1644
+ readonly issueRef: string;
1645
+ readonly prompt: string;
1646
+ readonly sourceRevision: string;
1647
+ readonly contextHash?: string;
1648
+ readonly signal: AbortSignal;
631
1649
  }
632
- interface BenchmarkTaskScope {
633
- readonly read: readonly string[];
634
- readonly write: readonly string[];
1650
+ interface AgentUsage {
1651
+ readonly status: 'measured' | 'unknown';
1652
+ readonly inputTokens?: number;
1653
+ readonly outputTokens?: number;
1654
+ readonly totalTokens?: number;
1655
+ }
1656
+ interface CodingAgentResult {
1657
+ readonly status: 'completed' | 'failed' | 'timeout' | 'cancelled';
1658
+ readonly output: Readonly<Record<string, unknown>>;
1659
+ readonly diff: string;
1660
+ readonly usage: AgentUsage;
1661
+ readonly durationMs: number;
1662
+ readonly failure?: FailureClassification;
1663
+ readonly metadata: AdapterMetadata;
1664
+ }
1665
+ interface CodingAgentHandlerResult {
1666
+ readonly output: Readonly<Record<string, unknown>>;
1667
+ readonly diff: string;
1668
+ readonly usage?: AgentUsage;
1669
+ }
1670
+ interface CodingAgentAdapter {
1671
+ readonly id: string;
1672
+ readonly version: string;
1673
+ readonly assurance: AssuranceLevel;
1674
+ execute(request: Omit<CodingAgentRequest, 'signal'> & {
1675
+ readonly signal?: AbortSignal;
1676
+ }): Promise<CodingAgentResult>;
1677
+ }
1678
+ declare const createCodingAgentAdapter: ({ id, version, assurance, timeoutMs, execute }: {
1679
+ readonly id: string;
1680
+ readonly version: string;
1681
+ readonly assurance?: AssuranceLevel;
1682
+ readonly timeoutMs?: number;
1683
+ readonly execute: (request: CodingAgentRequest) => Promise<CodingAgentHandlerResult> | CodingAgentHandlerResult;
1684
+ }) => CodingAgentAdapter;
1685
+
1686
+ declare const BENCHMARK_SCHEMA_VERSION: 1;
1687
+ type BenchmarkObservationStatus = 'passed' | 'failed' | 'blocked' | 'not-run';
1688
+ type BenchmarkImprovementDirection = 'improved' | 'regressed' | 'unchanged' | 'unavailable';
1689
+ interface BenchmarkTask {
1690
+ readonly id: string;
1691
+ readonly title: string;
1692
+ readonly acceptanceCriteria: readonly string[];
635
1693
  }
636
1694
  interface BenchmarkObservation {
637
1695
  readonly taskId: string;
@@ -641,11 +1699,6 @@ interface BenchmarkObservation {
641
1699
  readonly recordedAt: string;
642
1700
  readonly attempts?: number;
643
1701
  readonly durationMs?: number;
644
- readonly durationSamplesMs?: readonly number[];
645
- /** Fraction of repeated samples whose task artifact passed acceptance validation. */
646
- readonly artifactAcceptanceRate?: number;
647
- /** Fraction of repeated samples whose verification protocol completed. */
648
- readonly protocolCompletionRate?: number;
649
1702
  readonly reviewMinutes?: number;
650
1703
  readonly escapedIncomplete?: number;
651
1704
  readonly evidence?: readonly BenchmarkObservationEvidence[];
@@ -661,10 +1714,8 @@ interface BenchmarkManifest {
661
1714
  readonly schemaVersion: typeof BENCHMARK_SCHEMA_VERSION;
662
1715
  readonly suiteId: string;
663
1716
  readonly name: string;
664
- readonly provenance?: BenchmarkSuiteSource;
665
1717
  readonly tasks: readonly BenchmarkTask[];
666
1718
  readonly observations: readonly BenchmarkObservation[];
667
- readonly policy?: BenchmarkPolicy;
668
1719
  }
669
1720
  interface BenchmarkRun {
670
1721
  readonly runId: string;
@@ -688,26 +1739,20 @@ interface BenchmarkRun {
688
1739
  readonly total: number;
689
1740
  readonly attached: number;
690
1741
  };
691
- /** Optional artifact outcome emitted by structured benchmark evidence. */
692
- readonly artifactAcceptanceRate?: number;
693
1742
  readonly escapedIncomplete?: number;
694
1743
  readonly humanApproved: boolean;
695
1744
  readonly humanReviewMinutes?: number;
696
1745
  readonly authorized: boolean;
1746
+ readonly machine?: MachineMetrics;
697
1747
  readonly benchmark?: BenchmarkBinding;
698
1748
  }
699
1749
  interface BenchmarkComparison {
700
1750
  readonly taskId: string;
701
1751
  readonly title: string;
702
- readonly comparability: 'comparable' | 'missing-baseline' | 'baseline-not-run' | 'baseline-evidence-missing' | 'baseline-incomplete' | 'baseline-samples-insufficient' | 'harness-not-run' | 'harness-not-complete';
1752
+ readonly comparability: 'comparable' | 'missing-baseline' | 'baseline-not-run' | 'baseline-evidence-missing' | 'harness-not-run' | 'harness-not-complete';
703
1753
  readonly comparable: boolean;
704
- readonly baselineDeliveryComplete: boolean;
705
1754
  readonly baseline?: BenchmarkObservation;
706
1755
  readonly baselineEvidenceCoverageRate: number | null;
707
- readonly baselineSampleCount: number;
708
- readonly baselineArtifactAcceptanceRate: number | null;
709
- readonly baselineProtocolCompletionRate: number | null;
710
- readonly baselineMedianDurationMs?: number;
711
1756
  readonly improvement: {
712
1757
  readonly durationRate: number | null;
713
1758
  readonly duration: BenchmarkImprovementDirection;
@@ -715,36 +1760,21 @@ interface BenchmarkComparison {
715
1760
  readonly attempts: BenchmarkImprovementDirection;
716
1761
  readonly reviewRate: number | null;
717
1762
  readonly review: BenchmarkImprovementDirection;
718
- readonly artifactAcceptanceRate: number | null;
719
- readonly artifactAcceptance: BenchmarkImprovementDirection;
720
- readonly artifactAcceptanceDelta: number | null;
721
- readonly protocolCompletionRate: number | null;
722
- readonly protocolCompletion: BenchmarkImprovementDirection;
723
- readonly protocolCompletionDelta: number | null;
724
1763
  readonly escapedIncompleteRate: number | null;
725
1764
  readonly escapedIncomplete: BenchmarkImprovementDirection;
726
1765
  };
727
1766
  readonly harness: {
728
1767
  readonly attempts: number;
729
- readonly retryCount: number;
730
- readonly completedRuns: number;
731
- readonly durationSamplesMs: readonly number[];
732
- readonly medianDurationMs?: number;
733
1768
  readonly latestState: RunState | 'NOT_RUN';
734
1769
  readonly latestRunId?: string;
735
1770
  readonly latestDurationMs?: number;
736
1771
  readonly checkPassRate: number | null;
737
1772
  readonly outcomePassRate: number | null;
738
1773
  readonly evidenceCoverageRate: number | null;
739
- readonly artifactAcceptanceRate?: number;
740
- readonly artifactAcceptanceSampleCount: number;
741
- readonly protocolCompletionRate: number | null;
742
- readonly protocolCompletionSampleCount: number;
743
1774
  readonly humanApproved: boolean;
744
1775
  readonly escapedIncomplete?: number;
745
1776
  readonly humanReviewMinutes?: number;
746
1777
  };
747
- readonly confidence: BenchmarkConfidence;
748
1778
  readonly durationDeltaMs?: number;
749
1779
  readonly attemptDelta?: number;
750
1780
  readonly reviewDeltaMinutes?: number;
@@ -759,12 +1789,6 @@ interface BenchmarkSummary {
759
1789
  readonly firstAttemptRuns: number;
760
1790
  readonly humanApprovedRuns: number;
761
1791
  readonly authorizedRuns: number;
762
- readonly effectiveRunCount: number;
763
- readonly effectiveCompleteRuns: number;
764
- readonly effectiveCompletionRate: number | null;
765
- readonly effectiveCheckPassRate: number | null;
766
- readonly effectiveOutcomePassRate: number | null;
767
- readonly effectiveEvidenceCoverageRate: number | null;
768
1792
  readonly checkPassRate: number | null;
769
1793
  readonly outcomePassRate: number | null;
770
1794
  readonly evidenceCoverageRate: number | null;
@@ -788,7 +1812,6 @@ interface BenchmarkReport {
788
1812
  readonly comparableTaskCount: number;
789
1813
  };
790
1814
  readonly comparisons: readonly BenchmarkComparison[];
791
- readonly qualityGate: BenchmarkQualityGate;
792
1815
  }
793
1816
  interface BenchmarkObservationInput {
794
1817
  readonly taskId: string;
@@ -797,9 +1820,6 @@ interface BenchmarkObservationInput {
797
1820
  readonly recordedAt?: string;
798
1821
  readonly attempts?: number;
799
1822
  readonly durationMs?: number;
800
- readonly durationSamplesMs?: readonly number[];
801
- readonly artifactAcceptanceRate?: number;
802
- readonly protocolCompletionRate?: number;
803
1823
  readonly reviewMinutes?: number;
804
1824
  readonly escapedIncomplete?: number;
805
1825
  readonly evidence?: readonly BenchmarkObservationEvidence[];
@@ -810,33 +1830,6 @@ declare const loadBenchmarkManifest: (path: string) => BenchmarkManifest;
810
1830
  declare const recordBenchmarkObservation: (path: string, input: BenchmarkObservationInput) => BenchmarkManifest;
811
1831
  declare const benchmarkRuns: (stateDir: string, manifest?: BenchmarkManifest) => BenchmarkReport;
812
1832
 
813
- type ExternalCodingBenchmarkStatus = 'ok' | 'partial' | 'fail' | 'timeout';
814
- interface ExternalCodingBenchmarkRow {
815
- readonly providerId: string;
816
- readonly status: ExternalCodingBenchmarkStatus;
817
- readonly completenessScore: number;
818
- readonly fileEditCount: number;
819
- readonly summary: string;
820
- readonly durationMs?: number;
821
- readonly inputTokens?: number;
822
- readonly outputTokens?: number;
823
- readonly costUsd?: number;
824
- readonly successPassed?: boolean;
825
- }
826
- interface ExternalCodingBenchmarkReport {
827
- readonly kind: string;
828
- readonly prompt: string;
829
- readonly dryRun: boolean;
830
- readonly isolateWorktrees: boolean;
831
- readonly repoRoot: string;
832
- readonly rows: readonly ExternalCodingBenchmarkRow[];
833
- }
834
- /**
835
- * Validates the stable report shape emitted by AgentsKit OS coding benchmarks.
836
- * Provider heuristics remain observations; this function never grants human acceptance.
837
- */
838
- declare const validateExternalCodingBenchmarkReport: (value: unknown) => ExternalCodingBenchmarkReport;
839
-
840
1833
  interface PolicyRule {
841
1834
  readonly id: string;
842
1835
  readonly effect: 'allow' | 'block' | 'approve';
@@ -915,6 +1908,229 @@ interface SessionRecorder {
915
1908
  }
916
1909
  declare const createSessionRecorder: ({ stateDir, run, adapter, policy, runtime, sessionId, resume }: AgentSessionOptions) => SessionRecorder;
917
1910
 
1911
+ interface MachineThresholds {
1912
+ readonly warningPercent: number;
1913
+ readonly criticalPercent: number;
1914
+ }
1915
+ declare const sampleMachine: () => MachineSample;
1916
+ declare const summarizeMachine: (samples: readonly MachineSample[], sampleIntervalMs?: number, limits?: Partial<MachineThresholds>) => MachineMetrics;
1917
+ declare const adaptiveConcurrency: (configured: number, sample: MachineSample, limits?: Partial<MachineThresholds>) => number;
1918
+ declare const createMachineMonitor: (sampleIntervalMs?: number, options?: {
1919
+ readonly sample?: () => MachineSample;
1920
+ readonly thresholds?: Partial<MachineThresholds>;
1921
+ }) => {
1922
+ readonly sample: () => MachineSample;
1923
+ readonly observeConcurrency: (value: number) => void;
1924
+ readonly markThrottle: () => void;
1925
+ readonly stop: () => MachineMetrics;
1926
+ };
1927
+
1928
+ interface CoordinationIdentity {
1929
+ readonly tracker: string;
1930
+ readonly repository: string;
1931
+ readonly issue: string;
1932
+ readonly worktree: string;
1933
+ readonly branch: string;
1934
+ }
1935
+ interface DispatchLease extends CoordinationIdentity {
1936
+ readonly key: string;
1937
+ readonly leaseId: string;
1938
+ readonly owner: string;
1939
+ readonly claimedAt: string;
1940
+ }
1941
+ interface ClaimResult {
1942
+ readonly decision: 'claimed' | 'already-claimed';
1943
+ readonly lease: DispatchLease;
1944
+ }
1945
+ interface DispatchRecord extends DispatchLease {
1946
+ readonly action: 'dispatch' | 'release' | 'recover';
1947
+ readonly at: string;
1948
+ readonly idempotencyKey?: string;
1949
+ readonly commandDigest?: string;
1950
+ readonly reason?: string;
1951
+ }
1952
+ interface DispatchLedger {
1953
+ claim(identity: CoordinationIdentity & {
1954
+ readonly owner: string;
1955
+ }): ClaimResult;
1956
+ recordDispatch(input: {
1957
+ readonly lease: DispatchLease;
1958
+ readonly idempotencyKey: string;
1959
+ readonly commandDigest: string;
1960
+ }): {
1961
+ readonly decision: 'recorded' | 'duplicate';
1962
+ readonly record: DispatchRecord;
1963
+ };
1964
+ release(lease: DispatchLease, reason?: string): DispatchRecord;
1965
+ recover(key: string, input: {
1966
+ readonly actor: string;
1967
+ readonly maxAgeMs?: number;
1968
+ readonly reason: string;
1969
+ }): DispatchRecord;
1970
+ active(): readonly DispatchLease[];
1971
+ records(): readonly DispatchRecord[];
1972
+ }
1973
+ declare const createDispatchLedger: (stateDir: string) => DispatchLedger;
1974
+
1975
+ interface ChangedFile {
1976
+ readonly path: string;
1977
+ readonly status?: string;
1978
+ }
1979
+ interface FilePreflightPlan {
1980
+ readonly files: readonly string[];
1981
+ readonly codeFiles: readonly string[];
1982
+ readonly testFiles: readonly string[];
1983
+ readonly docsOnly: boolean;
1984
+ readonly checks: readonly ('lint' | 'typecheck' | 'test')[];
1985
+ }
1986
+ declare const validateSafeCommand: (command: string) => {
1987
+ readonly valid: true;
1988
+ readonly command: string;
1989
+ };
1990
+ declare const planFilePreflight: (files: readonly ChangedFile[], options?: {
1991
+ readonly testRoots?: readonly string[];
1992
+ readonly includeTests?: boolean;
1993
+ }) => FilePreflightPlan;
1994
+
1995
+ declare const BLOCK_STATUSES: readonly ["todo", "picked", "development", "validation", "pr-open", "merged", "post-merge", "done", "blocked", "scope-cut"];
1996
+ type BlockStatus = typeof BLOCK_STATUSES[number];
1997
+ interface BlockManifest {
1998
+ readonly schemaVersion: 1;
1999
+ readonly id: string;
2000
+ readonly title: string;
2001
+ readonly tracker: string;
2002
+ readonly repository: string;
2003
+ readonly acceptanceCriteria: readonly string[];
2004
+ readonly dependencies: readonly string[];
2005
+ readonly wave: number;
2006
+ readonly status: BlockStatus;
2007
+ readonly budget?: {
2008
+ readonly maxMinutes?: number;
2009
+ readonly maxAttempts?: number;
2010
+ };
2011
+ readonly humanGates?: readonly string[];
2012
+ readonly sourceHash?: string;
2013
+ }
2014
+ interface BlockAssessment {
2015
+ readonly status: 'ready' | 'blocked';
2016
+ readonly manifestHash: string;
2017
+ readonly blockers: readonly string[];
2018
+ readonly next: readonly string[];
2019
+ }
2020
+ declare const validateBlockManifest: (value: unknown) => BlockManifest;
2021
+ declare const assessBlock: (manifest: BlockManifest, completedDependencies?: readonly string[]) => BlockAssessment;
2022
+
2023
+ declare const LEARNING_STATUSES: readonly ["proposed", "promoted", "rejected"];
2024
+ type LearningStatus = typeof LEARNING_STATUSES[number];
2025
+ interface LearningRecord {
2026
+ readonly id: string;
2027
+ readonly source: string;
2028
+ readonly category: 'worked' | 'problem' | 'adjustment' | 'other';
2029
+ readonly text: string;
2030
+ readonly status: LearningStatus;
2031
+ readonly recordedAt: string;
2032
+ }
2033
+ declare const parseRetro: (markdown: string, source: string, recordedAt?: string) => readonly LearningRecord[];
2034
+ declare const promoteLearnings: (records: readonly LearningRecord[], input: {
2035
+ readonly actor: string;
2036
+ readonly ids: readonly string[];
2037
+ readonly status?: "promoted" | "rejected";
2038
+ }) => readonly LearningRecord[];
2039
+
2040
+ interface StatusBlock {
2041
+ readonly id: string;
2042
+ readonly status: BlockStatus;
2043
+ readonly owner?: string;
2044
+ readonly issue?: string;
2045
+ readonly branch?: string;
2046
+ readonly revision?: string;
2047
+ readonly blockers?: readonly string[];
2048
+ }
2049
+ interface StatusSnapshot {
2050
+ readonly schemaVersion: 1;
2051
+ readonly generatedAt: string;
2052
+ readonly sourceRevision: string;
2053
+ readonly blocks: readonly StatusBlock[];
2054
+ readonly machine?: MachineMetrics;
2055
+ readonly metrics?: Readonly<Record<string, number>>;
2056
+ readonly next?: string;
2057
+ readonly digest: string;
2058
+ }
2059
+ declare const createStatusSnapshot: (input: Omit<StatusSnapshot, "schemaVersion" | "digest">) => StatusSnapshot;
2060
+ declare const validateStatusSnapshot: (value: unknown) => StatusSnapshot;
2061
+
2062
+ declare const MODEL_ROLES: readonly ["orchestrator", "reviewer", "builder", "watcher"];
2063
+ type ModelRole = typeof MODEL_ROLES[number];
2064
+ interface ModelBinding {
2065
+ readonly role: ModelRole;
2066
+ readonly provider: string;
2067
+ readonly model: string;
2068
+ readonly maxTokens?: number;
2069
+ }
2070
+ interface ModelPolicy {
2071
+ readonly bindings: readonly ModelBinding[];
2072
+ readonly digest: string;
2073
+ }
2074
+ declare const createModelPolicy: (bindings: readonly ModelBinding[]) => ModelPolicy;
2075
+ declare const modelFor: (policy: ModelPolicy, role: ModelRole) => ModelBinding;
2076
+
2077
+ interface OrcaDispatchInput {
2078
+ readonly repository: string;
2079
+ readonly worktree: string;
2080
+ readonly branch: string;
2081
+ readonly baseBranch: string;
2082
+ readonly goalFile: string;
2083
+ readonly agent?: string;
2084
+ }
2085
+ interface OrcaDispatchPlan {
2086
+ readonly argv: readonly string[];
2087
+ readonly commandDigest: string;
2088
+ readonly idempotencyKey: string;
2089
+ }
2090
+ type OrcaLeaseState = 'acquired' | 'resumed' | 'conflict' | 'released';
2091
+ interface OrcaLifecycleInput {
2092
+ readonly issueRef: string;
2093
+ readonly repository: string;
2094
+ readonly worktree: string;
2095
+ readonly branch: string;
2096
+ readonly leaseState: OrcaLeaseState;
2097
+ readonly issueLock: 'held' | 'missing';
2098
+ readonly expectedRemoteSha?: string;
2099
+ readonly observedRemoteSha?: string;
2100
+ readonly cleanupRequested?: boolean;
2101
+ }
2102
+ interface OrcaLifecycleProjection {
2103
+ readonly status: 'ready' | 'resume' | 'blocked' | 'escalated';
2104
+ readonly leaseState: OrcaLeaseState;
2105
+ readonly worktreeKey: string;
2106
+ readonly issueLock: 'held' | 'missing';
2107
+ readonly remoteShaConfirmed: boolean;
2108
+ readonly cleanupAllowed: boolean;
2109
+ readonly assurance: AssuranceLevel;
2110
+ readonly telemetry: AdapterTelemetry;
2111
+ }
2112
+ declare const createOrcaDispatchPlan: (input: OrcaDispatchInput) => OrcaDispatchPlan;
2113
+ declare const createOrcaLifecycleProjection: (input: OrcaLifecycleInput) => OrcaLifecycleProjection;
2114
+
2115
+ interface TrackingTransition {
2116
+ readonly tracker: string;
2117
+ readonly issue: string;
2118
+ readonly from?: string;
2119
+ readonly to: string;
2120
+ readonly reason: string;
2121
+ readonly idempotencyKey: string;
2122
+ }
2123
+ interface TrackingAdapter {
2124
+ readonly id: string;
2125
+ readonly assurance?: AssuranceLevel;
2126
+ readonly telemetry?: () => AdapterTelemetry;
2127
+ transition(input: Omit<TrackingTransition, 'idempotencyKey'>): Promise<TrackingTransition>;
2128
+ }
2129
+ declare const createTrackingTransition: (input: Omit<TrackingTransition, "idempotencyKey">) => TrackingTransition;
2130
+ declare const createTrackingAdapter: (id: string, handler: (input: TrackingTransition) => Promise<void> | void, options?: {
2131
+ readonly dryRun?: boolean;
2132
+ }) => TrackingAdapter;
2133
+
918
2134
  declare const EVIDENCE_BUNDLE_SCHEMA_VERSION: 1;
919
2135
  interface EvidenceBundleFile {
920
2136
  readonly path: string;
@@ -965,4 +2181,4 @@ declare const verifyEvidenceBundle: (path: string, { trustedKeys }?: {
965
2181
  }) => EvidenceBundleVerification;
966
2182
  declare const readEvidenceTrustStore: (path: string) => readonly TrustedEvidenceKey[];
967
2183
 
968
- export { type AgentAdapter, type AgentSessionOptions, BENCHMARK_SCHEMA_VERSION, type BenchmarkBinding, type BenchmarkComparison, type BenchmarkConfidence, type BenchmarkImprovementDirection, type BenchmarkManifest, type BenchmarkObservation, type BenchmarkObservationEvidence, type BenchmarkObservationInput, type BenchmarkObservationStatus, type BenchmarkPolicy, type BenchmarkQualityGate, type BenchmarkReport, type BenchmarkRun, type BenchmarkSuiteSource, type BenchmarkSummary, type BenchmarkTask, type BenchmarkTaskFile, type BenchmarkTaskScope, type BenchmarkTaskSource, CHECK_CATEGORIES, CONTEXT_PROVIDER_SLOT, type CheckCategory, type CheckResult, type ContextProvider, type ContextQuery, type ContextReference, type ContextSnapshot, type ContractOutcome, type ContractScope, type Disposer, type DockerMount, type DockerRuntimeEvidence, type DockerToolDefinition, EVENT_LOG_GENESIS, EVIDENCE_BUNDLE_SCHEMA_VERSION, type EventLogLock, type EventLogLockRecovery, type EventLogLockStatus, type EventLogVerification, type EventStore, type EvidenceArtifact, type EvidenceBundle, type EvidenceBundleFile, type EvidenceBundleSignature, type EvidenceBundleVerification, type EvidenceReference, type ExternalCodingBenchmarkReport, type ExternalCodingBenchmarkRow, type ExternalCodingBenchmarkStatus, FileEventStore, HARNESS_EVENT_SCHEMA_VERSION, HARNESS_EVENT_TYPES, HARNESS_PLUGIN_API_VERSION, HarnessError, type HarnessEvent, type HarnessEventInput, type HarnessEventListener, type HarnessEventPayloads, type HarnessEventType, type HarnessPlugin, type HarnessPluginContext, LEGAL_TRANSITIONS, type LoadedConfig, type PluginContribution, type PluginRegistry, type PluginSlot, type PolicyDecision, type PolicyGate, type PolicyRequest, type PolicyRule, type ProcessToolDefinition, RUN_STATES, type RunOutcome, type RunReconciliation, type RunState, STATES, SURFACE_NAMES, type SessionRecorder, type SourceSnapshot, type StateTransition, type StructuredEvidence, type SurfaceName, type SurfaceRequirement, type TaskContract, type ToolDefinition, type ToolExecutionRequest, type ToolExecutionResult, type ToolRuntime, type TrackingConfig, type TrustedEvidenceKey, type VerificationCheck, type VerificationConfig, type VerificationRun, approveRun, approvedDecision, assertHuman, authorizeRun, benchmarkRuns, cancelRun, cleanTaskArtifacts, createDocBridgeContextProvider, createDockerToolRuntime, createPluginRegistry, createPluginSlot, createPolicyGate, createProcessToolRuntime, createSessionRecorder, createToolRuntime, exportEvidenceBundle, hashContextSnapshot, hashContextSnapshots, inspectEventLogLock, loadBenchmarkManifest, loadConfig, loadLatestRun, planRun, readContextSnapshots, readEvidenceTrustStore, reconcileRun, recordBenchmarkObservation, recoverEventLogLock, retryRun, startRun, transition, validateBenchmarkManifest, validateConfig, validateContextSnapshot, validateContextSnapshots, validateExternalCodingBenchmarkReport, verifyEvidenceBundle, verifyRun };
2184
+ export { ARTIFACT_SCHEMA_VERSION, ARTIFACT_TYPES, ASSURANCE_LEVELS, type AdapterMetadata, type AdapterTelemetry, type AdversarialReviewResult, type AgentAdapter, type AgentEvalCase, type AgentEvalReport, type AgentEvalSuite, type AgentMemoryAdapter, type AgentMemoryHit, type AgentMemoryKvStore, type AgentMemoryRecord, type AgentSessionOptions, type AgentUsage, type ApprovedAssumption, type ArtifactBinding, type ArtifactEnvelope, type ArtifactEnvelopeInput, type ArtifactType, type AssuranceLevel, type AutonomyMode, BENCHMARK_SCHEMA_VERSION, BLOCK_STATUSES, type BenchmarkBinding, type BenchmarkComparison, type BenchmarkImprovementDirection, type BenchmarkManifest, type BenchmarkObservation, type BenchmarkObservationEvidence, type BenchmarkObservationInput, type BenchmarkObservationStatus, type BenchmarkReport, type BenchmarkRun, type BenchmarkSummary, type BenchmarkTask, type BlockAssessment, type BlockManifest, type BlockStatus, CAPABILITY_KINDS, CAPABILITY_MANIFEST_SCHEMA_VERSION, CHECK_CATEGORIES, COMPATIBILITY_COMPONENTS, COMPATIBILITY_SCHEMA_VERSION, CONTEXT_PROVIDER_SLOT, type CacheUsage, type CapabilityDescriptor, type CapabilityKind, type CapabilityManifest, type CapabilityManifestInput, type ChangedFile, type CheckCategory, type CheckResult, type ClaimResult, type CodingAgentAdapter, type CodingAgentHandlerResult, type CodingAgentRequest, type CodingAgentResult, type CompatibilityComponent, type CompatibilityComponentId, type CompatibilityManifest, type CompatibilityObservation, type CompatibilityReport, type CompatibilityStatus, type ContextProvider, type ContextQuery, type ContextReference, type ContextSnapshot, type ContractOutcome, type ContractScope, type CoordinationIdentity, type CriterionStatus, type CycleIterationMetrics, type CycleMatrixRow, type CycleStepResult, type CycleStepStatus, type DecisionPacket, type DiscoveryAmbiguity, type DiscoveryCurrentInput, type DiscoveryCurrentResult, type DiscoveryDecisionLogEntry, type DiscoveryInput, type DiscoveryOption, type DiscoveryResult, type DispatchLease, type DispatchLedger, type DispatchRecord, type Disposer, type DockerMount, type DockerRuntimeEvidence, type DockerToolDefinition, EVAL_COMPONENTS, EVAL_LAYERS, EVAL_MANIFEST_SCHEMA_VERSION, EVENT_LOG_GENESIS, EVIDENCE_BUNDLE_SCHEMA_VERSION, type EvalBatteryReport, type EvalCaseDefinition, type EvalCaseReport, type EvalComponent, type EvalExpectation, type EvalLayer, type EvalManifest, type EvalObservation, type EvalObservationStatus, type EventLogLock, type EventLogLockRecovery, type EventLogLockStatus, type EventLogVerification, type EventStore, type EvidenceArtifact, type EvidenceBundle, type EvidenceBundleFile, type EvidenceBundleSignature, type EvidenceBundleVerification, type EvidenceReference, type ExecutePhaseProfileOptions, type FailureClass, type FailureClassification, FileArtifactStore, FileEventStore, type FilePreflightPlan, type GateAssessment, type GateBinding, type GateCriterion, HARNESS_ERROR_CATALOG, HARNESS_ERROR_CODES, HARNESS_EVENT_ENVELOPE_SCHEMA_VERSION, HARNESS_EVENT_SCHEMA_VERSION, HARNESS_EVENT_TYPES, HARNESS_PLUGIN_API_VERSION, HarnessError, type HarnessErrorClassification, type HarnessErrorDisposition, type HarnessEvent, type HarnessEventContext, type HarnessEventEnvelope, type HarnessEventEnvelopeInput, type HarnessEventInput, type HarnessEventListener, type HarnessEventPayloads, type HarnessEventProvenance, type HarnessEventType, type HarnessPlugin, type HarnessPluginContext, IMPROVEMENT_CYCLE_STEPS, type ImprovementCycleAssessment, type ImprovementCycleInput, type ImprovementCycleIteration, type ImprovementCycleStep, LEARNING_STATUSES, LEGAL_TRANSITIONS, type LearningRecord, type LearningStatus, type LlmCache, type LlmCacheKeyInput, type LlmCacheStats, type LoadedConfig, MEMORY_SCOPES, MODEL_ROLES, type MachineMetrics, type MachineSample, type MachineThresholds, type MemoryScope, type MemoryUsage, type MetricStatus, type ModelBinding, type ModelPolicy, type ModelRole, type NormalizedPhaseProfile, type OptimizationComparison, type OptimizationObservation, type OrcaDispatchInput, type OrcaDispatchPlan, type OrcaLeaseState, type OrcaLifecycleInput, type OrcaLifecycleProjection, PHASE_DECISIONS, PHASE_EFFECTS, PHASE_EFFECT_ACTIONS, PHASE_MODES, type ParallelismUsage, type PhaseAmbiguity, type PhaseContext, type PhaseDecision, type PhaseDecisionPacket, type PhaseDefinition, type PhaseEffect, type PhaseEffectAction, type PhaseEffectPolicy, type PhaseExecution, type PhaseExecutionReport, type PhaseGateEvaluator, type PhaseGateResult, type PhaseHandler, type PhaseHandlerResult, type PhaseMachineMetrics, type PhaseMode, type PhasePreflight, type PhasePreflightResult, type PhaseProfile, type PhaseResumeState, type PhaseRetryPolicy, type PhaseRoutePlan, type PhaseTelemetry, type PhaseTokenMetrics, type PilotAssessment, type PilotEntry, type PilotManifest, type PluginContribution, type PluginRegistry, type PluginSlot, type PolicyDecision, type PolicyGate, type PolicyRequest, type PolicyRule, type ProcessToolDefinition, type ProductionEvidence, type PullRequestApproval, type PullRequestDraft, QUALITY_DIMENSIONS, type QaTransitionAssessment, type QualityDimension, type QualityDimensionScore, type QualityMatrix, RUN_STATES, type RecoveryObservation, type RecoveryPolicy, type RecoveryResult, type RepositoryProfile, type ReviewLens, type ReviewVerdict, type RunOutcome, type RunReconciliation, type RunState, type RuntimeConfig, type RuntimeExperimentCandidate, type RuntimeExperimentResult, STATES, SURFACE_NAMES, type SessionRecorder, type SourceSnapshot, type StateTransition, type StatusBlock, type StatusSnapshot, type StructuredEvidence, type SurfaceName, type SurfaceRequirement, type TaskContract, type TokenUsage, type ToolDefinition, type ToolExecutionRequest, type ToolExecutionResult, type ToolRuntime, type TrackingAdapter, type TrackingConfig, type TrackingTransition, type TrustedEvidenceKey, type VerificationCheck, type VerificationConfig, type VerificationRun, WIP_STATES, type WatchdogBlocker, type WatchdogBudget, type WatchdogResult, type WipAssessment, type WipAssessmentInput, type WipEntry, type WipState, type WorkflowNode, type WorkflowResult, adaptiveConcurrency, approveRun, approvedDecision, artifactDigest, artifactFilePath, artifactIsFresh, artifactMarkdownPath, assertHuman, assessAcceptance, assessAgentEval, assessBlock, assessCompatibility, assessDiscovery, assessImprovementCycle, assessIntegration, assessPilot, assessPreflight, assessProduction, assessQaTransition, assessWip, assessWorktreeCleanup, authorizeRun, benchmarkRuns, cancelRun, classifyFailure, classifyHarnessError, cleanTaskArtifacts, compareOptimization, composePullRequest, createArtifactEnvelope, createCapabilityManifest, createCodingAgentAdapter, createCompatibilityManifest, createConfiguredToolRuntime, createDispatchLedger, createDocBridgeContextProvider, createDockerToolRuntime, createEvalManifest, createHarnessEventEnvelope, createInMemoryMemoryAdapter, createKvMemoryAdapter, createLlmCache, createLlmCacheKey, createMachineMonitor, createModelPolicy, createOrcaDispatchPlan, createOrcaLifecycleProjection, createPhaseArtifact, createPhaseProfile, createPluginRegistry, createPluginSlot, createPolicyGate, createProcessToolRuntime, createPullRequestApproval, createQualityMatrix, createSessionRecorder, createStatusSnapshot, createToolRuntime, createTrackingAdapter, createTrackingTransition, evaluateWatchdog, executePhaseProfile, exportEvidenceBundle, hashContextSnapshot, hashContextSnapshots, inspectEventLogLock, isDiscoveryCurrent, loadBenchmarkManifest, loadConfig, loadLatestRun, modelFor, parseRetro, planFilePreflight, planPhaseProfile, planRun, promoteLearnings, readArtifactFile, readContextSnapshots, readEvidenceTrustStore, reconcileRun, recordBenchmarkObservation, recoverEventLogLock, recoveryDelayMs, renderArtifactMarkdown, resumeStateFromArtifacts, retryRun, runAdversarialReview, runAgentEval, runEvalBattery, runWithRecovery, runWorkflow, sampleMachine, selectRuntime, startRun, summarizeMachine, transition, unknownTelemetry, validateAdapterMetadata, validateArtifactEnvelope, validateBenchmarkManifest, validateBlockManifest, validateCacheableOperation, validateCapabilityManifest, validateCompatibilityManifest, validateConfig, validateContextSnapshot, validateContextSnapshots, validateEvalManifest, validateHarnessErrorClassification, validateHarnessEventEnvelope, validateMemoryRecord, validateOptimizationObservation, validatePhaseTelemetry, validateSafeCommand, validateStatusSnapshot, verifyEvidenceBundle, verifyPullRequestApproval, verifyRun };