Repository navigation
feat(schema): report audience size as a range on sync_audiences - #8024
Conversation
Add optional audience_size and targetable_size to each sync_audiences audience result, both using one new shared core/audience-size.json object (lower_bound, upper_bound, precision, optional as_of), and an optional match_rate_basis (platform_reported | derived) qualifying effective_match_rate. Clarify that matched_count and effective_match_rate MAY be absent and buyers MUST NOT read absence as zero, and that size is never disclosed below the seller minimum (too_small stays authoritative). Additive and non-breaking. Part 1 of #8023; audience overlap follows separately. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated paths touched and review not yet approved.
This is an additive, non-breaking sync_audiences size-reporting change: new optional audience_size/targetable_size (shared core/audience-size.json), new match_rate_basis, and matched_count/effective_match_rate relaxed to MAY-be-absent. The reviewer found a correct minor changeset, coherent schema↔docs, new enums registered in index.json, no new undiscriminated oneOf, no dist mutation, and a thorough validation test wired into test:schemas. No blocking or Medium findings.
However, the diff touches files under static/schemas/source/**, which are under a hard, deterministic approval gate (gated_paths: true), and review_decision is REVIEW_REQUIRED (not APPROVED). Per decision rule row 2, the outcome must be escalate until a human/CODEOWNERS approval satisfies the gate.
Escalation reasons
- Touches gated protocol-source files (
static/schemas/source/core/audience-size.json,.../enums/audience-match-rate-basis.json,.../enums/audience-size-precision.json,.../enums/audience-status.json,.../index.json,.../media-buy/sync-audiences-response.json) under thestatic/schemas/source/**hard approval gate;review_decisionisREVIEW_REQUIRED. Human/CODEOWNERS review is required before merge.
No code-level concerns block this PR — it is clean on the merits. The gate lifts once review is approved.
Why human review
- Gated paths: PR modifies files under static/schemas/source/** (protocol source of truth) while review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS review required per hard approval gate (row 2).
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/audience-size.json (added) matches
static/schemas/source/**; static/schemas/source/enums/audience-match-rate-basis.json (added) matchesstatic/schemas/source/**; static/schemas/source/enums/audience-size-precision.json (added) matchesstatic/schemas/source/**; static/schemas/source/enums/audience-status.json (modified) matchesstatic/schemas/source/**; static/schemas/source/index.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/sync-audiences-response.json (modified) matchesstatic/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated path change requires human/CODEOWNERS approval.
This PR touches static/schemas/source/**, which is under a hard, deterministic approval gate (gated_paths: true), and review_decision is REVIEW_REQUIRED — not APPROVED. Per decision rule row 2, the outcome must be escalate until a real human/CODEOWNERS approval lifts the gate.
The change itself is clean and additive: adds optional audience_size/targetable_size (shared core/audience-size.json) and match_rate_basis to each sync_audiences result, plus two new enums. Nothing renamed, removed, or made required. Reviewer verified schema↔docs coherence (sync_audiences.mdx table, "Audience size" section, and ready status row all match the schema), correct minor changeset for a non-breaking protocol-surface addition, no new undiscriminated oneOf, additionalProperties: true per DR-0009, no dist/** edits, and a new test wired into test:schemas. No blocking or medium findings.
Despite the clean diff, auto-approve is not available: the gated-paths rule is non-overridable and requires explicit approval review status.
Escalation reasons
- Touches gated schema source files (
static/schemas/source/core/audience-size.json, two new enums, and modifications toaudience-status.json,index.json,sync-audiences-response.json);review_decisionisREVIEW_REQUIRED. Human/CODEOWNERS review required to satisfy the hard approval gate.
Why human review
- Gated paths touched (static/schemas/source/**) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required to lift the hard approval gate.
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/audience-size.json (added) matches
static/schemas/source/**; static/schemas/source/enums/audience-match-rate-basis.json (added) matchesstatic/schemas/source/**; static/schemas/source/enums/audience-size-precision.json (added) matchesstatic/schemas/source/**; static/schemas/source/enums/audience-status.json (modified) matchesstatic/schemas/source/**; static/schemas/source/index.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/sync-audiences-response.json (modified) matchesstatic/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated paths touched without an approving review.
This PR modifies the protocol source of truth under static/schemas/source/** (3 added files, 3 modified), which is under a deterministic hard approval gate (gated_paths: true). review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied (decision table row 2).
No blocking findings. The reviewer found no Critical/High/Medium issues: the change is cleanly additive — optional audience_size/targetable_size (shared core/audience-size.json) and match_rate_basis on each sync_audiences result, plus two new enums. Schema↔docs coherence verified, correct minor changeset for an additive change, no new undiscriminated oneOf, no dist/** edits. The matched_count/effective_match_rate loosening is prose-only against fields never in required[], so no wire-validation change and every prior message stays valid.
Escalation reasons:
- Touches gated path(s)
static/schemas/source/core/audience-size.json,.../enums/audience-match-rate-basis.json,.../enums/audience-size-precision.json,.../enums/audience-status.json,.../index.json,.../media-buy/sync-audiences-response.json— human/CODEOWNERS review required (review_decisionisREVIEW_REQUIRED, notAPPROVED). - This is a Normative (additive) protocol change to the published wire surface; ratification is a human act per the constitution's decision-class gate.
Once a human/CODEOWNERS approval lands, the diff is clean and should fall through to approve.
Why human review
- Gated paths touched (static/schemas/source/**) with review_decision=REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required (decision rule row 2)
- Normative protocol change to the published wire surface (new optional fields + two new enums on sync_audiences); per the constitution's decision-class gate, normative ratification is a human act
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/audience-size.json (added) matches
static/schemas/source/**; static/schemas/source/enums/audience-match-rate-basis.json (added) matchesstatic/schemas/source/**; static/schemas/source/enums/audience-size-precision.json (added) matchesstatic/schemas/source/**; static/schemas/source/enums/audience-status.json (modified) matchesstatic/schemas/source/**; static/schemas/source/index.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/sync-audiences-response.json (modified) matchesstatic/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.
Summary
Implements part 1 of #8023: audience size fields on
sync_audiences. Audience overlap (part 2 of the RFC) is not included and follows separately.A buyer syncing one CRM list to several platforms needs to know how many people each platform reached and how many it can serve now. Platforms report size as an interval, an approximation, or a bucket, and not all report a matched count, so a seller today has to invent a point value for
matched_count. This adds a range-with-precision shape for size and says where the existing counts may be absent.Field evidence from #8023 (all are in the PR body only; the normative schema text names no vendor, per
docs/spec-guidelines.md):approximate_count_lower_bound/approximate_count_upper_bound, no matched count or match rate.size_for_display/size_for_search, bucketedsize_range_*,match_rate_percentage.audienceSizeand rolling-7-daymatchedCount.approximate_number_users. X:audience_size. Pinterest:size.What changed
New shared definitions (defined once, so #5966 and #7763 can reuse them):
core/audience-size.json:{ lower_bound, upper_bound, precision, as_of? }.lower_bound,upper_bound,precisionrequired; integers>= 0;as_ofisdate-time.upper_bound >= lower_boundalways, andlower_bound == upper_boundwhenprecisionisexact(documented as MUST; JSON Schema draft-07 cannot compare two fields).enums/audience-size-precision.json:exact | approximate | bucketed.enums/audience-match-rate-basis.json:platform_reported | derived.static/schemas/source/index.json.media-buy/sync-audiences-response.json, each per-audience result, new optional fields:audience_size($refcore size): people matched on the platform.targetable_size($refcore size): people the platform can serve now.match_rate_basis($refenum): describeseffective_match_rate.Description-only clarifications (no type, range, or
requiredchange):matched_countandeffective_match_rate: MAY be absent when the seller cannot report them; buyers MUST NOT read absence as zero.audience_sizeandtargetable_sizeare omitted whenstatusistoo_small, which stays governed by the existingtoo_smallstatus andminimum_size. The existingtoo_smallsemantics (includingmatched_count) are untouched.enums/audience-status.jsonreadydescription no longer says the counts are always populated, so it does not contradict the above.Docs and tests:
docs/media-buy/task-reference/sync_audiences.mdx: new field rows, an "Audience size" section with a short example, and an updatedreadystatus row.tests/audience-size-range.test.cjs(wired intotest:schemas): shared$refshape, required/optional, valid and malformed size objects, size withoutmatched_count, pre-3.3 results still valid, and the MUST wording..changeset/audience-size-range.md:minor,adcontextprotocol.Additive and non-breaking
Nothing is renamed, removed, or made required, and no existing type changes. A message without the new fields validates as before. The only 3.2 messages affected are ones that already used
audience_size,targetable_size, ormatch_rate_basison an audience result with a different shape (these results allow additional properties, so such a use was legal), the same class of exception asdooh_placement_attributes.locationin the 3.3 notes.Not in this PR
get_adcp_capabilitiesadvertisement andcompare_to.execution_readinessaudiencecandidates and RFC: audience lifecycle snapshots and status-change notifications #5966 notifications; both can$refcore/audience-size.json.af3f18ee21), and recent 3.3 schema PRs (feat(schema): add DOOH geo location and inventory summary fields #7416, feat(schema): declare catalog ingestion capabilities #7927) carry only a changeset.Judgment calls for review (#8023 is
needs-wg-review)x-status: experimental. The issue does not ask for experimental. If the WG wants it incubated through 3.3, it is one flag on each new field.targetable_size) is answered with the simplest default: one value, surface left to the seller. A per-surface breakdown can be added later as a separate optional field.too_small(the issue says "not disclosed"). That is stated as prose MUST, not as anif/thenschema rule, to keep the change strictly additive.as_ofis optional, per the issue's required-property list.Validation
Run from a fresh clone of
mainat0efa4bee05plus this branch; every command exited 0:node --test tests/audience-size-range.test.cjs(8 tests)npm run test:schemas(includes the new test),test:platform-agnostic,test:schema-utf8,test:composed,test:examples,test:contracts,test:audience-external-sources,test:build-schemas-hoist-enums,test:oneof-discriminators,test:error-codes,test:doc-compliance-drift,test:dist-schema-version-ids,test:mcp-schema-projectionnpm run build:schemas,node scripts/build-compliance.cjs --check,npm run lint:schema-links,npm run check:x-entity-gaps,npm run test:docs-nav,npm run test:owned-links,npm run typechecknode tests/json-schema-validation.test.cjs --fileandnode tests/snippet-validation.test.cjs --fileonsync_audiences.mdxnode scripts/check-changeset-protocol-scope.cjs origin/mainandchangesets status --since=origin/mainNot run: the full
npm testandnpm run buildaggregate (training-agent runtime, hosted storyboards), which this schema-and-docs change does not touch; CI is the check.Refs #8023
🤖 Generated with Claude Code