@qulib/core 0.7.0 → 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 (116) hide show
  1. package/README.md +30 -5
  2. package/bin/qulib.js +2 -3
  3. package/dist/__tests__/fixtures/api-fixture-repo/app/api/orders/route.d.ts +7 -0
  4. package/dist/__tests__/fixtures/api-fixture-repo/app/api/orders/route.d.ts.map +1 -0
  5. package/dist/__tests__/fixtures/api-fixture-repo/app/api/orders/route.js +7 -0
  6. package/dist/__tests__/fixtures/api-fixture-repo/app/api/users/route.d.ts +10 -0
  7. package/dist/__tests__/fixtures/api-fixture-repo/app/api/users/route.d.ts.map +1 -0
  8. package/dist/__tests__/fixtures/api-fixture-repo/app/api/users/route.js +9 -0
  9. package/dist/__tests__/fixtures/api-fixture-repo/pages/api/health.d.ts +9 -0
  10. package/dist/__tests__/fixtures/api-fixture-repo/pages/api/health.d.ts.map +1 -0
  11. package/dist/__tests__/fixtures/api-fixture-repo/pages/api/health.js +10 -0
  12. package/dist/__tests__/playwright-available.d.ts +32 -0
  13. package/dist/__tests__/playwright-available.d.ts.map +1 -0
  14. package/dist/__tests__/playwright-available.js +35 -0
  15. package/dist/adapters/api-adapter.d.ts +26 -0
  16. package/dist/adapters/api-adapter.d.ts.map +1 -1
  17. package/dist/adapters/api-adapter.js +156 -2
  18. package/dist/adapters/ci-results-adapter.d.ts +67 -0
  19. package/dist/adapters/ci-results-adapter.d.ts.map +1 -0
  20. package/dist/adapters/ci-results-adapter.js +143 -0
  21. package/dist/adapters/cypress-e2e-adapter.d.ts.map +1 -1
  22. package/dist/adapters/cypress-e2e-adapter.js +25 -2
  23. package/dist/adapters/playwright-adapter.d.ts.map +1 -1
  24. package/dist/adapters/playwright-adapter.js +94 -2
  25. package/dist/adapters/pr-metadata-adapter.d.ts +75 -0
  26. package/dist/adapters/pr-metadata-adapter.d.ts.map +1 -0
  27. package/dist/adapters/pr-metadata-adapter.js +146 -0
  28. package/dist/adapters/validate-specs.d.ts +55 -0
  29. package/dist/adapters/validate-specs.d.ts.map +1 -0
  30. package/dist/adapters/validate-specs.js +67 -0
  31. package/dist/baseline/baseline.d.ts +54 -0
  32. package/dist/baseline/baseline.d.ts.map +1 -0
  33. package/dist/baseline/baseline.js +252 -0
  34. package/dist/baseline/baseline.schema.d.ts +233 -0
  35. package/dist/baseline/baseline.schema.d.ts.map +1 -0
  36. package/dist/baseline/baseline.schema.js +59 -0
  37. package/dist/cli/confidence-run.d.ts +16 -0
  38. package/dist/cli/confidence-run.d.ts.map +1 -0
  39. package/dist/cli/confidence-run.js +158 -0
  40. package/dist/cli/index.d.ts +11 -1
  41. package/dist/cli/index.d.ts.map +1 -1
  42. package/dist/cli/index.js +80 -4
  43. package/dist/cli/scaffold-run.d.ts +86 -0
  44. package/dist/cli/scaffold-run.d.ts.map +1 -0
  45. package/dist/cli/scaffold-run.js +232 -0
  46. package/dist/cli/score-automation-run.d.ts +25 -0
  47. package/dist/cli/score-automation-run.d.ts.map +1 -0
  48. package/dist/cli/score-automation-run.js +123 -0
  49. package/dist/examples/notquality-dogfood/fixture.d.ts +166 -0
  50. package/dist/examples/notquality-dogfood/fixture.d.ts.map +1 -0
  51. package/dist/examples/notquality-dogfood/fixture.js +174 -0
  52. package/dist/examples/notquality-dogfood/run.d.ts +34 -0
  53. package/dist/examples/notquality-dogfood/run.d.ts.map +1 -0
  54. package/dist/examples/notquality-dogfood/run.js +139 -0
  55. package/dist/index.d.ts +18 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +13 -0
  58. package/dist/recipes/a11y.d.ts +36 -0
  59. package/dist/recipes/a11y.d.ts.map +1 -0
  60. package/dist/recipes/a11y.js +118 -0
  61. package/dist/recipes/auth.d.ts +38 -0
  62. package/dist/recipes/auth.d.ts.map +1 -0
  63. package/dist/recipes/auth.js +156 -0
  64. package/dist/recipes/index.d.ts +26 -0
  65. package/dist/recipes/index.d.ts.map +1 -0
  66. package/dist/recipes/index.js +41 -0
  67. package/dist/recipes/nav.d.ts +34 -0
  68. package/dist/recipes/nav.d.ts.map +1 -0
  69. package/dist/recipes/nav.js +128 -0
  70. package/dist/recipes/seed.d.ts +34 -0
  71. package/dist/recipes/seed.d.ts.map +1 -0
  72. package/dist/recipes/seed.js +87 -0
  73. package/dist/scaffold-tests.d.ts +21 -0
  74. package/dist/scaffold-tests.d.ts.map +1 -1
  75. package/dist/scaffold-tests.js +12 -2
  76. package/dist/schemas/automation-maturity.schema.d.ts +8 -8
  77. package/dist/schemas/automation-maturity.schema.d.ts.map +1 -1
  78. package/dist/schemas/automation-maturity.schema.js +1 -0
  79. package/dist/schemas/confidence.schema.d.ts +526 -0
  80. package/dist/schemas/confidence.schema.d.ts.map +1 -0
  81. package/dist/schemas/confidence.schema.js +161 -0
  82. package/dist/schemas/gap-analysis.schema.d.ts +8 -8
  83. package/dist/schemas/gap-analysis.schema.js +1 -1
  84. package/dist/schemas/index.d.ts +3 -0
  85. package/dist/schemas/index.d.ts.map +1 -1
  86. package/dist/schemas/index.js +3 -0
  87. package/dist/schemas/public-surface.schema.d.ts +5 -5
  88. package/dist/schemas/recipe.schema.d.ts +66 -0
  89. package/dist/schemas/recipe.schema.d.ts.map +1 -0
  90. package/dist/schemas/recipe.schema.js +45 -0
  91. package/dist/schemas/repo-analysis.schema.d.ts +7 -7
  92. package/dist/schemas/views.schema.d.ts +234 -0
  93. package/dist/schemas/views.schema.d.ts.map +1 -0
  94. package/dist/schemas/views.schema.js +82 -0
  95. package/dist/tools/repo/api-surface.d.ts +59 -0
  96. package/dist/tools/repo/api-surface.d.ts.map +1 -0
  97. package/dist/tools/repo/api-surface.js +414 -0
  98. package/dist/tools/scoring/api-coverage.d.ts +74 -0
  99. package/dist/tools/scoring/api-coverage.d.ts.map +1 -0
  100. package/dist/tools/scoring/api-coverage.js +158 -0
  101. package/dist/tools/scoring/automation-maturity.d.ts +11 -1
  102. package/dist/tools/scoring/automation-maturity.d.ts.map +1 -1
  103. package/dist/tools/scoring/automation-maturity.js +43 -9
  104. package/dist/tools/scoring/confidence-from-qulib.d.ts +34 -0
  105. package/dist/tools/scoring/confidence-from-qulib.d.ts.map +1 -0
  106. package/dist/tools/scoring/confidence-from-qulib.js +206 -0
  107. package/dist/tools/scoring/confidence-views.d.ts +40 -0
  108. package/dist/tools/scoring/confidence-views.d.ts.map +1 -0
  109. package/dist/tools/scoring/confidence-views.js +163 -0
  110. package/dist/tools/scoring/confidence.d.ts +32 -0
  111. package/dist/tools/scoring/confidence.d.ts.map +1 -0
  112. package/dist/tools/scoring/confidence.js +180 -0
  113. package/dist/tools/scoring/levels.d.ts +15 -0
  114. package/dist/tools/scoring/levels.d.ts.map +1 -0
  115. package/dist/tools/scoring/levels.js +21 -0
  116. package/package.json +15 -7
