Skip to content

feat(schema): reporting subscriptions name geography systems and carry geo codes - #9049

Merged
bokelley merged 3 commits into
mainfrom
bokelley/reporting-geo-dimensions
Nov 21, 2026
Merged

bokelley merged 3 commits into
mainfrom
bokelley/reporting-geo-dimensions

Conversation

@bokelley

@bokelley bokelley commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A buyer can get delivery by geography from a seller two ways: ask for reporting_dimensions.geo on get_media_buy_delivery, or subscribe to a Reliable Reporting feed broken down by country, region or metro. The two describe the same breakdown differently, and the feed side leaves two things unsaid:

  1. Which system.
    • get_media_buy_delivery takes a geo_level of country, region, metro or postal_area, with a system for metro and postal, such as nielsen_dma or US zip.
    • The subscription vocabulary has metro but no way to say which metro system, and no postal_area.
    • So a buyer can't subscribe to "delivery by Nielsen DMA". If two of a seller's offerings report metro in different systems, the selector can't tell them apart, and the rows' metro codes are ambiguous.
  2. What the values are. An offering maps its native dimensions onto country, region or metro, but nothing says what a row carries in them. A seller could send New York or an internal ID and still conform.

This PR closes both, following the 1.2 precedent that already fixes how the package breakdown is named (package_id).

  • postal_area joins the standard reporting-dimension vocabulary.

  • dimension_systems is a new core/reporting-dimension-systems.json:

    • metro takes a metro-system;
    • postal_area takes a list of core/postal-country-system.json pairings, the same { country, system } pairing by_geo rows and postal targeting use, so a system must belong to its country.
  • Offerings. An offering whose standard_dimensions include metro or postal_area must publish dimension_systems for each. The schema enforces this with if/then.

  • Selectors. A subscription selector may set dimension_systems. An offering then matches only when its metro system equals the selector's, and its postal systems include every selector entry. A metro key requires metro in the selector's dimensions, and a postal_area key requires postal_area; the schema refuses a system for a breakdown the selector doesn't request. Omitting a key accepts any system, so existing selectors resolve exactly as before.

  • Report definitions. A contract_version 1.2 report definition names each geography dimension with its standard name and fills it with codes, never display names:

    • ISO 3166-1 alpha-2 for country;
    • ISO 3166-2 for region;
    • a code in the offering's metro system for metro;
    • a code in one of its postal systems for postal_area.

    These are the values geo_code carries in by_geo delivery rows. A native geography dimension that breaks the rule, a display-name column among them, is listed as unmapped.

Why now

Apostra is building geography delivery reporting for buyers on Reliable Reporting feeds instead of polling, and wants its public read to use AdCP's words exactly. That's where these two gaps showed up. Everything here sits under the experimental media_buy.reporting_subscriptions feature, and contract 1.2 is new in 3.3, so 3.3 is the place to fix them. 3.3.0-rc.2 has published; this would land in the next release candidate.

Compatibility

  • Additive and optional. A selector without dimension_systems resolves exactly as before.
  • One new requirement: an offering that maps metro or postal_area must name its systems. Only experimental 3.3 offerings are affected.
  • Report definitions: the rule on geography values applies only at contract_version 1.2, which 3.3 introduces. Definitions at 1.0 and 1.1 keep validating unchanged.
  • Release pages: What's new in 3.3, the release notes and the migration guide are not edited here; they're left to the release PR.
  • SDKs: @adcp/sdk and the Python adcp need to adopt dimension_systems in their selector resolution. Until they do, the SDK interop check (not a required check) disagrees on match-metro-system-named and match-postal-systems-subset: both SDKs ignore the selector's system and pick the lowest offering_id. The omitted-system case already agrees.
  • Python SDK generation (not required): with postal_area items referencing postal-country-system.json, the Python SDK generator's fix_postal_union_arm_order step no longer finds PostalArea1 | PostalArea2 in core/postal_area.py and stops. That step matches generated class names, which shift when another schema references the postal pairing. The fix belongs in adcp-client-python; I'll file it there.
  • Capabilities bounds: dimension_systems.postal_area is capped at 16 entries, so the worst-case document stays finite. The pinned figure in security.mdx and tests/capabilities-structural-bounds.test.cjs moves from 99,101,211 to 99,198,584 bytes, and open positions from 190 to 193.

