Skip to content

fix(governance)!: banned_language ban is total — no exceptions#280

Open
hyperpolymath wants to merge 1 commit into
mainfrom
chore/python-ban-no-exceptions
Open

fix(governance)!: banned_language ban is total — no exceptions#280
hyperpolymath wants to merge 1 commit into
mainfrom
chore/python-ban-no-exceptions

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Why

Companion to #279. Org policy 2026-05-18: the banned-language ban (incl. Python) is now absolute — no SaltStack-style carve-outs. The governance rule must stop honouring banned_language_file exemptions.

What (follow-up #1)

  • lib/hypatia/scanner_suppression.exsuppressed?/4 gains a hard short-circuit clause: cicd_rules/banned_language_file is never suppressed, by any vector (.hypatia-ignore, built-in default exemptions, universal excludes, training-corpus paths). Added the canonical bodiless default head so the guard clause coexists with the optional opts arg.
  • lib/rules/cicd_rules.ex:python_detected loses its exception: "SaltStack" field.
  • 4 new tests pin the invariant (unsuppressible via every vector; an unrelated rule on the same path stays suppressible).

Compiles clean; 24/24 scanner_suppression_test.exs pass.

Re: follow-up #2 (the #272 unwrap_without_check false positive) — no change needed

Verified empirically: the source regex ~r/\.unwrap\(\)/ does not match unwrap_or (Regex.match? → false). It is not a rule defect. The false positive came from a stale compiled escript, which is exactly what #278 rebuilds. Fabricating a rule change here would be wrong; #278 landing resolves it.

🤖 Generated with Claude Code

Org policy 2026-05-18: the banned-language ban (incl. Python) is now
absolute, with no SaltStack-style carve-outs.

- ScannerSuppression.suppressed?/4 gains a hard short-circuit clause:
  cicd_rules/banned_language_file is NEVER suppressed — not by
  .hypatia-ignore, built-in default exemptions, universal excludes, or
  training-corpus paths. (Added the canonical bodiless default head so
  the guard clause coexists with the optional opts arg.)
- cicd_rules :python_detected loses its `exception: "SaltStack"` field.
- 4 new tests pin the invariant (unsuppressible via every vector;
  unrelated rules on the same path remain suppressible).

Compiles clean; 24/24 scanner_suppression tests pass.

Companion to #279 (which removed hypatia's own Python + revoked its
exemption records). Note: the #272 `unwrap_without_check` false
positive is NOT a rule defect — the source regex /\.unwrap\(\)/ does
not match `unwrap_or` (verified); it was a stale compiled escript,
already addressed by #278's escript rebuild. No rule change there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 18, 2026 21:19
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