@@ -0,0 +1,161 @@
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
+ // ---------------------------------------------------------------------------
15
+ // Evidence source kinds
16
+ // ---------------------------------------------------------------------------
17
+ export const EvidenceSourceKindSchema = z.enum([
18
+ // qulib-native (P3 wires these)
19
+ 'live-app-quality',
20
+ 'accessibility',
21
+ 'crawl-coverage',
22
+ 'test-automation',
23
+ 'api-coverage',
24
+ // external — schema reserves them; P4 wires them
25
+ 'ci-results',
26
+ 'deploy-metadata',
27
+ 'error-telemetry',
28
+ 'feature-flags',
29
+ 'doc-health',
30
+ 'human-approval',
31
+ 'agent-evidence',
32
+ ]);
33
+ // ---------------------------------------------------------------------------
34
+ // Policy
35
+ // ---------------------------------------------------------------------------
36
+ export const ConfidencePolicySchema = z.object({
37
+ /**
38
+ * Confidence score at or above this is required for verdict='ship'. Default 80.
39
+ * Mirrors AgentSummaryPolicy.passConfidenceThreshold.
40
+ */
41
+ passThreshold: z.number().min(0).max(100).default(80),
42
+ /**
43
+ * Confidence score below this produces verdict='hold'. Default 30.
44
+ * Mirrors AgentSummaryPolicy.failConfidenceThreshold.
45
+ */
46
+ failThreshold: z.number().min(0).max(100).default(30),
47
+ /** Max items in topRisks / recommendedNextChecks / honestyNotes lists. Default 5. */
48
+ maxListLength: z.number().int().min(1).default(5),
49
+ /**
50
+ * Sources listed here produce verdict='caution' when their applicability is 'unknown'.
51
+ * Empty by default — callers can require specific sources for stricter gates.
52
+ */
53
+ requiredSources: z.array(EvidenceSourceKindSchema).default([]),
54
+ /**
55
+ * Per-source weight overrides. When provided, these replace the scorer's default weights
56
+ * for the named sources; unmentioned sources keep their defaults.
57
+ */
58
+ weights: z.record(EvidenceSourceKindSchema, z.number().min(0).max(1)).optional(),
59
+ });
60
+ // ---------------------------------------------------------------------------
61
+ // Evidence item (universal adapter envelope)
62
+ // ---------------------------------------------------------------------------
63
+ export const EvidenceItemSchema = z.object({
64
+ source: EvidenceSourceKindSchema,
65
+ /**
66
+ * 0–100 normalized score, or null when the source ran but could not produce
67
+ * an honest score (e.g. auth-blocked crawl). null → excluded from denominator
68
+ * AND contributes to honesty notes.
69
+ */
70
+ score: z.number().min(0).max(100).nullable(),
71
+ weight: z.number().min(0).max(1),
72
+ /**
73
+ * - applicable — qulib has signal and produced a real score.
74
+ * - not_applicable — the capability does not apply (e.g. api-coverage with 0 endpoints).
75
+ * Score is reported but excluded from the denominator.
76
+ * - unknown — qulib could not collect enough signal to score honestly.
77
+ * Excluded from denominator; narrated in honestyNotes.
78
+ */
79
+ applicability: z.enum(['applicable', 'not_applicable', 'unknown']).default('applicable'),
80
+ /**
81
+ * When true, forces verdict='block' regardless of score.
82
+ * Use for hard gates: auth wall, critical gap, failed deploy.
83
+ */
84
+ blocking: z.boolean().default(false),
85
+ /** Human-readable "why this score" bullet points. */
86
+ evidence: z.array(z.string()),
87
+ recommendations: z.array(z.string()).default([]),
88
+ /** Required when applicability !== 'applicable'. Explains why the source was excluded. */
89
+ reason: z.string().optional(),
90
+ /** ISO-8601 datetime when this evidence was collected. */
91
+ collectedAt: z.string().datetime(),
92
+ /**
93
+ * Provenance for Replay/Audit views — how this item was produced.
94
+ */
95
+ collector: z.object({
96
+ tool: z.string(),
97
+ inputRef: z.string().optional(),
98
+ durationMs: z.number().optional(),
99
+ cost: z
100
+ .object({
101
+ inputTokens: z.number(),
102
+ outputTokens: z.number(),
103
+ })
104
+ .optional(),
105
+ }),
106
+ });
107
+ // ---------------------------------------------------------------------------
108
+ // Subject (what we are judging)
109
+ // ---------------------------------------------------------------------------
110
+ export const ConfidenceSubjectSchema = z.object({
111
+ kind: z.enum(['release', 'pr', 'deploy', 'app', 'repo']),
112
+ ref: z.string(),
113
+ /** Multi-tenant stamp (CLAUDE.md rule 17). Default 'default' while single-tenant. */
114
+ tenantId: z.string().default('default'),
115
+ });
116
+ // ---------------------------------------------------------------------------
117
+ // Confidence input (the scorer's full input)
118
+ // ---------------------------------------------------------------------------
119
+ export const ConfidenceInputSchema = z.object({
120
+ subject: ConfidenceSubjectSchema,
121
+ evidence: z.array(EvidenceItemSchema),
122
+ policy: ConfidencePolicySchema.optional(),
123
+ });
124
+ // ---------------------------------------------------------------------------
125
+ // Verdict
126
+ // ---------------------------------------------------------------------------
127
+ export const ConfidenceVerdictSchema = z.enum(['ship', 'caution', 'hold', 'block']);
128
+ // ---------------------------------------------------------------------------
129
+ // Release confidence output (the aggregator's result — View 1)
130
+ // ---------------------------------------------------------------------------
131
+ export const ConfidenceContributionSchema = z.object({
132
+ source: EvidenceSourceKindSchema,
133
+ score: z.number().min(0).max(100).nullable(),
134
+ weight: z.number(),
135
+ /** Renormalized weight over the applicable set (sums to 1.0 across applicable items). */
136
+ effectiveWeight: z.number(),
137
+ applicability: z.enum(['applicable', 'not_applicable', 'unknown']),
138
+ blocking: z.boolean(),
139
+ });
140
+ export const ReleaseConfidenceSchema = z.object({
141
+ schemaVersion: z.literal(1),
142
+ computedAt: z.string().datetime(),
143
+ subject: ConfidenceSubjectSchema,
144
+ /**
145
+ * Fused confidence score (0–100) over applicable, non-null evidence only.
146
+ * null when no applicable evidence exists (honesty floor → verdict = 'block').
147
+ */
148
+ confidenceScore: z.number().min(0).max(100).nullable(),
149
+ verdict: ConfidenceVerdictSchema,
150
+ level: z.number().int().min(1).max(5),
151
+ label: z.string(),
152
+ /** Per-source breakdown including excluded (not_applicable / unknown) items. */
153
+ contributions: z.array(ConfidenceContributionSchema),
154
+ topRisks: z.array(z.string()),
155
+ recommendedNextChecks: z.array(z.string()),
156
+ /** One note per degraded/excluded/partial source — the honesty layer. */
157
+ honestyNotes: z.array(z.string()),
158
+ /** Non-empty only when verdict='block'; explains what caused the block. */
159
+ blockers: z.array(z.string()),
160
+ scoreFormula: z.string(),
161
+ });
@@ -4,7 +4,7 @@ export declare const GapSchema: z.ZodObject<{
4
4
  path: z.ZodString;
5
5
  severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
6
6
  reason: z.ZodString;
7
- category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage"]>;
7
+ category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage", "untested-api-endpoint"]>;
8
8
  description: z.ZodOptional<z.ZodString>;
9
9
  recommendation: z.ZodOptional<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
@@ -12,7 +12,7 @@ export declare const GapSchema: z.ZodObject<{
12
12
  id: string;
13
13
  severity: "critical" | "high" | "medium" | "low";
14
14
  reason: string;
15
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
15
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
16
16
  recommendation?: string | undefined;
17
17
  description?: string | undefined;
18
18
  }, {
@@ -20,7 +20,7 @@ export declare const GapSchema: z.ZodObject<{
20
20
  id: string;
21
21
  severity: "critical" | "high" | "medium" | "low";
22
22
  reason: string;
23
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
23
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
24
24
  recommendation?: string | undefined;
25
25
  description?: string | undefined;
26
26
  }>;
@@ -163,7 +163,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
163
163
  path: z.ZodString;
164
164
  severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
165
165
  reason: z.ZodString;
166
- category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage"]>;
166
+ category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage", "untested-api-endpoint"]>;
167
167
  description: z.ZodOptional<z.ZodString>;
168
168
  recommendation: z.ZodOptional<z.ZodString>;
169
169
  }, "strip", z.ZodTypeAny, {
@@ -171,7 +171,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
171
171
  id: string;
172
172
  severity: "critical" | "high" | "medium" | "low";
173
173
  reason: string;
174
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
174
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
175
175
  recommendation?: string | undefined;
176
176
  description?: string | undefined;
177
177
  }, {
@@ -179,7 +179,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
179
179
  id: string;
180
180
  severity: "critical" | "high" | "medium" | "low";
181
181
  reason: string;
182
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
182
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
183
183
  recommendation?: string | undefined;
184
184
  description?: string | undefined;
185
185
  }>, "many">;
@@ -445,7 +445,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
445
445
  id: string;
446
446
  severity: "critical" | "high" | "medium" | "low";
447
447
  reason: string;
448
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
448
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
449
449
  recommendation?: string | undefined;
450
450
  description?: string | undefined;
451
451
  }[];
