Skip to content

fix: a reserved spelling survives snake casing - #181

Merged
ShocOne merged 1 commit into
mainfrom
fix/reserved-spellings-survive-snake-casing
Aug 31, 2026
Merged

ShocOne merged 1 commit into
mainfrom
fix/reserved-spellings-survive-snake-casing

Conversation

@ShocOne

@ShocOne ShocOne commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fixes #180. Cut from main after #172.

What

reservedSpellings in internal/intermediate_representation/naming.go — the owner's two lists, as ruled:

  • technology: oauth, oauth2, idp, ios, ipados, macos, tvos, watchos, visionos
  • brands: itunes, github

Each member is keyed by the exact casing wires use (OAuth/oAuth, IdP, iOS, macOS, iTunes, GitHub, …) and maps to its one-word snake form. snakeCase consumes the lists as a pre-pass with two boundary guards: a spelling matches case-exactly, an uppercase-led spelling may follow a lowercase letter or digit (that joint is what identifies it) while a lowercase-led one only starts a word, and no spelling may end against a lowercase letter — so RadiOS → radi_os and idPage → id_page are untouched, proven in tests.

The Go side follows the vendor-adapted casing ruling: the acronym table gains OAuth2, IdP, IOS, IPadOS, MacOS, TvOS, WatchOS, VisionOS, ITunes, GitHub, so pascalCase("cloud_idp_common") = CloudIdPCommon and camelCase keeps its leading-lowercase rule (iosDetails). Glossary row reservedSpellings records the class, both lists, and that additions go through the owner.

Contract note (semver, migration)

Generated attribute names change where a document uses these spellings — a breaking rename for existing configurations:

was becomes where seen today
o_auth, o_auth2 oauth, oauth2 ThousandEyes tests
cloud_id_p_common cloud_idp_common Jamf Pro
mac_os_enterprise_enrollment_enabled, sso_for_mac_os_self_service_enabled macos_… Jamf Pro

Latent wires (iOS, tvOS, watchOS, visionOS, iTunesStoreAccountActive, enabledForGitHubApps) now snake correctly the day their entities emit. Pilots regenerate with the renames after merge; the tracker gets its note then.

Evidence basis: censuses over all three pilot documents (only these tokens split; FileVault → file_vault is a legitimate two-word compound and was deliberately not included) and both reference providers' spellings (oauth, oauth_client_id, ipv6_policy, dnssec — all single runs).

Verification

TestUnit_Naming_SnakeCase gains thirteen rows including both guards; TestUnit_Naming_AcronymCasing gains seven. make check green (90.2% total, hygiene clean); golangci-lint 0 issues.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XPLePCqzyYncF7TedagFkg

The ecosystem writes some wire spellings as one run — a technology term
such as OAuth or iOS, a brand such as iTunes — and the letter-boundary
walk in snakeCase split them: oAuth became o_auth, CloudIdPCommon became
cloud_id_p_common, macOS became mac_os. Both hand-written reference
providers spell these as single runs.

reservedSpellings carries the owner's two lists — technology (oauth,
oauth2, idp, ios, ipados, macos, tvos, watchos, visionos) and brands
(itunes, github) — keyed by the exact casing a wire uses, mapping each to
its one-word snake form. snakeCase consumes them as a pre-pass: a
spelling matches case-exactly and only between word boundaries, so
RadiOS never yields ios and idPage never yields idp. Each member's Go
spelling joins the acronym table in the vendor's own casing (OAuth, IdP,
MacOS, ITunes, GitHub), so the terraform, Go and wire spellings of one
term stay one word.

Generated attribute names change where a document uses these spellings:
o_auth and o_auth2 become oauth and oauth2, cloud_id_p_common becomes
cloud_idp_common, mac_os_* becomes macos_*.

Fixes #180.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPLePCqzyYncF7TedagFkg
@ShocOne
ShocOne merged commit c67cdab into main Aug 31, 2026
2 checks passed
@ShocOne
ShocOne deleted the fix/reserved-spellings-survive-snake-casing branch August 31, 2026 22:01
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.

a wire acronym splits when it becomes a terraform attribute name

1 participant