@alisio/sdk 0.6.0 → 0.8.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/dist/index.d.ts +442 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -792,6 +792,19 @@ export interface RunEventDataMap {
|
|
|
792
792
|
latencyMs: number;
|
|
793
793
|
reason: DecisionFallbackReason;
|
|
794
794
|
};
|
|
795
|
+
/** A Proof criterion changed derived status or gained evidence. */
|
|
796
|
+
proof_updated: {
|
|
797
|
+
criterionId: string;
|
|
798
|
+
status: ProofStatus;
|
|
799
|
+
stale: boolean;
|
|
800
|
+
evidenceId?: string;
|
|
801
|
+
};
|
|
802
|
+
/** The final text claims something the Proof ledger does not back (display only). */
|
|
803
|
+
proof_divergence: {
|
|
804
|
+
claim: string;
|
|
805
|
+
criterionId?: string;
|
|
806
|
+
actual: ProofStatus;
|
|
807
|
+
};
|
|
795
808
|
}
|
|
796
809
|
/** Every `RunEvent.type` the core emits today. `RunEvent.type` itself stays `string`. */
|
|
797
810
|
export type RunEventType = keyof RunEventDataMap;
|
|
@@ -1155,6 +1168,11 @@ export interface PlanReview {
|
|
|
1155
1168
|
artifact?: ArtifactRef;
|
|
1156
1169
|
/** The diagrams that were accepted for this revision (absent without diagrams). */
|
|
1157
1170
|
diagrams?: PlanDiagramInfo[];
|
|
1171
|
+
/**
|
|
1172
|
+
* Acceptance criteria the model proposed (drafts). Approving the plan activates exactly these;
|
|
1173
|
+
* any other decision discards them (absent when none were proposed).
|
|
1174
|
+
*/
|
|
1175
|
+
acceptanceCriteria?: PlanCriterionDraft[];
|
|
1158
1176
|
}
|
|
1159
1177
|
/** What a diagram illustrates: a purpose, not a Mermaid syntax. */
|
|
1160
1178
|
export type PlanDiagramType = "overview" | "flow" | "components" | "architecture" | "sequence" | "data" | "state" | "other";
|
|
@@ -1218,6 +1236,8 @@ export interface PlanManifest {
|
|
|
1218
1236
|
id: string;
|
|
1219
1237
|
title: string;
|
|
1220
1238
|
}>;
|
|
1239
|
+
/** The acceptance-criteria drafts of this revision (absent when none were proposed). */
|
|
1240
|
+
acceptanceCriteria?: PlanCriterionDraft[];
|
|
1221
1241
|
}
|
|
1222
1242
|
/** Lifecycle of a background task (`bg_run`); a terminal state is never left. */
|
|
1223
1243
|
export type BackgroundTaskStatus = "queued" | "running" | "stopping" | "succeeded" | "failed" | "cancelled" | "lost";
|
|
@@ -1270,7 +1290,9 @@ export interface BackgroundTaskOutput {
|
|
|
1270
1290
|
/** The state of a session goal (`/goal`); `complete` and `budget_limited` are final unless re-armed. */
|
|
1271
1291
|
export type GoalStatus = "active" | "paused" | "blocked" | "budget_limited" | "complete";
|
|
1272
1292
|
/** Why a goal is in its state: a closed set of codes (the UIs translate them). */
|
|
1273
|
-
export type GoalReason = "created" | "resumed" | "edited" | "user_paused" | "user_interrupt" | "model_complete" | "model_blocked" | "policy_denied" | "run_error" | "token_budget" | "max_turns" | "max_wall" | "no_progress" | "restart"
|
|
1293
|
+
export type GoalReason = "created" | "resumed" | "edited" | "user_paused" | "user_interrupt" | "model_complete" | "model_blocked" | "policy_denied" | "run_error" | "token_budget" | "max_turns" | "max_wall" | "no_progress" | "restart"
|
|
1294
|
+
/** The user completed the goal over unmet required criteria (Proof override). */
|
|
1295
|
+
| "user_override";
|
|
1274
1296
|
/** What an active goal is waiting for before its next continuation (never stored: computed). */
|
|
1275
1297
|
export type GoalWaiting = "approval" | "question" | "user_input" | "plan_mode" | "background_tasks";
|
|
1276
1298
|
/** What the user can do to a goal (the actions the UIs offer per state). */
|
|
@@ -1279,6 +1301,151 @@ export type GoalAction = "pause" | "resume" | "edit" | "clear" | "budget";
|
|
|
1279
1301
|
export interface GoalEvidence {
|
|
1280
1302
|
kind: "file" | "test" | "log" | "command" | "denied" | "other";
|
|
1281
1303
|
detail: string;
|
|
1304
|
+
/** Links this declaration to captured Proof evidence; without it the text is a free claim. */
|
|
1305
|
+
evidenceId?: string;
|
|
1306
|
+
}
|
|
1307
|
+
/** Derived state of an acceptance criterion (never stored as an independent truth). */
|
|
1308
|
+
export type ProofStatus = "verified" | "failed" | "not_checked" | "manual_review" | "not_applicable";
|
|
1309
|
+
/** How a criterion is checked. Consumers must ignore verifier kinds they do not know. */
|
|
1310
|
+
export type ProofVerifierSpec = {
|
|
1311
|
+
kind: "command";
|
|
1312
|
+
command: string;
|
|
1313
|
+
cwd?: string;
|
|
1314
|
+
successExitCodes?: number[];
|
|
1315
|
+
outputPattern?: string;
|
|
1316
|
+
} | {
|
|
1317
|
+
kind: "file";
|
|
1318
|
+
path: string;
|
|
1319
|
+
sha256?: string;
|
|
1320
|
+
pattern?: string;
|
|
1321
|
+
} | {
|
|
1322
|
+
kind: "data-check";
|
|
1323
|
+
datasetId: string;
|
|
1324
|
+
check: "row_count" | "sum" | "equals";
|
|
1325
|
+
column?: string;
|
|
1326
|
+
expected: number | string;
|
|
1327
|
+
/** Table to query; `data` (CSV/TSV/JSON/JSONL) when absent, `s_<sheet>` for XLSX. */
|
|
1328
|
+
table?: string;
|
|
1329
|
+
} | {
|
|
1330
|
+
kind: "coverage";
|
|
1331
|
+
command: string;
|
|
1332
|
+
minPercent: number;
|
|
1333
|
+
} | {
|
|
1334
|
+
kind: "manual";
|
|
1335
|
+
} | {
|
|
1336
|
+
kind: "plugin";
|
|
1337
|
+
verifierId: string;
|
|
1338
|
+
input?: unknown;
|
|
1339
|
+
};
|
|
1340
|
+
/**
|
|
1341
|
+
* What a plugin verifier returns. The evidence is the `outputHash` (sha256 hex of the output the
|
|
1342
|
+
* verdict rests on) and, when the verifier made core tool calls, the `callId` of the one that
|
|
1343
|
+
* backs the verdict. A result without a valid `outputHash`, or naming a call the session never
|
|
1344
|
+
* made, is degraded to `manual_review`: a verdict nobody can trace is not a verification.
|
|
1345
|
+
*/
|
|
1346
|
+
export interface ProofResult {
|
|
1347
|
+
ok: boolean;
|
|
1348
|
+
outputHash: string;
|
|
1349
|
+
callId?: string;
|
|
1350
|
+
/** Short human-readable summary; redacted and bounded by the host. */
|
|
1351
|
+
excerpt?: string;
|
|
1352
|
+
}
|
|
1353
|
+
/** What the host hands a plugin verifier. It carries no permission of its own. */
|
|
1354
|
+
export interface ProofVerifierContext {
|
|
1355
|
+
sessionId: string;
|
|
1356
|
+
criterionId: string;
|
|
1357
|
+
workspace: string;
|
|
1358
|
+
signal: AbortSignal;
|
|
1359
|
+
/**
|
|
1360
|
+
* Runs a core tool through the same gate as a model call (permission mode, `--read-only`,
|
|
1361
|
+
* path policy). A refused or failed call resolves with `result.isError` set and nothing ran.
|
|
1362
|
+
* `callId` is what a `ProofResult` may reference.
|
|
1363
|
+
*/
|
|
1364
|
+
callTool(name: string, input: Record<string, unknown>): Promise<{
|
|
1365
|
+
callId: string;
|
|
1366
|
+
result: ToolResult;
|
|
1367
|
+
}>;
|
|
1368
|
+
}
|
|
1369
|
+
/** A verifier a plugin contributes to Proof; criteria bind to it as `<pluginId>:<id>`. */
|
|
1370
|
+
export interface ProofVerifierRegistration {
|
|
1371
|
+
/** Lowercase letters, digits, `.`, `_` and `-` (max 64). */
|
|
1372
|
+
id: string;
|
|
1373
|
+
describe: string;
|
|
1374
|
+
run(input: unknown, ctx: ProofVerifierContext): Promise<ProofResult>;
|
|
1375
|
+
}
|
|
1376
|
+
/** One acceptance criterion with its derived status. */
|
|
1377
|
+
export interface ProofCriterion {
|
|
1378
|
+
criterionId: string;
|
|
1379
|
+
sessionId: string;
|
|
1380
|
+
goalId?: string;
|
|
1381
|
+
text: string;
|
|
1382
|
+
required: boolean;
|
|
1383
|
+
origin: "plan" | "goal" | "user" | "inferred" | "cli";
|
|
1384
|
+
verifier?: ProofVerifierSpec;
|
|
1385
|
+
/** Globs of the files the criterion covers; absent means the whole workspace. */
|
|
1386
|
+
scope?: string[];
|
|
1387
|
+
status: ProofStatus;
|
|
1388
|
+
/** True when the criterion had successful evidence that a later edit in its scope invalidated. */
|
|
1389
|
+
stale?: boolean;
|
|
1390
|
+
evidenceIds: string[];
|
|
1391
|
+
notApplicableReason?: string;
|
|
1392
|
+
}
|
|
1393
|
+
/** Immutable record that a verifier ran. A new run creates a new evidence, never an edit. */
|
|
1394
|
+
export interface ProofEvidence {
|
|
1395
|
+
evidenceId: string;
|
|
1396
|
+
criterionId: string;
|
|
1397
|
+
verifierKind: ProofVerifierSpec["kind"];
|
|
1398
|
+
runId: string;
|
|
1399
|
+
callId: string;
|
|
1400
|
+
ok: boolean;
|
|
1401
|
+
commandFingerprint?: string;
|
|
1402
|
+
exitCode?: number;
|
|
1403
|
+
durationMs: number;
|
|
1404
|
+
outputHash: string;
|
|
1405
|
+
excerpt?: string;
|
|
1406
|
+
treeFingerprint: string;
|
|
1407
|
+
filesTouched: string[];
|
|
1408
|
+
capturedAt: string;
|
|
1409
|
+
}
|
|
1410
|
+
/** The criteria and evidence of one session, as shown by every surface. */
|
|
1411
|
+
export interface ProofLedger {
|
|
1412
|
+
sessionId: string;
|
|
1413
|
+
criteria: ProofCriterion[];
|
|
1414
|
+
evidence: ProofEvidence[];
|
|
1415
|
+
divergences: {
|
|
1416
|
+
claim: string;
|
|
1417
|
+
criterionId?: string;
|
|
1418
|
+
actual: ProofStatus;
|
|
1419
|
+
}[];
|
|
1420
|
+
generatedAt: string;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* What a completed goal records about its Proof criteria: a compact snapshot taken inside the
|
|
1424
|
+
* completing transaction (never a second source of truth: the ledger derives statuses on read).
|
|
1425
|
+
*/
|
|
1426
|
+
export interface GoalProofInfo {
|
|
1427
|
+
criteria: {
|
|
1428
|
+
criterionId: string;
|
|
1429
|
+
required: boolean;
|
|
1430
|
+
status: ProofStatus;
|
|
1431
|
+
}[];
|
|
1432
|
+
/** Required criteria that were `failed` or `not_checked` at completion. */
|
|
1433
|
+
unmet: string[];
|
|
1434
|
+
/** Evidence ids the model declared that resolved to captured evidence of the session. */
|
|
1435
|
+
linkedEvidence: string[];
|
|
1436
|
+
/** Present only when the USER completed the goal over unmet criteria. */
|
|
1437
|
+
override?: {
|
|
1438
|
+
reason: string;
|
|
1439
|
+
at: number;
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
/** A criterion the model proposed in `exit_plan`: a draft until the user approves the plan. */
|
|
1443
|
+
export interface PlanCriterionDraft {
|
|
1444
|
+
text: string;
|
|
1445
|
+
required: boolean;
|
|
1446
|
+
verifier?: ProofVerifierSpec;
|
|
1447
|
+
scope?: string[];
|
|
1448
|
+
origin: "inferred";
|
|
1282
1449
|
}
|
|
1283
1450
|
/** A session goal as shown by routes and UIs. */
|
|
1284
1451
|
export interface GoalInfo {
|
|
@@ -1303,6 +1470,8 @@ export interface GoalInfo {
|
|
|
1303
1470
|
/** The model's last `update_goal` report. */
|
|
1304
1471
|
summary?: string;
|
|
1305
1472
|
evidence?: GoalEvidence[];
|
|
1473
|
+
/** The Proof snapshot of a completed goal that had criteria (absent without criteria). */
|
|
1474
|
+
proof?: GoalProofInfo;
|
|
1306
1475
|
/** What the next continuation waits for (set by the host: it knows the live state). */
|
|
1307
1476
|
waiting?: GoalWaiting;
|
|
1308
1477
|
/** The user actions allowed in this state. */
|
|
@@ -1689,6 +1858,13 @@ export interface PluginAPI {
|
|
|
1689
1858
|
views?: {
|
|
1690
1859
|
register(view: ViewDefinition): () => void;
|
|
1691
1860
|
};
|
|
1861
|
+
/**
|
|
1862
|
+
* Proof verifiers (specs/011). Absent on a core that predates Proof: feature-detect with
|
|
1863
|
+
* `api.proof?.registerVerifier(...)` so the plugin keeps working there.
|
|
1864
|
+
*/
|
|
1865
|
+
proof?: {
|
|
1866
|
+
registerVerifier(verifier: ProofVerifierRegistration): () => void;
|
|
1867
|
+
};
|
|
1692
1868
|
/**
|
|
1693
1869
|
* Decision Intelligence: register a `DecisionProvider` or consume decisions. Absent on a core
|
|
1694
1870
|
* that predates it: feature-detect with `api.decisions?.registerProvider(...)`.
|
|
@@ -1937,6 +2113,10 @@ export type ServerFrame = {
|
|
|
1937
2113
|
};
|
|
1938
2114
|
/** The session's goal, when it has one (so a reload shows the goal bar at once). */
|
|
1939
2115
|
goal?: GoalInfo;
|
|
2116
|
+
/** How many Proof criteria the session has; absent without any (the card loads on demand). */
|
|
2117
|
+
proof?: {
|
|
2118
|
+
criteria: number;
|
|
2119
|
+
};
|
|
1940
2120
|
}
|
|
1941
2121
|
/** Durable event; its SSE `id` is `event.eventId`. */
|
|
1942
2122
|
| {
|
|
@@ -2775,4 +2955,265 @@ export interface ForgeProgress {
|
|
|
2775
2955
|
durationMs?: number;
|
|
2776
2956
|
};
|
|
2777
2957
|
}
|
|
2958
|
+
/** Hard limits of one reliability-lab task (`specs/010`). A run that exceeds one ends `budget_exceeded`. */
|
|
2959
|
+
export interface EvalBudget {
|
|
2960
|
+
maxTurns: number;
|
|
2961
|
+
maxTokens?: number;
|
|
2962
|
+
maxWallMs: number;
|
|
2963
|
+
maxToolCalls?: number;
|
|
2964
|
+
}
|
|
2965
|
+
/** Assertion over the sequence of tool events of one run. */
|
|
2966
|
+
export type ToolSequenceRule =
|
|
2967
|
+
/** `first` must occur before `then`. */
|
|
2968
|
+
{
|
|
2969
|
+
type: "before";
|
|
2970
|
+
first: string;
|
|
2971
|
+
then: string;
|
|
2972
|
+
} | {
|
|
2973
|
+
type: "never";
|
|
2974
|
+
tool: string;
|
|
2975
|
+
} | {
|
|
2976
|
+
type: "max-calls";
|
|
2977
|
+
tool: string;
|
|
2978
|
+
max: number;
|
|
2979
|
+
} | {
|
|
2980
|
+
type: "no-repeat-failure";
|
|
2981
|
+
tool: string;
|
|
2982
|
+
};
|
|
2983
|
+
/** Deterministic, local check of a task result. `kind` stays open for future adapters. */
|
|
2984
|
+
export type EvalVerifier = {
|
|
2985
|
+
kind: "command";
|
|
2986
|
+
id: string;
|
|
2987
|
+
command: string[];
|
|
2988
|
+
timeoutMs: number;
|
|
2989
|
+
expectExit?: number;
|
|
2990
|
+
expectStdoutIncludes?: string;
|
|
2991
|
+
} | {
|
|
2992
|
+
kind: "file-equals";
|
|
2993
|
+
id: string;
|
|
2994
|
+
path: string;
|
|
2995
|
+
sha256: string;
|
|
2996
|
+
} | {
|
|
2997
|
+
kind: "file-contains";
|
|
2998
|
+
id: string;
|
|
2999
|
+
path: string;
|
|
3000
|
+
text: string;
|
|
3001
|
+
} | {
|
|
3002
|
+
kind: "file-absent";
|
|
3003
|
+
id: string;
|
|
3004
|
+
path: string;
|
|
3005
|
+
} | {
|
|
3006
|
+
kind: "tree-diff-within";
|
|
3007
|
+
id: string;
|
|
3008
|
+
allowed: string[];
|
|
3009
|
+
} | {
|
|
3010
|
+
kind: "tool-sequence";
|
|
3011
|
+
id: string;
|
|
3012
|
+
rule: ToolSequenceRule;
|
|
3013
|
+
};
|
|
3014
|
+
export interface EvalTask {
|
|
3015
|
+
id: string;
|
|
3016
|
+
prompt: string;
|
|
3017
|
+
/** Fixture directory, relative to the suite directory. */
|
|
3018
|
+
fixture: string;
|
|
3019
|
+
agent?: string;
|
|
3020
|
+
budget: EvalBudget;
|
|
3021
|
+
/**
|
|
3022
|
+
* `allow` lists extra effects on top of the mode: `write`, `process`, `external` or `analysis`
|
|
3023
|
+
* (never MCP or agents). A task can only equal or restrict what the invoker already holds.
|
|
3024
|
+
*/
|
|
3025
|
+
policy: {
|
|
3026
|
+
mode: "ask" | "auto" | "full";
|
|
3027
|
+
readOnly?: boolean;
|
|
3028
|
+
allow?: string[];
|
|
3029
|
+
};
|
|
3030
|
+
verifiers: EvalVerifier[];
|
|
3031
|
+
tags?: string[];
|
|
3032
|
+
/** Initialize a git repository (identity set, no global config) in the run copy of the fixture. */
|
|
3033
|
+
fixtureGit?: boolean;
|
|
3034
|
+
/**
|
|
3035
|
+
* Replay-only noise filter, versioned with the suite: each `pattern` (a JavaScript regular
|
|
3036
|
+
* expression, applied globally) found in a string of a request is replaced by `replace` BEFORE
|
|
3037
|
+
* the request is fingerprinted, after the lab's own path and id normalization. Use it for
|
|
3038
|
+
* non-deterministic fixture output (a timestamp a command prints). Over-broad rules hide real
|
|
3039
|
+
* regressions; keep them narrow.
|
|
3040
|
+
*/
|
|
3041
|
+
replayNormalize?: Array<{
|
|
3042
|
+
pattern: string;
|
|
3043
|
+
replace: string;
|
|
3044
|
+
}>;
|
|
3045
|
+
}
|
|
3046
|
+
/** Content of a versioned `suite.json`. */
|
|
3047
|
+
export interface EvalSuite {
|
|
3048
|
+
schemaVersion: 1;
|
|
3049
|
+
suiteId: string;
|
|
3050
|
+
suiteVersion: string;
|
|
3051
|
+
description: string;
|
|
3052
|
+
tasks: EvalTask[];
|
|
3053
|
+
}
|
|
3054
|
+
/** One repetition of one task, with the conditions it was measured under. */
|
|
3055
|
+
export interface EvalRunRecord {
|
|
3056
|
+
schemaVersion: 1;
|
|
3057
|
+
runId: string;
|
|
3058
|
+
suiteId: string;
|
|
3059
|
+
suiteVersion: string;
|
|
3060
|
+
taskId: string;
|
|
3061
|
+
repetition: number;
|
|
3062
|
+
seed: number;
|
|
3063
|
+
harnessVersion: string;
|
|
3064
|
+
configHash: string;
|
|
3065
|
+
provider: string;
|
|
3066
|
+
model: string;
|
|
3067
|
+
mode: "live" | "replay";
|
|
3068
|
+
startedAt: number;
|
|
3069
|
+
endedAt: number;
|
|
3070
|
+
status: "pass" | "fail" | "budget_exceeded" | "error";
|
|
3071
|
+
/** Which budget ended the run; present only when `status` is `budget_exceeded`. */
|
|
3072
|
+
budgetExceeded?: "maxTurns" | "maxTokens" | "maxWallMs" | "maxToolCalls";
|
|
3073
|
+
/**
|
|
3074
|
+
* Why the run ended `error` (infrastructure or refusal), or the detail of a failure the model
|
|
3075
|
+
* caused (`fail` with a `run_aborted` incident). Never contains file contents.
|
|
3076
|
+
*/
|
|
3077
|
+
error?: string;
|
|
3078
|
+
/**
|
|
3079
|
+
* `sha256:` of the compaction-related configuration the run was measured under. Compaction
|
|
3080
|
+
* calls are not in `measured` tokens, so two runs with different compaction settings are not
|
|
3081
|
+
* comparable on tokens or cost.
|
|
3082
|
+
*/
|
|
3083
|
+
compactionHash?: string;
|
|
3084
|
+
verifiers: Array<{
|
|
3085
|
+
id: string;
|
|
3086
|
+
status: "pass" | "fail" | "error";
|
|
3087
|
+
detail?: string;
|
|
3088
|
+
}>;
|
|
3089
|
+
/** Provider-reported usage, wall time and event counts. Never mixed with `estimated`. */
|
|
3090
|
+
measured: {
|
|
3091
|
+
inputTokens?: number;
|
|
3092
|
+
outputTokens?: number;
|
|
3093
|
+
/**
|
|
3094
|
+
* True when only SOME turns reported usage: the token totals above understate the run and are
|
|
3095
|
+
* treated as not reported by every aggregation.
|
|
3096
|
+
*/
|
|
3097
|
+
usagePartial?: true;
|
|
3098
|
+
wallMs: number;
|
|
3099
|
+
turns: number;
|
|
3100
|
+
toolCalls: number;
|
|
3101
|
+
};
|
|
3102
|
+
/** Derived values (cost from configured rates, approximate tokens). */
|
|
3103
|
+
estimated?: {
|
|
3104
|
+
costUsd?: number;
|
|
3105
|
+
approxTokens?: number;
|
|
3106
|
+
};
|
|
3107
|
+
incidents: Array<{
|
|
3108
|
+
kind: string;
|
|
3109
|
+
count: number;
|
|
3110
|
+
}>;
|
|
3111
|
+
/**
|
|
3112
|
+
* Present on a replay run that ended `error` with `error: "replay_divergence"`: the harness asked
|
|
3113
|
+
* the provider for something the cassette did not record.
|
|
3114
|
+
*/
|
|
3115
|
+
divergence?: EvalReplayDivergence;
|
|
3116
|
+
}
|
|
3117
|
+
/** One field of a request that differs from the recorded one (excerpts are redacted, at most ~240 characters). */
|
|
3118
|
+
export interface EvalDivergenceEntry {
|
|
3119
|
+
call: number;
|
|
3120
|
+
/** For example `instructions`, `messages[2].tool.result`, `tools[read_file].description`, `model`. */
|
|
3121
|
+
field: string;
|
|
3122
|
+
excerpt: {
|
|
3123
|
+
before: string;
|
|
3124
|
+
after: string;
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
3127
|
+
/** Why a replay stopped: a changed request, a call past the recording, or recorded calls never asked for. */
|
|
3128
|
+
export interface EvalReplayDivergence {
|
|
3129
|
+
kind: "fingerprint" | "exhausted" | "unconsumed";
|
|
3130
|
+
message: string;
|
|
3131
|
+
/** Empty unless `kind` is `fingerprint`; at most 10 entries. */
|
|
3132
|
+
diff: EvalDivergenceEntry[];
|
|
3133
|
+
}
|
|
3134
|
+
/**
|
|
3135
|
+
* Rates the caller supplies to turn measured tokens into an estimated cost (USD per million
|
|
3136
|
+
* tokens). Alisio never ships or guesses rates: without them no cost is computed.
|
|
3137
|
+
*/
|
|
3138
|
+
export interface EvalRates {
|
|
3139
|
+
inputPerMTokUsd: number;
|
|
3140
|
+
outputPerMTokUsd: number;
|
|
3141
|
+
}
|
|
3142
|
+
/**
|
|
3143
|
+
* Reliability metrics of one task over its repetitions. Runs that ended `error` (infrastructure)
|
|
3144
|
+
* are not repetitions of the task: they are excluded from every number here and counted in
|
|
3145
|
+
* `errored`. `k` is the number of judged runs (pass, fail or budget_exceeded).
|
|
3146
|
+
*/
|
|
3147
|
+
export interface EvalTaskMetrics {
|
|
3148
|
+
taskId: string;
|
|
3149
|
+
k: number;
|
|
3150
|
+
/** Judged runs only. With `k: 0` the value is 0 and the interval [0, 1] carries no information. */
|
|
3151
|
+
successRate: {
|
|
3152
|
+
value: number;
|
|
3153
|
+
wilsonLow: number;
|
|
3154
|
+
wilsonHigh: number;
|
|
3155
|
+
};
|
|
3156
|
+
passAtK: boolean;
|
|
3157
|
+
passPowK: boolean;
|
|
3158
|
+
/** Runs of this task that ended `error` and were excluded from the numbers (omitted when 0). */
|
|
3159
|
+
errored?: number;
|
|
3160
|
+
/** `configHash` the task was measured under (a hash covers the task's own policy and budget). */
|
|
3161
|
+
configHash?: string;
|
|
3162
|
+
/**
|
|
3163
|
+
* Provider-reported usage and wall time only. A value that cannot be computed honestly is
|
|
3164
|
+
* omitted, never invented: the median needs one judged run, a variance two samples, the
|
|
3165
|
+
* per-success figures at least one success (and usage on every judged run for tokens).
|
|
3166
|
+
*/
|
|
3167
|
+
measured: {
|
|
3168
|
+
medianWallMs?: number;
|
|
3169
|
+
varianceWallMs?: number;
|
|
3170
|
+
varianceTokens?: number;
|
|
3171
|
+
tokensPerSuccess?: number;
|
|
3172
|
+
wallMsPerSuccess?: number;
|
|
3173
|
+
};
|
|
3174
|
+
/** Present only when the caller supplied rates and every judged run reported usage. */
|
|
3175
|
+
estimated?: {
|
|
3176
|
+
costUsdPerSuccess?: number;
|
|
3177
|
+
};
|
|
3178
|
+
}
|
|
3179
|
+
export interface EvalReport {
|
|
3180
|
+
schemaVersion: 1;
|
|
3181
|
+
suiteId: string;
|
|
3182
|
+
suiteVersion: string;
|
|
3183
|
+
conditions: {
|
|
3184
|
+
harnessVersion: string;
|
|
3185
|
+
configHash: string;
|
|
3186
|
+
provider: string;
|
|
3187
|
+
model: string;
|
|
3188
|
+
mode: "live" | "replay";
|
|
3189
|
+
k: number;
|
|
3190
|
+
seedBase: number;
|
|
3191
|
+
/** Compaction identity shared by every run (omitted for reports of older runs). */
|
|
3192
|
+
compactionHash?: string;
|
|
3193
|
+
};
|
|
3194
|
+
/** The variant this report was measured as (`eval variants`): its id and config overrides. */
|
|
3195
|
+
variant?: {
|
|
3196
|
+
id: string;
|
|
3197
|
+
overrides: Record<string, unknown>;
|
|
3198
|
+
};
|
|
3199
|
+
/** Caveats about what the numbers mean (for example which tokens are counted). */
|
|
3200
|
+
notes?: string[];
|
|
3201
|
+
tasks: EvalTaskMetrics[];
|
|
3202
|
+
/** IDs of the `EvalRunRecord`s, errored ones included (the detail lives in `runs.jsonl`). */
|
|
3203
|
+
runs: string[];
|
|
3204
|
+
/**
|
|
3205
|
+
* Counts of RUNS, except `tasks`: `passed`, `failed`, `errored` and `budgetExceeded` add up to
|
|
3206
|
+
* `runs`. `errored` runs are infrastructure and are excluded from every rate and spread.
|
|
3207
|
+
*/
|
|
3208
|
+
summary: {
|
|
3209
|
+
tasks: number;
|
|
3210
|
+
passed: number;
|
|
3211
|
+
errored: number;
|
|
3212
|
+
budgetExceeded: number;
|
|
3213
|
+
runs?: number;
|
|
3214
|
+
failed?: number;
|
|
3215
|
+
};
|
|
3216
|
+
/** The rates behind every `estimated` figure; absent when none was supplied. */
|
|
3217
|
+
rates?: EvalRates;
|
|
3218
|
+
}
|
|
2778
3219
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alisio/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Typed plugin SDK for Alisio: the stable contract for tools, commands, context, compaction and session hooks, model completions and storage. Types only plus tiny helpers; zero runtime dependencies.",
|
|
5
5
|
"author": "Gustavo Gutiérrez",
|
|
6
6
|
"license": "MIT",
|