@@ -524,7 +524,7 @@ export declare const GapAnalysisSchema: z.ZodObject<{
524
524
  id: string;
525
525
  severity: "critical" | "high" | "medium" | "low";
526
526
  reason: string;
527
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
527
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
528
528
  recommendation?: string | undefined;
529
529
  description?: string | undefined;
530
530
  }[];
@@ -5,7 +5,7 @@ export const GapSchema = z.object({
5
5
  path: z.string(),
6
6
  severity: z.enum(['critical', 'high', 'medium', 'low']),
7
7
  reason: z.string(),
8
- category: z.enum(['untested-route', 'a11y', 'console-error', 'broken-link', 'auth-surface', 'coverage']),
8
+ category: z.enum(['untested-route', 'a11y', 'console-error', 'broken-link', 'auth-surface', 'coverage', 'untested-api-endpoint']),
9
9
  description: z.string().optional(),
10
10
  recommendation: z.string().optional(),
11
11
  });
@@ -6,4 +6,7 @@ export { CostIntelligenceSchema, LlmUsageRecordSchema, LlmDataQualitySchema, Llm
6
6
  export { RepoAnalysisSchema, FrameworkDetectionSchema, DetectedFrameworkPrimarySchema, FrameworkDetectionConfidenceSchema, TestFrameworkDetectedSchema, type RepoAnalysis, type FrameworkDetectionResult, type DetectedFrameworkPrimary, } from './repo-analysis.schema.js';
7
7
  export { AutomationMaturitySchema, AutomationMaturityDimensionSchema, AutomationMaturityApplicabilitySchema, type AutomationMaturity, type AutomationMaturityDimension, type AutomationMaturityApplicability, } from './automation-maturity.schema.js';
8
8
  export { PublicSurfaceSchema, PublicSurfaceViolationSchema, PublicSurfaceBrokenLinkSchema, type PublicSurface, type PublicSurfaceViolation, type PublicSurfaceBrokenLink, } from './public-surface.schema.js';
9
+ export { RecipeIdSchema, RecipeConfigSchema, type RecipeId, type RecipeConfig, } from './recipe.schema.js';
10
+ export { EvidenceSourceKindSchema, EvidenceItemSchema, ConfidenceSubjectSchema, ConfidenceInputSchema, ConfidencePolicySchema, ConfidenceVerdictSchema, ConfidenceContributionSchema, ReleaseConfidenceSchema, type EvidenceSourceKind, type EvidenceItem, type ConfidenceSubject, type ConfidenceInput, type ConfidencePolicy, type ConfidenceVerdict, type ConfidenceContribution, type ReleaseConfidence, } from './confidence.schema.js';
11
+ export { DeliveryTrafficPointSchema, InboxItemKindSchema, InboxItemSchema, ReplayStepSchema, ReplayTraceSchema, AuditEntrySchema, type DeliveryTrafficPoint, type InboxItemKind, type InboxItem, type ReplayStep, type ReplayTrace, type AuditEntry, } from './views.schema.js';
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,cAAc,EACd,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,KAAK,GACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,6BAA6B,EAC7B,KAAK,WAAW,EAChB,KAAK,GAAG,EACR,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,qCAAqC,EACrC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,6BAA6B,EAC7B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,cAAc,EACd,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,KAAK,GACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,6BAA6B,EAC7B,KAAK,WAAW,EAChB,KAAK,GAAG,EACR,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,qCAAqC,EACrC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,GACrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,6BAA6B,EAC7B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC"}
@@ -6,3 +6,6 @@ export { CostIntelligenceSchema, LlmUsageRecordSchema, LlmDataQualitySchema, Llm
6
6
  export { RepoAnalysisSchema, FrameworkDetectionSchema, DetectedFrameworkPrimarySchema, FrameworkDetectionConfidenceSchema, TestFrameworkDetectedSchema, } from './repo-analysis.schema.js';
7
7
  export { AutomationMaturitySchema, AutomationMaturityDimensionSchema, AutomationMaturityApplicabilitySchema, } from './automation-maturity.schema.js';
8
8
  export { PublicSurfaceSchema, PublicSurfaceViolationSchema, PublicSurfaceBrokenLinkSchema, } from './public-surface.schema.js';
9
+ export { RecipeIdSchema, RecipeConfigSchema, } from './recipe.schema.js';
10
+ export { EvidenceSourceKindSchema, EvidenceItemSchema, ConfidenceSubjectSchema, ConfidenceInputSchema, ConfidencePolicySchema, ConfidenceVerdictSchema, ConfidenceContributionSchema, ReleaseConfidenceSchema, } from './confidence.schema.js';
11
+ export { DeliveryTrafficPointSchema, InboxItemKindSchema, InboxItemSchema, ReplayStepSchema, ReplayTraceSchema, AuditEntrySchema, } from './views.schema.js';
@@ -118,7 +118,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
118
118
  path: z.ZodString;
119
119
  severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
120
120
  reason: z.ZodString;
121
- category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage"]>;
121
+ category: z.ZodEnum<["untested-route", "a11y", "console-error", "broken-link", "auth-surface", "coverage", "untested-api-endpoint"]>;
122
122
  description: z.ZodOptional<z.ZodString>;
123
123
  recommendation: z.ZodOptional<z.ZodString>;
124
124
  }, "strip", z.ZodTypeAny, {
@@ -126,7 +126,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
126
126
  id: string;
127
127
  severity: "critical" | "high" | "medium" | "low";
128
128
  reason: string;
129
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
129
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
130
130
  recommendation?: string | undefined;
131
131
  description?: string | undefined;
132
132
  }, {
@@ -134,7 +134,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
134
134
  id: string;
135
135
  severity: "critical" | "high" | "medium" | "low";
136
136
  reason: string;
137
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
137
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
138
138
  recommendation?: string | undefined;
139
139
  description?: string | undefined;
140
140
  }>, "many">;
@@ -181,7 +181,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
181
181
  id: string;
182
182
  severity: "critical" | "high" | "medium" | "low";
183
183
  reason: string;
184
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
184
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
185
185
  recommendation?: string | undefined;
186
186
  description?: string | undefined;
187
187
  }[];
