fix: bound conversational nested JSON arrays

This commit is contained in:
Jesse_Chen
2026-07-20 23:58:12 +08:00
parent ae41023b96
commit 439338ae8a
3 changed files with 71 additions and 4 deletions
@@ -66,8 +66,8 @@ const candidateSchema = boundedJson(z.object({
const technicalReceiptSchema = boundedJson(z.object({
calculationVersion: boundedNonblankText(80),
stableLayers: z.array(boundedNonblankText(80)).max(20),
sensitiveLayers: z.array(boundedNonblankText(80)).max(20),
stableLayers: boundedJson(z.array(boundedNonblankText(80)).max(20), 4_096),
sensitiveLayers: boundedJson(z.array(boundedNonblankText(80)).max(20), 4_096),
candidateDifferenceRefs: z.array(boundedNonblankText(120)).max(40),
}).strict(), 8_192);
@@ -152,10 +152,10 @@ export const privateCandidateSchema = boundedJson(z.object({
rangeEnd: timeSchema.nullable().optional(),
calculationVersion: boundedText(80),
candidateWeights: z.array(z.number().finite().min(0).max(1)).max(1_440).optional(),
candidateModelRefs: z.array(boundedText(120)).max(80).optional(),
candidateModelRefs: boundedJson(z.array(boundedText(120)).max(80), 16_384).optional(),
d1Stability: z.enum(["stable", "sensitive", "unavailable"]).optional(),
boundaryDistanceMinutes: z.number().int().min(0).max(1_440).nullable().optional(),
supportedSensitiveLayers: z.array(boundedText(80)).max(40).optional(),
supportedSensitiveLayers: boundedJson(z.array(boundedText(80)).max(40), 8_192).optional(),
scoredHistoricalEvidence: z.array(scoredEvidenceSchema).max(100).optional(),
suggestedDomains: z.array(evidenceDomainSchema).max(6).optional(),
futureWindows: z.array(futureWindowSchema).max(20).optional(),