/**
 * attribution-meta-writer.ts — Zod schema for the run-scoped
 * attribution metadata artifact (ATTR-01) emitted by Phase 4 and read
 * back alongside the per-entry attribution objects.
 *
 * The schema asserts `satisfies z.ZodType<AttributionMeta>` against the
 * canonical domain type in `packages/core/src/types/attribution.ts`
 * (D0045 / W0187) — drift is a build error.
 *
 * `embeddingModel` is REQUIRED (Pitfall #6): silently downgrading to a
 * default has caused regressions in adjacent codebases — model swaps
 * MUST invalidate cached weights.
 *
 * Phase 1 lands the SHAPE only — no compute, no file I/O.
 *
 * @see docs/decisions/D0045-type-architecture-and-contract-enforcement.md
 * @see docs/design-docs/actionability-ladder/04-per-document-attribution-ensemble.md
 */
import { z } from "zod";
/**
 * Canonical schema for {@link AttributionMeta}. Persisted at
 * `runs/{runId}/attribution/_meta.json` (or whatever bulk path the
 * Phase 4 descriptor pins) and parsed on read.
 */
export const AttributionMetaSchema = z.object({
    ensembleVersion: z.string().min(1),
    embeddingModel: z.string().min(1),
    calibrationSetVersion: z.string().optional(),
    weights: z.object({
        citation: z.number(),
        canonical: z.number(),
        retrieved: z.number(),
    }),
});
