{"version":3,"sources":["../../src/contracts/artifact.ts","../../src/contracts/aggregate-commit.ts","../../src/contracts/context.ts","../../src/contracts/continuity.ts","../../src/contracts/declarative-document-import.ts","../../src/contracts/trend.ts","../../src/contracts/workflow-runtime.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n  ContractIdentifierSchema,\n  EntityRefSchema,\n  IsoDateTimeSchema,\n  JsonValueSchema,\n  Sha256Schema,\n} from './common';\n\nexport const StorageLocatorSchema = z\n  .object({\n    provider: ContractIdentifierSchema,\n    bucket: ContractIdentifierSchema.optional(),\n    key: ContractIdentifierSchema,\n    region: ContractIdentifierSchema.optional(),\n    url: z.string().url().optional(),\n    expiresAt: IsoDateTimeSchema.optional(),\n  })\n  .strict();\n\nexport const ArtifactAccessSchema = z\n  .object({\n    tenantId: ContractIdentifierSchema.optional(),\n    teamId: ContractIdentifierSchema.optional(),\n    ownerRef: EntityRefSchema.optional(),\n    visibility: z.enum(['private', 'team', 'tenant', 'public']),\n  })\n  .strict();\n\nexport const ArtifactManifestSchema = z\n  .object({\n    contract: z.literal('ArtifactManifest'),\n    artifactId: ContractIdentifierSchema,\n    kind: ContractIdentifierSchema,\n    mimeType: z.string().trim().min(1),\n    byteSize: z.number().int().nonnegative().optional(),\n    sha256: Sha256Schema,\n    storage: StorageLocatorSchema,\n    sourceRef: EntityRefSchema.optional(),\n    runRef: EntityRefSchema,\n    outputRef: EntityRefSchema,\n    producer: z\n      .object({\n        service: ContractIdentifierSchema,\n        version: ContractIdentifierSchema,\n        capabilityRef: EntityRefSchema.optional(),\n      })\n      .strict(),\n    access: ArtifactAccessSchema,\n    metadata: z.record(z.string(), JsonValueSchema).default({}),\n    createdAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const OutputRecordSchema = z\n  .object({\n    contract: z.literal('OutputRecord'),\n    outputId: ContractIdentifierSchema,\n    runRef: EntityRefSchema,\n    outputPort: ContractIdentifierSchema,\n    value: JsonValueSchema.optional(),\n    artifactRefs: z.array(EntityRefSchema).default([]),\n    schemaRef: ContractIdentifierSchema.optional(),\n    createdAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport type StorageLocator = z.infer<typeof StorageLocatorSchema>;\nexport type ArtifactAccess = z.infer<typeof ArtifactAccessSchema>;\nexport type ArtifactManifest = z.infer<typeof ArtifactManifestSchema>;\nexport type OutputRecord = z.infer<typeof OutputRecordSchema>;\n","import { z } from 'zod';\nimport { JsonObjectSchema } from './common';\n\nconst AggregateIdentifierSchema = z.string().trim().min(1).max(128);\nconst AggregateRequestIdentifierSchema = z.string().trim().min(1).max(256);\nconst AggregateMutationsLimit = 500;\n\nexport const AggregateAssetSchema = z\n  .object({\n    id: AggregateIdentifierSchema,\n    name: z.string().trim().min(1).max(500),\n    asset_type: AggregateIdentifierSchema,\n    primary_content: JsonObjectSchema,\n    status: z.string().trim().min(1).max(64).optional(),\n    creator_user_id: AggregateIdentifierSchema.optional(),\n    properties: JsonObjectSchema.optional(),\n    files: z.array(JsonObjectSchema).max(100).optional(),\n    media: z.string().max(4096).optional(),\n    thumbnail: z.string().max(4096).optional(),\n    media_ref: JsonObjectSchema.optional(),\n    keywords: z.string().max(2000).optional(),\n    extra: JsonObjectSchema.optional(),\n    sort: z.number().int().nonnegative().optional(),\n  })\n  .strict();\n\nexport const AggregateAssetUpsertSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    asset: AggregateAssetSchema,\n    tag_ids: z.array(AggregateIdentifierSchema).max(200).optional(),\n  })\n  .strict();\n\nexport const AggregateAssetDeleteSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    asset_id: AggregateIdentifierSchema,\n  })\n  .strict();\n\nexport const AggregateFeatureValueWriteSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    asset_id: AggregateIdentifierSchema,\n    column_id: AggregateIdentifierSchema,\n    value_text: z.string().max(1_000_000).nullable(),\n  })\n  .strict();\n\nexport const AggregateFeatureRelationTargetSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    asset_id: AggregateIdentifierSchema,\n  })\n  .strict();\n\nexport const AggregateFeatureRelationReplaceSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    asset_id: AggregateIdentifierSchema,\n    column_id: AggregateIdentifierSchema,\n    targets: z.array(AggregateFeatureRelationTargetSchema).max(AggregateMutationsLimit),\n  })\n  .strict();\n\nexport const AggregateAssetRelationObjectSchema = z\n  .object({\n    object_kind: z.string().trim().min(1).max(64),\n    object_id: z.string().trim().min(1).max(256),\n    properties: JsonObjectSchema.optional(),\n  })\n  .strict();\n\nexport const AggregateAssetRelationReplaceSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    asset_id: AggregateIdentifierSchema,\n    relation_kind: z.string().trim().min(1).max(64),\n    objects: z.array(AggregateAssetRelationObjectSchema).max(AggregateMutationsLimit),\n  })\n  .strict();\n\nexport const AggregateContainerMembershipWriteSchema = z\n  .object({\n    ontology_id: AggregateIdentifierSchema,\n    container_view_id: AggregateIdentifierSchema,\n    asset_id: AggregateIdentifierSchema,\n    present: z.boolean(),\n  })\n  .strict();\n\nexport const AggregateCommitRequestSchema = z\n  .object({\n    contract: z.literal('AggregateCommitRequest'),\n    aggregate_id: AggregateIdentifierSchema,\n    request_id: AggregateRequestIdentifierSchema,\n    idempotency_key: AggregateIdentifierSchema,\n    expected_head_commit_id: AggregateIdentifierSchema.optional(),\n    message: z.string().trim().max(500).optional(),\n    assets: z.array(AggregateAssetUpsertSchema).max(AggregateMutationsLimit).optional(),\n    asset_deletes: z.array(AggregateAssetDeleteSchema).max(AggregateMutationsLimit).optional(),\n    feature_values: z.array(AggregateFeatureValueWriteSchema).max(AggregateMutationsLimit).optional(),\n    feature_relations: z.array(AggregateFeatureRelationReplaceSchema).max(AggregateMutationsLimit).optional(),\n    asset_relations: z.array(AggregateAssetRelationReplaceSchema).max(AggregateMutationsLimit).optional(),\n    container_memberships: z.array(AggregateContainerMembershipWriteSchema).max(AggregateMutationsLimit).optional(),\n  })\n  .strict()\n  .superRefine((request, context) => {\n    const mutationCount =\n      (request.assets?.length ?? 0) +\n      (request.asset_deletes?.length ?? 0) +\n      (request.feature_values?.length ?? 0) +\n      (request.feature_relations?.length ?? 0) +\n      (request.asset_relations?.length ?? 0) +\n      (request.container_memberships?.length ?? 0);\n    if (mutationCount === 0) {\n      context.addIssue({ code: 'custom', message: 'at least one aggregate mutation is required' });\n    }\n  });\n\nexport type AggregateAsset = z.infer<typeof AggregateAssetSchema>;\nexport type AggregateAssetUpsert = z.infer<typeof AggregateAssetUpsertSchema>;\nexport type AggregateAssetDelete = z.infer<typeof AggregateAssetDeleteSchema>;\nexport type AggregateFeatureValueWrite = z.infer<typeof AggregateFeatureValueWriteSchema>;\nexport type AggregateFeatureRelationTarget = z.infer<typeof AggregateFeatureRelationTargetSchema>;\nexport type AggregateFeatureRelationReplace = z.infer<typeof AggregateFeatureRelationReplaceSchema>;\nexport type AggregateAssetRelationObject = z.infer<typeof AggregateAssetRelationObjectSchema>;\nexport type AggregateAssetRelationReplace = z.infer<typeof AggregateAssetRelationReplaceSchema>;\nexport type AggregateContainerMembershipWrite = z.infer<typeof AggregateContainerMembershipWriteSchema>;\nexport type AggregateCommitRequest = z.infer<typeof AggregateCommitRequestSchema>;\n","import { z } from 'zod';\nimport {\n  ContractIdentifierSchema,\n  EntityRefSchema,\n  IsoDateTimeSchema,\n  JsonValueSchema,\n} from './common';\n\nexport const ActorRefSchema = z\n  .object({\n    kind: z.enum(['human', 'agent', 'service', 'tenant', 'public']),\n    id: ContractIdentifierSchema.optional(),\n    userId: ContractIdentifierSchema.optional(),\n    agentId: ContractIdentifierSchema.optional(),\n    serviceId: ContractIdentifierSchema.optional(),\n  })\n  .strict();\n\nexport const AuthorityScopeSchema = z\n  .object({\n    resource: ContractIdentifierSchema,\n    actions: z.array(ContractIdentifierSchema).min(1),\n    constraints: z.record(z.string(), JsonValueSchema).optional(),\n  })\n  .strict();\n\nexport const RequestScopeSchema = z\n  .object({\n    contract: z.literal('RequestScope'),\n    requestId: ContractIdentifierSchema,\n    traceId: ContractIdentifierSchema.optional(),\n    appId: ContractIdentifierSchema,\n    tenantId: ContractIdentifierSchema.optional(),\n    teamId: ContractIdentifierSchema.optional(),\n    actor: ActorRefSchema,\n    session: z\n      .object({\n        authType: ContractIdentifierSchema,\n        authenticated: z.boolean(),\n        membershipVerified: z.boolean(),\n      })\n      .strict(),\n    permissionCodes: z.array(ContractIdentifierSchema).default([]),\n    authority: z.array(AuthorityScopeSchema).default([]),\n    issuedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const ExecutionLinkSchema = z\n  .object({\n    contract: z.literal('ExecutionLink'),\n    requestId: ContractIdentifierSchema,\n    traceId: ContractIdentifierSchema.optional(),\n    correlationId: ContractIdentifierSchema.optional(),\n    causationId: ContractIdentifierSchema.optional(),\n    workflowRef: EntityRefSchema.optional(),\n    runRef: EntityRefSchema,\n    taskRef: EntityRefSchema.optional(),\n    parentRunRef: EntityRefSchema.optional(),\n  })\n  .strict();\n\nexport const CompletionHeaderSchema = z\n  .object({\n    contract: z.literal('CompletionHeader'),\n    eventId: ContractIdentifierSchema,\n    runtimeEventId: ContractIdentifierSchema,\n    idempotencyKey: ContractIdentifierSchema,\n    sequence: z.number().int().nonnegative(),\n    execution: ExecutionLinkSchema,\n    producer: z\n      .object({\n        service: ContractIdentifierSchema,\n        runtime: ContractIdentifierSchema,\n        version: ContractIdentifierSchema,\n      })\n      .strict(),\n    status: z.enum(['SUCCEEDED', 'FAILED', 'CANCELLED', 'TIMED_OUT']),\n    occurredAt: IsoDateTimeSchema,\n    payloadSchemaRef: ContractIdentifierSchema.optional(),\n  })\n  .strict();\n\nexport const CompletionEventSchema = z\n  .object({\n    header: CompletionHeaderSchema,\n    payload: JsonValueSchema.optional(),\n  })\n  .strict();\n\nexport const AgentRuntimeEventSchema = z\n  .object({\n    contract: z.literal('AgentRuntimeEvent'),\n    runtimeEventId: ContractIdentifierSchema,\n    streamId: ContractIdentifierSchema,\n    sequence: z.number().int().nonnegative(),\n    requestId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    threadId: ContractIdentifierSchema.optional(),\n    eventType: z.enum(['messages:append', 'messages:update', 'thread:update', 'tool-call:upsert', 'session:event']),\n    payload: JsonValueSchema,\n    occurredAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport type ActorRef = z.infer<typeof ActorRefSchema>;\nexport type AuthorityScope = z.infer<typeof AuthorityScopeSchema>;\nexport type RequestScope = z.infer<typeof RequestScopeSchema>;\nexport type ExecutionLink = z.infer<typeof ExecutionLinkSchema>;\nexport type CompletionHeader = z.infer<typeof CompletionHeaderSchema>;\nexport type CompletionEvent = z.infer<typeof CompletionEventSchema>;\nexport type AgentRuntimeEvent = z.infer<typeof AgentRuntimeEventSchema>;\n","import { z } from 'zod';\nimport {\n  ContractIdentifierSchema,\n  ContractVersionSchema,\n  EntityRefSchema,\n  IsoDateTimeSchema,\n  JsonObjectSchema,\n} from './common';\n\nexport const DataContinuityEnvelopeSchema = z\n  .object({\n    contract: z.literal('DataContinuityEnvelope'),\n    tenantId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    sourceRef: EntityRefSchema.optional(),\n    bodyRef: EntityRefSchema.optional(),\n    runRef: EntityRefSchema.optional(),\n    outputRef: EntityRefSchema.optional(),\n    artifactRef: EntityRefSchema.optional(),\n    requestId: ContractIdentifierSchema,\n    actorRef: EntityRefSchema,\n    schemaVersion: ContractVersionSchema,\n  })\n  .strict()\n  .refine(\n    value => Boolean(value.sourceRef || value.bodyRef || value.runRef || value.outputRef || value.artifactRef),\n    'At least one continuity ref is required.',\n  );\n\nexport const BodyRelationRecordSchema = z\n  .object({\n    contract: z.literal('BodyRelationRecord'),\n    relationId: ContractIdentifierSchema,\n    relationKind: ContractIdentifierSchema,\n    subjectRef: EntityRefSchema,\n    objectRef: EntityRefSchema,\n    ownerRepo: ContractIdentifierSchema,\n    authorityScope: z.enum(['tenant', 'team', 'global']),\n    properties: JsonObjectSchema.default({}),\n    createdAt: IsoDateTimeSchema,\n    updatedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const ApplicationRunSchema = z\n  .object({\n    contract: z.literal('ApplicationRun'),\n    runId: ContractIdentifierSchema,\n    definitionRef: EntityRefSchema,\n    runtimeLedgerRef: EntityRefSchema.optional(),\n    requestId: ContractIdentifierSchema,\n    actorRef: EntityRefSchema,\n    status: z.enum(['PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLED', 'EXPIRED']),\n    inputRefs: z.array(EntityRefSchema).default([]),\n    outputRefs: z.array(EntityRefSchema).default([]),\n    startedAt: IsoDateTimeSchema.optional(),\n    completedAt: IsoDateTimeSchema.optional(),\n    expiresAt: IsoDateTimeSchema.optional(),\n    metadata: JsonObjectSchema.default({}),\n  })\n  .strict()\n  .superRefine((run, context) => {\n    if (run.definitionRef.kind !== 'workflow-definition') {\n      context.addIssue({\n        code: 'custom',\n        path: ['definitionRef', 'kind'],\n        message: 'definitionRef must reference a workflow-definition.',\n      });\n    }\n    if (run.runtimeLedgerRef && run.runtimeLedgerRef.kind !== 'workflow-run') {\n      context.addIssue({\n        code: 'custom',\n        path: ['runtimeLedgerRef', 'kind'],\n        message: 'runtimeLedgerRef must reference a workflow-run.',\n      });\n    }\n    if ((run.status === 'RUNNING' || run.status === 'COMPLETED' || run.status === 'CANCELLED') && !run.runtimeLedgerRef) {\n      context.addIssue({\n        code: 'custom',\n        path: ['runtimeLedgerRef'],\n        message: `${run.status} ApplicationRun requires runtimeLedgerRef.`,\n      });\n    }\n    if (run.status === 'RUNNING' && !run.startedAt) {\n      context.addIssue({\n        code: 'custom',\n        path: ['startedAt'],\n        message: 'RUNNING ApplicationRun requires startedAt.',\n      });\n    }\n    if (['COMPLETED', 'FAILED', 'CANCELLED', 'EXPIRED'].includes(run.status) && !run.completedAt) {\n      context.addIssue({\n        code: 'custom',\n        path: ['completedAt'],\n        message: `Terminal ApplicationRun status ${run.status} requires completedAt.`,\n      });\n    }\n  });\n\nexport const ExpiringAccessGrantSchema = z\n  .object({\n    contract: z.literal('ExpiringAccessGrant'),\n    grantId: ContractIdentifierSchema,\n    subjectRef: EntityRefSchema,\n    resourceRef: EntityRefSchema,\n    permissions: z.array(ContractIdentifierSchema).min(1),\n    issuedAt: IsoDateTimeSchema,\n    expiresAt: IsoDateTimeSchema,\n    revokedAt: IsoDateTimeSchema.optional(),\n  })\n  .strict()\n  .refine(value => Date.parse(value.expiresAt) > Date.parse(value.issuedAt), 'expiresAt must be after issuedAt');\n\nexport type DataContinuityEnvelope = z.infer<typeof DataContinuityEnvelopeSchema>;\nexport type BodyRelationRecord = z.infer<typeof BodyRelationRecordSchema>;\nexport type ApplicationRun = z.infer<typeof ApplicationRunSchema>;\nexport type ExpiringAccessGrant = z.infer<typeof ExpiringAccessGrantSchema>;\n","import { z } from \"zod\";\nimport { ContractIdentifierSchema, Sha256Schema } from \"./common\";\nimport { DeclarativeDiagnosticSchema } from \"./declarative-diagnostic\";\nimport {\n  NavigationSchema,\n  PageSchema,\n  ProductSurfaceSchema,\n  RevisionRefSchema,\n  TenantScopeSchema,\n} from \"./declarative-control\";\n\nconst sameScope = (\n  left: z.infer<typeof TenantScopeSchema>,\n  right: z.infer<typeof TenantScopeSchema>,\n): boolean =>\n  ([\"tenantRef\", \"dataSpaceRef\", \"teamRef\"] as const).every(\n    (key) =>\n      left[key]?.kind === right[key]?.kind &&\n      left[key]?.id === right[key]?.id &&\n      left[key]?.ownerRepo === right[key]?.ownerRepo,\n  );\n\nexport const DeclarativeImportDocumentSchema = z.union([\n  PageSchema,\n  NavigationSchema,\n]);\n\nconst requestShape = {\n  document: DeclarativeImportDocumentSchema,\n  surface: ProductSurfaceSchema,\n  environmentId: ContractIdentifierSchema.optional(),\n};\n\nfunction supportsSurface(value: {\n  document: z.infer<typeof DeclarativeImportDocumentSchema>;\n  surface: \"kernel\" | \"studio\";\n}): boolean {\n  return value.document.contract === \"Page\"\n    ? value.document.surface === value.surface\n    : value.document.supportedSurfaces.includes(value.surface);\n}\n\nexport const DeclarativeDocumentImportRequestSchema = z\n  .object(requestShape)\n  .strict()\n  .refine(supportsSurface, {\n    path: [\"surface\"],\n    message: \"The document does not support the selected surface.\",\n  });\n\nexport const DeclarativeDocumentImportIntentSchema = z\n  .object({\n    ...requestShape,\n    expectedVersion: z.number().int().nonnegative(),\n    expectedPlanHash: Sha256Schema,\n    idempotencyKey: z.string().trim().min(1).max(256),\n  })\n  .strict()\n  .refine(supportsSurface, {\n    path: [\"surface\"],\n    message: \"The document does not support the selected surface.\",\n  });\n\nexport const DeclarativeDocumentImportPlanSchema = z\n  .object({\n    contract: z.literal(\"DeclarativeDocumentImportPlan\"),\n    schemaVersion: z.literal(1),\n    resourceKind: z.enum([\"page\", \"navigation\"]),\n    resourceId: ContractIdentifierSchema,\n    surface: ProductSurfaceSchema,\n    sourceContentHash: Sha256Schema,\n    environmentRevisionRef: RevisionRefSchema,\n    document: DeclarativeImportDocumentSchema,\n    tenantScope: TenantScopeSchema.nullable(),\n    requiresInitialization: z.boolean(),\n    expectedVersion: z.number().int().nonnegative(),\n    currentContentHash: Sha256Schema.nullable(),\n    changed: z.boolean(),\n    diagnostics: z.array(DeclarativeDiagnosticSchema),\n    dependencyContentHash: Sha256Schema,\n    planHash: Sha256Schema,\n  })\n  .strict()\n  .superRefine((value, context) => {\n    const kind = value.document.contract === \"Page\" ? \"page\" : \"navigation\";\n    const id =\n      value.document.contract === \"Page\"\n        ? value.document.pageId\n        : value.document.navigationId;\n    if (\n      kind !== value.resourceKind ||\n      id !== value.resourceId ||\n      !supportsSurface(value)\n    )\n      context.addIssue({\n        code: \"custom\",\n        path: [\"document\"],\n        message: \"The plan must identify its document and supported surface.\",\n      });\n    if (value.requiresInitialization !== (value.tenantScope === null))\n      context.addIssue({\n        code: \"custom\",\n        path: [\"requiresInitialization\"],\n        message: \"Only an uninitialized target may omit tenantScope.\",\n      });\n    if (value.environmentRevisionRef.kind !== \"environment\")\n      context.addIssue({\n        code: \"custom\",\n        path: [\"environmentRevisionRef\"],\n        message: \"The import plan must pin an environment revision.\",\n      });\n    if (\n      value.tenantScope &&\n      !sameScope(value.tenantScope, value.document.tenantScope)\n    )\n      context.addIssue({\n        code: \"custom\",\n        path: [\"tenantScope\"],\n        message: \"The plan and bound document must belong to the same scope.\",\n      });\n  });\n\nexport const DeclarativeDocumentImportResultSchema = z\n  .object({\n    action: z.literal(\"import\"),\n    changed: z.boolean(),\n    plan: DeclarativeDocumentImportPlanSchema,\n    revisionRef: RevisionRefSchema,\n  })\n  .strict()\n  .superRefine((value, context) => {\n    if (\n      value.changed !== value.plan.changed ||\n      value.revisionRef.kind !== value.plan.resourceKind ||\n      value.revisionRef.id !== value.plan.resourceId ||\n      value.revisionRef.revision !==\n        value.plan.expectedVersion + Number(value.changed) ||\n      !value.revisionRef.tenantScope ||\n      !sameScope(value.revisionRef.tenantScope, value.plan.document.tenantScope)\n    ) {\n      context.addIssue({\n        code: \"custom\",\n        path: [\"revisionRef\"],\n        message:\n          \"The import result must identify the exact saved or unchanged draft revision.\",\n      });\n    }\n  });\n\nexport type DeclarativeImportDocument = z.infer<\n  typeof DeclarativeImportDocumentSchema\n>;\nexport type DeclarativeDocumentImportRequest = z.infer<\n  typeof DeclarativeDocumentImportRequestSchema\n>;\nexport type DeclarativeDocumentImportIntent = z.infer<\n  typeof DeclarativeDocumentImportIntentSchema\n>;\nexport type DeclarativeDocumentImportPlan = z.infer<\n  typeof DeclarativeDocumentImportPlanSchema\n>;\nexport type DeclarativeDocumentImportResult = z.infer<\n  typeof DeclarativeDocumentImportResultSchema\n>;\n","import { z } from 'zod';\nimport {\n  ContractIdentifierSchema,\n  EntityRefSchema,\n  IsoDateTimeSchema,\n  JsonObjectSchema,\n  JsonValueSchema,\n  Sha256Schema,\n} from './common';\nimport { LineageRecordSchema } from './data';\nimport { OutputRecordSchema } from './artifact';\n\nexport const RadarDecisionMetricsSchema = z\n  .object({\n    currentSales: z.number().finite(),\n    forecastSales: z.number().finite(),\n    searchHeat: z.number().finite(),\n    socialHeat: z.number().finite(),\n    confidence: z.number().min(0).max(1),\n  })\n  .strict();\n\nexport const TrendSourceSchema = z\n  .object({\n    sourceId: ContractIdentifierSchema,\n    provider: ContractIdentifierSchema,\n    channel: z.enum(['trend', 'ecommerce', 'social', 'search', 'internal']),\n    collectedAt: IsoDateTimeSchema,\n    sourceUrl: z.string().url().optional(),\n    evidenceRefs: z.array(EntityRefSchema).default([]),\n  })\n  .strict();\n\nexport const TrendIngestRunSchema = z\n  .object({\n    contract: z.literal('TrendIngestRun'),\n    ingestRunId: ContractIdentifierSchema,\n    sourceId: ContractIdentifierSchema,\n    requestId: ContractIdentifierSchema,\n    idempotencyKey: ContractIdentifierSchema,\n    status: z.enum(['RUNNING', 'SUCCEEDED', 'FAILED', 'PARTIAL']),\n    recordCount: z.number().int().nonnegative(),\n    errorCount: z.number().int().nonnegative(),\n    startedAt: IsoDateTimeSchema,\n    completedAt: IsoDateTimeSchema.optional(),\n  })\n  .strict();\n\nexport const TrendSourceRecordSchema = z\n  .object({\n    contract: z.literal('TrendSourceRecord'),\n    sourceRecordId: ContractIdentifierSchema,\n    source: TrendSourceSchema,\n    ingestRunRef: EntityRefSchema,\n    recordVersion: z.number().int().positive(),\n    contentHash: Sha256Schema,\n    payload: JsonValueSchema,\n    idempotencyKey: ContractIdentifierSchema,\n    collectedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const HotwordBodySchema = z\n  .object({\n    contract: z.literal('HotwordBody'),\n    hotwordId: ContractIdentifierSchema,\n    label: z.string().trim().min(1),\n    normalizedLabel: z.string().trim().min(1),\n    categories: z.array(ContractIdentifierSchema).default([]),\n    sourceRefs: z.array(TrendSourceSchema).min(1),\n    relationRefs: z.array(EntityRefSchema).default([]),\n    createdAt: IsoDateTimeSchema,\n    updatedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nconst CommerceBodyFieldsSchema = {\n  displayName: z.string().trim().min(1),\n  normalizedName: z.string().trim().min(1),\n  categories: z.array(ContractIdentifierSchema).default([]),\n  sourceRefs: z.array(EntityRefSchema).min(1),\n  relationRefs: z.array(EntityRefSchema).default([]),\n  createdAt: IsoDateTimeSchema,\n  updatedAt: IsoDateTimeSchema,\n};\n\nexport const BrandBodySchema = z\n  .object({\n    contract: z.literal('BrandBody'),\n    brandId: ContractIdentifierSchema,\n    ...CommerceBodyFieldsSchema,\n  })\n  .strict();\n\nexport const ProductBodySchema = z\n  .object({\n    contract: z.literal('ProductBody'),\n    productId: ContractIdentifierSchema,\n    brandRef: EntityRefSchema.optional(),\n    ...CommerceBodyFieldsSchema,\n  })\n  .strict();\n\nexport const TrendMetricSnapshotSchema = z\n  .object({\n    contract: z.literal('TrendMetricSnapshot'),\n    snapshotId: ContractIdentifierSchema,\n    subjectRef: EntityRefSchema,\n    observedAt: IsoDateTimeSchema,\n    metrics: z.record(z.string(), z.number().finite()),\n    confidence: z.number().min(0).max(1),\n    evidenceRefs: z.array(EntityRefSchema).min(1),\n  })\n  .strict();\n\nexport const RadarScoreModelBodySchema = z\n  .object({\n    contract: z.literal('RadarScoreModelBody'),\n    modelId: ContractIdentifierSchema,\n    version: z.number().int().positive(),\n    weights: RadarDecisionMetricsSchema,\n    thresholds: z.record(z.string(), z.number().finite()).default({}),\n    explanationRules: z.record(z.string(), z.string().trim().min(1)).default({}),\n    createdAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarScoreProjectionSchema = z\n  .object({\n    contract: z.literal('RadarScoreProjection'),\n    projectionId: ContractIdentifierSchema,\n    subjectRef: EntityRefSchema,\n    modelRef: EntityRefSchema,\n    totalScore: z.number().finite(),\n    dimensions: RadarDecisionMetricsSchema,\n    evidenceRefs: z.array(EntityRefSchema).min(1),\n    freshnessAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarPanoramaNodeSchema = z\n  .object({\n    ref: EntityRefSchema,\n    label: z.string().trim().min(1),\n    categories: z.array(ContractIdentifierSchema).default([]),\n    score: z.number().finite().optional(),\n    freshnessAt: IsoDateTimeSchema.optional(),\n  })\n  .strict();\n\nexport const RadarPanoramaEdgeSchema = z\n  .object({\n    sourceRef: EntityRefSchema,\n    targetRef: EntityRefSchema,\n    relation: ContractIdentifierSchema,\n    evidenceRefs: z.array(EntityRefSchema).default([]),\n  })\n  .strict();\n\nexport const RadarPanoramaSchema = z\n  .object({\n    contract: z.literal('RadarPanorama'),\n    nodes: z.array(RadarPanoramaNodeSchema),\n    edges: z.array(RadarPanoramaEdgeSchema),\n    generatedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const BrandGeneticsProfileSchema = z\n  .object({\n    contract: z.literal('BrandGeneticsProfile'),\n    brandRef: EntityRefSchema,\n    categories: z.array(ContractIdentifierSchema).default([]),\n    signature: z.record(ContractIdentifierSchema, z.number().finite()),\n    relatedRefs: z.array(EntityRefSchema).default([]),\n    evidenceRefs: z.array(EntityRefSchema).default([]),\n    computedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarOpportunityMatrixPointSchema = z\n  .object({\n    subjectRef: EntityRefSchema,\n    label: z.string().trim().min(1),\n    x: z.number().finite(),\n    y: z.number().finite(),\n    score: z.number().finite(),\n    evidenceRefs: z.array(EntityRefSchema).default([]),\n  })\n  .strict();\n\nexport const RadarOpportunityMatrixSchema = z\n  .object({\n    contract: z.literal('RadarOpportunityMatrix'),\n    xMetric: z.enum(['currentSales', 'forecastSales', 'searchHeat', 'socialHeat', 'confidence']),\n    yMetric: z.enum(['currentSales', 'forecastSales', 'searchHeat', 'socialHeat', 'confidence']),\n    points: z.array(RadarOpportunityMatrixPointSchema),\n    computedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarQueryBodySchema = z\n  .object({\n    contract: z.literal('RadarQueryBody'),\n    queryId: ContractIdentifierSchema,\n    filters: z.record(z.string(), JsonValueSchema).default({}),\n    sort: z\n      .object({\n        field: ContractIdentifierSchema,\n        direction: z.enum(['asc', 'desc']),\n      })\n      .strict(),\n    pageSize: z.number().int().min(1).max(200),\n    updatedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const SavedRadarQuerySchema = z\n  .object({\n    contract: z.literal('SavedRadarQuery'),\n    savedQueryId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    ownerRef: EntityRefSchema,\n    name: z.string().trim().min(1),\n    queryRef: EntityRefSchema,\n    expectedVersion: z.number().int().nonnegative(),\n    updatedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarSelectionSchema = z\n  .object({\n    contract: z.literal('RadarSelection'),\n    selectionId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    ownerRef: EntityRefSchema,\n    subjectRefs: z.array(EntityRefSchema),\n    status: z.enum(['stashed', 'selected', 'rejected', 'archived']),\n    note: z.string().optional(),\n    expectedVersion: z.number().int().nonnegative(),\n    updatedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nconst versionedRefFields = {\n  id: ContractIdentifierSchema,\n  version: z.union([z.number().int().positive(), z.string().trim().min(1)]).optional(),\n  ownerRepo: ContractIdentifierSchema.optional(),\n};\n\nexport const TrendRadarCollectionAssetRefSchema = z\n  .object({\n    kind: z.literal('asset'),\n    ...versionedRefFields,\n  })\n  .strict();\n\nexport const TrendRadarCollectionSelectionRefSchema = z\n  .object({\n    kind: z.literal('radar-selection'),\n    ...versionedRefFields,\n  })\n  .strict();\n\nexport const TrendRadarCollectionRunRefSchema = z\n  .object({\n    kind: z.literal('radar-analysis-run'),\n    ...versionedRefFields,\n  })\n  .strict();\n\nexport const TrendRadarCollectionSubjectRefSchema = z\n  .object({\n    kind: z.literal('hotword'),\n    ...versionedRefFields,\n  })\n  .strict();\n\nexport const TrendRadarCollectionArtifactRefSchema = z\n  .object({\n    kind: z.literal('artifact'),\n    ...versionedRefFields,\n  })\n  .strict();\n\nexport const TrendRadarCollectionRecipeEntrySchema = z\n  .object({\n    subjectRef: TrendRadarCollectionSubjectRefSchema,\n    label: z.string().trim().min(1).max(200),\n  })\n  .strict();\n\nexport const TrendRadarCollectionRecipeSchema = z\n  .object({\n    category: z.array(TrendRadarCollectionRecipeEntrySchema),\n    design: z.array(TrendRadarCollectionRecipeEntrySchema),\n    audience: z.array(TrendRadarCollectionRecipeEntrySchema),\n  })\n  .strict()\n  .refine(\n    recipe => recipe.category.length + recipe.design.length + recipe.audience.length > 0,\n    'A Trend Radar collection recipe must contain at least one subject.',\n  );\n\nexport const TrendRadarCollectionDecisionAxisSchema = z\n  .object({\n    key: ContractIdentifierSchema,\n    label: z.string().trim().min(1).max(200).optional(),\n    value: z.number().finite(),\n  })\n  .strict();\n\nexport const TrendRadarCollectionDecisionProjectionSchema = z\n  .object({\n    axes: z.array(TrendRadarCollectionDecisionAxisSchema).max(32).optional(),\n    overallScore: z.number().finite().optional(),\n    itemRank: z.number().finite().optional(),\n    sourceRefs: z.array(EntityRefSchema).optional(),\n    outputRefs: z.array(EntityRefSchema).optional(),\n  })\n  .strict()\n  .superRefine((projection, context) => {\n    const hasProjection = Boolean(\n      projection.axes?.length\n      || projection.overallScore !== undefined\n      || projection.itemRank !== undefined\n      || projection.sourceRefs?.length\n      || projection.outputRefs?.length,\n    );\n    if (!hasProjection) {\n      context.addIssue({\n        code: 'custom',\n        message: 'A decision projection must contain canonical decision data or references.',\n      });\n    }\n\n    const seenAxisKeys = new Set<string>();\n    projection.axes?.forEach((axis, index) => {\n      if (seenAxisKeys.has(axis.key)) {\n        context.addIssue({\n          code: 'custom',\n          path: ['axes', index, 'key'],\n          message: `Duplicate decision axis key: ${axis.key}`,\n        });\n      }\n      seenAxisKeys.add(axis.key);\n    });\n  });\n\nexport const TrendRadarCollectionArtifactProjectionSchema = z\n  .object({\n    artifactRef: TrendRadarCollectionArtifactRefSchema,\n    url: z.string().url().optional(),\n    thumbnailUrl: z.string().url().optional(),\n    mimeType: z.string().trim().min(1).optional(),\n    metadata: JsonObjectSchema.optional(),\n  })\n  .strict();\n\nexport const TrendRadarCollectionProjectionWritebackSchema = z\n  .object({\n    status: z.enum(['PENDING', 'APPLIED', 'FAILED']),\n    updatedAt: IsoDateTimeSchema,\n    error: z\n      .object({\n        code: ContractIdentifierSchema,\n        message: z.string().trim().min(1),\n        retryable: z.boolean(),\n      })\n      .strict()\n      .optional(),\n  })\n  .strict()\n  .superRefine((writeback, context) => {\n    if (writeback.status === 'FAILED' && !writeback.error) {\n      context.addIssue({\n        code: 'custom',\n        path: ['error'],\n        message: 'A failed collection projection writeback must include an error.',\n      });\n    }\n    if (writeback.status !== 'FAILED' && writeback.error) {\n      context.addIssue({\n        code: 'custom',\n        path: ['error'],\n        message: 'Only a failed collection projection writeback may include an error.',\n      });\n    }\n  });\n\nexport const TrendRadarCollectionItemSchema = z\n  .object({\n    contract: z.literal('TrendRadarCollectionItem'),\n    schemaVersion: z.literal(1),\n    selectionRef: TrendRadarCollectionSelectionRefSchema,\n    recipe: TrendRadarCollectionRecipeSchema,\n    status: z.enum(['SAVED', 'QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', 'PARTIAL']),\n    latestRunRef: TrendRadarCollectionRunRefSchema.optional(),\n    decisionProjection: TrendRadarCollectionDecisionProjectionSchema.optional(),\n    artifactProjection: TrendRadarCollectionArtifactProjectionSchema.optional(),\n    createdAt: IsoDateTimeSchema,\n    updatedAt: IsoDateTimeSchema,\n    generatedAt: IsoDateTimeSchema.optional(),\n  })\n  .strict();\n\nexport const RadarAnalysisRunSchema = z\n  .object({\n    contract: z.literal('RadarAnalysisRun'),\n    runId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    selectionRef: EntityRefSchema,\n    workflowRef: EntityRefSchema,\n    executionRef: EntityRefSchema.optional(),\n    designProjectRef: EntityRefSchema.optional(),\n    replayedFromRef: EntityRefSchema.optional(),\n    collectionAssetRef: TrendRadarCollectionAssetRefSchema.optional(),\n    collectionProjectionWriteback: TrendRadarCollectionProjectionWritebackSchema.optional(),\n    workflowDefinitionTeamId: ContractIdentifierSchema.optional(),\n    workflowInput: z.record(z.string(), JsonValueSchema).default({}),\n    createDesignProject: z.boolean().default(true),\n    designProjectName: z.string().trim().min(1).max(200).optional(),\n    modelRef: EntityRefSchema,\n    requestId: ContractIdentifierSchema,\n    idempotencyKey: ContractIdentifierSchema,\n    status: z.enum(['QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED', 'PARTIAL']),\n    outputRefs: z.array(EntityRefSchema).default([]),\n    error: z\n      .object({\n        code: ContractIdentifierSchema,\n        message: z.string().trim().min(1),\n        retryable: z.boolean(),\n      })\n      .strict()\n      .optional(),\n    startedAt: IsoDateTimeSchema.optional(),\n    completedAt: IsoDateTimeSchema.optional(),\n    createdAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarAnalysisAssetSchema = z\n  .object({\n    artifactRef: EntityRefSchema,\n    kind: ContractIdentifierSchema,\n    mimeType: z.string().trim().min(1).optional(),\n    url: z.string().url(),\n    metadata: z.record(z.string(), JsonValueSchema).default({}),\n    createdAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarAnalysisDetailSchema = z\n  .object({\n    contract: z.literal('RadarAnalysisDetail'),\n    run: RadarAnalysisRunSchema,\n    runVersion: z.number().int().positive(),\n    selection: RadarSelectionSchema,\n    outputs: z.array(OutputRecordSchema),\n    assets: z.array(RadarAnalysisAssetSchema),\n    lineage: z.array(LineageRecordSchema),\n  })\n  .strict();\n\nexport const RadarActionRecordSchema = z\n  .object({\n    contract: z.literal('RadarActionRecord'),\n    actionId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    actorRef: EntityRefSchema,\n    action: z.enum(['stash', 'select', 'reject', 'archive', 'launch', 'retry', 'replay', 'rollback']),\n    targetRef: EntityRefSchema,\n    requestId: ContractIdentifierSchema,\n    idempotencyKey: ContractIdentifierSchema,\n    expectedVersion: z.number().int().nonnegative(),\n    occurredAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport const RadarWritebackRecordSchema = z\n  .object({\n    contract: z.literal('RadarWritebackRecord'),\n    writebackId: ContractIdentifierSchema,\n    actionRef: EntityRefSchema,\n    targetRef: EntityRefSchema,\n    status: z.enum(['PENDING', 'APPLIED', 'FAILED']),\n    resultingVersion: z.number().int().nonnegative().optional(),\n    error: z.string().trim().min(1).optional(),\n    recordedAt: IsoDateTimeSchema,\n  })\n  .strict();\n\nexport type TrendSource = z.infer<typeof TrendSourceSchema>;\nexport type TrendIngestRun = z.infer<typeof TrendIngestRunSchema>;\nexport type TrendSourceRecord = z.infer<typeof TrendSourceRecordSchema>;\nexport type HotwordBody = z.infer<typeof HotwordBodySchema>;\nexport type BrandBody = z.infer<typeof BrandBodySchema>;\nexport type ProductBody = z.infer<typeof ProductBodySchema>;\nexport type TrendMetricSnapshot = z.infer<typeof TrendMetricSnapshotSchema>;\nexport type RadarDecisionMetrics = z.infer<typeof RadarDecisionMetricsSchema>;\nexport type RadarScoreModelBody = z.infer<typeof RadarScoreModelBodySchema>;\nexport type RadarScoreProjection = z.infer<typeof RadarScoreProjectionSchema>;\nexport type RadarPanorama = z.infer<typeof RadarPanoramaSchema>;\nexport type BrandGeneticsProfile = z.infer<typeof BrandGeneticsProfileSchema>;\nexport type RadarOpportunityMatrix = z.infer<typeof RadarOpportunityMatrixSchema>;\nexport type RadarQueryBody = z.infer<typeof RadarQueryBodySchema>;\nexport type SavedRadarQuery = z.infer<typeof SavedRadarQuerySchema>;\nexport type RadarSelection = z.infer<typeof RadarSelectionSchema>;\nexport type TrendRadarCollectionAssetRef = z.infer<typeof TrendRadarCollectionAssetRefSchema>;\nexport type TrendRadarCollectionSelectionRef = z.infer<typeof TrendRadarCollectionSelectionRefSchema>;\nexport type TrendRadarCollectionRunRef = z.infer<typeof TrendRadarCollectionRunRefSchema>;\nexport type TrendRadarCollectionSubjectRef = z.infer<typeof TrendRadarCollectionSubjectRefSchema>;\nexport type TrendRadarCollectionArtifactRef = z.infer<typeof TrendRadarCollectionArtifactRefSchema>;\nexport type TrendRadarCollectionRecipeEntry = z.infer<typeof TrendRadarCollectionRecipeEntrySchema>;\nexport type TrendRadarCollectionRecipe = z.infer<typeof TrendRadarCollectionRecipeSchema>;\nexport type TrendRadarCollectionDecisionAxis = z.infer<typeof TrendRadarCollectionDecisionAxisSchema>;\nexport type TrendRadarCollectionDecisionProjection = z.infer<typeof TrendRadarCollectionDecisionProjectionSchema>;\nexport type TrendRadarCollectionArtifactProjection = z.infer<typeof TrendRadarCollectionArtifactProjectionSchema>;\nexport type TrendRadarCollectionProjectionWriteback = z.infer<typeof TrendRadarCollectionProjectionWritebackSchema>;\nexport type TrendRadarCollectionItem = z.infer<typeof TrendRadarCollectionItemSchema>;\nexport type RadarAnalysisRun = z.infer<typeof RadarAnalysisRunSchema>;\nexport type RadarAnalysisAsset = z.infer<typeof RadarAnalysisAssetSchema>;\nexport type RadarAnalysisDetail = z.infer<typeof RadarAnalysisDetailSchema>;\nexport type RadarActionRecord = z.infer<typeof RadarActionRecordSchema>;\nexport type RadarWritebackRecord = z.infer<typeof RadarWritebackRecordSchema>;\n","import { z } from 'zod';\nimport { ArtifactManifestSchema, OutputRecordSchema } from './artifact';\nimport {\n  ContractIdentifierSchema,\n  EntityRefSchema,\n  IsoDateTimeSchema,\n  JsonObjectSchema,\n  Sha256Schema,\n} from './common';\nimport { ApplicationRunSchema } from './continuity';\nimport { LineageRecordSchema } from './data';\n\nexport const WorkflowCatalogEntrySchema = z\n  .object({\n    contract: z.literal('WorkflowCatalogEntry'),\n    workflowId: ContractIdentifierSchema,\n    teamId: ContractIdentifierSchema,\n    creatorRef: EntityRefSchema,\n    currentDefinitionRef: EntityRefSchema,\n    lifecycle: z.enum(['ACTIVE', 'DELETED']),\n    asset: z\n      .object({\n        preset: z.boolean(),\n        marketplacePublished: z.boolean(),\n        publishConfig: JsonObjectSchema.optional(),\n        sort: z.number().int(),\n        forkFromRef: EntityRefSchema.optional(),\n        notAuthorized: z.boolean(),\n      })\n      .strict(),\n    createdAt: IsoDateTimeSchema,\n    updatedAt: IsoDateTimeSchema,\n    deletedAt: IsoDateTimeSchema.optional(),\n  })\n  .strict()\n  .superRefine((entry, context) => {\n    if (\n      entry.creatorRef.kind !== 'user' &&\n      entry.creatorRef.kind !== 'service'\n    ) {\n      context.addIssue({\n        code: 'custom',\n        path: ['creatorRef', 'kind'],\n        message: 'creatorRef must reference a user or service.',\n      });\n    }\n    if (entry.currentDefinitionRef.kind !== 'workflow-definition') {\n      context.addIssue({\n        code: 'custom',\n        path: ['currentDefinitionRef', 'kind'],\n        message: 'currentDefinitionRef must reference a workflow-definition.',\n      });\n    }\n    if (entry.lifecycle === 'DELETED' && !entry.deletedAt) {\n      context.addIssue({\n        code: 'custom',\n        path: ['deletedAt'],\n        message: 'Deleted workflow catalog entries require deletedAt.',\n      });\n    }\n    if (entry.lifecycle === 'ACTIVE' && entry.deletedAt) {\n      context.addIssue({\n        code: 'custom',\n        path: ['deletedAt'],\n        message: 'Active workflow catalog entries cannot declare deletedAt.',\n      });\n    }\n  });\n\nexport const WorkflowPublicationSchema = z\n  .object({\n    contract: z.literal('WorkflowPublication'),\n    publicationId: ContractIdentifierSchema,\n    definitionRef: EntityRefSchema,\n    runtimeDefinitionRef: EntityRefSchema,\n    sourceHash: Sha256Schema,\n    compiledHash: Sha256Schema,\n    status: z.enum(['PENDING', 'PUBLISHED', 'FAILED', 'RETIRED']),\n    publisherRef: EntityRefSchema,\n    publishedAt: IsoDateTimeSchema.optional(),\n    failureReason: z.string().trim().min(1).optional(),\n  })\n  .strict()\n  .superRefine((publication, context) => {\n    if (publication.definitionRef.kind !== 'workflow-definition') {\n      context.addIssue({\n        code: 'custom',\n        path: ['definitionRef', 'kind'],\n        message: 'definitionRef must reference a workflow-definition.',\n      });\n    }\n    if (publication.runtimeDefinitionRef.kind !== 'conductor-workflow-definition') {\n      context.addIssue({\n        code: 'custom',\n        path: ['runtimeDefinitionRef', 'kind'],\n        message: 'runtimeDefinitionRef must reference a conductor-workflow-definition.',\n      });\n    }\n    if (publication.status === 'PUBLISHED' && !publication.publishedAt) {\n      context.addIssue({\n        code: 'custom',\n        path: ['publishedAt'],\n        message: 'Published workflow publications require publishedAt.',\n      });\n    }\n    if (publication.status === 'FAILED' && !publication.failureReason) {\n      context.addIssue({\n        code: 'custom',\n        path: ['failureReason'],\n        message: 'Failed workflow publications require failureReason.',\n      });\n    }\n  });\n\nexport const WorkflowCompletionCommitSchema = z\n  .object({\n    contract: z.literal('WorkflowCompletionCommit'),\n    commitId: ContractIdentifierSchema,\n    run: ApplicationRunSchema,\n    outputs: z.array(OutputRecordSchema),\n    artifacts: z.array(ArtifactManifestSchema),\n    lineage: LineageRecordSchema,\n    completedAt: IsoDateTimeSchema,\n  })\n  .strict()\n  .superRefine((commit, context) => {\n    const expectedRunId = commit.run.runId;\n    const referencesRun = (value: { runRef: { kind: string; id: string } }) =>\n      value.runRef.kind === 'application-run' && value.runRef.id === expectedRunId;\n\n    commit.outputs.forEach((output, index) => {\n      if (!referencesRun(output)) {\n        context.addIssue({\n          code: 'custom',\n          path: ['outputs', index, 'runRef'],\n          message: 'Every output must reference the committed ApplicationRun.',\n        });\n      }\n    });\n    commit.artifacts.forEach((artifact, index) => {\n      if (!referencesRun(artifact)) {\n        context.addIssue({\n          code: 'custom',\n          path: ['artifacts', index, 'runRef'],\n          message: 'Every artifact must reference the committed ApplicationRun.',\n        });\n      }\n    });\n    if (\n      commit.lineage.subjectRef.kind !== 'application-run' ||\n      commit.lineage.subjectRef.id !== expectedRunId\n    ) {\n      context.addIssue({\n        code: 'custom',\n        path: ['lineage', 'subjectRef'],\n        message: 'Completion lineage must use the committed ApplicationRun as its subject.',\n      });\n    }\n    const outputIds = new Set(commit.outputs.map(output => output.outputId));\n    commit.artifacts.forEach((artifact, index) => {\n      if (\n        artifact.outputRef.kind !== 'workflow-output' ||\n        !outputIds.has(artifact.outputRef.id)\n      ) {\n        context.addIssue({\n          code: 'custom',\n          path: ['artifacts', index, 'outputRef'],\n          message: 'Artifact outputRef must reference an output in the same commit.',\n        });\n      }\n    });\n  });\n\nexport const WorkflowCompletionReceiptSchema = z\n  .object({\n    contract: z.literal('WorkflowCompletionReceipt'),\n    commitId: ContractIdentifierSchema,\n    runRef: EntityRefSchema,\n    outputRefs: z.array(EntityRefSchema),\n    artifactRefs: z.array(EntityRefSchema),\n    contentHash: Sha256Schema,\n    committedAt: IsoDateTimeSchema,\n    idempotentReplay: z.boolean(),\n  })\n  .strict()\n  .superRefine((receipt, context) => {\n    if (receipt.runRef.kind !== 'application-run') {\n      context.addIssue({\n        code: 'custom',\n        path: ['runRef', 'kind'],\n        message: 'runRef must reference an application-run.',\n      });\n    }\n    receipt.outputRefs.forEach((ref, index) => {\n      if (ref.kind !== 'workflow-output') {\n        context.addIssue({\n          code: 'custom',\n          path: ['outputRefs', index, 'kind'],\n          message: 'outputRefs must reference workflow-output records.',\n        });\n      }\n    });\n    receipt.artifactRefs.forEach((ref, index) => {\n      if (ref.kind !== 'artifact') {\n        context.addIssue({\n          code: 'custom',\n          path: ['artifactRefs', index, 'kind'],\n          message: 'artifactRefs must reference artifacts.',\n        });\n      }\n    });\n  });\n\nexport type WorkflowPublication = z.infer<typeof WorkflowPublicationSchema>;\nexport type WorkflowCatalogEntry = z.infer<typeof WorkflowCatalogEntrySchema>;\nexport type WorkflowCompletionCommit = z.infer<typeof WorkflowCompletionCommitSchema>;\nexport type WorkflowCompletionReceipt = z.infer<typeof WorkflowCompletionReceiptSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AASX,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,yBAAyB,SAAS;AAAA,EAC1C,KAAK;AAAA,EACL,QAAQ,yBAAyB,SAAS;AAAA,EAC1C,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC/B,WAAW,kBAAkB,SAAS;AACxC,CAAC,EACA,OAAO;AAEH,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,U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