@@ -224,7 +224,7 @@ export declare const PublicSurfaceSchema: z.ZodObject<{
224
224
  id: string;
225
225
  severity: "critical" | "high" | "medium" | "low";
226
226
  reason: string;
227
- category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage";
227
+ category: "untested-route" | "a11y" | "console-error" | "broken-link" | "auth-surface" | "coverage" | "untested-api-endpoint";
228
228
  recommendation?: string | undefined;
229
229
  description?: string | undefined;
230
230
  }[];
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * RecipeId — the stable vocabulary of reusable test patterns.
4
+ *
5
+ * Each value corresponds to a recipe module under src/recipes/:
6
+ * auth — login / logout / protected-route flows
7
+ * a11y — accessibility checks (axe-core assertions / aria probes)
8
+ * nav — navigation, deep-linking, back/forward, 404 handling
9
+ * seed — data-seeding helpers (reset, pre-populate state via API or UI)
10
+ *
11
+ * The enum is additive — new recipes can be appended without breaking callers.
12
+ */
13
+ export declare const RecipeIdSchema: z.ZodEnum<["auth", "a11y", "nav", "seed"]>;
14
+ export type RecipeId = z.infer<typeof RecipeIdSchema>;
15
+ /**
16
+ * Per-recipe configuration that callers may pass alongside a RecipeId to
17
+ * override defaults. All fields are optional — recipes work without config.
18
+ */
19
+ export declare const RecipeConfigSchema: z.ZodObject<{
20
+ /**
21
+ * Selectors to use for form-login auth steps (recipe: auth).
22
+ * When provided, the auth recipe uses these instead of the defaults derived
23
+ * from the NQ-2 / CaseLoom proven patterns.
24
+ */
25
+ loginUrl: z.ZodOptional<z.ZodString>;
26
+ usernameSelector: z.ZodOptional<z.ZodString>;
27
+ passwordSelector: z.ZodOptional<z.ZodString>;
28
+ submitSelector: z.ZodOptional<z.ZodString>;
29
+ /** Selector for a success indicator visible after login (recipe: auth). */
30
+ successSelector: z.ZodOptional<z.ZodString>;
31
+ /**
32
+ * Routes that the nav recipe should visit in addition to the root (recipe: nav).
33
+ * If omitted the recipe generates scenarios for '/', '/about', and '/404'.
34
+ */
35
+ navRoutes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ /**
37
+ * axe-core impact level threshold — violations at or above this level are
38
+ * asserted (recipe: a11y). Default 'serious'.
39
+ */
40
+ a11yImpact: z.ZodOptional<z.ZodEnum<["minor", "moderate", "serious", "critical"]>>;
41
+ /**
42
+ * API endpoint to call for seeding/resetting state (recipe: seed).
43
+ * POST with an empty body; expects 200/201/204.
44
+ */
45
+ seedEndpoint: z.ZodOptional<z.ZodString>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ loginUrl?: string | undefined;
48
+ usernameSelector?: string | undefined;
49
+ passwordSelector?: string | undefined;
50
+ submitSelector?: string | undefined;
51
+ successSelector?: string | undefined;
52
+ navRoutes?: string[] | undefined;
53
+ a11yImpact?: "critical" | "minor" | "moderate" | "serious" | undefined;
54
+ seedEndpoint?: string | undefined;
55
+ }, {
56
+ loginUrl?: string | undefined;
57
+ usernameSelector?: string | undefined;
58
+ passwordSelector?: string | undefined;
59
+ submitSelector?: string | undefined;
60
+ successSelector?: string | undefined;
61
+ navRoutes?: string[] | undefined;
62
+ a11yImpact?: "critical" | "minor" | "moderate" | "serious" | undefined;
63
+ seedEndpoint?: string | undefined;
64
+ }>;
65
+ export type RecipeConfig = z.infer<typeof RecipeConfigSchema>;
66
+ //# sourceMappingURL=recipe.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipe.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/recipe.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,4CAA0C,CAAC;AACtE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAC7B;;;;OAIG;;;;;IAKH,2EAA2E;;IAE3E;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * RecipeId — the stable vocabulary of reusable test patterns.
4
+ *
5
+ * Each value corresponds to a recipe module under src/recipes/:
6
+ * auth — login / logout / protected-route flows
7
+ * a11y — accessibility checks (axe-core assertions / aria probes)
8
+ * nav — navigation, deep-linking, back/forward, 404 handling
9
+ * seed — data-seeding helpers (reset, pre-populate state via API or UI)
10
+ *
11
+ * The enum is additive — new recipes can be appended without breaking callers.
12
+ */
13
+ export const RecipeIdSchema = z.enum(['auth', 'a11y', 'nav', 'seed']);
14
+ /**
15
+ * Per-recipe configuration that callers may pass alongside a RecipeId to
16
+ * override defaults. All fields are optional — recipes work without config.
17
+ */
18
+ export const RecipeConfigSchema = z.object({
19
+ /**
20
+ * Selectors to use for form-login auth steps (recipe: auth).
21
+ * When provided, the auth recipe uses these instead of the defaults derived
22
+ * from the NQ-2 / CaseLoom proven patterns.
23
+ */
24
+ loginUrl: z.string().optional(),
25
+ usernameSelector: z.string().optional(),
26
+ passwordSelector: z.string().optional(),
27
+ submitSelector: z.string().optional(),
28
+ /** Selector for a success indicator visible after login (recipe: auth). */
29
+ successSelector: z.string().optional(),
30
+ /**
31
+ * Routes that the nav recipe should visit in addition to the root (recipe: nav).
32
+ * If omitted the recipe generates scenarios for '/', '/about', and '/404'.
33
+ */
34
+ navRoutes: z.array(z.string()).optional(),
35
+ /**
36
+ * axe-core impact level threshold — violations at or above this level are
37
+ * asserted (recipe: a11y). Default 'serious'.
38
+ */
39
+ a11yImpact: z.enum(['minor', 'moderate', 'serious', 'critical']).optional(),
40
+ /**
41
+ * API endpoint to call for seeding/resetting state (recipe: seed).
42
+ * POST with an empty body; expects 200/201/204.
43
+ */
44
+ seedEndpoint: z.string().optional(),
45
+ });
@@ -156,7 +156,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
156
156
  level: z.ZodNumber;
