Skip to content

fix(governance): eradicate inline Python from governance-reusable.yml#189

Merged
hyperpolymath merged 1 commit into
mainfrom
chore/eradicate-inline-python
May 26, 2026
Merged

fix(governance): eradicate inline Python from governance-reusable.yml#189
hyperpolymath merged 1 commit into
mainfrom
chore/eradicate-inline-python

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Estate language policy bans Python with no exceptions (CLAUDE.md Language Policy; the SaltStack exception was removed 2026-01-03). The governance-reusable.yml workflow that enforces this policy was itself written as an 85-line inline python3 << PYEOF heredoc — a self-referential violation, structurally identical to the CSA001 self-loop fixed in hypatia#328 (the security gate alerting on itself).

This PR replaces the inline Python with a Deno script.

Changes

  • scripts/check-ts-allowlist.ts (new) — Deno port. --allow-read only; no network, no env, no write.
  • scripts/tests/check-ts-allowlist-test.sh (new) — 13 regression cases (builtin allows + CLAUDE.md table parsing).
  • .github/workflows/governance-reusable.yml — replaces the python3 heredoc step with setup-deno + actions/checkout of hyperpolymath/standards@${{ github.workflow_sha }} into .standards-checkout/ (sparse scripts/) + deno run --allow-read .standards-checkout/scripts/check-ts-allowlist.ts.

Behaviour preservation

Byte-identical refactor, not a policy change. All 13 fixture cases pass locally. Dogfooded against this standards repo itself: ✅ No TypeScript files outside allowlist (1 per-repo exemption(s) parsed) — matches the Telegraf bot carve-out in .claude/CLAUDE.md § TypeScript Exemptions.

Why now

The standards repo currently violates its own no-Python rule. Merging unblocks the per-repo Python sweep across the rest of the estate without leaving a CI gate that contradicts the policy it enforces.

Test plan

  • CI: governance-reusable still passes against the standards repo itself
  • bash scripts/tests/check-ts-allowlist-test.sh — 13/13 pass
  • Manual: a caller repo with no .claude/CLAUDE.md gets 0 per-repo exemption(s) parsed

Refs: hypatia#328 (CSA001 self-loop precedent), standards#168 (parent reusable).

🤖 Generated with Claude Code

Estate language policy bans Python with no exceptions (SaltStack
exception removed 2026-01-03). The governance-reusable workflow that
enforces the policy was itself written in inline Python — a
self-referential violation of the structural class fixed in hypatia#328.

This PR:

  * Ports the ~85-line python3 heredoc to scripts/check-ts-allowlist.ts
    (Deno; --allow-read only).
  * Adds scripts/tests/check-ts-allowlist-test.sh with 13 regression
    cases (builtin allows: mod.ts / bindings/ / vendor/ / *.bench.ts /
    lsp.ts / *.d.ts / vscode-dir / deno-prefix-dir; CLAUDE.md table
    parsing: bare violation, exempted, glob match, dotted-dir skip,
    later-heading closes table).
  * Updates governance-reusable.yml to install Deno + check out the
    standards repo's scripts/ via sparse-checkout at the same SHA the
    caller picked (`github.workflow_sha`) + run the script.

Behaviour MUST stay byte-identical to the previous Python; this is a
refactor, not a policy change. All 13 fixture cases pass locally.

Dogfooded against the standards repo itself: '✅ No TypeScript files
outside allowlist (1 per-repo exemption(s) parsed)' (matches the
Telegraf carve-out documented in .claude/CLAUDE.md).

Refs: hypatia#328 (CSA001 self-loop precedent),
      standards#168 (the reusable's parent landing).
@@ -0,0 +1,152 @@
// SPDX-License-Identifier: PMPL-1.0-or-later
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 119 issues detected

Severity Count
🔴 Critical 65
🟠 High 43
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/deno-ci-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "deno-ci-reusable.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance-reusable.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Python file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/standards/standards/a2ml-templates/state-scm-to-v2.py",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/standards/standards/a2ml/bindings/deno/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/standards/standards/lol/test/vitest.config.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/standards/standards/k9-svc/bindings/deno/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/standards/standards/scripts/check-ts-allowlist.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "Agda postulate assumes without proof -- potential soundness hole (4 occurrences, CWE-704)",
    "type": "agda_postulate",
    "file": "/home/runner/work/standards/standards/lol/proofs/theories/information_theory.agda",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/standards/standards/lol/src/abi/Locale.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath enabled auto-merge (squash) May 26, 2026 10:35
@hyperpolymath
hyperpolymath merged commit 0ec0b83 into main May 26, 2026
17 of 18 checks passed
@hyperpolymath
hyperpolymath deleted the chore/eradicate-inline-python branch May 26, 2026 14:42
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.

2 participants