Skip to content

feat: migrate church_sui_iuris to CESIDR esi: IDs - #9

Merged
JohnRDOrazio merged 2 commits into
mainfrom
feat/church-sui-iuris-esi-ids
Aug 8, 2026
Merged

feat: migrate church_sui_iuris to CESIDR esi: IDs#9
JohnRDOrazio merged 2 commits into
mainfrom
feat/church-sui-iuris-esi-ids

Conversation

@JohnRDOrazio

@JohnRDOrazio JohnRDOrazio commented Aug 8, 2026

Copy link
Copy Markdown
Member

Resolves open question 6.

church_sui_iuris now carries the full cross-reference rather than a bare slug:

{
  "id": "circ:us-boston",
  "church_sui_iuris": "esi:latin",
  "type": "ctype:archdiocese"
}

Both attributes are now <registry>:<slug> references, matching how the family already works — COECDR embeds CRPDR rp: IDs, CDOCTDR embeds CRMEDR mr: IDs.

A rename-free migration

CESIDR slugs were minted specifically to match the values this field already carried — latin, ukrainian, maronite, syro-malabar, exactly as rule 4 listed them. So this adds a prefix and nothing else. No value renamed, no entry changed meaning; all 2,935 entries move together from latin to esi:latin.

Rule 4 clarification

The migration forces a distinction worth stating explicitly. Where an eparchy shares a city with a Latin see, the slug qualifier stays bare:

circ:us-philadelphia              Latin
circ:us-philadelphia-ukrainian    archeparchy   ← not -esi-ukrainian

That qualifier is part of an identifier, not a reference to one. Only the church_sui_iuris field takes the prefix.

Enforcement, and its limit

generate_seed.py asserts the esi: prefix — verified by reverting a value, which exits 1 with church_sui_iuris values missing the esi: prefix: ['latin'].

It is a shape check only. CESIDR is a separate repository, so the generator cannot resolve these IDs the way it resolves ctype: values against the local types registry. Cross-repository resolution — whether by submodule, published index, or convention — is a real question and belongs with the namespace decision in open question 1.

Merge order

