@thinkai/tai-api-contract 2.175.0 → 2.177.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.
@@ -4893,6 +4893,50 @@ export interface paths {
4893
4893
  patch?: never;
4894
4894
  trace?: never;
4895
4895
  };
4896
+ "/workspaces/{workspaceId}/evals/suites/{suiteId}/compare": {
4897
+ parameters: {
4898
+ query?: never;
4899
+ header?: never;
4900
+ path?: never;
4901
+ cookie?: never;
4902
+ };
4903
+ /**
4904
+ * Compare two succeeded eval runs on a suite
4905
+ * @description Side-by-side compare of a baseline run vs a candidate run on the same suite. Both runs must be `succeeded`. Aligns cases by `caseId` and reports suite- and case-level score/token/cost deltas when present. Requires workspace membership. Does not trigger scoring.
4906
+ */
4907
+ get: operations["compareEvalRuns"];
4908
+ put?: never;
4909
+ post?: never;
4910
+ delete?: never;
4911
+ options?: never;
4912
+ head?: never;
4913
+ patch?: never;
4914
+ trace?: never;
4915
+ };
4916
+ "/workspaces/{workspaceId}/evals/suites/{suiteId}/decisions": {
4917
+ parameters: {
4918
+ query?: never;
4919
+ header?: never;
4920
+ path?: never;
4921
+ cookie?: never;
4922
+ };
4923
+ /**
4924
+ * List eval promote/keep/reject decisions for a suite
4925
+ * @description Returns the last 50 decisions for the suite (newest first). Empty → `{ "decisions": [] }`. Requires workspace membership.
4926
+ */
4927
+ get: operations["listEvalDecisions"];
4928
+ put?: never;
4929
+ /**
4930
+ * Record a promote, keep, or reject decision
4931
+ * @description Persists an audit decision for a baseline vs candidate run pair. Requires workspace editor or admin. Both runs must be `succeeded` on this suite. `promote` also applies the candidate run's `suiteSnapshot.target` to the live suite (version may bump). Promotion gate attach is deferred (`gateApplied: false`, `gateDetail.reason: deferred`) until thinkai-platform-workspace#492.
4932
+ */
4933
+ post: operations["createEvalDecision"];
4934
+ delete?: never;
4935
+ options?: never;
4936
+ head?: never;
4937
+ patch?: never;
4938
+ trace?: never;
4939
+ };
4896
4940
  "/workspaces/{workspaceId}/evals/suites/{suiteId}/runs": {
4897
4941
  parameters: {
4898
4942
  query?: never;
@@ -9100,7 +9144,7 @@ export interface components {
9100
9144
  };
9101
9145
  AssessmentDictionaryDto: {
9102
9146
  /** @enum {string} */
9103
- version: "2026-10-18.1";
9147
+ version: "2026-10-20.1";
9104
9148
  /** @enum {integer} */
9105
9149
  periodDays: 90;
9106
9150
  /** @enum {integer} */
@@ -9112,6 +9156,8 @@ export interface components {
9112
9156
  /** @enum {integer} */
9113
9157
  accessDaysAfterDelivery: 30;
9114
9158
  /** @enum {integer} */
9159
+ deliveryBusinessDays: 5;
9160
+ /** @enum {integer} */
9115
9161
  maxRepositories: 50;
9116
9162
  /** @enum {integer} */
9117
9163
  maxActiveEngineers: 500;
@@ -9141,15 +9187,90 @@ export interface components {
9141
9187
  status: "supported";
9142
9188
  providers: ("gitlab_self_managed" | "bitbucket_data_center")[];
9143
9189
  };
9190
+ rules: {
9191
+ /** @enum {number} */
9192
+ windowCoverageRatio: 1;
9193
+ /** @enum {integer} */
9194
+ repositoryMergedPullRequestsInBothWindows: 1;
9195
+ freshness: {
9196
+ /** @enum {integer} */
9197
+ gitHours: 24;
9198
+ /** @enum {integer} */
9199
+ jiraHours: 24;
9200
+ /** @enum {integer} */
9201
+ incidentHours: 24;
9202
+ /** @enum {integer} */
9203
+ aiUsageDays: 7;
9204
+ /** @enum {integer} */
9205
+ readinessScanDays: 30;
9206
+ };
9207
+ tolerances: {
9208
+ /** @enum {number} */
9209
+ moneyUsd: 0.01;
9210
+ /** @enum {number} */
9211
+ ratioPercentagePoints: 0.01;
9212
+ /** @enum {integer} */
9213
+ durationSeconds: 1;
9214
+ };
9215
+ /** @enum {string} */
9216
+ outputUnit: "normalized_ship_weight";
9217
+ /** @enum {string} */
9218
+ rolloutTimezone: "America/New_York";
9219
+ /** @enum {string} */
9220
+ rolloutBoundary: "midnight";
9221
+ /** @enum {string} */
9222
+ costAssessableCurrency: "USD";
9223
+ };
9144
9224
  unresolved: {
9145
9225
  baselinePrice: components["schemas"]["UnsetAssessmentDecisionDto"];
9146
9226
  premiumPrice: components["schemas"]["UnsetAssessmentDecisionDto"];
9147
- currency: components["schemas"]["UnsetAssessmentDecisionDto"];
9148
- creditWindowDays: components["schemas"]["UnsetAssessmentDecisionDto"];
9149
- jiraLinkageMinimum: components["schemas"]["UnsetAssessmentDecisionDto"];
9150
- confounderRules: components["schemas"]["UnsetAssessmentDecisionDto"];
9151
- activeEngineerRule: components["schemas"]["UnsetAssessmentDecisionDto"];
9152
- workingDayCalendar: components["schemas"]["UnsetAssessmentDecisionDto"];
9227
+ currency: {
9228
+ /** @enum {string} */
9229
+ status: "set";
9230
+ /** @enum {string} */
9231
+ code: "USD";
9232
+ };
9233
+ creditWindowDays: {
9234
+ /** @enum {string} */
9235
+ status: "set";
9236
+ /** @enum {integer} */
9237
+ days: 90;
9238
+ /** @enum {string} */
9239
+ eligibleSubscription: "annual";
9240
+ };
9241
+ jiraLinkageMinimum: {
9242
+ /** @enum {string} */
9243
+ status: "set";
9244
+ /** @enum {number} */
9245
+ ratio: 0.8;
9246
+ };
9247
+ confounderRules: {
9248
+ /** @enum {string} */
9249
+ status: "set";
9250
+ /** @enum {number} */
9251
+ headcountChangeRatio: 0.1;
9252
+ /** @enum {number} */
9253
+ repositoryScopeChangeRatio: 0.1;
9254
+ namedEvents: ("major_release" | "migration" | "acquisition" | "policy_change")[];
9255
+ };
9256
+ activeEngineerRule: {
9257
+ /** @enum {string} */
9258
+ status: "set";
9259
+ /** @enum {string} */
9260
+ activity: "authored_commit_or_merged_pr";
9261
+ /** @enum {string} */
9262
+ window: "measured_period";
9263
+ exclude: ("bot" | "service_account" | "unmapped" | "read_only")[];
9264
+ };
9265
+ workingDayCalendar: {
9266
+ /** @enum {string} */
9267
+ status: "set";
9268
+ /** @enum {string} */
9269
+ timezone: "America/New_York";
9270
+ weekdays: ("monday" | "tuesday" | "wednesday" | "thursday" | "friday")[];
9271
+ /** @enum {string} */
9272
+ holidays: "none";
9273
+ };
9153
9274
  countryAllowList: components["schemas"]["UnsetAssessmentDecisionDto"];
9154
9275
  };
9155
9276
  };
@@ -11291,6 +11412,8 @@ export interface components {
11291
11412
  createdByUserId: string;
11292
11413
  target: components["schemas"]["EvalSuiteTargetDto"];
11293
11414
  cases: components["schemas"]["EvalCaseDto"][];
11415
+ /** @description Most recent promote/keep/reject decision for this suite, when any exist. Omitted or null when none recorded. */
11416
+ latestDecision?: components["schemas"]["EvalDecisionDto"] | null;
11294
11417
  };
11295
11418
  EvalSuiteListDto: {
11296
11419
  suites: components["schemas"]["EvalSuiteDto"][];
@@ -11441,6 +11564,89 @@ export interface components {
11441
11564
  EvalPackListDto: {
11442
11565
  packs: components["schemas"]["EvalPackSummaryDto"][];
11443
11566
  };
11567
+ EvalCompareRunSummaryDto: {
11568
+ /** Format: uuid */
11569
+ id: string;
11570
+ suiteVersion: number;
11571
+ score: number | null;
11572
+ /** Format: date-time */
11573
+ finishedAt: string | null;
11574
+ target: components["schemas"]["EvalSuiteTargetDto"];
11575
+ passCount: number;
11576
+ failCount: number;
11577
+ errorCount: number;
11578
+ };
11579
+ EvalCompareCaseDto: {
11580
+ caseId: string;
11581
+ name: string;
11582
+ baselineStatus: (string & components["schemas"]["EvalCaseResultStatusDto"]) | null;
11583
+ candidateStatus: (string & components["schemas"]["EvalCaseResultStatusDto"]) | null;
11584
+ baselinePass: boolean | null;
11585
+ candidatePass: boolean | null;
11586
+ baselineFailedSignalIds: string[];
11587
+ candidateFailedSignalIds: string[];
11588
+ baselineInputTokens?: number | null;
11589
+ candidateInputTokens?: number | null;
11590
+ baselineOutputTokens?: number | null;
11591
+ candidateOutputTokens?: number | null;
11592
+ baselineCostCents?: number | null;
11593
+ candidateCostCents?: number | null;
11594
+ /** @description Candidate pass (1/0) minus baseline pass when both scored. */
11595
+ scoreDelta?: number | null;
11596
+ inputTokensDelta?: number | null;
11597
+ outputTokensDelta?: number | null;
11598
+ costCentsDelta?: number | null;
11599
+ };
11600
+ EvalCompareDto: {
11601
+ /** Format: uuid */
11602
+ suiteId: string;
11603
+ baseline: components["schemas"]["EvalCompareRunSummaryDto"];
11604
+ candidate: components["schemas"]["EvalCompareRunSummaryDto"];
11605
+ /** @description candidate.score − baseline.score when both present. */
11606
+ scoreDelta: number | null;
11607
+ avgInputTokensDelta?: number | null;
11608
+ avgOutputTokensDelta?: number | null;
11609
+ avgCostCentsDelta?: number | null;
11610
+ cases: components["schemas"]["EvalCompareCaseDto"][];
11611
+ /** @description Case ids present on only one run's results/snapshot. */
11612
+ unpairedCaseIds: string[];
11613
+ };
11614
+ /** @enum {string} */
11615
+ EvalDecisionKindDto: "promote" | "keep" | "reject";
11616
+ EvalGateDetailDto: {
11617
+ /** @description Machine-readable gate outcome. `deferred` until promotion-gate attach (thinkai-platform-workspace#492) ships. */
11618
+ reason: string;
11619
+ };
11620
+ EvalDecisionDto: {
11621
+ /** Format: uuid */
11622
+ id: string;
11623
+ /** Format: uuid */
11624
+ suiteId: string;
11625
+ decision: components["schemas"]["EvalDecisionKindDto"];
11626
+ /** Format: uuid */
11627
+ baselineRunId: string;
11628
+ /** Format: uuid */
11629
+ candidateRunId: string;
11630
+ /** Format: uuid */
11631
+ decidedByUserId: string;
11632
+ /** Format: date-time */
11633
+ decidedAt: string;
11634
+ note?: string | null;
11635
+ /** @description True when a promotion gate attach point enforced this decision. */
11636
+ gateApplied: boolean;
11637
+ gateDetail?: components["schemas"]["EvalGateDetailDto"] | null;
11638
+ };
11639
+ EvalDecisionListDto: {
11640
+ decisions: components["schemas"]["EvalDecisionDto"][];
11641
+ };
11642
+ CreateEvalDecisionBodyDto: {
11643
+ decision: components["schemas"]["EvalDecisionKindDto"];
11644
+ /** Format: uuid */
11645
+ baselineRunId: string;
11646
+ /** Format: uuid */
11647
+ candidateRunId: string;
11648
+ note?: string;
11649
+ };
11444
11650
  };
11445
11651
  responses: {
11446
11652
  /** @description Missing or invalid bearer token */
@@ -12159,6 +12365,14 @@ export type EvalModelComparisonDto = components['schemas']['EvalModelComparisonD
12159
12365
  export type EvalInsightsDto = components['schemas']['EvalInsightsDto'];
12160
12366
  export type EvalPackSummaryDto = components['schemas']['EvalPackSummaryDto'];
12161
12367
  export type EvalPackListDto = components['schemas']['EvalPackListDto'];
12368
+ export type EvalCompareRunSummaryDto = components['schemas']['EvalCompareRunSummaryDto'];
12369
+ export type EvalCompareCaseDto = components['schemas']['EvalCompareCaseDto'];
12370
+ export type EvalCompareDto = components['schemas']['EvalCompareDto'];
12371
+ export type EvalDecisionKindDto = components['schemas']['EvalDecisionKindDto'];
12372
+ export type EvalGateDetailDto = components['schemas']['EvalGateDetailDto'];
12373
+ export type EvalDecisionDto = components['schemas']['EvalDecisionDto'];
12374
+ export type EvalDecisionListDto = components['schemas']['EvalDecisionListDto'];
12375
+ export type CreateEvalDecisionBodyDto = components['schemas']['CreateEvalDecisionBodyDto'];
12162
12376
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
12163
12377
  export type ResponseForbidden = components['responses']['Forbidden'];
12164
12378
  export type ResponseZenHrSyncInProgress = components['responses']['ZenHrSyncInProgress'];
@@ -12511,11 +12725,44 @@ export interface operations {
12511
12725
  shareMode: "internal" | "external";
12512
12726
  /** @enum {string|null} */
12513
12727
  watermark: "NOT VALIDATED" | "SAMPLE · SYNTHETIC DATA" | null;
12514
- scope: Record<string, never>;
12515
- windows: Record<string, never>;
12516
- sources: Record<string, never>[];
12517
- consent: Record<string, never>;
12518
- sections: Record<string, never>[];
12728
+ scope: {
12729
+ repositories: {
12730
+ id: string;
12731
+ name: string;
12732
+ }[];
12733
+ excluded: {
12734
+ id: string;
12735
+ name: string;
12736
+ reason: string;
12737
+ }[];
12738
+ };
12739
+ windows: {
12740
+ pre: {
12741
+ start: string;
12742
+ end: string;
12743
+ } | null;
12744
+ post: {
12745
+ start: string;
12746
+ end: string;
12747
+ } | null;
12748
+ transitionDays: number;
12749
+ };
12750
+ sources: {
12751
+ provider: string;
12752
+ status: string;
12753
+ freshAt: string | null;
12754
+ }[];
12755
+ consent: {
12756
+ /** @enum {string} */
12757
+ aggregateUse: "opt_in" | "opt_out" | "unset";
12758
+ recordedAt: string | null;
12759
+ };
12760
+ sections: {
12761
+ id: string;
12762
+ /** @enum {string} */
12763
+ status: "ok" | "failed" | "omitted";
12764
+ reason?: string;
12765
+ }[];
12519
12766
  };
12520
12767
  workspaceId: string;
12521
12768
  expectedWorkspaceId: string;
@@ -25094,6 +25341,155 @@ export interface operations {
25094
25341
  };
25095
25342
  };
25096
25343
  };
25344
+ compareEvalRuns: {
25345
+ parameters: {
25346
+ query: {
25347
+ baselineRunId: string;
25348
+ candidateRunId: string;
25349
+ };
25350
+ header?: never;
25351
+ path: {
25352
+ workspaceId: components["parameters"]["WorkspaceId"];
25353
+ /** @description Eval suite id (`tai_workspace_eval_suites.id`). */
25354
+ suiteId: components["parameters"]["EvalSuiteId"];
25355
+ };
25356
+ cookie?: never;
25357
+ };
25358
+ requestBody?: never;
25359
+ responses: {
25360
+ /** @description Compare result */
25361
+ 200: {
25362
+ headers: {
25363
+ [name: string]: unknown;
25364
+ };
25365
+ content: {
25366
+ "application/json": components["schemas"]["EvalCompareDto"];
25367
+ };
25368
+ };
25369
+ /** @description Runs not comparable (e.g. not succeeded, same id, or invalid query). Codes: `eval_compare_runs_required`, `eval_compare_runs_not_succeeded`, `eval_compare_same_run`. */
25370
+ 400: {
25371
+ headers: {
25372
+ [name: string]: unknown;
25373
+ };
25374
+ content: {
25375
+ "application/json": components["schemas"]["ErrorMessageDto"];
25376
+ };
25377
+ };
25378
+ 401: components["responses"]["Unauthorized"];
25379
+ 403: components["responses"]["Forbidden"];
25380
+ /** @description Workspace, suite, or run not found */
25381
+ 404: {
25382
+ headers: {
25383
+ [name: string]: unknown;
25384
+ };
25385
+ content: {
25386
+ "application/json": components["schemas"]["ErrorMessageDto"];
25387
+ };
25388
+ };
25389
+ };
25390
+ };
25391
+ listEvalDecisions: {
25392
+ parameters: {
25393
+ query?: never;
25394
+ header?: never;
25395
+ path: {
25396
+ workspaceId: components["parameters"]["WorkspaceId"];
25397
+ /** @description Eval suite id (`tai_workspace_eval_suites.id`). */
25398
+ suiteId: components["parameters"]["EvalSuiteId"];
25399
+ };
25400
+ cookie?: never;
25401
+ };
25402
+ requestBody?: never;
25403
+ responses: {
25404
+ /** @description Decision history */
25405
+ 200: {
25406
+ headers: {
25407
+ [name: string]: unknown;
25408
+ };
25409
+ content: {
25410
+ /**
25411
+ * @example {
25412
+ * "decisions": []
25413
+ * }
25414
+ */
25415
+ "application/json": components["schemas"]["EvalDecisionListDto"];
25416
+ };
25417
+ };
25418
+ 401: components["responses"]["Unauthorized"];
25419
+ 403: components["responses"]["Forbidden"];
25420
+ /** @description Workspace or suite not found */
25421
+ 404: {
25422
+ headers: {
25423
+ [name: string]: unknown;
25424
+ };
25425
+ content: {
25426
+ "application/json": components["schemas"]["ErrorMessageDto"];
25427
+ };
25428
+ };
25429
+ };
25430
+ };
25431
+ createEvalDecision: {
25432
+ parameters: {
25433
+ query?: never;
25434
+ header?: never;
25435
+ path: {
25436
+ workspaceId: components["parameters"]["WorkspaceId"];
25437
+ /** @description Eval suite id (`tai_workspace_eval_suites.id`). */
25438
+ suiteId: components["parameters"]["EvalSuiteId"];
25439
+ };
25440
+ cookie?: never;
25441
+ };
25442
+ requestBody: {
25443
+ content: {
25444
+ "application/json": components["schemas"]["CreateEvalDecisionBodyDto"];
25445
+ };
25446
+ };
25447
+ responses: {
25448
+ /** @description Decision recorded */
25449
+ 201: {
25450
+ headers: {
25451
+ [name: string]: unknown;
25452
+ };
25453
+ content: {
25454
+ "application/json": components["schemas"]["EvalDecisionDto"];
25455
+ };
25456
+ };
25457
+ /** @description Validation failed. Codes: `eval_decision_invalid`, `eval_compare_runs_not_succeeded`, `eval_compare_same_run`, `eval_promote_snapshot_missing`. */
25458
+ 400: {
25459
+ headers: {
25460
+ [name: string]: unknown;
25461
+ };
25462
+ content: {
25463
+ "application/json": components["schemas"]["ErrorMessageDto"];
25464
+ };
25465
+ };
25466
+ 401: components["responses"]["Unauthorized"];
25467
+ /** @description Authenticated but not a workspace editor/admin */
25468
+ 403: {
25469
+ headers: {
25470
+ [name: string]: unknown;
25471
+ };
25472
+ content: {
25473
+ /**
25474
+ * @example {
25475
+ * "error": "Workspace editor role required",
25476
+ * "code": "workspace_editor_required"
25477
+ * }
25478
+ */
25479
+ "application/json": components["schemas"]["ErrorMessageDto"];
25480
+ };
25481
+ };
25482
+ /** @description Workspace, suite, or run not found */
25483
+ 404: {
25484
+ headers: {
25485
+ [name: string]: unknown;
25486
+ };
25487
+ content: {
25488
+ "application/json": components["schemas"]["ErrorMessageDto"];
25489
+ };
25490
+ };
25491
+ };
25492
+ };
25097
25493
  listEvalRuns: {
25098
25494
  parameters: {
25099
25495
  query?: never;