@qulib/core 0.8.2 → 0.9.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.
Files changed (88) hide show
  1. package/README.md +30 -5
  2. package/bin/qulib.js +2 -3
  3. package/dist/__tests__/playwright-available.d.ts +32 -0
  4. package/dist/__tests__/playwright-available.d.ts.map +1 -0
  5. package/dist/__tests__/playwright-available.js +35 -0
  6. package/dist/adapters/ci-results-adapter.d.ts +67 -0
  7. package/dist/adapters/ci-results-adapter.d.ts.map +1 -0
  8. package/dist/adapters/ci-results-adapter.js +143 -0
  9. package/dist/adapters/cypress-e2e-adapter.d.ts.map +1 -1
  10. package/dist/adapters/cypress-e2e-adapter.js +25 -2
  11. package/dist/adapters/playwright-adapter.d.ts.map +1 -1
  12. package/dist/adapters/playwright-adapter.js +25 -2
  13. package/dist/adapters/pr-metadata-adapter.d.ts +75 -0
  14. package/dist/adapters/pr-metadata-adapter.d.ts.map +1 -0
  15. package/dist/adapters/pr-metadata-adapter.js +146 -0
  16. package/dist/adapters/validate-specs.d.ts +55 -0
  17. package/dist/adapters/validate-specs.d.ts.map +1 -0
  18. package/dist/adapters/validate-specs.js +67 -0
  19. package/dist/baseline/baseline.d.ts +54 -0
  20. package/dist/baseline/baseline.d.ts.map +1 -0
  21. package/dist/baseline/baseline.js +252 -0
  22. package/dist/baseline/baseline.schema.d.ts +233 -0
  23. package/dist/baseline/baseline.schema.d.ts.map +1 -0
  24. package/dist/baseline/baseline.schema.js +59 -0
  25. package/dist/cli/confidence-run.d.ts +16 -0
  26. package/dist/cli/confidence-run.d.ts.map +1 -0
  27. package/dist/cli/confidence-run.js +158 -0
  28. package/dist/cli/index.d.ts +11 -1
  29. package/dist/cli/index.d.ts.map +1 -1
  30. package/dist/cli/index.js +80 -4
  31. package/dist/cli/scaffold-run.d.ts +86 -0
  32. package/dist/cli/scaffold-run.d.ts.map +1 -0
  33. package/dist/cli/scaffold-run.js +232 -0
  34. package/dist/cli/score-automation-run.d.ts +25 -0
  35. package/dist/cli/score-automation-run.d.ts.map +1 -0
  36. package/dist/cli/score-automation-run.js +123 -0
  37. package/dist/examples/notquality-dogfood/fixture.d.ts +166 -0
  38. package/dist/examples/notquality-dogfood/fixture.d.ts.map +1 -0
  39. package/dist/examples/notquality-dogfood/fixture.js +174 -0
  40. package/dist/examples/notquality-dogfood/run.d.ts +34 -0
  41. package/dist/examples/notquality-dogfood/run.d.ts.map +1 -0
  42. package/dist/examples/notquality-dogfood/run.js +139 -0
  43. package/dist/index.d.ts +14 -1
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +11 -0
  46. package/dist/recipes/a11y.d.ts +36 -0
  47. package/dist/recipes/a11y.d.ts.map +1 -0
  48. package/dist/recipes/a11y.js +118 -0
  49. package/dist/recipes/auth.d.ts +38 -0
  50. package/dist/recipes/auth.d.ts.map +1 -0
  51. package/dist/recipes/auth.js +156 -0
  52. package/dist/recipes/index.d.ts +26 -0
  53. package/dist/recipes/index.d.ts.map +1 -0
  54. package/dist/recipes/index.js +41 -0
  55. package/dist/recipes/nav.d.ts +34 -0
  56. package/dist/recipes/nav.d.ts.map +1 -0
  57. package/dist/recipes/nav.js +128 -0
  58. package/dist/recipes/seed.d.ts +34 -0
  59. package/dist/recipes/seed.d.ts.map +1 -0
  60. package/dist/recipes/seed.js +87 -0
  61. package/dist/scaffold-tests.d.ts +21 -0
  62. package/dist/scaffold-tests.d.ts.map +1 -1
  63. package/dist/scaffold-tests.js +12 -2
  64. package/dist/schemas/confidence.schema.d.ts +526 -0
  65. package/dist/schemas/confidence.schema.d.ts.map +1 -0
  66. package/dist/schemas/confidence.schema.js +161 -0
  67. package/dist/schemas/index.d.ts +3 -0
  68. package/dist/schemas/index.d.ts.map +1 -1
  69. package/dist/schemas/index.js +3 -0
  70. package/dist/schemas/recipe.schema.d.ts +66 -0
  71. package/dist/schemas/recipe.schema.d.ts.map +1 -0
  72. package/dist/schemas/recipe.schema.js +45 -0
  73. package/dist/schemas/views.schema.d.ts +234 -0
  74. package/dist/schemas/views.schema.d.ts.map +1 -0
  75. package/dist/schemas/views.schema.js +82 -0
  76. package/dist/tools/scoring/confidence-from-qulib.d.ts +34 -0
  77. package/dist/tools/scoring/confidence-from-qulib.d.ts.map +1 -0
  78. package/dist/tools/scoring/confidence-from-qulib.js +206 -0
  79. package/dist/tools/scoring/confidence-views.d.ts +40 -0
  80. package/dist/tools/scoring/confidence-views.d.ts.map +1 -0
  81. package/dist/tools/scoring/confidence-views.js +163 -0
  82. package/dist/tools/scoring/confidence.d.ts +32 -0
  83. package/dist/tools/scoring/confidence.d.ts.map +1 -0
  84. package/dist/tools/scoring/confidence.js +180 -0
  85. package/dist/tools/scoring/levels.d.ts +15 -0
  86. package/dist/tools/scoring/levels.d.ts.map +1 -0
  87. package/dist/tools/scoring/levels.js +21 -0
  88. package/package.json +13 -7
