Skip to content

Hoist remaining inline-enum duplicates (follow-up to #3144) #3166

Closed

Description

@bokelley

Context

#3144 / #3148 hoisted 4 of the most-duplicated inline string-literal unions into enums/ files (payment-terms, audio-channel-layout, media-buy-valid-action, rights-billing-period). Independent SDK-side review of #3148 spotted ~25 more inline-enum duplicates in static/schemas/source/ that follow the same byte-identical pattern across multiple parents and would benefit from the same treatment.

This is the tracker for the next tranche.

Candidates

Per the protocol-expert scan of source schemas:

  • match_type — ["broad", "exact", "phrase"] — appears in ~5 files (10 sites)
  • billing party — ["advertiser", "agent", "operator"] — ~4 files
  • kind — ["event_series", "publication", "rotation", "series"] — ~3 files
  • travel-unit — ["hr", "min"]
  • geometry — ["MultiPolygon", "Polygon"]
  • video constants: frame_rate_type, scan_type, gop_type, moov_atom_position
  • feature-status — ["failed", "passed", "unevaluated", "warning"]
  • sync-action — ["created", "deleted", "failed", "unchanged", "updated"]
  • account_scope
  • snapshot-unavailable-reason
  • verdict — ["fail", "pass"]
  • approval status — ["approved", "conditions", "denied"]
  • account-status

Several of these surface as per-parent Foo_BarValues exports in adcp-client's inline-enums.generated.ts (mirrors the concrete duplicates that motivated #3144).

Approach

Same as #3148:

  1. Verify each candidate's value sets are byte-identical across consumers (confirm with rg over static/schemas/source/).
  2. Add a new enums/<name>.json per shared set; pick names distinct from existing ones.
  3. Update each call site to \$ref the new file.
  4. minor bump, source-only (no dist/ edits per the immutability convention reaffirmed in fix(schema): correct title annotation in rate-limited error-details schema #3149 review).
  5. Follow-on: the SDK ships deprecated re-export aliases for any per-parent Values names that landed in a published release.

Out of scope for this issue

  • Subset enums (e.g., audio-asset-requirements.json ["mono","stereo"] is a constraint, not the layout type).
  • Distinct enum sets that look duplicated but aren't (e.g., insertion-order.json payment_terms is a different set than account.json).
  • \$defs hoisting for re-referenced complex object types (BriefAsset1, VASTAsset1, etc.) — see Rename SCREAMING_SNAKE schema artifacts that surface as public TypeScript types #3145 for that thread.

Refs

🤖 Filed by Claude Code

Activity

  1. added
    enhancement
    schema
    claude-triaging
    on Apr 25, 2026
  2. bokelley commented on Apr 25, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Feature request (schema hygiene)
    Bucket(s): spec / protocol
    Status: drafting-pr
    Milestone: 3.1.0

    What the experts said:

    • ad-tech-protocol-expert: Non-breaking; $ref substitution is semantically equivalent under draft-07. Three fixes applied before PR: match-type.json uses call-site order ["broad","phrase","exact"] (not alphabetical); approval-status.json renamed governance-decision.json to avoid collision with creative-approval-status.json and carries x-status: experimental; verdict.json uses ["pass","fail"] per call sites.
    • adtech-product-expert: Zero operator friction — wire format unchanged; adcp-client codegen impact (additive Foo_BarValues exports) is acceptable; SDK cleanup deferred to adcp-client#942 as proposed.
    • code-reviewer: No blockers. $comment added to sync-accounts-response.json action field explaining why the 4-value subset stays inline.

    My take: All 16 candidate enum sets verified byte-identical across call sites. 15 new enum files created, 24 schemas updated (46 replacements). Draft PR #3174 targets main, minor changeset.

    Draft PR: #3174 — feat(schema): hoist 16 duplicate inline enum sets into shared enums/ files


    Triaged by Claude Code. Session: https://claude.ai/code/session_01W7bQfLgAFaDVKEUxkf4E7R


    Generated by Claude Code

  3. added
    claude-triaged
    and removed
    claude-triaging
    on Apr 25, 2026
  4. added a commit that references this issue on Apr 25, 2026
    98c175a
  5. bokelley commented on Apr 25, 2026

    @bokelley
    ContributorAuthor

    Triage

    Outcome: Execute PR — Non-breaking schema refactor with clear precedent (#3148). Expert panel converged.

    Analysis

    Verified all 13 candidate enum sets are byte-identical across their call sites. All pass the hoisting bar: same values, same order, same wire semantics in every consumer. Created 13 new $id-bearing enum files in static/schemas/source/enums/ and updated 21 consumer schemas to $ref them.

    Deliberately excluded (with rationale):

    • geometry ["Polygon","MultiPolygon"] — GeoJSON RFC 7946 subset; hoisting would imply AdCP owns this discriminator. Left inline.
    • sync-action — Diverging value sets across consumers (accounts: 4, audiences: 5, creatives: 2). Cannot unify safely.
    • account-status — Already hoisted; enums/account-status.json already exists.

    Non-breaking: Replacing {type,enum} with $ref to an identical enum set resolves to the same JSON Schema constraint graph. All validators produce identical results. No wire values added, removed, or reordered.

    Bump: minor — new $id-bearing addressable schema resources (consistent with #3148).

    Expert sign-offs

    • ad-tech-protocol-expert: ✅ approved — confirmed non-breaking; geometry/sync-action exclusions correct; minor bump correct
    • code-reviewer: ✅ approved — no blockers

    Follow-up noted

    get-media-buy-artifacts-response.json has an unhoisted 3-value ["pass","fail","unevaluated"] inline enum for local_verdict — distinct from both binary-verdict and feature-check-status. Should be a follow-up issue.

    PR

    Draft PR: #3174


    Generated by Claude Code

  6. added a commit that references this issue on Apr 28, 2026
    feed616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedenhancementschema

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions