Skip to content

fix: strip the Italian archdiocesan type word (58 slugs) - #2

Merged
JohnRDOrazio merged 1 commit into
mainfrom
fix/italian-archdiocese-strip-rule
Aug 7, 2026
Merged

fix: strip the Italian archdiocesan type word (58 slugs)#2
JohnRDOrazio merged 1 commit into
mainfrom
fix/italian-archdiocese-strip-rule

Conversation

@JohnRDOrazio

@JohnRDOrazio JohnRDOrazio commented Aug 7, 2026

Copy link
Copy Markdown
Member

Fixes the strip rule for Italian archdioceses. The cohort was surfaced by @damienriehl in #1; the diagnosis here is different from the one recorded there, and this PR fixes the cause.

The defect

slugify() stripped generic type prefixes with a single alternation:

s = re.sub(r"^(arch)?diocesi di |^(arch)?diocese of ", "", s)

Italian forms the archdiocese as arcidiocesi, not archdiocesi. The optional arch prefix therefore never matched the Italian styled form, and all 58 Italian archdioceses kept the type word in their slug — contrary to rule 1 of the schema proposal, "the type is an attribute, not part of the identity".

The source index uses exactly four styled forms (Diocesi di ×149, Diocese of ×143, Arcidiocesi di ×58, Archdiocese of ×32); three of the four were handled. Splitting the alternation so each language keeps its own form covers all four:

s = re.sub(r"^(arci)?diocesi di ", "", s)
s = re.sub(r"^(arch)?diocese of ", "", s)

Effect

58 IDs change. No collisions — 2,935 entries, 2,935 unique IDs (the generator's duplicate assertion passes).

circ:it-arcidiocesi-di-acerenza              ->  circ:it-acerenza
circ:it-arcidiocesi-di-agrigento             ->  circ:it-agrigento
circ:it-arcidiocesi-di-amalfi-cava-de-tirreni ->  circ:it-amalfi-cava-de-tirreni
circ:it-arcidiocesi-di-bologna               ->  circ:it-bologna
...54 more

Sweeping the regenerated seed for surviving type words now returns nothing in the diocesan/archdiocesan cohort.

Deliberately out of scope

Two cohorts still carry a type word, both by design rather than by defect:

  • 31 military and personal ordinariates (circ:de-deutsches-militarordinariat, circ:pl-ordynariat-polowy-wojska-polskiego). Rule 5 already provides for these and names one in exactly this form. A military ordinariate has no see — its territory is a body of armed forces, not a place — so there is no place name beneath the type word to reduce to. Stripping it leaves circ:de-.
  • 8 Italian territorial prelatures and abbacies (circ:it-abbazia-territoriale-di-montecassino, circ:it-prelatura-territoriale-di-loreto). Whether these should reduce to circ:it-montecassino / circ:it-loreto under rule 1 is a genuine naming question, but it is a committee decision about eight entries rather than a generator bug, and it is left untouched here.

Status

All IDs remain drafts pending committee review, as the seed's own $comment records. This changes 58 of them while the registry is still pre-publication, which is when identifiers are revisable.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Corrected identifiers for Italian archdioceses by removing an unnecessary naming prefix.
    • Improved handling of Italian and English diocese and archdiocese names during data generation.
    • Preserved existing names, locations, rites, and classification details while improving data consistency.

The slugify() strip rule used `^(arch)?diocesi di |^(arch)?diocese of `.
Italian forms the archdiocese as "arcidiocesi", not "archdiocesi", so the
optional `arch` prefix never matched the Italian styled form and all 58
Italian archdioceses kept the type word in their slug, contrary to rule 1
of the schema proposal ("the type is an attribute, not part of the
identity").

Split the alternation so each language keeps its own form and regenerate
the seed. 58 IDs change, e.g. circ:it-arcidiocesi-di-acerenza ->
circ:it-acerenza. No collisions: 2,935 entries, 2,935 unique IDs.

Sweeping the regenerated seed for surviving type words leaves 8 Italian
territorial prelatures and abbacies (circ:it-abbazia-territoriale-di-
montecassino, circ:it-prelatura-territoriale-di-loreto). Whether those
reduce to the bare see name is a separate naming question for the
committee and is left unchanged here.

All IDs remain drafts pending committee review (#1).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d4c68d0a-0126-436e-be15-ee19403820a3

📥 Commits

Reviewing files that changed from the base of the PR and between 5067fb8 and e5f33ab.

📒 Files selected for processing (2)
  • data/circumscriptions.json
  • scripts/generate_seed.py

📝 Walkthrough

Walkthrough

The seed generator now handles Italian and English diocese prefixes separately. Italian archdiocese identifiers in the circumscriptions registry now omit the arcidiocesi-di- prefix. Other registry metadata remains unchanged.

Changes

Italian Circumscription Identifier Normalization

Layer / File(s) Summary
Normalize Italian archdiocese identifiers
scripts/generate_seed.py, data/circumscriptions.json
slugify now removes Italian diocesi di and arcidiocesi di prefixes separately from English prefixes. Italian archdiocese IDs in the registry now use the shorter normalized form.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the fix to remove the Italian archdiocesan type word from 58 slugs.
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.
✨ 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 fix/italian-archdiocese-strip-rule

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.

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