Skip to content

docs(governance): fix schema-invalid custom_policies/shared_exclusions examples#3202

Merged
bokelley merged 1 commit into
mainfrom
bokelley/policy-entry-schema-fixes
Apr 25, 2026
Merged

docs(governance): fix schema-invalid custom_policies/shared_exclusions examples#3202
bokelley merged 1 commit into
mainfrom
bokelley/policy-entry-schema-fixes

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Cherry-pick of the real schema-validity fix from #3143. Closes the example-vs-schema gap that PR identified, in a small focused PR.

What's wrong on main

Both custom_policies[] and portfolio.shared_exclusions[] are defined in sync-plans-request.json as PolicyEntry[] — each entry requires policy_id, enforcement, and policy text. The existing docs use plain strings:

// specification.mdx (BEFORE)
"custom_policies": ["No competitor brand adjacency"]
"shared_exclusions": ["No advertising on properties owned by competitor holding companies"]

// sync_plans.mdx (BEFORE)
"custom_policies": ["No advertising adjacent to competitor content"]

A reader copy-pasting these examples and validating against the schema fails. If the JSON blocks ever get a $schema ref for tests/json-schema-validation.test.cjs to pick up, CI would flag them.

What this PR changes

docs/governance/campaign/specification.mdx

  • Convert custom_policies and shared_exclusions plain-string examples to PolicyEntry objects
  • Update the shared_exclusions description from "Natural language exclusion rules" to "Bespoke exclusion policies applied to all member plans, using the PolicyEntry shape"
  • Add a <Warning> block in the Policy resolution section calling out the additive-only invariant from policy-entry.json — directly visible to anyone reading the spec on policy resolution rather than buried two pages away

docs/governance/campaign/tasks/sync_plans.mdx

  • Convert custom_policies example
  • Update field-table descriptions for both custom_policies and portfolio.shared_exclusions to reflect PolicyEntry shape with cross-link to policy resolution

Why this PR (vs. just landing #3143)

#3143 was drafted by claude-triage for #3140 and bundled this schema fix with the broader sync/versioning content. PR #3187 (merged) covered the sync/versioning content via a new sibling page (policy-registry-sync.mdx), leaving #3143's schema-fix portion still needed. This PR cherry-picks just that fix; #3143 will be closed.

Test plan

  • npm run test:docs-nav — passes
  • No stale schemas/latest/ references in docs/
  • All cross-links resolve
  • Pure-docs change; no schema, task, or runtime modifications

🤖 Generated with Claude Code

…s examples

The sync-plans-request.json schema defines both custom_policies[] and
portfolio.shared_exclusions[] as PolicyEntry[] (requiring policy_id,
enforcement, policy text). The existing examples in specification.mdx
and sync_plans.mdx used plain strings — a reader copy-pasting and
validating against the schema would fail.

Changes:
- specification.mdx: convert two plain-string examples (custom_policies,
  shared_exclusions) to PolicyEntry objects; update shared_exclusions
  description; add additive-only Warning block in the Policy resolution
  section calling out the invariant from policy-entry.json.
- sync_plans.mdx: convert custom_policies example; update field-table
  descriptions for both custom_policies and portfolio.shared_exclusions
  to reflect the PolicyEntry shape.

Cherry-picked from PR #3143 (which is superseded by the merged #3187
for the conceptual sync/versioning content, but carried this real
schema-validity fix). #3143 will be closed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit 40812a7 into main Apr 25, 2026
17 checks passed
@bokelley bokelley deleted the bokelley/policy-entry-schema-fixes branch April 25, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant