Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/governance-artifacts-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: governance-artifacts-ci

on:
push:
paths:
- 'docs/schemas/**'
- 'docs/reports/ENTERPRISE_CIVILIZATIONAL_AGI_ASI_BLUEPRINT_2026_2030.md'
- '.github/workflows/governance-artifacts-ci.yml'
- 'Makefile'
- '.yamllint'
pull_request:
paths:
- 'docs/schemas/**'
- 'docs/reports/ENTERPRISE_CIVILIZATIONAL_AGI_ASI_BLUEPRINT_2026_2030.md'
- '.github/workflows/governance-artifacts-ci.yml'
- 'Makefile'
- '.yamllint'

jobs:
validate-governance-artifacts:
runs-on: ubuntu-latest
permissions:

Check warning on line 22 in .github/workflows/governance-artifacts-ci.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/governance-artifacts-ci.yml#L22

Ensure top-level permissions are not set to write-all
contents: read
env:
PYTHONUNBUFFERED: '1'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: docs/schemas/requirements-governance.txt

- name: Install Python deps (pinned)
run: |
python -m pip install --upgrade pip
pip install -r docs/schemas/requirements-governance.txt

- name: Validate governance YAML/JSON artifacts
run: make governance-validate

- name: Setup OPA (pinned)
uses: open-policy-agent/setup-opa@v2
with:
version: v1.15.2

- name: Rego format and tests
run: make governance-policy-test

- name: Validator and evidence bundle unit tests
run: make governance-validator-test

- name: Build evidence manifest
run: make governance-evidence-manifest
Comment thread
OneFineStarstuff marked this conversation as resolved.

- name: Verify evidence manifest integrity
run: make governance-evidence-verify

- name: Validate evidence manifest schema
run: make governance-evidence-schema

- name: Generate machine-readable validation report
run: make governance-report

- name: Validate run report schema
run: make governance-report-schema

- name: Check generated artifacts are up to date
run: make governance-check-generated

- name: Upload validation report
uses: actions/upload-artifact@v4
with:
name: governance-validation-report
path: docs/schemas/validation_run_report.json
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/adrienverge/yamllint
rev: v1.37.1
hooks:
- id: yamllint
args: ["-c", ".yamllint", "docs/schemas/agi_asi_governance_profile_2026_2030.yaml"]
- repo: local
hooks:
- id: governance-validate
name: governance-validate
entry: make governance-validate
language: system
pass_filenames: false
- id: governance-policy-test
name: governance-policy-test
entry: make governance-policy-test
language: system
pass_filenames: false
- id: governance-validator-test
name: governance-validator-test
entry: make governance-validator-test
language: system
pass_filenames: false
- id: governance-evidence-checks
name: governance-evidence-checks
entry: make governance-evidence-manifest && make governance-evidence-verify && make governance-evidence-schema && make governance-report-schema && make governance-check-generated
language: system
pass_filenames: false
5 changes: 5 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends: default
rules:
line-length: disable
document-start: disable
truthy: disable
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.PHONY: governance-setup governance-deps-check governance-lint governance-validate governance-artifact-inventory governance-policy-test governance-validator-test governance-evidence-manifest governance-evidence-verify governance-evidence-schema governance-report governance-report-schema governance-check-generated

governance-setup:
python -m pip install -r docs/schemas/requirements-governance.txt

governance-deps-check:
python docs/schemas/check_dependencies.py

governance-lint:
yamllint -c .yamllint docs/schemas/agi_asi_governance_profile_2026_2030.yaml
python -m json.tool docs/schemas/compliance_control_mapping.json > /dev/null

governance-validate: governance-deps-check governance-lint
python docs/schemas/governance_artifacts_validation.py

governance-artifact-inventory:
python docs/schemas/validate_artifact_inventory.py

governance-policy-test:
opa fmt --fail docs/schemas/policies/ai_governance.rego
opa fmt --fail docs/schemas/policies/ai_governance_test.rego
opa test docs/schemas/policies/ai_governance.rego docs/schemas/policies/ai_governance_test.rego

governance-validator-test: governance-deps-check
python docs/schemas/test_governance_artifacts_validation.py -v
python docs/schemas/test_generate_evidence_bundle.py -v
python docs/schemas/test_verify_evidence_bundle.py -v
python docs/schemas/test_validate_evidence_manifest.py -v
python docs/schemas/test_validate_run_report.py -v
python docs/schemas/test_run_governance_checks.py -v
python docs/schemas/test_validate_artifact_inventory.py -v
python docs/schemas/test_check_generated_artifacts.py -v
python docs/schemas/test_check_dependencies.py -v
python docs/schemas/test_validation_deps.py -v

governance-evidence-manifest:
python docs/schemas/generate_evidence_bundle.py

governance-evidence-verify:
python docs/schemas/verify_evidence_bundle.py

governance-evidence-schema: governance-deps-check
python docs/schemas/validate_evidence_manifest.py

governance-report:
python docs/schemas/run_governance_checks.py --max-tail-chars 1200

governance-report-schema: governance-deps-check
python docs/schemas/validate_run_report.py

governance-check-generated:
python docs/schemas/check_generated_artifacts.py
Loading
Loading