@@ -0,0 +1,526 @@
1
+ /**
2
+ * Release Confidence Aggregator — Zod schemas (single source of truth).
3
+ *
4
+ * P3 — qulib Confidence Layer v1.
5
+ * Pure schema definitions; no I/O. Scorer lives in tools/scoring/confidence.ts.
6
+ *
7
+ * Architecture note (§1d of spec):
8
+ * - EvidenceItem is the universal adapter envelope — any signal feeds the same scorer.
9
+ * - EvidenceSourceKind enum reserves external sources (ci-results, deploy-metadata, …)
10
+ * for P4 wiring; qulib-native sources are wired in P3.
11
+ * - tenantId on every record (CLAUDE.md rule 17 — multi-tenant from day one).
12
+ */
13
+ import { z } from 'zod';
14
+ export declare const EvidenceSourceKindSchema: z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>;
15
+ export type EvidenceSourceKind = z.infer<typeof EvidenceSourceKindSchema>;
16
+ export declare const ConfidencePolicySchema: z.ZodObject<{
17
+ /**
18
+ * Confidence score at or above this is required for verdict='ship'. Default 80.
19
+ * Mirrors AgentSummaryPolicy.passConfidenceThreshold.
20
+ */
21
+ passThreshold: z.ZodDefault<z.ZodNumber>;
22
+ /**
23
+ * Confidence score below this produces verdict='hold'. Default 30.
24
+ * Mirrors AgentSummaryPolicy.failConfidenceThreshold.
25
+ */
26
+ failThreshold: z.ZodDefault<z.ZodNumber>;
27
+ /** Max items in topRisks / recommendedNextChecks / honestyNotes lists. Default 5. */
28
+ maxListLength: z.ZodDefault<z.ZodNumber>;
29
+ /**
30
+ * Sources listed here produce verdict='caution' when their applicability is 'unknown'.
31
+ * Empty by default — callers can require specific sources for stricter gates.
32
+ */
33
+ requiredSources: z.ZodDefault<z.ZodArray<z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>, "many">>;
34
+ /**
35
+ * Per-source weight overrides. When provided, these replace the scorer's default weights
36
+ * for the named sources; unmentioned sources keep their defaults.
37
+ */
38
+ weights: z.ZodOptional<z.ZodRecord<z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>, z.ZodNumber>>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ passThreshold: number;
41
+ failThreshold: number;
42
+ maxListLength: number;
43
+ requiredSources: ("accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence")[];
44
+ weights?: Partial<Record<"accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence", number>> | undefined;
45
+ }, {
46
+ passThreshold?: number | undefined;
47
+ failThreshold?: number | undefined;
48
+ maxListLength?: number | undefined;
49
+ requiredSources?: ("accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence")[] | undefined;
50
+ weights?: Partial<Record<"accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence", number>> | undefined;
51
+ }>;
52
+ export type ConfidencePolicy = z.infer<typeof ConfidencePolicySchema>;
53
+ export declare const EvidenceItemSchema: z.ZodObject<{
54
+ source: z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>;
55
+ /**
56
+ * 0–100 normalized score, or null when the source ran but could not produce
57
+ * an honest score (e.g. auth-blocked crawl). null → excluded from denominator
58
+ * AND contributes to honesty notes.
59
+ */
60
+ score: z.ZodNullable<z.ZodNumber>;
61
+ weight: z.ZodNumber;
62
+ /**
63
+ * - applicable — qulib has signal and produced a real score.
64
+ * - not_applicable — the capability does not apply (e.g. api-coverage with 0 endpoints).
65
+ * Score is reported but excluded from the denominator.
66
+ * - unknown — qulib could not collect enough signal to score honestly.
67
+ * Excluded from denominator; narrated in honestyNotes.
68
+ */
69
+ applicability: z.ZodDefault<z.ZodEnum<["applicable", "not_applicable", "unknown"]>>;
70
+ /**
71
+ * When true, forces verdict='block' regardless of score.
72
+ * Use for hard gates: auth wall, critical gap, failed deploy.
73
+ */
74
+ blocking: z.ZodDefault<z.ZodBoolean>;
75
+ /** Human-readable "why this score" bullet points. */
76
+ evidence: z.ZodArray<z.ZodString, "many">;
77
+ recommendations: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
78
+ /** Required when applicability !== 'applicable'. Explains why the source was excluded. */
79
+ reason: z.ZodOptional<z.ZodString>;
80
+ /** ISO-8601 datetime when this evidence was collected. */
81
+ collectedAt: z.ZodString;
82
+ /**
83
+ * Provenance for Replay/Audit views — how this item was produced.
84
+ */
85
+ collector: z.ZodObject<{
86
+ tool: z.ZodString;
87
+ inputRef: z.ZodOptional<z.ZodString>;
88
+ durationMs: z.ZodOptional<z.ZodNumber>;
89
+ cost: z.ZodOptional<z.ZodObject<{
90
+ inputTokens: z.ZodNumber;
91
+ outputTokens: z.ZodNumber;
92
+ }, "strip", z.ZodTypeAny, {
93
+ inputTokens: number;
94
+ outputTokens: number;
95
+ }, {
96
+ inputTokens: number;
97
+ outputTokens: number;
98
+ }>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ tool: string;
101
+ durationMs?: number | undefined;
102
+ inputRef?: string | undefined;
103
+ cost?: {
104
+ inputTokens: number;
105
+ outputTokens: number;
106
+ } | undefined;
107
+ }, {
108
+ tool: string;
109
+ durationMs?: number | undefined;
110
+ inputRef?: string | undefined;
111
+ cost?: {
112
+ inputTokens: number;
113
+ outputTokens: number;
114
+ } | undefined;
115
+ }>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
118
+ recommendations: string[];
119
+ score: number | null;
120
+ weight: number;
121
+ evidence: string[];
122
+ applicability: "unknown" | "applicable" | "not_applicable";
123
+ blocking: boolean;
124
+ collectedAt: string;
125
+ collector: {
126
+ tool: string;
127
+ durationMs?: number | undefined;
128
+ inputRef?: string | undefined;
129
+ cost?: {
130
+ inputTokens: number;
131
+ outputTokens: number;
132
+ } | undefined;
133
+ };
134
+ reason?: string | undefined;
135
+ }, {
136
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
137
+ score: number | null;
138
+ weight: number;
139
+ evidence: string[];
140
+ collectedAt: string;
141
+ collector: {
142
+ tool: string;
143
+ durationMs?: number | undefined;
144
+ inputRef?: string | undefined;
145
+ cost?: {
146
+ inputTokens: number;
147
+ outputTokens: number;
148
+ } | undefined;
149
+ };
150
+ reason?: string | undefined;
151
+ recommendations?: string[] | undefined;
152
+ applicability?: "unknown" | "applicable" | "not_applicable" | undefined;
153
+ blocking?: boolean | undefined;
154
+ }>;
155
+ export type EvidenceItem = z.infer<typeof EvidenceItemSchema>;
156
+ export declare const ConfidenceSubjectSchema: z.ZodObject<{
157
+ kind: z.ZodEnum<["release", "pr", "deploy", "app", "repo"]>;
158
+ ref: z.ZodString;
159
+ /** Multi-tenant stamp (CLAUDE.md rule 17). Default 'default' while single-tenant. */
160
+ tenantId: z.ZodDefault<z.ZodString>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
163
+ ref: string;
164
+ tenantId: string;
165
+ }, {
166
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
167
+ ref: string;
168
+ tenantId?: string | undefined;
169
+ }>;
170
+ export type ConfidenceSubject = z.infer<typeof ConfidenceSubjectSchema>;
171
+ export declare const ConfidenceInputSchema: z.ZodObject<{
172
+ subject: z.ZodObject<{
173
+ kind: z.ZodEnum<["release", "pr", "deploy", "app", "repo"]>;
174
+ ref: z.ZodString;
175
+ /** Multi-tenant stamp (CLAUDE.md rule 17). Default 'default' while single-tenant. */
176
+ tenantId: z.ZodDefault<z.ZodString>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
179
+ ref: string;
180
+ tenantId: string;
181
+ }, {
182
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
183
+ ref: string;
184
+ tenantId?: string | undefined;
185
+ }>;
186
+ evidence: z.ZodArray<z.ZodObject<{
187
+ source: z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>;
188
+ /**
189
+ * 0–100 normalized score, or null when the source ran but could not produce
190
+ * an honest score (e.g. auth-blocked crawl). null → excluded from denominator
191
+ * AND contributes to honesty notes.
192
+ */
193
+ score: z.ZodNullable<z.ZodNumber>;
194
+ weight: z.ZodNumber;
195
+ /**
196
+ * - applicable — qulib has signal and produced a real score.
197
+ * - not_applicable — the capability does not apply (e.g. api-coverage with 0 endpoints).
198
+ * Score is reported but excluded from the denominator.
199
+ * - unknown — qulib could not collect enough signal to score honestly.
200
+ * Excluded from denominator; narrated in honestyNotes.
201
+ */
202
+ applicability: z.ZodDefault<z.ZodEnum<["applicable", "not_applicable", "unknown"]>>;
203
+ /**
204
+ * When true, forces verdict='block' regardless of score.
205
+ * Use for hard gates: auth wall, critical gap, failed deploy.
206
+ */
207
+ blocking: z.ZodDefault<z.ZodBoolean>;
208
+ /** Human-readable "why this score" bullet points. */
209
+ evidence: z.ZodArray<z.ZodString, "many">;
210
+ recommendations: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
211
+ /** Required when applicability !== 'applicable'. Explains why the source was excluded. */
212
+ reason: z.ZodOptional<z.ZodString>;
213
+ /** ISO-8601 datetime when this evidence was collected. */
214
+ collectedAt: z.ZodString;
215
+ /**
216
+ * Provenance for Replay/Audit views — how this item was produced.
217
+ */
218
+ collector: z.ZodObject<{
219
+ tool: z.ZodString;
220
+ inputRef: z.ZodOptional<z.ZodString>;
221
+ durationMs: z.ZodOptional<z.ZodNumber>;
222
+ cost: z.ZodOptional<z.ZodObject<{
223
+ inputTokens: z.ZodNumber;
224
+ outputTokens: z.ZodNumber;
225
+ }, "strip", z.ZodTypeAny, {
226
+ inputTokens: number;
227
+ outputTokens: number;
228
+ }, {
229
+ inputTokens: number;
230
+ outputTokens: number;
231
+ }>>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ tool: string;
234
+ durationMs?: number | undefined;
235
+ inputRef?: string | undefined;
236
+ cost?: {
237
+ inputTokens: number;
238
+ outputTokens: number;
239
+ } | undefined;
240
+ }, {
241
+ tool: string;
242
+ durationMs?: number | undefined;
243
+ inputRef?: string | undefined;
244
+ cost?: {
245
+ inputTokens: number;
246
+ outputTokens: number;
247
+ } | undefined;
248
+ }>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
251
+ recommendations: string[];
252
+ score: number | null;
253
+ weight: number;
254
+ evidence: string[];
255
+ applicability: "unknown" | "applicable" | "not_applicable";
256
+ blocking: boolean;
257
+ collectedAt: string;
258
+ collector: {
259
+ tool: string;
260
+ durationMs?: number | undefined;
261
+ inputRef?: string | undefined;
262
+ cost?: {
263
+ inputTokens: number;
264
+ outputTokens: number;
265
+ } | undefined;
266
+ };
267
+ reason?: string | undefined;
268
+ }, {
269
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
270
+ score: number | null;
271
+ weight: number;
272
+ evidence: string[];
273
+ collectedAt: string;
274
+ collector: {
275
+ tool: string;
276
+ durationMs?: number | undefined;
277
+ inputRef?: string | undefined;
278
+ cost?: {
279
+ inputTokens: number;
280
+ outputTokens: number;
281
+ } | undefined;
282
+ };
283
+ reason?: string | undefined;
284
+ recommendations?: string[] | undefined;
285
+ applicability?: "unknown" | "applicable" | "not_applicable" | undefined;
286
+ blocking?: boolean | undefined;
287
+ }>, "many">;
288
+ policy: z.ZodOptional<z.ZodObject<{
289
+ /**
290
+ * Confidence score at or above this is required for verdict='ship'. Default 80.
291
+ * Mirrors AgentSummaryPolicy.passConfidenceThreshold.
292
+ */
293
+ passThreshold: z.ZodDefault<z.ZodNumber>;
294
+ /**
295
+ * Confidence score below this produces verdict='hold'. Default 30.
296
+ * Mirrors AgentSummaryPolicy.failConfidenceThreshold.
297
+ */
298
+ failThreshold: z.ZodDefault<z.ZodNumber>;
299
+ /** Max items in topRisks / recommendedNextChecks / honestyNotes lists. Default 5. */
300
+ maxListLength: z.ZodDefault<z.ZodNumber>;
301
+ /**
302
+ * Sources listed here produce verdict='caution' when their applicability is 'unknown'.
303
+ * Empty by default — callers can require specific sources for stricter gates.
304
+ */
305
+ requiredSources: z.ZodDefault<z.ZodArray<z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>, "many">>;
306
+ /**
307
+ * Per-source weight overrides. When provided, these replace the scorer's default weights
308
+ * for the named sources; unmentioned sources keep their defaults.
309
+ */
310
+ weights: z.ZodOptional<z.ZodRecord<z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>, z.ZodNumber>>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ passThreshold: number;
313
+ failThreshold: number;
314
+ maxListLength: number;
315
+ requiredSources: ("accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence")[];
316
+ weights?: Partial<Record<"accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence", number>> | undefined;
317
+ }, {
318
+ passThreshold?: number | undefined;
319
+ failThreshold?: number | undefined;
320
+ maxListLength?: number | undefined;
321
+ requiredSources?: ("accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence")[] | undefined;
322
+ weights?: Partial<Record<"accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence", number>> | undefined;
323
+ }>>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ evidence: {
326
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
327
+ recommendations: string[];
328
+ score: number | null;
329
+ weight: number;
330
+ evidence: string[];
331
+ applicability: "unknown" | "applicable" | "not_applicable";
332
+ blocking: boolean;
333
+ collectedAt: string;
334
+ collector: {
335
+ tool: string;
336
+ durationMs?: number | undefined;
337
+ inputRef?: string | undefined;
338
+ cost?: {
339
+ inputTokens: number;
340
+ outputTokens: number;
341
+ } | undefined;
342
+ };
343
+ reason?: string | undefined;
344
+ }[];
345
+ subject: {
346
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
347
+ ref: string;
348
+ tenantId: string;
349
+ };
350
+ policy?: {
351
+ passThreshold: number;
352
+ failThreshold: number;
353
+ maxListLength: number;
354
+ requiredSources: ("accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence")[];
355
+ weights?: Partial<Record<"accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence", number>> | undefined;
356
+ } | undefined;
357
+ }, {
358
+ evidence: {
359
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
360
+ score: number | null;
361
+ weight: number;
362
+ evidence: string[];
363
+ collectedAt: string;
364
+ collector: {
365
+ tool: string;
366
+ durationMs?: number | undefined;
367
+ inputRef?: string | undefined;
368
+ cost?: {
369
+ inputTokens: number;
370
+ outputTokens: number;
371
+ } | undefined;
372
+ };
373
+ reason?: string | undefined;
374
+ recommendations?: string[] | undefined;
375
+ applicability?: "unknown" | "applicable" | "not_applicable" | undefined;
376
+ blocking?: boolean | undefined;
377
+ }[];
378
+ subject: {
379
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
380
+ ref: string;
381
+ tenantId?: string | undefined;
382
+ };
383
+ policy?: {
384
+ passThreshold?: number | undefined;
385
+ failThreshold?: number | undefined;
386
+ maxListLength?: number | undefined;
387
+ requiredSources?: ("accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence")[] | undefined;
388
+ weights?: Partial<Record<"accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence", number>> | undefined;
389
+ } | undefined;
390
+ }>;
391
+ export type ConfidenceInput = z.infer<typeof ConfidenceInputSchema>;
392
+ export declare const ConfidenceVerdictSchema: z.ZodEnum<["ship", "caution", "hold", "block"]>;
393
+ export type ConfidenceVerdict = z.infer<typeof ConfidenceVerdictSchema>;
394
+ export declare const ConfidenceContributionSchema: z.ZodObject<{
395
+ source: z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>;
396
+ score: z.ZodNullable<z.ZodNumber>;
397
+ weight: z.ZodNumber;
398
+ /** Renormalized weight over the applicable set (sums to 1.0 across applicable items). */
399
+ effectiveWeight: z.ZodNumber;
400
+ applicability: z.ZodEnum<["applicable", "not_applicable", "unknown"]>;
401
+ blocking: z.ZodBoolean;
402
+ }, "strip", z.ZodTypeAny, {
403
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
404
+ score: number | null;
405
+ weight: number;
406
+ applicability: "unknown" | "applicable" | "not_applicable";
407
+ blocking: boolean;
408
+ effectiveWeight: number;
409
+ }, {
410
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
411
+ score: number | null;
412
+ weight: number;
413
+ applicability: "unknown" | "applicable" | "not_applicable";
414
+ blocking: boolean;
415
+ effectiveWeight: number;
416
+ }>;
417
+ export type ConfidenceContribution = z.infer<typeof ConfidenceContributionSchema>;
418
+ export declare const ReleaseConfidenceSchema: z.ZodObject<{
419
+ schemaVersion: z.ZodLiteral<1>;
420
+ computedAt: z.ZodString;
421
+ subject: z.ZodObject<{
422
+ kind: z.ZodEnum<["release", "pr", "deploy", "app", "repo"]>;
423
+ ref: z.ZodString;
424
+ /** Multi-tenant stamp (CLAUDE.md rule 17). Default 'default' while single-tenant. */
425
+ tenantId: z.ZodDefault<z.ZodString>;
426
+ }, "strip", z.ZodTypeAny, {
427
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
428
+ ref: string;
429
+ tenantId: string;
430
+ }, {
431
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
432
+ ref: string;
433
+ tenantId?: string | undefined;
434
+ }>;
435
+ /**
436
+ * Fused confidence score (0–100) over applicable, non-null evidence only.
437
+ * null when no applicable evidence exists (honesty floor → verdict = 'block').
438
+ */
439
+ confidenceScore: z.ZodNullable<z.ZodNumber>;
440
+ verdict: z.ZodEnum<["ship", "caution", "hold", "block"]>;
441
+ level: z.ZodNumber;
442
+ label: z.ZodString;
443
+ /** Per-source breakdown including excluded (not_applicable / unknown) items. */
444
+ contributions: z.ZodArray<z.ZodObject<{
445
+ source: z.ZodEnum<["live-app-quality", "accessibility", "crawl-coverage", "test-automation", "api-coverage", "ci-results", "deploy-metadata", "error-telemetry", "feature-flags", "doc-health", "human-approval", "agent-evidence"]>;
446
+ score: z.ZodNullable<z.ZodNumber>;
447
+ weight: z.ZodNumber;
448
+ /** Renormalized weight over the applicable set (sums to 1.0 across applicable items). */
449
+ effectiveWeight: z.ZodNumber;
450
+ applicability: z.ZodEnum<["applicable", "not_applicable", "unknown"]>;
451
+ blocking: z.ZodBoolean;
452
+ }, "strip", z.ZodTypeAny, {
453
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
454
+ score: number | null;
455
+ weight: number;
456
+ applicability: "unknown" | "applicable" | "not_applicable";
457
+ blocking: boolean;
458
+ effectiveWeight: number;
459
+ }, {
460
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
461
+ score: number | null;
462
+ weight: number;
463
+ applicability: "unknown" | "applicable" | "not_applicable";
464
+ blocking: boolean;
465
+ effectiveWeight: number;
466
+ }>, "many">;
467
+ topRisks: z.ZodArray<z.ZodString, "many">;
468
+ recommendedNextChecks: z.ZodArray<z.ZodString, "many">;
469
+ /** One note per degraded/excluded/partial source — the honesty layer. */
470
+ honestyNotes: z.ZodArray<z.ZodString, "many">;
471
+ /** Non-empty only when verdict='block'; explains what caused the block. */
472
+ blockers: z.ZodArray<z.ZodString, "many">;
473
+ scoreFormula: z.ZodString;
474
+ }, "strip", z.ZodTypeAny, {
475
+ label: string;
476
+ level: number;
477
+ computedAt: string;
478
+ scoreFormula: string;
479
+ subject: {
480
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
481
+ ref: string;
482
+ tenantId: string;
483
+ };
484
+ schemaVersion: 1;
485
+ confidenceScore: number | null;
486
+ verdict: "ship" | "caution" | "hold" | "block";
487
+ contributions: {
488
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
489
+ score: number | null;
490
+ weight: number;
491
+ applicability: "unknown" | "applicable" | "not_applicable";
492
+ blocking: boolean;
493
+ effectiveWeight: number;
494
+ }[];
495
+ topRisks: string[];
496
+ recommendedNextChecks: string[];
497
+ honestyNotes: string[];
498
+ blockers: string[];
499
+ }, {
500
+ label: string;
501
+ level: number;
502
+ computedAt: string;
503
+ scoreFormula: string;
504
+ subject: {
505
+ kind: "app" | "repo" | "release" | "pr" | "deploy";
506
+ ref: string;
507
+ tenantId?: string | undefined;
508
+ };
509
+ schemaVersion: 1;
510
+ confidenceScore: number | null;
511
+ verdict: "ship" | "caution" | "hold" | "block";
512
+ contributions: {
513
+ source: "accessibility" | "live-app-quality" | "crawl-coverage" | "test-automation" | "api-coverage" | "ci-results" | "deploy-metadata" | "error-telemetry" | "feature-flags" | "doc-health" | "human-approval" | "agent-evidence";
514
+ score: number | null;
515
+ weight: number;
516
+ applicability: "unknown" | "applicable" | "not_applicable";
517
+ blocking: boolean;
518
+ effectiveWeight: number;
519
+ }[];
520
+ topRisks: string[];
521
+ recommendedNextChecks: string[];
522
+ honestyNotes: string[];
523
+ blockers: string[];
524
+ }>;
525
+ export type ReleaseConfidence = z.infer<typeof ReleaseConfidenceSchema>;
526
+ //# sourceMappingURL=confidence.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confidence.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/confidence.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,wBAAwB,8NAenC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E,eAAO,MAAM,sBAAsB;IACjC;;;OAGG;;IAEH;;;OAGG;;IAEH,qFAAqF;;IAErF;;;OAGG;;IAEH;;;OAGG;;;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAMtE,eAAO,MAAM,kBAAkB;;IAE7B;;;;OAIG;;;IAGH;;;;;;OAMG;;IAEH;;;OAGG;;IAEH,qDAAqD;;;IAGrD,0FAA0F;;IAE1F,0DAA0D;;IAE1D;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYH,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,uBAAuB;;;IAGlC,qFAAqF;;;;;;;;;;EAErF,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,qBAAqB;;;;QAThC,qFAAqF;;;;;;;;;;;;;QAnDrF;;;;WAIG;;;QAGH;;;;;;WAMG;;QAEH;;;WAGG;;QAEH,qDAAqD;;;QAGrD,0FAA0F;;QAE1F,0DAA0D;;QAE1D;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA5DH;;;WAGG;;QAEH;;;WAGG;;QAEH,qFAAqF;;QAErF;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EH,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,uBAAuB,iDAA+C,CAAC;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,4BAA4B;;;;IAIvC,yFAAyF;;;;;;;;;;;;;;;;;;EAIzF,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,uBAAuB;;;;;;QAtClC,qFAAqF;;;;;;;;;;;IA0CrF;;;OAGG;;;;;IAKH,gFAAgF;;;;;QAnBhF,yFAAyF;;;;;;;;;;;;;;;;;;;;;IAuBzF,yEAAyE;;IAEzE,2EAA2E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3E,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}