Skip to content

Commit 5245a66

Browse files
ci(language-policy): DRY local Java/Kotlin check via estate reusable (#117)
## 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 - `hyperpolymath/standards#341` (closed) — estate-wide grep change was redundant given the baseline mechanism already exists. - `#107` (closed) — same intent as this PR but pre-#105; rebase would have been a different change. ## Test plan - [x] 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](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6a5c79a commit 5245a66

1 file changed

Lines changed: 22 additions & 18 deletions

File tree

.github/workflows/language-policy.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,28 @@ jobs:
8484
fi
8585
echo "✓ No npm runtime dependencies found"
8686
87-
- name: Check for Java/Kotlin files
88-
run: |
89-
# Carve-out: the android/ subtree is owner-authored Kotlin/Gradle
90-
# code currently being migrated to Gossamer (RFC PR #97). It is
91-
# not vendored upstream — it is intentional work-in-flight. Once
92-
# the Gossamer migration lands and android/ is removed, this
93-
# exclusion should be removed too. Mirrors the .hypatia-ignore /
94-
# .hypatia-baseline.json carve-out consumed by the standards
95-
# governance-reusable workflow.
96-
VIOLATIONS=$(find . \
97-
\( -path './android' -o -path './android/*' -o -path './.git/*' \) -prune -o \
98-
\( -name "*.java" -o -name "*.kt" -o -name "*.kts" \) -type f -print)
99-
if [ -n "$VIOLATIONS" ]; then
100-
echo "::error::Java/Kotlin files found. Use Rust/Tauri/Dioxus instead."
101-
echo "$VIOLATIONS"
102-
exit 1
103-
fi
104-
echo "✓ No Java/Kotlin files found (android/ exempt — Gossamer migration in flight, RFC PR #97)"
87+
# Java/Kotlin check is delegated to the estate-wide standards
88+
# `governance-reusable.yml language-policy` job (called from this
89+
# repo's governance.yml). That reusable already:
90+
# - reads `.hypatia-baseline.json` and honours `file_pattern`
91+
# entries (governance-reusable.yml:91-285);
92+
# - uses `git ls-files` (which respects .gitignore correctly,
93+
# unlike `find` — see governance-reusable.yml:331-337);
94+
# - emits an explicit "exempt" line per skipped match for audit
95+
# trail.
96+
#
97+
# The neurophone-local `.hypatia-baseline.json` already declares
98+
# the android/** carve-out for the Gossamer migration (PR #97).
99+
# That single source of truth is enough; the previous local
100+
# duplicate find-based check both (a) duplicated the policy and
101+
# (b) used the brittle `find` mechanism that the reusable comment
102+
# explicitly warned against.
103+
#
104+
# When the Gossamer migration completes and android/ is removed,
105+
# the baseline entry will become stale — the reusable's
106+
# `Detect stale baseline entries` job (governance-reusable.yml:127
107+
# onward) will warn, and the entry can be removed in the same PR
108+
# that deletes android/.
105109

106110
- name: Check for Swift files
107111
run: |

0 commit comments

Comments
 (0)