@thinkai/tai-api-contract 2.126.0 → 2.128.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.
@@ -1393,6 +1393,46 @@ export interface paths {
1393
1393
  patch?: never;
1394
1394
  trace?: never;
1395
1395
  };
1396
+ "/workspaces/{workspaceId}/insights/test-pyramid/summary": {
1397
+ parameters: {
1398
+ query?: never;
1399
+ header?: never;
1400
+ path?: never;
1401
+ cookie?: never;
1402
+ };
1403
+ /**
1404
+ * Test pyramid assessment — workspace summary
1405
+ * @description Org-level Test pyramid assessment for `/insights/test-pyramid`. Aggregates each active repo's **latest** readiness-scan test-pyramid snapshot and the immediately previous succeeded/partial_failed/failed point when present (`limitPerRepo: 2`). Layer **presence is count-based** (`fileCount > 0`); CI/dependency-only AF `present` flags are ignored. Shape uses fixed advisory targets (base ~70% unit, middle ~20% integration+contract+acceptance/BDD, top ~10% E2E) and returns `insufficient_data` when total classified test files < 10. Also returns maturity trend, coverage overlay, confidence, applicability, E2E-cross/hotspot risk, and workspace-only `ciQuality` from the latest org dashboard snapshot. Does not change Agentic Foundation `/readiness/test-pyramid*` responses.
1406
+ */
1407
+ get: operations["getInsightsTestPyramidSummary"];
1408
+ put?: never;
1409
+ post?: never;
1410
+ delete?: never;
1411
+ options?: never;
1412
+ head?: never;
1413
+ patch?: never;
1414
+ trace?: never;
1415
+ };
1416
+ "/workspaces/{workspaceId}/insights/test-pyramid/repos": {
1417
+ parameters: {
1418
+ query?: never;
1419
+ header?: never;
1420
+ path?: never;
1421
+ cookie?: never;
1422
+ };
1423
+ /**
1424
+ * Test pyramid assessment — per-repo list (paginated)
1425
+ * @description Page of repos with latest classified test-file counts, count-based presence, presence maturity, shape, trend vs the previous pyramid point, coverage overlay, confidence/evidence, layer applicability, and risk signals (`e2eCrossRepoCandidate`, `hotspotCount`). Use `gapsByLayer` on the summary endpoint (or filter this list via layerPresent) to answer “who lacks layer X?”. No v1 repo-detail Insights route — link repo names to AF readiness inventory.
1426
+ */
1427
+ get: operations["listInsightsTestPyramidRepos"];
1428
+ put?: never;
1429
+ post?: never;
1430
+ delete?: never;
1431
+ options?: never;
1432
+ head?: never;
1433
+ patch?: never;
1434
+ trace?: never;
1435
+ };
1396
1436
  "/workspaces/{workspaceId}/integrations/ai-tool/{provider}/members": {
1397
1437
  parameters: {
1398
1438
  query?: never;
@@ -9543,6 +9583,176 @@ export interface components {
9543
9583
  topHotspots: components["schemas"]["CodeInsightsOrgHotspotDto"][];
9544
9584
  sonar: components["schemas"]["CodeInsightsSonarDto"];
9545
9585
  };
9586
+ /**
9587
+ * @description Presence maturity (model A) using count-based layer presence (`fileCount > 0`), not AF signal-inclusive `present`.
9588
+ * @enum {string}
9589
+ */
9590
+ InsightsTestPyramidMaturityDto: "missing" | "emerging" | "established" | "mature";
9591
+ /**
9592
+ * @description Advisory shape label vs fixed 70/20/10. `insufficient_data` when total classified test files < 10 (band percents are null).
9593
+ * @enum {string}
9594
+ */
9595
+ InsightsTestPyramidShapeLabelDto: "insufficient_data" | "base_heavy" | "balanced" | "top_heavy" | "middle_heavy";
9596
+ InsightsTestPyramidShapeDto: {
9597
+ label: components["schemas"]["InsightsTestPyramidShapeLabelDto"];
9598
+ /** @description Sum of classified test **files** across the five layers (not test cases). */
9599
+ totalClassifiedFiles: number;
9600
+ /** @description Share of classified files in unit (base). Null when insufficient_data. */
9601
+ basePercent: number | null;
9602
+ /** @description Share in integration + contract + acceptance_bdd (middle). Null when insufficient_data. */
9603
+ middlePercent: number | null;
9604
+ /** @description Share in e2e (top). Null when insufficient_data. */
9605
+ topPercent: number | null;
9606
+ targets: {
9607
+ /** @enum {number} */
9608
+ basePercent: 70;
9609
+ /** @enum {number} */
9610
+ middlePercent: 20;
9611
+ /** @enum {number} */
9612
+ topPercent: 10;
9613
+ };
9614
+ };
9615
+ InsightsTestPyramidLayerCountsDto: {
9616
+ unit: number;
9617
+ integration: number;
9618
+ acceptance_bdd: number;
9619
+ contract: number;
9620
+ e2e: number;
9621
+ };
9622
+ InsightsTestPyramidLayerPresentDto: {
9623
+ unit: boolean;
9624
+ integration: boolean;
9625
+ acceptance_bdd: boolean;
9626
+ contract: boolean;
9627
+ e2e: boolean;
9628
+ };
9629
+ InsightsTestPyramidLayerPresenceDto: {
9630
+ presentRepos: number;
9631
+ applicableRepos: number;
9632
+ percent: number | null;
9633
+ missingRepoIds: string[];
9634
+ missingRepoNames: string[];
9635
+ };
9636
+ InsightsTestPyramidGapRepoDto: {
9637
+ /** Format: uuid */
9638
+ repoId: string;
9639
+ repoName: string;
9640
+ };
9641
+ InsightsTestPyramidGapsByLayerDto: {
9642
+ unit: components["schemas"]["InsightsTestPyramidGapRepoDto"][];
9643
+ integration: components["schemas"]["InsightsTestPyramidGapRepoDto"][];
9644
+ acceptance_bdd: components["schemas"]["InsightsTestPyramidGapRepoDto"][];
9645
+ contract: components["schemas"]["InsightsTestPyramidGapRepoDto"][];
9646
+ e2e: components["schemas"]["InsightsTestPyramidGapRepoDto"][];
9647
+ };
9648
+ InsightsTestPyramidMaturityCountsDto: {
9649
+ missing: number;
9650
+ emerging: number;
9651
+ established: number;
9652
+ mature: number;
9653
+ };
9654
+ InsightsTestPyramidLayerPresenceMapDto: {
9655
+ unit: components["schemas"]["InsightsTestPyramidLayerPresenceDto"];
9656
+ integration: components["schemas"]["InsightsTestPyramidLayerPresenceDto"];
9657
+ acceptance_bdd: components["schemas"]["InsightsTestPyramidLayerPresenceDto"];
9658
+ contract: components["schemas"]["InsightsTestPyramidLayerPresenceDto"];
9659
+ e2e: components["schemas"]["InsightsTestPyramidLayerPresenceDto"];
9660
+ };
9661
+ /**
9662
+ * @description Insights maturity rank change vs the immediately previous pyramid point (missing 0, emerging 1, established 2, mature 3). `none` when the repo has no previous succeeded/partial_failed/failed point.
9663
+ * @enum {string}
9664
+ */
9665
+ InsightsTestPyramidMaturityDeltaDto: "up" | "down" | "unchanged" | "none";
9666
+ /** @enum {string} */
9667
+ InsightsTestPyramidConfidenceDto: "high" | "medium" | "low";
9668
+ InsightsTestPyramidLayerConfidenceDto: {
9669
+ unit: components["schemas"]["InsightsTestPyramidConfidenceDto"];
9670
+ integration: components["schemas"]["InsightsTestPyramidConfidenceDto"];
9671
+ acceptance_bdd: components["schemas"]["InsightsTestPyramidConfidenceDto"];
9672
+ contract: components["schemas"]["InsightsTestPyramidConfidenceDto"];
9673
+ e2e: components["schemas"]["InsightsTestPyramidConfidenceDto"];
9674
+ };
9675
+ InsightsTestPyramidCoverageRollupDto: {
9676
+ /** @description Repos whose overlaid `lineCoverage` is non-null. */
9677
+ reposWithCoverage: number;
9678
+ /** @description Median of repo `linePercent` among repos that have coverage. Null when `reposWithCoverage` is 0. */
9679
+ medianLinePercent: number | null;
9680
+ };
9681
+ InsightsTestPyramidCiQualityDto: {
9682
+ /** @description Latest org dashboard `quality.ciFailureRatePercent`, falling back to `quality.ciBuildFailRatePercent`. */
9683
+ ciFailureRatePercent: number;
9684
+ /** @description Included only when `quality.ciFlakinessPercent` is a finite number. */
9685
+ ciFlakinessPercent?: number;
9686
+ /** @description Dashboard metrics bucket end for the org snapshot. */
9687
+ bucketEnd: string;
9688
+ } | null;
9689
+ InsightsTestPyramidSummaryDto: {
9690
+ /** Format: uuid */
9691
+ workspaceId: string;
9692
+ /** Format: date-time */
9693
+ generatedAt: string;
9694
+ reposWithPyramid: number;
9695
+ /** @description Repos whose newest pyramid came from a non-succeeded readiness run. */
9696
+ reposFromDegradedRuns: string[];
9697
+ /** @description Workspace sum of classified test files (not cases). */
9698
+ totalClassifiedFiles: number;
9699
+ shape: components["schemas"]["InsightsTestPyramidShapeDto"];
9700
+ layerPresence: components["schemas"]["InsightsTestPyramidLayerPresenceMapDto"];
9701
+ maturityCounts: components["schemas"]["InsightsTestPyramidMaturityCountsDto"];
9702
+ gapsByLayer: components["schemas"]["InsightsTestPyramidGapsByLayerDto"];
9703
+ /**
9704
+ * Format: date-time
9705
+ * @description Latest per-repo `scannedAt`. Null when `reposWithPyramid` is 0.
9706
+ */
9707
+ newestScannedAt: string | null;
9708
+ /** @description Repos whose Insights maturity rank increased vs the previous point. */
9709
+ maturedRepoCount: number;
9710
+ /** @description Repos whose Insights maturity rank decreased vs the previous point. */
9711
+ slippedRepoCount: number;
9712
+ /** @description Insights workspace shape from previous-point file totals for repos that have a previous point. Null when no repo has a previous point. */
9713
+ previousShape: components["schemas"]["InsightsTestPyramidShapeDto"] | null;
9714
+ coverage: components["schemas"]["InsightsTestPyramidCoverageRollupDto"];
9715
+ e2eCrossRepoCandidateCount: number;
9716
+ /** @description Repos whose latest Code Insights snapshot has `hotspotCount` > 0. */
9717
+ reposWithHotspots: number;
9718
+ ciQuality: components["schemas"]["InsightsTestPyramidCiQualityDto"];
9719
+ };
9720
+ InsightsTestPyramidRepoItemDto: {
9721
+ /** Format: uuid */
9722
+ repoId: string;
9723
+ repoName: string;
9724
+ /** Format: date-time */
9725
+ scannedAt: string;
9726
+ currentRunStatus: components["schemas"]["TestPyramidRunStatusDto"];
9727
+ maturity: components["schemas"]["InsightsTestPyramidMaturityDto"];
9728
+ previousMaturity: components["schemas"]["InsightsTestPyramidMaturityDto"] | null;
9729
+ maturityDelta: components["schemas"]["InsightsTestPyramidMaturityDeltaDto"];
9730
+ previousShapeLabel: components["schemas"]["InsightsTestPyramidShapeLabelDto"] | null;
9731
+ layerFileCounts: components["schemas"]["InsightsTestPyramidLayerCountsDto"];
9732
+ layerPresent: components["schemas"]["InsightsTestPyramidLayerPresentDto"];
9733
+ /** @description Snapshot `layers.*.applicable` for each layer. */
9734
+ layerApplicable: components["schemas"]["InsightsTestPyramidLayerPresentDto"];
9735
+ totalClassifiedFiles: number;
9736
+ shape: components["schemas"]["InsightsTestPyramidShapeDto"];
9737
+ /** @description Same overlay as AF progress — latest Sonar row first, else snapshot `testPyramid.lineCoverage`. Null when both are missing. Not Code Insights `coveragePct`. */
9738
+ lineCoverage: components["schemas"]["TestPyramidLineCoverageDto"];
9739
+ /** @description Minimum confidence among layers with Insights presence (`fileCount > 0`); if none present, minimum of applicable layers. Order low < medium < high. */
9740
+ lowestConfidence: components["schemas"]["InsightsTestPyramidConfidenceDto"];
9741
+ layerConfidence: components["schemas"]["InsightsTestPyramidLayerConfidenceDto"];
9742
+ /** @description Sum of layer `evidence[]` lengths on the latest snapshot. */
9743
+ evidenceCount: number;
9744
+ /** @description Unique framework names across layers, capped at 8. */
9745
+ frameworks: string[];
9746
+ e2eCrossRepoCandidate: boolean;
9747
+ /** @description Row count in `tai_workspace_repo_code_hotspots` for the repo's latest Code Insights metrics snapshot. Null when the repo has no metrics snapshot. */
9748
+ hotspotCount: number | null;
9749
+ };
9750
+ InsightsTestPyramidRepoListDto: {
9751
+ items: components["schemas"]["InsightsTestPyramidRepoItemDto"][];
9752
+ total: number;
9753
+ limit: number;
9754
+ offset: number;
9755
+ };
9546
9756
  };
9547
9757
  responses: {
9548
9758
  /** @description Missing or invalid bearer token */
@@ -9630,6 +9840,10 @@ export interface components {
9630
9840
  CodeInsightsRepoSort: "repoName" | "locTotal" | "ccAvg" | "dupPct" | "lastMeasuredAt";
9631
9841
  /** @description Case-insensitive substring filter on repo name / provider slug. */
9632
9842
  CodeInsightsRepoSearch: string;
9843
+ /** @description Allowlisted Test pyramid assessment repo sort field. */
9844
+ InsightsTestPyramidRepoSort: "repoName" | "totalClassifiedFiles" | "scannedAt" | "maturity";
9845
+ /** @description Case-insensitive substring filter on repository name. */
9846
+ InsightsTestPyramidRepoSearch: string;
9633
9847
  /** @description Case-insensitive filter on repository name, language, or provider slug. */
9634
9848
  ReadinessRepoSearch: string;
9635
9849
  /** @description Exact language filter (e.g. `typescript`). */
@@ -10153,6 +10367,24 @@ export type CodeInsightsDesignAnalyzeResponseDto = components['schemas']['CodeIn
10153
10367
  export type CodeInsightsOrgHotspotDto = components['schemas']['CodeInsightsOrgHotspotDto'];
10154
10368
  export type CodeInsightsSonarDto = components['schemas']['CodeInsightsSonarDto'];
10155
10369
  export type CodeInsightsSummaryDto = components['schemas']['CodeInsightsSummaryDto'];
10370
+ export type InsightsTestPyramidMaturityDto = components['schemas']['InsightsTestPyramidMaturityDto'];
10371
+ export type InsightsTestPyramidShapeLabelDto = components['schemas']['InsightsTestPyramidShapeLabelDto'];
10372
+ export type InsightsTestPyramidShapeDto = components['schemas']['InsightsTestPyramidShapeDto'];
10373
+ export type InsightsTestPyramidLayerCountsDto = components['schemas']['InsightsTestPyramidLayerCountsDto'];
10374
+ export type InsightsTestPyramidLayerPresentDto = components['schemas']['InsightsTestPyramidLayerPresentDto'];
10375
+ export type InsightsTestPyramidLayerPresenceDto = components['schemas']['InsightsTestPyramidLayerPresenceDto'];
10376
+ export type InsightsTestPyramidGapRepoDto = components['schemas']['InsightsTestPyramidGapRepoDto'];
10377
+ export type InsightsTestPyramidGapsByLayerDto = components['schemas']['InsightsTestPyramidGapsByLayerDto'];
10378
+ export type InsightsTestPyramidMaturityCountsDto = components['schemas']['InsightsTestPyramidMaturityCountsDto'];
10379
+ export type InsightsTestPyramidLayerPresenceMapDto = components['schemas']['InsightsTestPyramidLayerPresenceMapDto'];
10380
+ export type InsightsTestPyramidMaturityDeltaDto = components['schemas']['InsightsTestPyramidMaturityDeltaDto'];
10381
+ export type InsightsTestPyramidConfidenceDto = components['schemas']['InsightsTestPyramidConfidenceDto'];
10382
+ export type InsightsTestPyramidLayerConfidenceDto = components['schemas']['InsightsTestPyramidLayerConfidenceDto'];
10383
+ export type InsightsTestPyramidCoverageRollupDto = components['schemas']['InsightsTestPyramidCoverageRollupDto'];
10384
+ export type InsightsTestPyramidCiQualityDto = components['schemas']['InsightsTestPyramidCiQualityDto'];
10385
+ export type InsightsTestPyramidSummaryDto = components['schemas']['InsightsTestPyramidSummaryDto'];
10386
+ export type InsightsTestPyramidRepoItemDto = components['schemas']['InsightsTestPyramidRepoItemDto'];
10387
+ export type InsightsTestPyramidRepoListDto = components['schemas']['InsightsTestPyramidRepoListDto'];
10156
10388
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
10157
10389
  export type ResponseForbidden = components['responses']['Forbidden'];
10158
10390
  export type ResponseZenHrSyncInProgress = components['responses']['ZenHrSyncInProgress'];
@@ -10184,6 +10416,8 @@ export type ParameterPaginationOrder = components['parameters']['PaginationOrder
10184
10416
  export type ParameterReadinessRepoSort = components['parameters']['ReadinessRepoSort'];
10185
10417
  export type ParameterCodeInsightsRepoSort = components['parameters']['CodeInsightsRepoSort'];
10186
10418
  export type ParameterCodeInsightsRepoSearch = components['parameters']['CodeInsightsRepoSearch'];
10419
+ export type ParameterInsightsTestPyramidRepoSort = components['parameters']['InsightsTestPyramidRepoSort'];
10420
+ export type ParameterInsightsTestPyramidRepoSearch = components['parameters']['InsightsTestPyramidRepoSearch'];
10187
10421
  export type ParameterReadinessRepoSearch = components['parameters']['ReadinessRepoSearch'];
10188
10422
  export type ParameterReadinessRepoLanguage = components['parameters']['ReadinessRepoLanguage'];
10189
10423
  export type ParameterReadinessFixSort = components['parameters']['ReadinessFixSort'];
@@ -14107,6 +14341,106 @@ export interface operations {
14107
14341
  };
14108
14342
  };
14109
14343
  };
14344
+ getInsightsTestPyramidSummary: {
14345
+ parameters: {
14346
+ query?: never;
14347
+ header?: never;
14348
+ path: {
14349
+ workspaceId: components["parameters"]["WorkspaceId"];
14350
+ };
14351
+ cookie?: never;
14352
+ };
14353
+ requestBody?: never;
14354
+ responses: {
14355
+ /** @description Test pyramid assessment workspace summary */
14356
+ 200: {
14357
+ headers: {
14358
+ [name: string]: unknown;
14359
+ };
14360
+ content: {
14361
+ "application/json": components["schemas"]["InsightsTestPyramidSummaryDto"];
14362
+ };
14363
+ };
14364
+ 401: components["responses"]["Unauthorized"];
14365
+ 403: components["responses"]["Forbidden"];
14366
+ /** @description Workspace does not exist or malformed workspaceId */
14367
+ 404: {
14368
+ headers: {
14369
+ [name: string]: unknown;
14370
+ };
14371
+ content?: never;
14372
+ };
14373
+ /** @description Test pyramid history not supported by store */
14374
+ 501: {
14375
+ headers: {
14376
+ [name: string]: unknown;
14377
+ };
14378
+ content: {
14379
+ "application/json": components["schemas"]["ErrorMessageDto"];
14380
+ };
14381
+ };
14382
+ };
14383
+ };
14384
+ listInsightsTestPyramidRepos: {
14385
+ parameters: {
14386
+ query?: {
14387
+ /** @description Page size (default 25, max 100). */
14388
+ limit?: components["parameters"]["PaginationLimit"];
14389
+ /** @description Zero-based row offset into the filtered, sorted result set. */
14390
+ offset?: components["parameters"]["PaginationOffset"];
14391
+ /** @description Allowlisted Test pyramid assessment repo sort field. */
14392
+ sort?: components["parameters"]["InsightsTestPyramidRepoSort"];
14393
+ /** @description Sort direction. */
14394
+ order?: components["parameters"]["PaginationOrder"];
14395
+ /** @description Case-insensitive substring filter on repository name. */
14396
+ search?: components["parameters"]["InsightsTestPyramidRepoSearch"];
14397
+ };
14398
+ header?: never;
14399
+ path: {
14400
+ workspaceId: components["parameters"]["WorkspaceId"];
14401
+ };
14402
+ cookie?: never;
14403
+ };
14404
+ requestBody?: never;
14405
+ responses: {
14406
+ /** @description Paginated test pyramid assessment repo rows */
14407
+ 200: {
14408
+ headers: {
14409
+ [name: string]: unknown;
14410
+ };
14411
+ content: {
14412
+ "application/json": components["schemas"]["InsightsTestPyramidRepoListDto"];
14413
+ };
14414
+ };
14415
+ /** @description Invalid pagination or sort query */
14416
+ 400: {
14417
+ headers: {
14418
+ [name: string]: unknown;
14419
+ };
14420
+ content: {
14421
+ "application/json": components["schemas"]["ErrorMessageDto"];
14422
+ };
14423
+ };
14424
+ 401: components["responses"]["Unauthorized"];
14425
+ 403: components["responses"]["Forbidden"];
14426
+ /** @description Workspace does not exist or malformed workspaceId */
14427
+ 404: {
14428
+ headers: {
14429
+ [name: string]: unknown;
14430
+ };
14431
+ content?: never;
14432
+ };
14433
+ /** @description Test pyramid history not supported by store */
14434
+ 501: {
14435
+ headers: {
14436
+ [name: string]: unknown;
14437
+ };
14438
+ content: {
14439
+ "application/json": components["schemas"]["ErrorMessageDto"];
14440
+ };
14441
+ };
14442
+ };
14443
+ };
14110
14444
  getAiToolMembers: {
14111
14445
  parameters: {
14112
14446
  query?: {