feat(schema): hoist 13 duplicate inline enum sets into shared enums/ definitions#3174
Conversation
…definitions Follows the approach of #3148. Adds 13 new $id-bearing enum files to static/schemas/source/enums/ and updates 21 source schemas to $ref them instead of repeating inline definitions. Wire format unchanged in all cases. New enum files: match-type, collection-kind, frame-rate-type, scan-type, gop-type, moov-atom-position, binary-verdict, account-scope, governance-decision, billing-party, feature-check-status, snapshot-unavailable-reason, travel-time-unit. Intentionally NOT hoisted: geometry ["Polygon","MultiPolygon"] (GeoJSON subset risk per protocol-expert review), sync-action (diverging value sets across consumers), account-status (already hoisted in prior batch). Closes #3166 https://claude.ai/code/session_01ETBaMbHLSMBLW6CUfYHtHp
cc8a3e1 to
98561cd
Compare
Independent post-PR review (code-reviewer + ad-tech-protocol-expert)Both reviewers ran independently on the full diff. One blocker + a couple of follow-ups worth deciding before merge. Required before merge1.
Two ways forward:
The order discrepancy ( Should verify2. JSON Schema Confirmed cleanCode-review verified all 16 hoists against the GA cache (
Optional follow-up (informational, not blocking)Strict draft-07 ignores sibling Versioning
Triggered by independent SDK-side review (ad-tech-protocol-expert + code-reviewer). |
|
Ad-tech-protocol-expert review summary: Verdict: sound-with-caveats ✅ Wire-compat: spot-checked ✅ Semver
Ready for review. The |
…3316) The previous workflow filtered PR comments out via `github.event.issue.pull_request == null` with a comment claiming "auto-fix handles those" — but no auto-fix workflow exists, and the slack-routing only routes `/triage` slash commands. PR review feedback (like the reviewer summaries on #3170/#3174/#3225/#3226 earlier today) sat unactioned because nothing else was wired to pick them up. Drop the filter. Route PR comments to the same triage routine, with two adaptations on the payload so the routine can branch: - `is_pr: true|false` flag at the top of the prompt - `pr` block with head_ref, base_ref, draft, state when is_pr=true - MODE directive when is_pr=true: "apply requested fix as a follow-up commit on the PR's head branch, or post a reply if it's a question" Self-loop guard widened to skip comments containing "Fixed by Claude Code" in addition to the existing "Triaged by Claude Code" — so the routine's own follow-up replies on PRs don't re-fire it. Concurrency group already keys on `issue.number`, which GitHub assigns sequentially across both issues and PRs, so PR runs won't collide with issue runs even when numbers happen to match. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes #3166
Second tranche of inline-enum hoisting, same pattern as #3148. All 13 candidate enum sets were verified byte-identical across every call site before replacement.
What changed
13 new shared enum files added to
static/schemas/source/enums/:match-type.json["broad","phrase","exact"]collection-kind.json["series","publication","event_series","rotation"]travel-time-unit.json["min","hr"]frame-rate-type.json["constant","variable"]scan-type.json["progressive","interlaced"]gop-type.json["closed","open"]moov-atom-position.json["start","end"]binary-verdict.json["pass","fail"]account-scope.json["operator","brand","operator_brand","agent"]governance-decision.json["approved","denied","conditions"]billing-party.json["operator","agent","advertiser"]feature-check-status.json["passed","failed","warning","unevaluated"]snapshot-unavailable-reason.json["SNAPSHOT_UNSUPPORTED","SNAPSHOT_TEMPORARILY_UNAVAILABLE","SNAPSHOT_PERMISSION_DENIED"]21 consumer schemas updated across
media-buy/,core/,collection/,content-standards/,property/,account/,governance/, andcreative/.Non-breaking justification
Replacing
{"type":"string","enum":[...]}with a$refto an equivalent standalone schema produces an identical JSON Schema subgraph under draft-07. All validators and codegen tools behave identically. No enum values added, removed, or reordered. Wire format unchanged.minorbump is for new$id-bearing addressable schema resources (consistent with #3148 precedent).Deliberately excluded candidates
geometry["Polygon","MultiPolygon"]— GeoJSON RFC 7946 subset; hoisting would incorrectly imply AdCP owns this discriminator. Left inline incatchment.jsonandproduct-filters.json.sync-action— Diverging value sets across consumers (sync-accounts-responsehas 4 values without"deleted",sync-audiences-responsehas all 5,sync-creatives-responsehas only 2). Cannot be safely unified into a single enum file.account-status— Already hoisted in a prior batch;enums/account-status.jsonalready exists and is$ref'd correctly.Notable implementation details
governance-decision.jsoncarries a$commentnoting thatsummary.statuses.human_reviewedinget-plan-audit-logs-response.jsonis a supplementary counter, NOT a valid governance decision value — prevents future consumers from incorrectly iterating the enum file and dropping it.binary-verdict.jsonnamed explicitly to distinguish fromfeature-check-status.json(4-value past-tense set) and any future 3-value sets withunevaluated.snapshot-unavailable-reason.jsonpreserves SCREAMING_SNAKE_CASE exactly as found in the inline originals.default: "broad"preserved alongside$refinproduct-filters.json— valid draft-07 behavior, functions as documentation hint.Follow-up noted (not in scope)
get-media-buy-artifacts-response.jsoncontains an unhoisted 3-value inline enum["pass","fail","unevaluated"]forlocal_verdict. This is distinct from bothbinary-verdictandfeature-check-statusand should be filed as a follow-up.Pre-PR review
minorbump confirmedMilestone
Targets 3.1.0 (next open minor milestone). Please set via milestone selector if not auto-assigned.
Session: https://claude.ai/code/session_01ETBaMbHLSMBLW6CUfYHtHp