caelum0x 695a365ae4 feat: PaperTrail — enterprise evidence-verification platform
Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a
deterministic verification core: clinical-trial claims checked against
ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI
recomputed in code, oracle-tested), code-enforced exact-span grounding, and
multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing
at scale (unpdf + Docling), agentic workflows, Claude Science connector,
compliance/audit, billing, public API, and more.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 07:21:22 +03:00

37 lines
1.1 KiB
TypeScript

import { z } from "zod";
import { SIGNATURE_MEANINGS } from "@/lib/compliance/types";
// Zod schemas validating all request bodies at the Compliance API boundary.
// Never trust raw JSON — every mutation parses through one of these first.
export const createSignatureSchema = z.object({
entityType: z
.string()
.trim()
.min(1, "entityType is required.")
.max(64, "entityType is too long."),
entityId: z.string().uuid("entityId must be a valid uuid."),
meaning: z.enum(SIGNATURE_MEANINGS, {
errorMap: () => ({ message: "Invalid signature meaning." }),
}),
});
export type CreateSignatureInput = z.infer<typeof createSignatureSchema>;
export const upsertRetentionPolicySchema = z.object({
entityType: z
.string()
.trim()
.min(1, "entityType is required.")
.max(64, "entityType is too long."),
retainDays: z
.number()
.int("retainDays must be an integer.")
.min(0, "retainDays cannot be negative.")
.max(36500, "retainDays cannot exceed 100 years."),
});
export type UpsertRetentionPolicyInput = z.infer<
typeof upsertRetentionPolicySchema
>;