157
157
  label: z.ZodString;
158
158
  dimensions: z.ZodArray<z.ZodObject<{
159
- dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio"]>;
159
+ dimension: z.ZodEnum<["test-coverage-breadth", "framework-adoption", "test-id-hygiene", "ci-integration", "auth-test-coverage", "component-test-ratio", "api-test-coverage"]>;
160
160
  score: z.ZodNumber;
161
161
  weight: z.ZodNumber;
162
162
  evidence: z.ZodArray<z.ZodString, "many">;
@@ -166,7 +166,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
166
166
  guidance: z.ZodOptional<z.ZodString>;
167
167
  }, "strip", z.ZodTypeAny, {
168
168
  recommendations: string[];
169
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
169
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
170
170
  score: number;
171
171
  weight: number;
172
172
  evidence: string[];
@@ -175,7 +175,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
175
175
  guidance?: string | undefined;
176
176
  }, {
177
177
  recommendations: string[];
178
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
178
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
179
179
  score: number;
180
180
  weight: number;
181
181
  evidence: string[];
@@ -193,7 +193,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
193
193
  overallScore: number;
194
194
  dimensions: {
195
195
  recommendations: string[];
196
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
196
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
197
197
  score: number;
198
198
  weight: number;
199
199
  evidence: string[];
@@ -211,7 +211,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
211
211
  overallScore: number;
212
212
  dimensions: {
213
213
  recommendations: string[];
214
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
214
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
215
215
  score: number;
216
216
  weight: number;
217
217
  evidence: string[];
@@ -261,7 +261,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
261
261
  overallScore: number;
262
262
  dimensions: {
263
263
  recommendations: string[];
264
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
264
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
265
265
  score: number;
266
266
  weight: number;
267
267
  evidence: string[];
@@ -311,7 +311,7 @@ export declare const RepoAnalysisSchema: z.ZodObject<{
311
311
  overallScore: number;
312
312
  dimensions: {
313
313
  recommendations: string[];
314
- dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio";
314
+ dimension: "test-coverage-breadth" | "framework-adoption" | "test-id-hygiene" | "ci-integration" | "auth-test-coverage" | "component-test-ratio" | "api-test-coverage";
315
315
  score: number;
316
316
  weight: number;
317
317
  evidence: string[];