@agentskit/harness 0.3.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.
- package/CHANGELOG.md +7 -0
- package/README.md +77 -2
- package/capabilities/public-surface.json +668 -0
- package/compatibility/manifest.json +17 -0
- package/compatibility/migration.md +10 -0
- package/compatibility/report.json +23 -0
- package/compatibility/report.md +22 -0
- package/compatibility/rollback.md +8 -0
- package/dist/cli.js +185 -41
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +633 -35
- package/dist/index.js +1344 -300
- package/dist/index.js.map +1 -1
- package/docs/ADR-0026-kernel-adapters-boundary.md +82 -0
- package/docs/GETTING-STARTED.md +18 -0
- package/docs/MODULE-BOUNDARIES.md +143 -0
- package/docs/ORGANIZATION.md +13 -4
- package/docs/TROUBLESHOOTING.md +24 -0
- package/examples/minimum-profile.mjs +27 -0
- package/package.json +13 -2
- package/release/manifest.json +14 -0
- package/release/notes.md +10 -0
- package/release/qualification.json +14 -0
package/dist/index.d.ts
CHANGED
|
@@ -13,12 +13,50 @@ declare const LEGAL_TRANSITIONS: {
|
|
|
13
13
|
readonly SUPERSEDED: readonly [];
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
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 {
|
|
@@ -108,9 +149,34 @@ declare const createDockerToolRuntime: ({ tools, timeoutMs, maxOutputBytes, dock
|
|
|
108
149
|
}) => ToolRuntime;
|
|
109
150
|
|
|
110
151
|
declare const HARNESS_EVENT_SCHEMA_VERSION: 1;
|
|
152
|
+
declare const HARNESS_EVENT_ENVELOPE_SCHEMA_VERSION: 2;
|
|
111
153
|
declare const EVENT_LOG_GENESIS: "GENESIS";
|
|
112
|
-
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"];
|
|
113
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;
|
|
114
180
|
interface HarnessEventContext {
|
|
115
181
|
readonly operationId: string;
|
|
116
182
|
readonly runId?: string;
|
|
@@ -145,6 +211,14 @@ interface HarnessEventPayloads {
|
|
|
145
211
|
readonly totalDurationMs: number;
|
|
146
212
|
readonly budgetExceeded: boolean;
|
|
147
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
|
+
};
|
|
148
222
|
readonly 'approval.recorded': {
|
|
149
223
|
readonly decision: 'approved' | 'rejected';
|
|
150
224
|
readonly resultingState: RunState;
|
|
@@ -345,6 +419,7 @@ interface ContextReference {
|
|
|
345
419
|
readonly title?: string;
|
|
346
420
|
readonly version?: string;
|
|
347
421
|
readonly contentHash?: string;
|
|
422
|
+
readonly relevance?: number;
|
|
348
423
|
}
|
|
349
424
|
interface ContextSnapshot {
|
|
350
425
|
readonly providerId: string;
|
|
@@ -353,6 +428,8 @@ interface ContextSnapshot {
|
|
|
353
428
|
readonly sourceHash: string;
|
|
354
429
|
readonly snapshotHash: string;
|
|
355
430
|
readonly resolvedAt: string;
|
|
431
|
+
readonly assurance?: AssuranceLevel;
|
|
432
|
+
readonly telemetry?: AdapterTelemetry;
|
|
356
433
|
}
|
|
357
434
|
interface ContextProvider {
|
|
358
435
|
readonly id: string;
|
|
@@ -621,6 +698,37 @@ declare const cleanTaskArtifacts: (configPath: string) => {
|
|
|
621
698
|
readonly cleaned: readonly string[];
|
|
622
699
|
};
|
|
623
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
|
+
|
|
624
732
|
interface DocBridgeContextProviderOptions {
|
|
625
733
|
readonly root: string;
|
|
626
734
|
readonly indexPath?: string;
|
|
@@ -736,6 +844,32 @@ interface RuntimeExperimentResult {
|
|
|
736
844
|
}
|
|
737
845
|
declare const selectRuntime: (candidates: readonly RuntimeExperimentCandidate[]) => RuntimeExperimentResult;
|
|
738
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>>;
|
|
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
|
+
|
|
739
873
|
type CriterionStatus = 'passed' | 'failed' | 'pending' | 'not-applicable';
|
|
740
874
|
interface GateCriterion {
|
|
741
875
|
readonly id: string;
|
|
@@ -790,6 +924,44 @@ declare const composePullRequest: ({ draft, g2, remote }: {
|
|
|
790
924
|
readonly reason: string;
|
|
791
925
|
readonly idempotencyKey: string;
|
|
792
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;
|
|
793
965
|
declare const assessIntegration: ({ g2, candidateRevision, evidenceRevision, contractHash, configHash, ci }: {
|
|
794
966
|
readonly g2: GateAssessment;
|
|
795
967
|
readonly candidateRevision: string;
|
|
@@ -931,6 +1103,69 @@ interface AgentEvalReport {
|
|
|
931
1103
|
readonly accuracy: number;
|
|
932
1104
|
readonly failures: readonly string[];
|
|
933
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>;
|
|
934
1169
|
declare const runAgentEval: ({ suite, agent, concurrency }: {
|
|
935
1170
|
readonly suite: AgentEvalSuite;
|
|
936
1171
|
readonly agent: (input: string) => Promise<string>;
|
|
@@ -962,6 +1197,8 @@ interface LlmCacheStats {
|
|
|
962
1197
|
declare const validateCacheableOperation: (operation: unknown) => "context" | "read-only";
|
|
963
1198
|
declare const createLlmCacheKey: (input: LlmCacheKeyInput) => string;
|
|
964
1199
|
interface LlmCache<T> {
|
|
1200
|
+
readonly assurance?: AssuranceLevel;
|
|
1201
|
+
readonly telemetry?: () => AdapterTelemetry;
|
|
965
1202
|
getOrCompute(key: string, compute: () => Promise<T>): Promise<T>;
|
|
966
1203
|
invalidate(key?: string): void;
|
|
967
1204
|
stats(): LlmCacheStats;
|
|
@@ -1039,6 +1276,8 @@ interface AgentMemoryHit {
|
|
|
1039
1276
|
interface AgentMemoryAdapter {
|
|
1040
1277
|
readonly id: string;
|
|
1041
1278
|
readonly version: string;
|
|
1279
|
+
readonly assurance?: AssuranceLevel;
|
|
1280
|
+
readonly telemetry?: () => AdapterTelemetry;
|
|
1042
1281
|
remember(record: AgentMemoryRecord): Promise<void>;
|
|
1043
1282
|
recall(input: {
|
|
1044
1283
|
readonly query: string;
|
|
@@ -1081,6 +1320,369 @@ declare const runWorkflow: <T>(nodes: readonly WorkflowNode<T>[], options: {
|
|
|
1081
1320
|
readonly currentConcurrency?: () => number;
|
|
1082
1321
|
}) => Promise<WorkflowResult<T>>;
|
|
1083
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;
|
|
1573
|
+
readonly revision: 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;
|
|
1649
|
+
}
|
|
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
|
+
|
|
1084
1686
|
declare const BENCHMARK_SCHEMA_VERSION: 1;
|
|
1085
1687
|
type BenchmarkObservationStatus = 'passed' | 'failed' | 'blocked' | 'not-run';
|
|
1086
1688
|
type BenchmarkImprovementDirection = 'improved' | 'regressed' | 'unchanged' | 'unavailable';
|
|
@@ -1370,37 +1972,6 @@ interface DispatchLedger {
|
|
|
1370
1972
|
}
|
|
1371
1973
|
declare const createDispatchLedger: (stateDir: string) => DispatchLedger;
|
|
1372
1974
|
|
|
1373
|
-
type FailureClass = 'quota' | 'timeout' | 'policy' | 'validation' | 'external' | 'unknown';
|
|
1374
|
-
interface FailureClassification {
|
|
1375
|
-
readonly class: FailureClass;
|
|
1376
|
-
readonly retryable: boolean;
|
|
1377
|
-
readonly reason: string;
|
|
1378
|
-
}
|
|
1379
|
-
interface RecoveryPolicy {
|
|
1380
|
-
readonly maxAttempts: number;
|
|
1381
|
-
readonly baseDelayMs: number;
|
|
1382
|
-
readonly maxDelayMs: number;
|
|
1383
|
-
readonly timeoutMs?: number;
|
|
1384
|
-
}
|
|
1385
|
-
interface RecoveryObservation {
|
|
1386
|
-
readonly attempt: number;
|
|
1387
|
-
readonly failure: FailureClassification;
|
|
1388
|
-
readonly delayMs: number;
|
|
1389
|
-
}
|
|
1390
|
-
interface RecoveryResult<T> {
|
|
1391
|
-
readonly value?: T;
|
|
1392
|
-
readonly status: 'completed' | 'failed';
|
|
1393
|
-
readonly attempts: number;
|
|
1394
|
-
readonly observations: readonly RecoveryObservation[];
|
|
1395
|
-
readonly failure?: FailureClassification;
|
|
1396
|
-
}
|
|
1397
|
-
declare const classifyFailure: (error: unknown) => FailureClassification;
|
|
1398
|
-
declare const recoveryDelayMs: (attempt: number, policy: Pick<RecoveryPolicy, "baseDelayMs" | "maxDelayMs">) => number;
|
|
1399
|
-
declare const runWithRecovery: <T>(operation: (signal: AbortSignal, attempt: number) => Promise<T>, options: RecoveryPolicy & {
|
|
1400
|
-
readonly sleep?: (delayMs: number) => Promise<void>;
|
|
1401
|
-
readonly onObservation?: (observation: RecoveryObservation) => void;
|
|
1402
|
-
}) => Promise<RecoveryResult<T>>;
|
|
1403
|
-
|
|
1404
1975
|
interface ChangedFile {
|
|
1405
1976
|
readonly path: string;
|
|
1406
1977
|
readonly status?: string;
|
|
@@ -1516,7 +2087,30 @@ interface OrcaDispatchPlan {
|
|
|
1516
2087
|
readonly commandDigest: string;
|
|
1517
2088
|
readonly idempotencyKey: string;
|
|
1518
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
|
+
}
|
|
1519
2112
|
declare const createOrcaDispatchPlan: (input: OrcaDispatchInput) => OrcaDispatchPlan;
|
|
2113
|
+
declare const createOrcaLifecycleProjection: (input: OrcaLifecycleInput) => OrcaLifecycleProjection;
|
|
1520
2114
|
|
|
1521
2115
|
interface TrackingTransition {
|
|
1522
2116
|
readonly tracker: string;
|
|
@@ -1528,10 +2122,14 @@ interface TrackingTransition {
|
|
|
1528
2122
|
}
|
|
1529
2123
|
interface TrackingAdapter {
|
|
1530
2124
|
readonly id: string;
|
|
2125
|
+
readonly assurance?: AssuranceLevel;
|
|
2126
|
+
readonly telemetry?: () => AdapterTelemetry;
|
|
1531
2127
|
transition(input: Omit<TrackingTransition, 'idempotencyKey'>): Promise<TrackingTransition>;
|
|
1532
2128
|
}
|
|
1533
2129
|
declare const createTrackingTransition: (input: Omit<TrackingTransition, "idempotencyKey">) => TrackingTransition;
|
|
1534
|
-
declare const createTrackingAdapter: (id: string, handler: (input: TrackingTransition) => Promise<void> | void
|
|
2130
|
+
declare const createTrackingAdapter: (id: string, handler: (input: TrackingTransition) => Promise<void> | void, options?: {
|
|
2131
|
+
readonly dryRun?: boolean;
|
|
2132
|
+
}) => TrackingAdapter;
|
|
1535
2133
|
|
|
1536
2134
|
declare const EVIDENCE_BUNDLE_SCHEMA_VERSION: 1;
|
|
1537
2135
|
interface EvidenceBundleFile {
|
|
@@ -1583,4 +2181,4 @@ declare const verifyEvidenceBundle: (path: string, { trustedKeys }?: {
|
|
|
1583
2181
|
}) => EvidenceBundleVerification;
|
|
1584
2182
|
declare const readEvidenceTrustStore: (path: string) => readonly TrustedEvidenceKey[];
|
|
1585
2183
|
|
|
1586
|
-
export { type AgentAdapter, type AgentEvalCase, type AgentEvalReport, type AgentEvalSuite, type AgentMemoryAdapter, type AgentMemoryHit, type AgentMemoryKvStore, type AgentMemoryRecord, type AgentSessionOptions, type ApprovedAssumption, 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, CHECK_CATEGORIES, CONTEXT_PROVIDER_SLOT, type CacheUsage, type ChangedFile, type CheckCategory, type CheckResult, type ClaimResult, 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, EVENT_LOG_GENESIS, EVIDENCE_BUNDLE_SCHEMA_VERSION, type EvalExpectation, type EventLogLock, type EventLogLockRecovery, type EventLogLockStatus, type EventLogVerification, type EventStore, type EvidenceArtifact, type EvidenceBundle, type EvidenceBundleFile, type EvidenceBundleSignature, type EvidenceBundleVerification, type EvidenceReference, type FailureClass, type FailureClassification, FileEventStore, type FilePreflightPlan, type GateAssessment, type GateBinding, type GateCriterion, HARNESS_EVENT_SCHEMA_VERSION, HARNESS_EVENT_TYPES, HARNESS_PLUGIN_API_VERSION, HarnessError, type HarnessEvent, type HarnessEventContext, type HarnessEventInput, type HarnessEventListener, type HarnessEventPayloads, 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 ModelBinding, type ModelPolicy, type ModelRole, type OptimizationComparison, type OptimizationObservation, type OrcaDispatchInput, type OrcaDispatchPlan, type ParallelismUsage, 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 PullRequestDraft, RUN_STATES, type RecoveryObservation, type RecoveryPolicy, type RecoveryResult, type RepositoryProfile, 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 WipAssessment, type WipAssessmentInput, type WipEntry, type WipState, type WorkflowNode, type WorkflowResult, adaptiveConcurrency, approveRun, approvedDecision, assertHuman, assessAcceptance, assessAgentEval, assessBlock, assessDiscovery, assessImprovementCycle, assessIntegration, assessPilot, assessPreflight, assessProduction, assessWip, assessWorktreeCleanup, authorizeRun, benchmarkRuns, cancelRun, classifyFailure, cleanTaskArtifacts, compareOptimization, composePullRequest, createConfiguredToolRuntime, createDispatchLedger, createDocBridgeContextProvider, createDockerToolRuntime, createInMemoryMemoryAdapter, createKvMemoryAdapter, createLlmCache, createLlmCacheKey, createMachineMonitor, createModelPolicy, createOrcaDispatchPlan, createPluginRegistry, createPluginSlot, createPolicyGate, createProcessToolRuntime, createSessionRecorder, createStatusSnapshot, createToolRuntime, createTrackingAdapter, createTrackingTransition, exportEvidenceBundle, hashContextSnapshot, hashContextSnapshots, inspectEventLogLock, isDiscoveryCurrent, loadBenchmarkManifest, loadConfig, loadLatestRun, modelFor, parseRetro, planFilePreflight, planRun, promoteLearnings, readContextSnapshots, readEvidenceTrustStore, reconcileRun, recordBenchmarkObservation, recoverEventLogLock, recoveryDelayMs, retryRun, runAgentEval, runWithRecovery, runWorkflow, sampleMachine, selectRuntime, startRun, summarizeMachine, transition, validateBenchmarkManifest, validateBlockManifest, validateCacheableOperation, validateConfig, validateContextSnapshot, validateContextSnapshots, validateMemoryRecord, validateOptimizationObservation, validateSafeCommand, validateStatusSnapshot, 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 };
|