ci(language-policy): DRY local Java/Kotlin check via estate reusable#117
Merged
Merged
Conversation
PR #105 added an android/** carve-out by both: (a) prune-ing android/ from a local `find` step in language-policy.yml (b) adding `.hypatia-baseline.json` with `file_pattern: "android/**"` The estate-wide reusable (standards governance-reusable.yml) already reads `.hypatia-baseline.json` and exempts matched paths in its own language-policy job. So (b) alone is sufficient; (a) is a duplicate that uses the brittle `find` mechanism the reusable explicitly warns against (`git ls-files` respects .gitignore correctly). Removing the local step: - reduces drift surface (one carve-out declaration instead of two); - aligns with the reusable's stale-baseline-warning machinery (which will flag the entry when android/ is removed at end of migration); - keeps Kotlin (.kt, .kts) AND non-Android Java fully banned via the reusable's `enforce "Java/Kotlin files"` block. Net behaviour change: zero. Local check duplicated estate check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Why
PR #105 added the android/** carve-out via two mechanisms:
android/from a localfindstep in.github/workflows/language-policy.yml.hypatia-baseline.jsonwithfile_pattern: "android/**"The estate-wide reusable at
hyperpolymath/standards/.github/workflows/governance-reusable.yml(called from this repo'sgovernance.yml) already reads.hypatia-baseline.jsonand exempts matched paths in its ownlanguage-policyjob (seegovernance-reusable.yml:91-285).(b) alone is sufficient. (a) is a duplicate that uses the brittle
findmechanism the reusable explicitly warns against —git ls-filesrespects.gitignorecorrectly.What this PR does
Removes the local
Check for Java/Kotlin filesstep. The neurophone.hypatia-baseline.jsoncarve-out continues to handle the android/** exemption via the estate-wide reusable.Net behaviour change
Zero. The local check duplicated the estate check. Both gate on Java/Kotlin files; both exempt android/** via different mechanisms. Removing the local check means there's one mechanism instead of two, and the remaining mechanism is the auditable baseline file.
Properties preserved
.kt,.kts) is still fully banned — by the estate-wide reusable'senforce "Java/Kotlin files"block.Foo.javaat repo root) is still blocked — same path.android/**carve-out is still respected via.hypatia-baseline.json.Stale-entry cleanup at end of migration
When the Gossamer migration completes and
android/is removed, the baseline entry will become stale. The reusable'sDetect stale baseline entriesjob (governance-reusable.yml:127+) will warn. The entry can be removed in the same PR that deletesandroid/(i.e. sub-PR #9 of the migration sequence in RFC PR #97).Supersedes
hyperpolymath/standards#341(closed) — estate-wide grep change was redundant given the baseline mechanism already exists.hyperpolymath/neurophone#107(closed) — same intent as this PR but pre-fix(cicd): carve out android/** from banned-language scan (Gossamer migration in flight) #105; rebase would have been a different change.Test plan
Foo.javaat repo root would still trigger the estate-wideLanguage / package anti-pattern policyjob (verified by inspection ofgovernance-reusable.yml:345+enforce()at line 310 +is_exempt()at line 292).🤖 Generated with Claude Code