Skip to content

Regression in 6.19.0: per-asset-type requirements codegen as z.any() (was typed in 6.18) #1659

@bokelley

Description

@bokelley

Summary

Following the great work in #1654 (named slot unions + Format.assets typed), 6.19.0 introduces a runtime-Zod regression on the per-asset-type requirements bag. In 6.18.0 the codegen produced typed Zod schemas (ImageAssetRequirementsSchema, TextAssetRequirementsSchema, …); in 6.19.0 those Zod schemas are gone, and the requirements field inside each Individual<Type>AssetSchema is now z.optional(z.any()).

The TS types for the requirement bags are unchanged (ImageAssetRequirements, TextAssetRequirements, etc. still live in core.generated.ts and are referenced correctly by Individual<Type>Asset interfaces). The regression is only on the runtime Zod side.

Evidence

From @adcp/sdk@6.19.0/dist/lib/types/schemas.generated.d.ts:

export declare const IndividualImageAssetSchema: z.ZodIntersection<
  z.ZodObject<{ /* base slot fields */ }, z.core.$loose>,
  z.ZodObject<{
    asset_type: z.ZodLiteral<"image">;
    requirements: z.ZodOptional<z.ZodAny>;   // ← was ImageAssetRequirementsSchema in 6.18
  }, z.core.$loose>
>;

export declare const AssetRequirementsSchema: z.ZodUnion<readonly [
  z.ZodAny, z.ZodAny, z.ZodAny, z.ZodAny, z.ZodAny, z.ZodAny,
  z.ZodAny, z.ZodAny, z.ZodAny, z.ZodAny, z.ZodAny, z.ZodAny
]>;

Compare 6.18, where TextAssetRequirementsSchema (and the 11 siblings) were fully typed Zod objects with min_length, max_length, character_pattern, prohibited_terms, etc., and AssetRequirementsSchema was a proper z.ZodUnion of those 12 objects.

The per-asset-type *AssetRequirementsSchema exports are also gone from 6.19 (replaced by the Individual<Type>AssetSchema slot wrappers). Downstream consumers that previously imported them — including agentic-api in scope3data/agentic-api#2366 — fail to resolve.

Impact

Likely cause

Speculation, but the slot-level intersection pattern in #1654 may have tripped the ts-to-zod codegen on the per-type requirement objects, falling back to z.any() for the requirements field. The TS types were unaffected because they don't go through the same codegen path.

Ask

Restore typed Zod for requirements in each Individual<Type>AssetSchema (and the parallel Group<Type>AssetSchema). Either by re-exporting the per-type *AssetRequirementsSchema and referencing them inside the slot schemas, or by inlining the requirement shape directly in each slot schema's intersection.

Cross-link: AdCP protocol context adcontextprotocol/adcp#3305 (Creative Formats v2 RFC, validate_input scaffolding).

Versions

@adcp/sdk@6.19.0 exhibits the regression. @adcp/sdk@6.18.0 does not — those typed schemas existed there.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions