Skip to content

Commit 4c7a1a3

Browse files
Merge pull request #68 from OneFineStarstuff/codex/develop-comprehensive-ai-governance-reference
Add enterprise AI governance artifact package, tooling, CI workflow, and tests
2 parents 2c3c00a + 5caade6 commit 4c7a1a3

24 files changed

Lines changed: 2565 additions & 0 deletions
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Governance Artifact Validation
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- docs/artifacts/**
8+
- docs/reports/INSTITUTIONAL_AGI_ASI_MASTER_REFERENCE_2026_2030.md
9+
- scripts/validate_governance_artifact.py
10+
- scripts/export_governance_artifact_json.py
11+
- scripts/summarize_governance_test_results.py
12+
- scripts/generate_governance_manifest.py
13+
- scripts/governance_artifact_constants.py
14+
- test_validate_governance_artifact.py
15+
- test_export_governance_artifact_json.py
16+
- test_summarize_governance_test_results.py
17+
- test_governance_artifact_integrity.py
18+
- test_generate_governance_manifest.py
19+
- requirements-dev.txt
20+
- Makefile
21+
- .github/workflows/governance-artifact-validation.yml
22+
push:
23+
branches: ["main"]
24+
paths:
25+
- docs/artifacts/**
26+
- docs/reports/INSTITUTIONAL_AGI_ASI_MASTER_REFERENCE_2026_2030.md
27+
- scripts/validate_governance_artifact.py
28+
- scripts/export_governance_artifact_json.py
29+
- scripts/summarize_governance_test_results.py
30+
- scripts/generate_governance_manifest.py
31+
- scripts/governance_artifact_constants.py
32+
- test_validate_governance_artifact.py
33+
- test_export_governance_artifact_json.py
34+
- test_summarize_governance_test_results.py
35+
- test_governance_artifact_integrity.py
36+
- test_generate_governance_manifest.py
37+
- requirements-dev.txt
38+
- Makefile
39+
- .github/workflows/governance-artifact-validation.yml
40+
41+
permissions:
42+
contents: read
43+
44+
concurrency:
45+
group: governance-artifact-${{ github.ref }}
46+
cancel-in-progress: true
47+
48+
jobs:
49+
validate-governance-artifacts:
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 10
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Setup Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: '3.11'
60+
cache: 'pip'
61+
cache-dependency-path: 'requirements-dev.txt'
62+
63+
- name: Install dependencies
64+
run: pip install -r requirements-dev.txt
65+
66+
- name: Run governance verification pipeline
67+
run: make verify-governance
68+
69+
- name: Publish test summary
70+
if: always()
71+
run: |
72+
if [ -f artifacts/test-results/governance-tests.xml ]; then
73+
SUMMARY=$(make --no-print-directory summarize-governance-tests)
74+
echo "$SUMMARY" | tee -a "$GITHUB_STEP_SUMMARY"
75+
else
76+
echo "Governance tests summary unavailable: JUnit report not found." | tee -a "$GITHUB_STEP_SUMMARY"
77+
fi
78+
79+
- name: Upload governance test results
80+
if: always() && hashFiles('artifacts/test-results/governance-tests.xml') != ''
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: governance-test-results
84+
path: artifacts/test-results/governance-tests.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ Thumbs.db
3737
next-env.d.ts
3838
__pycache__/
3939
*.patch
40+
41+
# Governance test artifacts
42+
artifacts/test-results/

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## Version 1.1.0
4+
- Added enterprise AI governance artifact package under `docs/artifacts/` with YAML source, canonical JSON export, JSON Schema contract, and example templates.
5+
- Added governance tooling scripts for export, validation, and JUnit result summarization:
6+
- `scripts/export_governance_artifact_json.py`
7+
- `scripts/validate_governance_artifact.py`
8+
- `scripts/summarize_governance_test_results.py`
9+
- Added Makefile-driven governance checks (`build-governance-json`, `check-governance-json-clean`, `validate-governance`, `test-governance-ci`, `summarize-governance-tests`).
10+
- Added governance CI workflow (`.github/workflows/governance-artifact-validation.yml`) with summary publishing and test artifact upload.
11+
- Added pytest coverage for exporter/validator/summarizer and pinned governance dev dependencies in `requirements-dev.txt`.
12+
313
## Version 1.0.1
414
- Integrated NLP, CV, and Speech Processor modules.
515
- Added OAuth2 authentication.

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
.PHONY: build-governance-json check-governance-json-clean check-governance-manifest-clean validate-governance test-governance test-governance-ci summarize-governance-tests build-governance-manifest verify-governance
2+
3+
build-governance-json:
4+
python scripts/export_governance_artifact_json.py --root .
5+
6+
check-governance-json-clean:
7+
python scripts/export_governance_artifact_json.py --root . --verify
8+
9+
validate-governance:
10+
python scripts/validate_governance_artifact.py --root .
11+
12+
test-governance:
13+
pytest -q test_validate_governance_artifact.py test_export_governance_artifact_json.py test_summarize_governance_test_results.py test_governance_artifact_integrity.py test_generate_governance_manifest.py
14+
15+
test-governance-ci:
16+
mkdir -p artifacts/test-results
17+
pytest -q test_validate_governance_artifact.py test_export_governance_artifact_json.py test_summarize_governance_test_results.py test_governance_artifact_integrity.py test_generate_governance_manifest.py --junitxml=artifacts/test-results/governance-tests.xml
18+
19+
summarize-governance-tests:
20+
python scripts/summarize_governance_test_results.py --report artifacts/test-results/governance-tests.xml
21+
22+
build-governance-manifest:
23+
python scripts/generate_governance_manifest.py --root .
24+
25+
check-governance-manifest-clean:
26+
python scripts/generate_governance_manifest.py --root . --verify
27+
28+
verify-governance:
29+
$(MAKE) check-governance-json-clean
30+
$(MAKE) check-governance-manifest-clean
31+
$(MAKE) validate-governance
32+
$(MAKE) test-governance-ci
33+
$(MAKE) summarize-governance-tests
134
.DEFAULT_GOAL := check-gsifi-governance
235

336
.PHONY: validate-gsifi-governance validate-gsifi-governance-module test-gsifi-governance lint-gsifi-governance check-gsifi-governance

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,68 @@ Feel free to open issues or submit pull requests!
6161
## License
6262

6363
This project is licensed under the MIT License - see the LICENSE file for details.
64+
65+
## Governance Artifact Tooling
66+
67+
This repository includes a governance artifact package under `docs/artifacts/` with:
68+
- YAML source-of-truth artifact
69+
- canonical JSON export
70+
- JSON Schema contract
71+
- sample CI/CD policy and regulator report templates
72+
73+
### Local governance checks
74+
75+
```bash
76+
pip install -r requirements-dev.txt
77+
# non-mutating freshness checks
78+
make check-governance-json-clean
79+
make check-governance-manifest-clean
80+
make validate-governance
81+
make test-governance
82+
# CI-style run with JUnit output
83+
make test-governance-ci
84+
make summarize-governance-tests
85+
# one-shot full pipeline
86+
make verify-governance
87+
```
88+
89+
When generated files are intentionally updated, regenerate before commit:
90+
91+
```bash
92+
make build-governance-json
93+
make build-governance-manifest
94+
```
95+
96+
### Notes
97+
- `make check-governance-json-clean` fails if committed JSON is stale (without rewriting files).
98+
- `make check-governance-manifest-clean` fails if committed `docs/artifacts/manifest.json` is stale (without rewriting files).
99+
- `make validate-governance` enforces schema, parity, and template checks.
100+
- `make test-governance` includes an integrity test against the repository artifact files.
101+
- CI runs the same targets in `.github/workflows/governance-artifact-validation.yml` and uploads JUnit results and posts a summary.
102+
103+
104+
### Advanced path overrides
105+
106+
Use custom paths when artifacts are relocated (all paths are relative to `--root`):
107+
108+
```bash
109+
python scripts/export_governance_artifact_json.py --root . \
110+
--yaml docs/artifacts/custom.yaml \
111+
--json docs/artifacts/custom.json
112+
113+
python scripts/validate_governance_artifact.py --root . \
114+
--yaml docs/artifacts/custom.yaml \
115+
--json docs/artifacts/custom.json \
116+
--schema docs/artifacts/schemas/enterprise_ai_governance_artifact.schema.json \
117+
--cicd docs/artifacts/examples/cicd_policy_gate_manifest.yaml \
118+
--report docs/artifacts/examples/regulator_report_template.xml
119+
```
120+
121+
122+
### Tool version flags
123+
124+
```bash
125+
python scripts/export_governance_artifact_json.py --version
126+
python scripts/validate_governance_artifact.py --version
127+
python scripts/summarize_governance_test_results.py --version
128+
```

docs/artifacts/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Enterprise AI Governance Artifact Package
2+
3+
This folder contains the machine-readable governance package for the 2026–2030 program.
4+
5+
## Contents
6+
7+
- `enterprise_ai_governance_machine_readable_2026_2030.yaml` — source-of-truth artifact.
8+
- `enterprise_ai_governance_machine_readable_2026_2030.json` — canonical exported JSON.
9+
- `schemas/enterprise_ai_governance_artifact.schema.json` — JSON Schema contract.
10+
- `examples/cicd_policy_gate_manifest.yaml` — CI/CD gate manifest example.
11+
- `examples/regulator_report_template.xml` — regulator report template (`title/abstract/content`).
12+
- `manifest.json` — SHA-256 manifest for package integrity tracking.
13+
14+
## Validation workflow
15+
16+
From repository root:
17+
18+
```bash
19+
pip install -r requirements-dev.txt
20+
# non-mutating freshness checks
21+
make check-governance-json-clean
22+
make check-governance-manifest-clean
23+
make validate-governance
24+
make test-governance
25+
# one-shot full pipeline
26+
make verify-governance
27+
```
28+
29+
`check-governance-json-clean` and `check-governance-manifest-clean` are non-mutating
30+
verification gates that fail when generated artifacts need regeneration.
31+
32+
When intentionally updating generated artifacts, run:
33+
34+
```bash
35+
make build-governance-json
36+
make build-governance-manifest
37+
```
38+
39+
CI uses the same sequence in `.github/workflows/governance-artifact-validation.yml`.
40+
41+
## Custom path usage
42+
43+
Both exporter and validator support path overrides relative to `--root`:
44+
45+
```bash
46+
python scripts/export_governance_artifact_json.py --root . --yaml docs/artifacts/custom.yaml --json docs/artifacts/custom.json
47+
python scripts/validate_governance_artifact.py --root . --yaml docs/artifacts/custom.yaml --json docs/artifacts/custom.json --schema docs/artifacts/schemas/enterprise_ai_governance_artifact.schema.json --cicd docs/artifacts/examples/cicd_policy_gate_manifest.yaml --report docs/artifacts/examples/regulator_report_template.xml
48+
```
49+
50+
51+
## Integrity test
52+
53+
Repository-level artifact integrity is enforced by `test_governance_artifact_integrity.py`, which validates committed YAML/JSON parity and schema conformance against the files in this folder.

0 commit comments

Comments
 (0)