Changes

  • Schemas:
    • enums/reporting-dimension.json gains postal_area;
    • new core/reporting-dimension-systems.json, registered in index.json;
    • dimension_systems added to core/reporting-delivery-offering.json (with the if/then rules) and to core/reporting-subscription.json (selector);
    • the geography rule added to the core/reporting-report-definition.json dimensions description.
  • Docs:
    • docs/protocol/sync_principal.mdx: the selector table and the standard_dimensions paragraph;
    • docs/media-buy/task-reference/get_reporting_status.mdx: the 1.2 row and a geography-dimension table.
  • Reference model: scripts/reference/reporting-coverage/coverage.cjs checks dimension_systems when it resolves a selector.
  • Test vectors: three new cases in static/compliance/source/test-vectors/reporting-subscriptions/vectors.json:
    • a named metro system picks the DMA offering over a lower-id UK ITL2 one;
    • an omitted system keeps the lowest offering_id;
    • a postal selector matches only an offering that includes its country and system.
  • Tests: tests/reporting-subscriptions.test.cjs pins the new enum value and checks dimension_systems on selectors and offerings, including mismatched postal pairings and systems named for unrequested dimensions. tests/capabilities-structural-bounds.test.cjs and docs/building/by-layer/L1/security.mdx carry the new worst-case figure.

Testing

  • node --test tests/reporting-subscription-coverage-vectors.test.cjs: 154/154. The reference model reproduces every case, including the three new ones, and every case validates against case.schema.json.
  • node --test tests/reporting-subscriptions.test.cjs, reporting-subscription-coverage-vectors, capabilities-structural-bounds and x-added-in-3-3-sweep: 241/241.
  • npm run build:compliance: regenerated the symbol links in get_reporting_status.mdx.
  • node --test tests/x-added-in-3-3-sweep.test.cjs: 6/6.
  • node tests/schema-validation.test.cjs: 36/36.
  • node scripts/check-changeset-protocol-scope.cjs origin/main: passed.
  • Pre-commit hook passed in full on the first commit: unit tests, server unit tests (seven load-sensitive files passed on its isolated re-run) and typecheck.
  • On the bounds fix commit, the hook's unit tests and the three checks after them passed, and precommit:server-unit hit its 1,500-second limit on a heavily loaded shared host. That commit changes only a schema bound, a test constant and doc text, so I ran npm run typecheck separately, committed with --no-verify, and am relying on hosted CI for the full server suite.
  • On the review-fix commit (d8eed66), the hook's server suite failed one file, training-agent-hosted-grader-credential, whose setup hook timed out at 10 seconds on a loaded host. It passes 8/8 run alone with a longer hook timeout, and it doesn't touch these schemas. I committed with --no-verify and rely on hosted CI.

🤖 Generated with Claude Code

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated schema paths require human/CODEOWNERS approval.

This is a clean additive change: adds a postal_area reporting dimension and a dimension_systems schema naming the metro/postal system behind a geography breakdown, on both offerings and subscription selectors. The reviewer verified referenced enums (metro-system.json, postal-system.json) exist, vector values are valid members, systemsMatch (coverage.cjs:98) implements equality-for-metro / superset-for-postal correctly, the two allOf conditionals require the right systems, schema↔docs are coherent across sync_principal.mdx and get_reporting_status.mdx, and the minor changeset is the correct class for an additive change on an x-extensible enum. No Critical/High/Medium findings.