Based on feat/circumscription-types (#8), and targeted at that branch rather than main, because both touch schema-proposal.md, README.md and generate_seed.py. Merge #8 first; this then retargets to main cleanly. Reviewing the two-commit diff shows only this change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added documentation for companion registries, including CESIDR church references and circumscription cross-references.
    • Updated schema examples and migration guidance to use esi:-prefixed church identifiers.
  • Data Validation

    • Seed generation now uses standardized CESIDR identifiers and validates the required identifier format.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JohnRDOrazio, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c84c1a40-1214-4a32-9303-9524ddcec2ca

📥 Commits

Reviewing files that changed from the base of the PR and between 82b9555 and dd9d9ac.

📒 Files selected for processing (1)
  • scripts/generate_seed.py
📝 Walkthrough

Walkthrough

The schema now uses CESIDR esi: identifiers for church_sui_iuris. The seed generator emits esi:latin and validates the identifier prefix. Documentation describes the CESIDR and companion type registries.

Changes

CESIDR cross-reference adoption

Layer / File(s) Summary
CESIDR schema contract
docs/schema-proposal.md, README.md
The schema documents church_sui_iuris as an esi: CESIDR reference. Examples and migration notes use the new identifier format. The README documents both companion registries.
Seed generation and validation
scripts/generate_seed.py
Generated entries use esi:latin. The generator asserts that every church_sui_iuris value begins with esi:.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • CatholicOS/cecdr#8: Applies the related companion-registry cross-reference pattern to circumscription type identifiers.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the migration of church_sui_iuris values to CESIDR esi: identifiers.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/church-sui-iuris-esi-ids

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JohnRDOrazio

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/generate_seed.py`:
- Around line 100-104: The church_sui_iuris validation in the entry-checking
block must reject the bare "esi:" value. Replace the assert-based prefix check
with an explicit validation that requires at least one character after "esi:"
and aborts before generated output is written when invalid references are found.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 577fec66-792f-4ce7-a300-1dc489f94fed

📥 Commits

Reviewing files that changed from the base of the PR and between 8bd972c and 82b9555.

📒 Files selected for processing (4)
  • README.md
  • data/circumscriptions.json
  • docs/schema-proposal.md
  • scripts/generate_seed.py

Comment thread scripts/generate_seed.py Outdated
@JohnRDOrazio

Copy link
Copy Markdown
Member Author

Verified against the code. One of the three points holds; fixed in ab563e6.

Fixed — bare esi: passed the check

Correct. "esi:".startswith("esi:") is True, so a value carrying no slug and resolving to nothing would have passed a check whose whole purpose is to catch that. Now matched against the full shape:

if not re.fullmatch(r"esi:[a-z0-9]+(-[a-z0-9]+)*", str(e["church_sui_iuris"]))

That also rejects uppercase and leading/trailing hyphens. Verified — each case exits 1 and leaves data/circumscriptions.json byte-identical:

value exit output unchanged
"esi:" 1
"latin" 1
"esi:Latin" 1
"esi:-latin" 1

Worth noting it was latent, not live: church_sui_iuris is set in exactly one place and no MANUAL override touches the field, so no entry could reach that state today. The check guards the field as it grows, and it should do that correctly.

Skipped — "aborts before generated output is written"

Already true. The assertion is at line 104; out is constructed at 105 and written at 115–118. Nothing is written when validation fails — confirmed by the byte-identical column above, which was the point of measuring it.

Skipped — "replace the assert-based prefix check"

The real concern here is that assert is stripped under python -O. That is legitimate, but it applies identically to the duplicate-ID check (line 93) and the ctype: resolution check (line 99). Converting one of the three in isolation would leave the file inconsistent without closing the gap.

If the -O concern should be addressed, the right change is all three together, in its own PR — happy to open one. Out of scope for a migration that adds a prefix.

Base automatically changed from feat/circumscription-types to main August 8, 2026 01:20
JohnRDOrazio and others added 2 commits August 8, 2026 03:20
Resolves open question 6: `church_sui_iuris` now carries the full
cross-reference (`"church_sui_iuris": "esi:latin"`) rather than a bare slug,
matching how `type` carries `ctype:` and how the family carries `rp:` and
`mr:` references.

The CESIDR slugs were minted to match the values this field already held —
latin, ukrainian, maronite, syro-malabar — so the migration adds a prefix and
nothing else. No value was renamed, no entry changed meaning, and all 2,935
entries move together from `latin` to `esi:latin`.

Rule 4 gains a clarification the migration makes necessary: the slug
qualifier for an eparchy sharing a city with a Latin see stays bare
(`circ:us-philadelphia-ukrainian`, not `-esi-ukrainian`), because that is
part of an identifier rather than a reference to one.

generate_seed.py asserts the `esi:` prefix. It cannot resolve these values —
CESIDR is a separate repository — so this is a shape check only, and
cross-repository resolution is left to the committee alongside the prefix
decision.

Based on the circumscription-types branch; that PR should merge first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`startswith("esi:")` accepted the bare string `"esi:"`, which carries no
slug and resolves to nothing. Matching the full shape instead also rejects
uppercase and leading/trailing hyphens.

Latent rather than live: the value is set in one place and no MANUAL
override touches the field, so no entry could reach the bad state today. The
check exists to guard the field as it grows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JohnRDOrazio
JohnRDOrazio force-pushed the feat/church-sui-iuris-esi-ids branch from ab563e6 to dd9d9ac Compare August 8, 2026 01:20
@JohnRDOrazio
JohnRDOrazio merged commit 3ffa357 into main Aug 8, 2026
1 check passed
@JohnRDOrazio
JohnRDOrazio deleted the feat/church-sui-iuris-esi-ids branch August 8, 2026 01:21
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