Skip to content

feat(governance): add licence-consistency CI check#201

Open
hyperpolymath wants to merge 2 commits into
mainfrom
claude/licence-consistency-check
Open

feat(governance): add licence-consistency CI check#201
hyperpolymath wants to merge 2 commits into
mainfrom
claude/licence-consistency-check

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

What the check catches

  • Missing LICENSE file (10 estate repos per audit).
  • Missing SPDX-License-Identifier header (e.g. 007).
  • SPDX-vs-manifest mismatch (e.g. ephapax Cargo.toml = PMPL-1.0-or-later but LICENSE SPDX = MPL-2.0).
  • SPDX-vs-body mismatch (e.g. SPDX=MPL-2.0 but body has only PMPL text and no MPL-2.0 fallback).
  • Proprietary text (e.g. 007's "All Rights Reserved") contradicting a manifest claiming an OSI licence.

What it deliberately accepts

  • A Palimpsest preamble that wraps the canonical MPL-2.0 body (as standards' own LICENSE currently does). Full-file scan; if MPL-2.0 text is present, the body classifies as MPL-2.0 even when introduced by a Palimpsest preamble.

Self-referential class

Initial draft of the check failed on standards itself; refined the body classifier to accept the existing structure. Other estate repos still need their Cargo.toml/Project.toml manifests aligned to MPL-2.0 — that's Item 2 (separate per-repo PR sweep).

Companion

  • standards#195 (proof debt audit)
  • standards#196 (licence debt audit — drives this PR)
  • standards#197 (documentation debt audit)

🤖 Generated with Claude Code

Closes Item 1 of the 2026-05-26 estate tech-debt audit follow-up
(standards#195/#196/#197).

Adds `scripts/check-licence-consistency.sh` — a portable Bash check that
verifies, for any caller repo:

  1. A LICENSE / LICENCE / COPYING file exists at repo root.
  2. The LICENSE file carries an SPDX-License-Identifier header.
  3. If a build manifest (Cargo.toml, package.json, pyproject.toml,
     mix.exs, Project.toml, *.ipkg, *.cabal) declares a licence, it
     matches the SPDX header.
  4. The LICENSE body text classification matches the SPDX header
     (full-file scan — accepts a Palimpsest preamble that wraps a full
     MPL-2.0 body, but rejects SPDX=MPL-2.0 with body=PMPL-only).

Wires the check into `governance-reusable.yml` as a new
`licence-consistency` job — every consumer of the governance bundle
inherits the gate automatically.

The audit (#196) flagged 4 HIGH-mismatch repos (developer-ecosystem,
ephapax, paint-type, and `standards` itself) plus 13 PMPL-1.0-or-later
holdouts. Item 2 of the follow-up will migrate those to MPL-2.0 body
text. Once that lands, the CI check will keep the estate honest.

Self-referential class: `standards` itself initially failed the body-vs-
SPDX check, which is why this PR also tightens the body classifier to
accept a Palimpsest preamble + canonical MPL-2.0 text body (the existing
structure in `LICENSE`). The script still fails on SPDX-vs-manifest
mismatches and on missing SPDX headers — those need Item 2 fixes per-repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 26, 2026 12:47
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 118 issues detected

Severity Count
🔴 Critical 64
🟠 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": "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"
  },
  {
    "reason": "Wildcard CORS -- restrict to specific origins or use env var (1 occurrences, CWE-942)",
    "type": "js_wildcard_cors",
    "file": "/home/runner/work/standards/standards/consent-aware-http/examples/reference-implementations/deno/aibdp_middleware.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 123 issues detected

Severity Count
🔴 Critical 65
🟠 High 47
🟡 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/elixir-ci-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "elixir-ci-reusable.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/elixir-ci-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "elixir-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": "Action hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "rust-ci-reusable.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "rust-ci-reusable.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/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"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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