@qulib/core 0.8.2 → 0.10.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/README.md +38 -13
- package/bin/qulib.js +2 -3
- package/dist/__tests__/playwright-available.d.ts +32 -0
- package/dist/__tests__/playwright-available.d.ts.map +1 -0
- package/dist/__tests__/playwright-available.js +35 -0
- package/dist/adapters/ci-results-adapter.d.ts +67 -0
- package/dist/adapters/ci-results-adapter.d.ts.map +1 -0
- package/dist/adapters/ci-results-adapter.js +143 -0
- package/dist/adapters/cypress-e2e-adapter.d.ts.map +1 -1
- package/dist/adapters/cypress-e2e-adapter.js +25 -2
- package/dist/adapters/playwright-adapter.d.ts.map +1 -1
- package/dist/adapters/playwright-adapter.js +25 -2
- package/dist/adapters/pr-metadata-adapter.d.ts +75 -0
- package/dist/adapters/pr-metadata-adapter.d.ts.map +1 -0
- package/dist/adapters/pr-metadata-adapter.js +146 -0
- package/dist/adapters/validate-specs.d.ts +55 -0
- package/dist/adapters/validate-specs.d.ts.map +1 -0
- package/dist/adapters/validate-specs.js +67 -0
- package/dist/baseline/baseline.d.ts +54 -0
- package/dist/baseline/baseline.d.ts.map +1 -0
- package/dist/baseline/baseline.js +252 -0
- package/dist/baseline/baseline.schema.d.ts +233 -0
- package/dist/baseline/baseline.schema.d.ts.map +1 -0
- package/dist/baseline/baseline.schema.js +59 -0
- package/dist/cli/analyze-diff-run.d.ts +77 -0
- package/dist/cli/analyze-diff-run.d.ts.map +1 -0
- package/dist/cli/analyze-diff-run.js +266 -0
- package/dist/cli/baseline-run.d.ts +55 -0
- package/dist/cli/baseline-run.d.ts.map +1 -0
- package/dist/cli/baseline-run.js +259 -0
- package/dist/cli/confidence-run.d.ts +16 -0
- package/dist/cli/confidence-run.d.ts.map +1 -0
- package/dist/cli/confidence-run.js +162 -0
- package/dist/cli/index.d.ts +11 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +84 -4
- package/dist/cli/scaffold-run.d.ts +86 -0
- package/dist/cli/scaffold-run.d.ts.map +1 -0
- package/dist/cli/scaffold-run.js +232 -0
- package/dist/cli/score-automation-run.d.ts +25 -0
- package/dist/cli/score-automation-run.d.ts.map +1 -0
- package/dist/cli/score-automation-run.js +127 -0
- package/dist/examples/notquality-dogfood/fixture.d.ts +166 -0
- package/dist/examples/notquality-dogfood/fixture.d.ts.map +1 -0
- package/dist/examples/notquality-dogfood/fixture.js +174 -0
- package/dist/examples/notquality-dogfood/run.d.ts +34 -0
- package/dist/examples/notquality-dogfood/run.d.ts.map +1 -0
- package/dist/examples/notquality-dogfood/run.js +139 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/recipes/a11y.d.ts +36 -0
- package/dist/recipes/a11y.d.ts.map +1 -0
- package/dist/recipes/a11y.js +118 -0
- package/dist/recipes/auth.d.ts +38 -0
- package/dist/recipes/auth.d.ts.map +1 -0
- package/dist/recipes/auth.js +156 -0
- package/dist/recipes/index.d.ts +26 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +41 -0
- package/dist/recipes/nav.d.ts +34 -0
- package/dist/recipes/nav.d.ts.map +1 -0
- package/dist/recipes/nav.js +128 -0
- package/dist/recipes/seed.d.ts +34 -0
- package/dist/recipes/seed.d.ts.map +1 -0
- package/dist/recipes/seed.js +87 -0
- package/dist/reporters/heatmap.d.ts +55 -0
- package/dist/reporters/heatmap.d.ts.map +1 -0
- package/dist/reporters/heatmap.js +146 -0
- package/dist/reporters/markdown-reporter.d.ts.map +1 -1
- package/dist/reporters/markdown-reporter.js +4 -1
- package/dist/scaffold-tests.d.ts +21 -0
- package/dist/scaffold-tests.d.ts.map +1 -1
- package/dist/scaffold-tests.js +12 -2
- package/dist/schemas/confidence.schema.d.ts +526 -0
- package/dist/schemas/confidence.schema.d.ts.map +1 -0
- package/dist/schemas/confidence.schema.js +161 -0
- package/dist/schemas/config.schema.d.ts.map +1 -1
- package/dist/schemas/config.schema.js +6 -1
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/recipe.schema.d.ts +66 -0
- package/dist/schemas/recipe.schema.d.ts.map +1 -0
- package/dist/schemas/recipe.schema.js +45 -0
- package/dist/schemas/views.schema.d.ts +234 -0
- package/dist/schemas/views.schema.d.ts.map +1 -0
- package/dist/schemas/views.schema.js +82 -0
- package/dist/tools/scoring/confidence-from-qulib.d.ts +34 -0
- package/dist/tools/scoring/confidence-from-qulib.d.ts.map +1 -0
- package/dist/tools/scoring/confidence-from-qulib.js +206 -0
- package/dist/tools/scoring/confidence-views.d.ts +40 -0
- package/dist/tools/scoring/confidence-views.d.ts.map +1 -0
- package/dist/tools/scoring/confidence-views.js +163 -0
- package/dist/tools/scoring/confidence.d.ts +32 -0
- package/dist/tools/scoring/confidence.d.ts.map +1 -0
- package/dist/tools/scoring/confidence.js +180 -0
- package/dist/tools/scoring/levels.d.ts +15 -0
- package/dist/tools/scoring/levels.d.ts.map +1 -0
- package/dist/tools/scoring/levels.js +21 -0
- package/package.json +18 -8
|
@@ -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
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,mBAAmB,GAAG,KAAK,GAAG,eAAe,CAAC;AAEvG,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAehC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -46,7 +46,12 @@ export const HarnessConfigSchema = z.object({
|
|
|
46
46
|
readOnlyMode: z.boolean(),
|
|
47
47
|
requireHumanReview: z.boolean(),
|
|
48
48
|
failOnConsoleError: z.boolean(),
|
|
49
|
-
explorer: z
|
|
49
|
+
explorer: z
|
|
50
|
+
.enum(['playwright', 'cypress'])
|
|
51
|
+
.default('playwright')
|
|
52
|
+
.describe("Browser explorer to use. 'playwright' is the production explorer. " +
|
|
53
|
+
"'cypress' is reserved for future Cypress-driven exploration and is not yet implemented — " +
|
|
54
|
+
'it will throw at runtime. Always use playwright in production.'),
|
|
50
55
|
defaultAdapter: z.enum(['playwright', 'cypress-e2e', 'cypress-component', 'api', 'accessibility']).default('playwright'),
|
|
51
56
|
adapters: z.array(z.enum(['playwright', 'cypress-e2e', 'cypress-component', 'api', 'accessibility'])).default(['playwright']),
|
|
52
57
|
llmProvider: z.enum(['anthropic']).optional(),
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -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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B,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,KAA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itySchema, 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';
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 5-View schemas for the qulib Confidence Layer (P3).
|
|
3
|
+
*
|
|
4
|
+
* View 1 — Release Confidence: ReleaseConfidenceSchema (defined in confidence.schema.ts).
|
|
5
|
+
* View 2 — Delivery Traffic: time series of confidence summaries.
|
|
6
|
+
* View 3 — Inbox: human-judgment items derived from blocking / unknown signals.
|
|
7
|
+
* View 4 — Replay: provenance chain explaining how a verdict formed.
|
|
8
|
+
* View 5 — Audit Trail: append-only tamper-evident ledger.
|
|
9
|
+
*
|
|
10
|
+
* P3: ships schemas + pure projection functions (buildReplay, deriveInbox, toAuditEntry,
|
|
11
|
+
* diffConfidence). Persistence sinks (file/db) and accumulation are deferred to P4.
|
|
12
|
+
*
|
|
13
|
+
* All records carry tenantId (CLAUDE.md rule 17 — multi-tenant from day one).
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
export declare const DeliveryTrafficPointSchema: z.ZodObject<{
|
|
17
|
+
subjectRef: z.ZodString;
|
|
18
|
+
tenantId: z.ZodDefault<z.ZodString>;
|
|
19
|
+
computedAt: z.ZodString;
|
|
20
|
+
confidenceScore: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
verdict: z.ZodEnum<["ship", "caution", "hold", "block"]>;
|
|
22
|
+
/** Change in confidenceScore vs the previous point (null when no prior exists). */
|
|
23
|
+
deltaFromPrev: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
computedAt: string;
|
|
26
|
+
tenantId: string;
|
|
27
|
+
confidenceScore: number | null;
|
|
28
|
+
verdict: "ship" | "caution" | "hold" | "block";
|
|
29
|
+
subjectRef: string;
|
|
30
|
+
deltaFromPrev: number | null;
|
|
31
|
+
}, {
|
|
32
|
+
computedAt: string;
|
|
33
|
+
confidenceScore: number | null;
|
|
34
|
+
verdict: "ship" | "caution" | "hold" | "block";
|
|
35
|
+
subjectRef: string;
|
|
36
|
+
deltaFromPrev: number | null;
|
|
37
|
+
tenantId?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export type DeliveryTrafficPoint = z.infer<typeof DeliveryTrafficPointSchema>;
|
|
40
|
+
export declare const InboxItemKindSchema: z.ZodEnum<["blocker", "unknown-signal", "approval-needed"]>;
|
|
41
|
+
export type InboxItemKind = z.infer<typeof InboxItemKindSchema>;
|
|
42
|
+
export declare const InboxItemSchema: z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
subjectRef: z.ZodString;
|
|
45
|
+
tenantId: z.ZodDefault<z.ZodString>;
|
|
46
|
+
kind: z.ZodEnum<["blocker", "unknown-signal", "approval-needed"]>;
|
|
47
|
+
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"]>;
|
|
48
|
+
summary: z.ZodString;
|
|
49
|
+
raisedAt: z.ZodString;
|
|
50
|
+
resolvedAt: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
id: string;
|
|
53
|
+
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";
|
|
54
|
+
summary: string;
|
|
55
|
+
kind: "blocker" | "unknown-signal" | "approval-needed";
|
|
56
|
+
tenantId: string;
|
|
57
|
+
subjectRef: string;
|
|
58
|
+
raisedAt: string;
|
|
59
|
+
resolvedAt?: string | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
id: string;
|
|
62
|
+
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";
|
|
63
|
+
summary: string;
|
|
64
|
+
kind: "blocker" | "unknown-signal" | "approval-needed";
|
|
65
|
+
subjectRef: string;
|
|
66
|
+
raisedAt: string;
|
|
67
|
+
tenantId?: string | undefined;
|
|
68
|
+
resolvedAt?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export type InboxItem = z.infer<typeof InboxItemSchema>;
|
|
71
|
+
export declare const ReplayStepSchema: z.ZodObject<{
|
|
72
|
+
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"]>;
|
|
73
|
+
tool: z.ZodString;
|
|
74
|
+
inputRef: z.ZodOptional<z.ZodString>;
|
|
75
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
76
|
+
weight: z.ZodNumber;
|
|
77
|
+
effectiveWeight: z.ZodNumber;
|
|
78
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
inputTokens: z.ZodNumber;
|
|
81
|
+
outputTokens: z.ZodNumber;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
inputTokens: number;
|
|
84
|
+
outputTokens: number;
|
|
85
|
+
}, {
|
|
86
|
+
inputTokens: number;
|
|
87
|
+
outputTokens: number;
|
|
88
|
+
}>>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
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";
|
|
91
|
+
score: number | null;
|
|
92
|
+
weight: number;
|
|
93
|
+
tool: string;
|
|
94
|
+
effectiveWeight: number;
|
|
95
|
+
durationMs?: number | undefined;
|
|
96
|
+
inputRef?: string | undefined;
|
|
97
|
+
cost?: {
|
|
98
|
+
inputTokens: number;
|
|
99
|
+
outputTokens: number;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
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";
|
|
103
|
+
score: number | null;
|
|
104
|
+
weight: number;
|
|
105
|
+
tool: string;
|
|
106
|
+
effectiveWeight: number;
|
|
107
|
+
durationMs?: number | undefined;
|
|
108
|
+
inputRef?: string | undefined;
|
|
109
|
+
cost?: {
|
|
110
|
+
inputTokens: number;
|
|
111
|
+
outputTokens: number;
|
|
112
|
+
} | undefined;
|
|
113
|
+
}>;
|
|
114
|
+
export type ReplayStep = z.infer<typeof ReplayStepSchema>;
|
|
115
|
+
export declare const ReplayTraceSchema: z.ZodObject<{
|
|
116
|
+
subjectRef: z.ZodString;
|
|
117
|
+
computedAt: z.ZodString;
|
|
118
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
119
|
+
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"]>;
|
|
120
|
+
tool: z.ZodString;
|
|
121
|
+
inputRef: z.ZodOptional<z.ZodString>;
|
|
122
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
123
|
+
weight: z.ZodNumber;
|
|
124
|
+
effectiveWeight: z.ZodNumber;
|
|
125
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
cost: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
inputTokens: z.ZodNumber;
|
|
128
|
+
outputTokens: z.ZodNumber;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
inputTokens: number;
|
|
131
|
+
outputTokens: number;
|
|
132
|
+
}, {
|
|
133
|
+
inputTokens: number;
|
|
134
|
+
outputTokens: number;
|
|
135
|
+
}>>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
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";
|
|
138
|
+
score: number | null;
|
|
139
|
+
weight: number;
|
|
140
|
+
tool: string;
|
|
141
|
+
effectiveWeight: number;
|
|
142
|
+
durationMs?: number | undefined;
|
|
143
|
+
inputRef?: string | undefined;
|
|
144
|
+
cost?: {
|
|
145
|
+
inputTokens: number;
|
|
146
|
+
outputTokens: number;
|
|
147
|
+
} | undefined;
|
|
148
|
+
}, {
|
|
149
|
+
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";
|
|
150
|
+
score: number | null;
|
|
151
|
+
weight: number;
|
|
152
|
+
tool: string;
|
|
153
|
+
effectiveWeight: number;
|
|
154
|
+
durationMs?: number | undefined;
|
|
155
|
+
inputRef?: string | undefined;
|
|
156
|
+
cost?: {
|
|
157
|
+
inputTokens: number;
|
|
158
|
+
outputTokens: number;
|
|
159
|
+
} | undefined;
|
|
160
|
+
}>, "many">;
|
|
161
|
+
formula: z.ZodString;
|
|
162
|
+
finalVerdict: z.ZodEnum<["ship", "caution", "hold", "block"]>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
steps: {
|
|
165
|
+
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";
|
|
166
|
+
score: number | null;
|
|
167
|
+
weight: number;
|
|
168
|
+
tool: string;
|
|
169
|
+
effectiveWeight: number;
|
|
170
|
+
durationMs?: number | undefined;
|
|
171
|
+
inputRef?: string | undefined;
|
|
172
|
+
cost?: {
|
|
173
|
+
inputTokens: number;
|
|
174
|
+
outputTokens: number;
|
|
175
|
+
} | undefined;
|
|
176
|
+
}[];
|
|
177
|
+
computedAt: string;
|
|
178
|
+
subjectRef: string;
|
|
179
|
+
formula: string;
|
|
180
|
+
finalVerdict: "ship" | "caution" | "hold" | "block";
|
|
181
|
+
}, {
|
|
182
|
+
steps: {
|
|
183
|
+
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";
|
|
184
|
+
score: number | null;
|
|
185
|
+
weight: number;
|
|
186
|
+
tool: string;
|
|
187
|
+
effectiveWeight: number;
|
|
188
|
+
durationMs?: number | undefined;
|
|
189
|
+
inputRef?: string | undefined;
|
|
190
|
+
cost?: {
|
|
191
|
+
inputTokens: number;
|
|
192
|
+
outputTokens: number;
|
|
193
|
+
} | undefined;
|
|
194
|
+
}[];
|
|
195
|
+
computedAt: string;
|
|
196
|
+
subjectRef: string;
|
|
197
|
+
formula: string;
|
|
198
|
+
finalVerdict: "ship" | "caution" | "hold" | "block";
|
|
199
|
+
}>;
|
|
200
|
+
export type ReplayTrace = z.infer<typeof ReplayTraceSchema>;
|
|
201
|
+
export declare const AuditEntrySchema: z.ZodObject<{
|
|
202
|
+
tenantId: z.ZodDefault<z.ZodString>;
|
|
203
|
+
subjectRef: z.ZodString;
|
|
204
|
+
computedAt: z.ZodString;
|
|
205
|
+
confidenceScore: z.ZodNullable<z.ZodNumber>;
|
|
206
|
+
verdict: z.ZodEnum<["ship", "caution", "hold", "block"]>;
|
|
207
|
+
evidenceSourceCount: z.ZodNumber;
|
|
208
|
+
blockers: z.ZodArray<z.ZodString, "many">;
|
|
209
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
210
|
+
/** SHA-256 hex digest over the canonical record — tamper-evident. */
|
|
211
|
+
recordHash: z.ZodString;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
computedAt: string;
|
|
214
|
+
tenantId: string;
|
|
215
|
+
schemaVersion: 1;
|
|
216
|
+
confidenceScore: number | null;
|
|
217
|
+
verdict: "ship" | "caution" | "hold" | "block";
|
|
218
|
+
blockers: string[];
|
|
219
|
+
subjectRef: string;
|
|
220
|
+
evidenceSourceCount: number;
|
|
221
|
+
recordHash: string;
|
|
222
|
+
}, {
|
|
223
|
+
computedAt: string;
|
|
224
|
+
schemaVersion: 1;
|
|
225
|
+
confidenceScore: number | null;
|
|
226
|
+
verdict: "ship" | "caution" | "hold" | "block";
|
|
227
|
+
blockers: string[];
|
|
228
|
+
subjectRef: string;
|
|
229
|
+
evidenceSourceCount: number;
|
|
230
|
+
recordHash: string;
|
|
231
|
+
tenantId?: string | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
export type AuditEntry = z.infer<typeof AuditEntrySchema>;
|
|
234
|
+
//# sourceMappingURL=views.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/views.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B;;;;;;IAMrC,mFAAmF;;;;;;;;;;;;;;;;EAEnF,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E,eAAO,MAAM,mBAAmB,6DAA2D,CAAC;AAC5F,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAMxD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D,eAAO,MAAM,gBAAgB;;;;;;;;;IAS3B,qEAAqE;;;;;;;;;;;;;;;;;;;;;;EAErE,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 5-View schemas for the qulib Confidence Layer (P3).
|
|
3
|
+
*
|
|
4
|
+
* View 1 — Release Confidence: ReleaseConfidenceSchema (defined in confidence.schema.ts).
|
|
5
|
+
* View 2 — Delivery Traffic: time series of confidence summaries.
|
|
6
|
+
* View 3 — Inbox: human-judgment items derived from blocking / unknown signals.
|
|
7
|
+
* View 4 — Replay: provenance chain explaining how a verdict formed.
|
|
8
|
+
* View 5 — Audit Trail: append-only tamper-evident ledger.
|
|
9
|
+
*
|
|
10
|
+
* P3: ships schemas + pure projection functions (buildReplay, deriveInbox, toAuditEntry,
|
|
11
|
+
* diffConfidence). Persistence sinks (file/db) and accumulation are deferred to P4.
|
|
12
|
+
*
|
|
13
|
+
* All records carry tenantId (CLAUDE.md rule 17 — multi-tenant from day one).
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import { EvidenceSourceKindSchema, ConfidenceVerdictSchema } from './confidence.schema.js';
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// View 2 — Delivery Traffic
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
export const DeliveryTrafficPointSchema = z.object({
|
|
21
|
+
subjectRef: z.string(),
|
|
22
|
+
tenantId: z.string().default('default'),
|
|
23
|
+
computedAt: z.string().datetime(),
|
|
24
|
+
confidenceScore: z.number().min(0).max(100).nullable(),
|
|
25
|
+
verdict: ConfidenceVerdictSchema,
|
|
26
|
+
/** Change in confidenceScore vs the previous point (null when no prior exists). */
|
|
27
|
+
deltaFromPrev: z.number().nullable(),
|
|
28
|
+
});
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// View 3 — Inbox
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
export const InboxItemKindSchema = z.enum(['blocker', 'unknown-signal', 'approval-needed']);
|
|
33
|
+
export const InboxItemSchema = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
subjectRef: z.string(),
|
|
36
|
+
tenantId: z.string().default('default'),
|
|
37
|
+
kind: InboxItemKindSchema,
|
|
38
|
+
source: EvidenceSourceKindSchema,
|
|
39
|
+
summary: z.string(),
|
|
40
|
+
raisedAt: z.string().datetime(),
|
|
41
|
+
resolvedAt: z.string().datetime().optional(),
|
|
42
|
+
});
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// View 4 — Replay
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
export const ReplayStepSchema = z.object({
|
|
47
|
+
source: EvidenceSourceKindSchema,
|
|
48
|
+
tool: z.string(),
|
|
49
|
+
inputRef: z.string().optional(),
|
|
50
|
+
score: z.number().min(0).max(100).nullable(),
|
|
51
|
+
weight: z.number(),
|
|
52
|
+
effectiveWeight: z.number(),
|
|
53
|
+
durationMs: z.number().optional(),
|
|
54
|
+
cost: z
|
|
55
|
+
.object({
|
|
56
|
+
inputTokens: z.number(),
|
|
57
|
+
outputTokens: z.number(),
|
|
58
|
+
})
|
|
59
|
+
.optional(),
|
|
60
|
+
});
|
|
61
|
+
export const ReplayTraceSchema = z.object({
|
|
62
|
+
subjectRef: z.string(),
|
|
63
|
+
computedAt: z.string().datetime(),
|
|
64
|
+
steps: z.array(ReplayStepSchema),
|
|
65
|
+
formula: z.string(),
|
|
66
|
+
finalVerdict: ConfidenceVerdictSchema,
|
|
67
|
+
});
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// View 5 — Audit Trail
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
export const AuditEntrySchema = z.object({
|
|
72
|
+
tenantId: z.string().default('default'),
|
|
73
|
+
subjectRef: z.string(),
|
|
74
|
+
computedAt: z.string().datetime(),
|
|
75
|
+
confidenceScore: z.number().min(0).max(100).nullable(),
|
|
76
|
+
verdict: ConfidenceVerdictSchema,
|
|
77
|
+
evidenceSourceCount: z.number().int().min(0),
|
|
78
|
+
blockers: z.array(z.string()),
|
|
79
|
+
schemaVersion: z.literal(1),
|
|
80
|
+
/** SHA-256 hex digest over the canonical record — tamper-evident. */
|
|
81
|
+
recordHash: z.string(),
|
|
82
|
+
});
|