fix: a reserved spelling survives snake casing - #181
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #180. Cut from
mainafter #172.What
reservedSpellingsininternal/intermediate_representation/naming.go— the owner's two lists, as ruled:oauth,oauth2,idp,ios,ipados,macos,tvos,watchos,visionositunes,githubEach member is keyed by the exact casing wires use (
OAuth/oAuth,IdP,iOS,macOS,iTunes,GitHub, …) and maps to its one-word snake form.snakeCaseconsumes 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 — soRadiOS→radi_osandidPage→id_pageare 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, sopascalCase("cloud_idp_common")=CloudIdPCommonandcamelCasekeeps 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:
o_auth,o_auth2oauth,oauth2cloud_id_p_commoncloud_idp_commonmac_os_enterprise_enrollment_enabled,sso_for_mac_os_self_service_enabledmacos_…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_vaultis 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_SnakeCasegains thirteen rows including both guards;TestUnit_Naming_AcronymCasinggains seven.make checkgreen (90.2% total, hygiene clean);golangci-lint0 issues.🤖 Generated with Claude Code
https://claude.ai/code/session_01XPLePCqzyYncF7TedagFkg