Despite the clean diff, this PR touches files under static/schemas/source/**, which fall under a hard, deterministic approval gate (gated_paths: true). review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied and the outcome must be escalate (decision table row 2). A human/CODEOWNERS approval lifts this gate.

Escalation reasons

  • Modifies/adds protocol schema source under static/schemas/source/** (reporting-delivery-offering.json, reporting-dimension-systems.json [new], reporting-report-definition.json, reporting-subscription.json, reporting-dimension.json, index.json) — gated path requires human/CODEOWNERS review; review_decision is REVIEW_REQUIRED.

Why human review

  • Touches gated path static/schemas/source/** (6 files, incl. new reporting-dimension-systems.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-delivery-offering.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-dimension-systems.json (added) matches static/schemas/source/**; static/schemas/source/core/reporting-report-definition.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription.json (modified) matches static/schemas/source/**; static/schemas/source/enums/reporting-dimension.json (modified) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/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.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Nov 16, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated path requires human/CODEOWNERS approval.

This PR modifies the published protocol surface under static/schemas/source/** (6 files, including the new reporting-dimension-systems.json). gated_paths is true and review_decision is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2, this is a hard, non-overridable approval gate — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

The reviewer pass is clean: a 62-line delta that bounds the previously-open postal_area array with maxItems:16, moves script-computed/test-pinned worst-case byte and open-position figures together (CI-enforced), and adds one markdown link. No schema↔docs drift, no changeset/oneOf issue, no released-artifact edits, no Critical/High/Medium findings. This cleanliness does not lift the gate — only an APPROVED review decision does.

No blocking findings. The prior escalate remains correct because the gate condition still holds.

Escalation reasons

  • Touches gated path static/schemas/source/** (reporting-delivery-offering.json, reporting-dimension-systems.json [new], reporting-report-definition.json, reporting-subscription.json, reporting-dimension.json, index.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.

Why human review

  • Touches gated path static/schemas/source/** (6 files, incl. new reporting-dimension-systems.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-delivery-offering.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-dimension-systems.json (added) matches static/schemas/source/**; static/schemas/source/core/reporting-report-definition.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription.json (modified) matches static/schemas/source/**; static/schemas/source/enums/reporting-dimension.json (modified) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/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.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated schema paths require human/CODEOWNERS approval.

This PR modifies the published protocol surface under static/schemas/source/** (6 files, incl. the new reporting-dimension-systems.json), which is under a hard, non-overridable approval gate. gated_paths: true and review_decision: REVIEW_REQUIRED (not APPROVED), so decision-table row 2 forces escalate — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

The reviewer's pass is clean: no Critical/High/Medium findings. The delta refines experimental 3.3 geo-reporting work — postal_area items moved to a $ref (country↔system pairing validated by new tests), two new allOf if/then rules on reporting-subscription.json (structurally correct, fully tested), geo_name removed consistently with no dangling references, and security.mdx worst-case bounds updated in lockstep with the pinning test. Schema↔docs coherence holds, changeset present and minor/additive on experimental surfaces, no undiscriminated oneOf, no dist/** mutation.

No blocking findings. The only reason this is not an approve is the unsatisfied hard approval gate on the gated schema paths. Once a human/CODEOWNERS approval moves review_decision to APPROVED, a clean re-run falls through to approve.

Escalation reasons

  • Touches gated path static/schemas/source/** (6 files, incl. new reporting-dimension-systems.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.

Why human review

  • Touches gated path static/schemas/source/** (6 files, incl. new reporting-dimension-systems.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-delivery-offering.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-dimension-systems.json (added) matches static/schemas/source/**; static/schemas/source/core/reporting-report-definition.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription.json (modified) matches static/schemas/source/**; static/schemas/source/enums/reporting-dimension.json (modified) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/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.

bokelley and others added 3 commits November 20, 2026 09:47
…y geo codes

The standard reporting dimension vocabulary gains postal_area, and a new
dimension_systems object names the metro system and the postal countries and
systems behind a metro or postal_area breakdown. Offerings that map either
breakdown must publish it; subscription selectors may set it to match only
those systems. A contract_version 1.2 report definition names geography
dimensions with their standard names and fills them with codes, the values
geo_code carries in by_geo delivery rows, so a feed and a delivery report
describe the same breakdown the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cap dimension_systems.postal_area at 16 entries so the capabilities
structural bounds hold, update the pinned worst-case figure (99,155,576
bytes) and open-position count (192) in the test and security.mdx, and
regenerate the compliance symbol link in get_reporting_status.mdx.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…drop geo_name

- dimension_systems.postal_area items reference postal-country-system.json,
  so a system must belong to its country (refuses {US, gb_outward},
  {DE, zip} and legacy country-fused values like us_zip).
- A selector's dimension_systems.metro requires metro in dimensions, and
  postal_area requires postal_area, enforced with if/then.
- Drop the invitation to add a geo_name dimension: it would be unmapped and
  block exact matches, including billing feeds.
- Refresh the documented worst case (99,198,584 bytes, 193 open positions).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bokelley
bokelley force-pushed the bokelley/reporting-geo-dimensions branch from d8eed66 to d302d0b Compare November 20, 2026 13:31
@bokelley
bokelley merged commit a1cebda into main Nov 21, 2026
66 of 68 checks passed
@bokelley
bokelley deleted the bokelley/reporting-geo-dimensions branch November 21, 2026 16:08
@bokelley

Copy link
Copy Markdown
Contributor Author

Admin merge authorized by Brian O'Kelley (@bokelley, author and maintainer) on 21 Nov 2026, on head d302d0b174cec7104603320b575573b7b49ea369. At merge, the only unmet rule was the approving review, which the author can't give. All five required checks passed on that head: TypeScript Build, Server integration tests, Check for changeset, No duplicate migration numbers, IPR Policy / Signature. No review threads were unresolved, and GitHub reported the PR mergeable. The head merged cleanly with current main, and the reporting, bounds, release-supersession and schema-validation suites passed on the merged tree (244/244 plus schema validation). Two non-required checks were red, both as explained in the description: the SDK interop harness, which disagrees on the two system-naming vectors until both SDKs adopt dimension_systems, and Generate Python SDK, where fix_postal_union_arm_order stops on the new postal pairing reference and the fix goes to adcp-client-python.

KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
… snapshots

Brings in adcontextprotocol#9150 (comply_test_controller seeds on the inventory tenants,
two isolated orchestrators per inventory tenant in CI), adcontextprotocol#9049 (reporting
subscriptions name geography systems and carry geo codes), and the
v3.1.34 and v3.2.12 doc snapshots (adcontextprotocol#9131, adcontextprotocol#9139).

Resolution ledger:
- mechanical: none.
- semantic: none. git merged the five files both sides changed with no
  conflicts:
  - server/src/addie/mcp/schema-tools.ts: main bumps the 3.1 and 3.2
    docs releases; this branch's changes are elsewhere in the file.
  - server/tests/unit/training-agent-inventory-tenants.test.ts: main
    adds seed tests beside this branch's changes.
  - tests/release-publication-freshness.test.cjs,
    tests/release-workflow-immutability.test.cjs and
    tests/run-storyboards-sharding.test.cjs: main adds the inventory
    orchestrator jobs and the --shard-group option.
- The local pre-push matrix keeps its tenants: the inventory jobs and
  --shard-group are CI only, and the local queue runs isolated tenants
  through run-storyboards-isolated.mjs, not the shard script.

Checks on the merge result:
- npm run typecheck: pass.
- node --test on the three release and sharding test files: 69 pass,
  0 fail.
- node scripts/precommit-server-unit.cjs --full: 867 files, 14,714
  passed, 31 skipped. Before the merge: 14,708; adcontextprotocol#9150 adds six tests.
KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
Resolution ledger:
- Conflicts: none. Only package.json changed on both sides; it
  auto-merged as a key-wise union: this branch adds
  lint:schema-conventions and the five lint tests in test:schemas;
  main changes version, test, test:release-workflow, precommit,
  verify:local and @adcp/sdk. No key changed on both sides.
- Mechanical: package-lock.json is main's (this branch does not
  change it); node_modules reinstalled with npm ci.
- Baseline: main's reporting dimension systems (adcontextprotocol#9049) add three
  property-name findings, recorded in
  scripts/lint-property-names-baseline.json with --update-baseline,
  since renames wait for 4.0:
  - singular-array core/reporting-dimension-systems.json#/properties/postal_area
  - one-type name:metro (object,string)
  - one-type name:postal_area (array<object>,object)
  The other four lints are unchanged on main: enum values 58, schema
  paths 593, value lists 24, x-adcp-validation 337.
- Proof: schema equivalence against 576ebca: 1113 roots, 0 differ,
  class 1; 158 informational x-adcp-validation entries at the same 18
  sites. In the built bundles the annotations differ only at the 15
  source annotations and where they are inlined, never under $defs.
KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
Brings in 41 commits from main, including adcontextprotocol#9049 (reporting subscriptions
name geography systems), the 3.2.12 and 3.1.34 forward-merges, the
3.3.0-rc.2 release records, and the @adcp/sdk 17.0.0-beta.32 bump.

Resolution ledger

Mechanical files, regenerated by rule:
- docs/building/by-layer/L1/security.mdx and
  tests/capabilities-structural-bounds.test.cjs (conflicted): the
  documented capabilities worst case is the output of
  scripts/capabilities-structural-bounds.cjs, so it is recomputed on the
  merged tree, not picked from either side: 99,149,720 bytes (about
  95 MiB) and 193 open positions. Main moved the figure from 99,101,211
  to 99,198,584 (+97,373, the adcontextprotocol#9049 dimension systems) and the open
  positions from 190 to 193; this branch moved it to 99,052,347
  (-48,864). The merged figure is exactly the sum of both deltas. The
  per-block MiB figures in security.mdx round the same.
- tests/mcp-schema-projection.test.cjs (auto-merged, failed the gate):
  the parity compile limit is the measured comply_test_controller
  projection rounded up to the next 1,000 bytes, the rule every earlier
  merge used. The adcontextprotocol#9049 dimension systems reach the controller: main
  measures 1,350,376 bytes, this branch's named schemas add 79,135, and
  the merged controller measures 1,429,511, so the limit moves from
  1,427,000 to 1,430,000.

Semantic files: none. Both conflicts were measured figures.

Sites changed because main added inline copies: none. Main's schema
changes (adcontextprotocol#9049) reference existing named schemas
(enums/metro-system.json, core/postal-country-system.json) and add no
inline pattern or enum, and lint-schema-named-constraints passes on the
merged tree. The inline pattern and enum counts stay at 83 and 471.

Delta manifest: unchanged. The schema equivalence check against the new
merge base reports the same 3,056 entries at 41 sites and 4,255
informational entries as before the merge, matches all 41 manifest
lines, finds a witness for each, and no corpus instance changes verdict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants