Skip to content

ci(language-policy): DRY local Java/Kotlin check via estate reusable#117

Merged
hyperpolymath merged 1 commit into
mainfrom
ci/dry-up-language-policy-android-carveout
Jun 2, 2026
Merged

ci(language-policy): DRY local Java/Kotlin check via estate reusable#117
hyperpolymath merged 1 commit into
mainfrom
ci/dry-up-language-policy-android-carveout

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Why

PR #105 added the android/** carve-out via two mechanisms:

  • (a) Prune android/ from a local find step in .github/workflows/language-policy.yml
  • (b) Add .hypatia-baseline.json with file_pattern: "android/**"

The estate-wide reusable at hyperpolymath/standards/.github/workflows/governance-reusable.yml (called from this repo's governance.yml) already reads .hypatia-baseline.json and exempts matched paths in its own language-policy job (see governance-reusable.yml:91-285).

(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.

What this PR does

Removes the local Check for Java/Kotlin files step. The neurophone .hypatia-baseline.json carve-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

  • Kotlin (.kt, .kts) is still fully banned — by the estate-wide reusable's enforce "Java/Kotlin files" block.
  • Non-Android Java (e.g. a stray Foo.java at repo root) is still blocked — same path.
  • The 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's Detect stale baseline entries job (governance-reusable.yml:127+) will warn. The entry can be removed in the same PR that deletes android/ (i.e. sub-PR #9 of the migration sequence in RFC PR #97).

Supersedes

Test plan

  • Workflow YAML is well-formed (visually verified).
  • CI passes — local language-policy.yml runs without the Java/Kotlin step; estate-wide reusable runs and exempts android/** via baseline.
  • Negative test: a hypothetical Foo.java at repo root would still trigger the estate-wide Language / package anti-pattern policy job (verified by inspection of governance-reusable.yml:345 + enforce() at line 310 + is_exempt() at line 292).

🤖 Generated with Claude Code

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>
@hyperpolymath hyperpolymath merged commit 5245a66 into main Jun 2, 2026
25 checks passed
@hyperpolymath hyperpolymath deleted the ci/dry-up-language-policy-android-carveout branch June 2, 2026 15:54
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