@growth-labs/conformance 0.3.1 → 0.5.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/CHANGELOG.md +66 -0
- package/README.md +45 -1
- package/dist/endpoint.d.ts +21 -0
- package/dist/endpoint.d.ts.map +1 -0
- package/dist/endpoint.js +225 -0
- package/dist/endpoint.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runner.js +71 -5
- package/dist/runner.js.map +1 -1
- package/dist/schema.d.ts +255 -142
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +23 -3
- package/dist/schema.js.map +1 -1
- package/fixtures/negative/required-negative-fixtures.json +49 -0
- package/package.json +5 -1
- package/src/endpoint.ts +279 -0
- package/src/index.ts +4 -0
- package/src/runner.ts +81 -5
- package/src/schema.ts +27 -3
package/src/schema.ts
CHANGED
|
@@ -33,6 +33,7 @@ export const REQUIRED_NEGATIVE_FIXTURE_CODES = {
|
|
|
33
33
|
'missing-max-image-preview-large': 'metadata.robots.missing_max_image_preview_large',
|
|
34
34
|
'crawler-public-cache-key-collision': 'cache.crawler_public_key_collision',
|
|
35
35
|
'runtime-canonical-override-not-applied': 'metadata.canonical.runtime_override_not_applied',
|
|
36
|
+
'llms-runtime-static-shadow': 'publication.surface.static_shadow',
|
|
36
37
|
} as const
|
|
37
38
|
|
|
38
39
|
export type RequiredNegativeFixtureId = keyof typeof REQUIRED_NEGATIVE_FIXTURE_CODES
|
|
@@ -62,6 +63,21 @@ export const surfaceResponseSchema = z.object({
|
|
|
62
63
|
body: z.string().optional(),
|
|
63
64
|
})
|
|
64
65
|
|
|
66
|
+
export const publicationSurfaceOwnerSchema = z.enum(['runtime', 'static', 'na'])
|
|
67
|
+
|
|
68
|
+
export const publicationSurfaceOwnerReceiptSchema = z.object({
|
|
69
|
+
collector: z.string().regex(/^[a-z0-9][a-z0-9:._-]*@[0-9]+$/i, {
|
|
70
|
+
message: 'collector must be a versioned identifier such as tool-name@1',
|
|
71
|
+
}),
|
|
72
|
+
observedAt: z
|
|
73
|
+
.string()
|
|
74
|
+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/, {
|
|
75
|
+
message: 'observedAt must be an ISO date-time with timezone, e.g. 2026-07-15T23:30:00Z',
|
|
76
|
+
})
|
|
77
|
+
.optional(),
|
|
78
|
+
signalHash: z.string().regex(/^sha256:[0-9a-f]{64}$/),
|
|
79
|
+
})
|
|
80
|
+
|
|
65
81
|
export const publicationSurfaceSchema = z.object({
|
|
66
82
|
name: z.string().min(1),
|
|
67
83
|
status: z.enum(['present', 'missing', 'na']),
|
|
@@ -71,6 +87,12 @@ export const publicationSurfaceSchema = z.object({
|
|
|
71
87
|
bodyBytes: z.number().int().nonnegative().optional(),
|
|
72
88
|
capabilityBoundary: z.string().min(1).optional(),
|
|
73
89
|
evidence: z.string().min(1).optional(),
|
|
90
|
+
intendedOwner: publicationSurfaceOwnerSchema.optional(),
|
|
91
|
+
observedOwner: publicationSurfaceOwnerSchema.optional(),
|
|
92
|
+
ownerReceipt: publicationSurfaceOwnerReceiptSchema.optional(),
|
|
93
|
+
staticEntryCount: z.number().int().nonnegative().optional(),
|
|
94
|
+
observedCount: z.number().int().nonnegative().optional(),
|
|
95
|
+
minimumCount: z.number().int().nonnegative().optional(),
|
|
74
96
|
})
|
|
75
97
|
|
|
76
98
|
export const cacheVariantSchema = z.object({
|
|
@@ -85,7 +107,7 @@ export const cacheVariantSchema = z.object({
|
|
|
85
107
|
export const securityFunctionalProbeReceiptSchema = z.object({
|
|
86
108
|
name: z.string().min(1),
|
|
87
109
|
status: checkStatusSchema,
|
|
88
|
-
checkedAt: z.string().
|
|
110
|
+
checkedAt: z.string().datetime({ offset: true }),
|
|
89
111
|
evidence: z.string().min(1).optional(),
|
|
90
112
|
capabilityBoundary: z.string().min(1).optional(),
|
|
91
113
|
})
|
|
@@ -93,7 +115,7 @@ export const securityFunctionalProbeReceiptSchema = z.object({
|
|
|
93
115
|
export const cspReportReceiptSchema = z.object({
|
|
94
116
|
name: z.string().min(1),
|
|
95
117
|
status: checkStatusSchema,
|
|
96
|
-
checkedAt: z.string().
|
|
118
|
+
checkedAt: z.string().datetime({ offset: true }),
|
|
97
119
|
evidence: z.string().min(1).optional(),
|
|
98
120
|
endpoint: z.string().min(1).optional(),
|
|
99
121
|
capabilityBoundary: z.string().min(1).optional(),
|
|
@@ -119,7 +141,7 @@ export const securityReceiptsSchema = z
|
|
|
119
141
|
export const buildEvidenceSchema = z.object({
|
|
120
142
|
commitSha: z.string().min(7).optional(),
|
|
121
143
|
artifactId: z.string().min(1).optional(),
|
|
122
|
-
generatedAt: z.string().
|
|
144
|
+
generatedAt: z.string().datetime({ offset: true }).optional(),
|
|
123
145
|
packageVersions: z.record(z.string().min(1)).default({}),
|
|
124
146
|
staticHeaderPolicy: z.boolean().default(false),
|
|
125
147
|
ssrHeaderPolicy: z.boolean().default(false),
|
|
@@ -268,6 +290,8 @@ export type Audience = z.infer<typeof audienceSchema>
|
|
|
268
290
|
export type RenderMode = z.infer<typeof renderModeSchema>
|
|
269
291
|
export type HeaderMap = z.infer<typeof headerMapSchema>
|
|
270
292
|
export type SurfaceResponse = z.infer<typeof surfaceResponseSchema>
|
|
293
|
+
export type PublicationSurfaceOwner = z.infer<typeof publicationSurfaceOwnerSchema>
|
|
294
|
+
export type PublicationSurfaceOwnerReceipt = z.infer<typeof publicationSurfaceOwnerReceiptSchema>
|
|
271
295
|
export type PublicationSurfaceEvidence = z.infer<typeof publicationSurfaceSchema>
|
|
272
296
|
export type CacheVariant = z.infer<typeof cacheVariantSchema>
|
|
273
297
|
export type SecurityFunctionalProbeReceipt = z.infer<typeof securityFunctionalProbeReceiptSchema>
|