@kb-labs/qa-contracts 2.88.0 → 2.93.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 +78 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,10 +53,24 @@ interface QACheckConfig {
|
|
|
53
53
|
* - "perPackage" (default): run in each discovered package directory
|
|
54
54
|
* - "scopePath": run once in the sub-repo root (e.g. platform/kb-labs-cli/)
|
|
55
55
|
* - "repoRoot": run once in the workspace root
|
|
56
|
+
* - "diffOnly": run per-package, but only for packages containing files changed in the current branch (git diff base..HEAD)
|
|
57
|
+
* - "newFiles": run per-package, but only for packages containing files added in the current branch (git diff --diff-filter=A)
|
|
56
58
|
*/
|
|
57
|
-
runIn?: 'perPackage' | 'scopePath' | 'repoRoot';
|
|
59
|
+
runIn?: 'perPackage' | 'scopePath' | 'repoRoot' | 'diffOnly' | 'newFiles';
|
|
58
60
|
/** Display icon (emoji, e.g. "🔒"). Used in CLI output and REST API. */
|
|
59
61
|
icon?: string;
|
|
62
|
+
/**
|
|
63
|
+
* How a failure affects the overall QA run.
|
|
64
|
+
* - "blocker" (default): failure sets status to "failed" and appears in blockers[]
|
|
65
|
+
* - "warning": failure does not change status, appears in warnings[]
|
|
66
|
+
* - "info": recorded but does not appear in blockers[] or warnings[]
|
|
67
|
+
*/
|
|
68
|
+
severity?: 'blocker' | 'warning' | 'info';
|
|
69
|
+
/**
|
|
70
|
+
* If true, write per-check trend history to .kb/qa/trends/<id>.json in addition to the global history.
|
|
71
|
+
* Useful for tracking long-term quality trends for specific checks without polluting global history.
|
|
72
|
+
*/
|
|
73
|
+
trending?: boolean;
|
|
60
74
|
}
|
|
61
75
|
/**
|
|
62
76
|
* Filter which packages are discovered and checked.
|
|
@@ -103,6 +117,38 @@ interface CategoryConfig {
|
|
|
103
117
|
packages: string[];
|
|
104
118
|
}
|
|
105
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Structured output types for QA checks.
|
|
122
|
+
* Checks with parser:"json" should return TypedCheckOutput on stdout.
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* A single actionable finding from a check.
|
|
126
|
+
*/
|
|
127
|
+
interface CheckItem {
|
|
128
|
+
/** File path, package name, or other target identifier */
|
|
129
|
+
target: string;
|
|
130
|
+
/** Human-readable description of the issue */
|
|
131
|
+
message: string;
|
|
132
|
+
/** Concrete action for the agent to take (optional) */
|
|
133
|
+
fix?: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Structured JSON output expected from checks with parser:"json".
|
|
137
|
+
* The check script should write this to stdout.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* process.stdout.write(JSON.stringify({
|
|
141
|
+
* ok: false,
|
|
142
|
+
* items: [
|
|
143
|
+
* { target: 'src/foo.ts', message: 'no test file found', fix: 'create src/foo.test.ts' }
|
|
144
|
+
* ]
|
|
145
|
+
* }));
|
|
146
|
+
*/
|
|
147
|
+
interface TypedCheckOutput {
|
|
148
|
+
ok: boolean;
|
|
149
|
+
items?: CheckItem[];
|
|
150
|
+
}
|
|
151
|
+
|
|
106
152
|
/**
|
|
107
153
|
* Types of checks the QA plugin can run.
|
|
108
154
|
*/
|
|
@@ -119,6 +165,8 @@ interface CheckResult {
|
|
|
119
165
|
skipped: string[];
|
|
120
166
|
/** Error messages keyed by package name */
|
|
121
167
|
errors: Record<string, string>;
|
|
168
|
+
/** Structured findings keyed by target (file/package). Populated when check uses parser:"json" and returns CheckItem[]. */
|
|
169
|
+
details?: Record<string, CheckItem[]>;
|
|
122
170
|
}
|
|
123
171
|
/**
|
|
124
172
|
* Combined results of all QA check types.
|
|
@@ -240,6 +288,17 @@ interface HistoryEntry {
|
|
|
240
288
|
skipped: number;
|
|
241
289
|
}>;
|
|
242
290
|
failedPackages: Record<string, string[]>;
|
|
291
|
+
/**
|
|
292
|
+
* Arbitrary context from the caller (e.g. workflow step, agent, task).
|
|
293
|
+
* Passed via --context flag as JSON. QA stores it as-is without interpretation.
|
|
294
|
+
*/
|
|
295
|
+
runContext?: {
|
|
296
|
+
taskId?: string;
|
|
297
|
+
sessionId?: string;
|
|
298
|
+
agentId?: string;
|
|
299
|
+
workflowRunId?: string;
|
|
300
|
+
[key: string]: unknown;
|
|
301
|
+
};
|
|
243
302
|
}
|
|
244
303
|
/**
|
|
245
304
|
* Trend analysis result for a single check type.
|
|
@@ -326,6 +385,13 @@ interface ReportSummary {
|
|
|
326
385
|
failed: number;
|
|
327
386
|
skipped: number;
|
|
328
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* A grouped set of findings for one check in the agent-facing report.
|
|
390
|
+
*/
|
|
391
|
+
interface ReportCheckFindings {
|
|
392
|
+
check: string;
|
|
393
|
+
items: CheckItem[];
|
|
394
|
+
}
|
|
329
395
|
/**
|
|
330
396
|
* Full QA report — returned by json reporter.
|
|
331
397
|
*/
|
|
@@ -336,6 +402,16 @@ interface QAReport {
|
|
|
336
402
|
failures: Record<string, string[]>;
|
|
337
403
|
errors: Record<string, Record<string, string>>;
|
|
338
404
|
baseline: BaselineDiff | null;
|
|
405
|
+
/**
|
|
406
|
+
* Blocker findings — checks with severity:"blocker" (default) that failed.
|
|
407
|
+
* Each entry has structured CheckItem[] for the agent to act on.
|
|
408
|
+
*/
|
|
409
|
+
blockers: ReportCheckFindings[];
|
|
410
|
+
/**
|
|
411
|
+
* Warning findings — checks with severity:"warning" that failed.
|
|
412
|
+
* Does not affect overall status, but agent should review.
|
|
413
|
+
*/
|
|
414
|
+
warnings: ReportCheckFindings[];
|
|
339
415
|
}
|
|
340
416
|
|
|
341
417
|
/**
|
|
@@ -2188,4 +2264,4 @@ declare const QA_FULL_ROUTES: {
|
|
|
2188
2264
|
};
|
|
2189
2265
|
type QARoute = typeof QA_ROUTES[keyof typeof QA_ROUTES];
|
|
2190
2266
|
|
|
2191
|
-
export { type BaselineCheckSnapshot, type BaselineDiff, type BaselineSnapshot, type CategoryConfig, type CategoryGroup, type CheckDiff, type CheckResult, type CheckType, type EnrichedTrendResult, type ErrorGroup, type GitInfo, type GroupSummary, type GroupedResults, HISTORY_MAX_ENTRIES, type HistoryEntry, PATHS, type PackageCheckDetail, type PackageFilter, type PackageStatus, type PackageTimelineEntry, type PackageTimelineResponse, type PackagesConfig, type QABaselineDiffRequest, QABaselineDiffRequestSchema, type QABaselineDiffResponse, QABaselineDiffResponseSchema, type QABaselineRequest, QABaselineRequestSchema, type QABaselineResponse, QABaselineResponseSchema, type QABaselineUpdateRequest, QABaselineUpdateRequestSchema, type QABaselineUpdateResponse, QABaselineUpdateResponseSchema, type QACheckConfig, type QADetailsRequest, QADetailsRequestSchema, type QADetailsResponse, QADetailsResponseSchema, type QAEnrichedTrendsResponse, QAEnrichedTrendsResponseSchema, type QAErrorGroupsRequest, QAErrorGroupsRequestSchema, type QAErrorGroupsResponse, QAErrorGroupsResponseSchema, type QAHistoryRequest, QAHistoryRequestSchema, type QAHistoryResponse, QAHistoryResponseSchema, type QALatestRequest, QALatestRequestSchema, type QALatestResponse, QALatestResponseSchema, type QAPackageTimelineRequest, QAPackageTimelineRequestSchema, type QAPackageTimelineResponse, QAPackageTimelineResponseSchema, type QAPluginConfig, type QARegressionsRequest, QARegressionsRequestSchema, type QARegressionsResponse, QARegressionsResponseSchema, type QAReport, type QAResults, type QARoute, type QARunCheckRequest, QARunCheckRequestSchema, type QARunCheckResponse, QARunCheckResponseSchema, type QARunOptions, type QARunRequest, QARunRequestSchema, type QARunResponse, QARunResponseSchema, type QARunResult, QASummaryCheckSchema, type QASummaryRequest, QASummaryRequestSchema, type QASummaryResponse, QASummaryResponseSchema, type QATrendsRequest, QATrendsRequestSchema, type QATrendsResponse, QATrendsResponseSchema, QA_BASE_PATH, QA_DATA_DIR, QA_FULL_ROUTES, QA_ROUTES, type RegressionEntry, type RegressionResult, type RepoGroup, type ReportSummary, type SubmoduleInfo, TRENDS_WINDOW, type TrendChangelogEntry, type TrendResult, type TrendTimeSeriesPoint, type WorkspacePackage, getCheckIcon, getCheckLabel };
|
|
2267
|
+
export { type BaselineCheckSnapshot, type BaselineDiff, type BaselineSnapshot, type CategoryConfig, type CategoryGroup, type CheckDiff, type CheckItem, type CheckResult, type CheckType, type EnrichedTrendResult, type ErrorGroup, type GitInfo, type GroupSummary, type GroupedResults, HISTORY_MAX_ENTRIES, type HistoryEntry, PATHS, type PackageCheckDetail, type PackageFilter, type PackageStatus, type PackageTimelineEntry, type PackageTimelineResponse, type PackagesConfig, type QABaselineDiffRequest, QABaselineDiffRequestSchema, type QABaselineDiffResponse, QABaselineDiffResponseSchema, type QABaselineRequest, QABaselineRequestSchema, type QABaselineResponse, QABaselineResponseSchema, type QABaselineUpdateRequest, QABaselineUpdateRequestSchema, type QABaselineUpdateResponse, QABaselineUpdateResponseSchema, type QACheckConfig, type QADetailsRequest, QADetailsRequestSchema, type QADetailsResponse, QADetailsResponseSchema, type QAEnrichedTrendsResponse, QAEnrichedTrendsResponseSchema, type QAErrorGroupsRequest, QAErrorGroupsRequestSchema, type QAErrorGroupsResponse, QAErrorGroupsResponseSchema, type QAHistoryRequest, QAHistoryRequestSchema, type QAHistoryResponse, QAHistoryResponseSchema, type QALatestRequest, QALatestRequestSchema, type QALatestResponse, QALatestResponseSchema, type QAPackageTimelineRequest, QAPackageTimelineRequestSchema, type QAPackageTimelineResponse, QAPackageTimelineResponseSchema, type QAPluginConfig, type QARegressionsRequest, QARegressionsRequestSchema, type QARegressionsResponse, QARegressionsResponseSchema, type QAReport, type QAResults, type QARoute, type QARunCheckRequest, QARunCheckRequestSchema, type QARunCheckResponse, QARunCheckResponseSchema, type QARunOptions, type QARunRequest, QARunRequestSchema, type QARunResponse, QARunResponseSchema, type QARunResult, QASummaryCheckSchema, type QASummaryRequest, QASummaryRequestSchema, type QASummaryResponse, QASummaryResponseSchema, type QATrendsRequest, QATrendsRequestSchema, type QATrendsResponse, QATrendsResponseSchema, QA_BASE_PATH, QA_DATA_DIR, QA_FULL_ROUTES, QA_ROUTES, type RegressionEntry, type RegressionResult, type RepoGroup, type ReportCheckFindings, type ReportSummary, type SubmoduleInfo, TRENDS_WINDOW, type TrendChangelogEntry, type TrendResult, type TrendTimeSeriesPoint, type TypedCheckOutput, type WorkspacePackage, getCheckIcon, getCheckLabel };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kb-labs/qa-contracts",
|
|
3
3
|
"description": "Contracts for KB Labs QA Plugin — types, interfaces, and constants for QA checks, baselines, and history tracking.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.93.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"tsup": "^8.5.0",
|
|
27
27
|
"typescript": "^5.6.3",
|
|
28
28
|
"vitest": "^3.2.4",
|
|
29
|
-
"@kb-labs/devkit": "2.
|
|
29
|
+
"@kb-labs/devkit": "2.93.0"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=20.0.0",
|