-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
254 lines (177 loc) · 11.9 KB
/
Copy pathMakefile
File metadata and controls
254 lines (177 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
.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
build-governance-json:
python scripts/export_governance_artifact_json.py --root .
check-governance-json-clean:
python scripts/export_governance_artifact_json.py --root . --verify
validate-governance:
python scripts/validate_governance_artifact.py --root .
test-governance:
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
test-governance-ci:
mkdir -p artifacts/test-results
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
summarize-governance-tests:
python scripts/summarize_governance_test_results.py --report artifacts/test-results/governance-tests.xml
build-governance-manifest:
python scripts/generate_governance_manifest.py --root .
check-governance-manifest-clean:
python scripts/generate_governance_manifest.py --root . --verify
verify-governance:
$(MAKE) check-governance-json-clean
$(MAKE) check-governance-manifest-clean
$(MAKE) validate-governance
$(MAKE) test-governance-ci
$(MAKE) summarize-governance-tests
.DEFAULT_GOAL := check-gsifi-governance
.PHONY: validate-gsifi-governance validate-gsifi-governance-module test-gsifi-governance lint-gsifi-governance check-gsifi-governance
validate-gsifi-governance:
python scripts/validate_gsifi_governance_assets.py
validate-gsifi-governance-module:
python -m scripts.validate_gsifi_governance_assets
test-gsifi-governance:
python -m py_compile scripts/validate_gsifi_governance_assets.py tests/conftest.py tests/test_validate_gsifi_governance_assets.py tests/test_validate_gsifi_governance_cli.py
pytest -q tests
lint-gsifi-governance:
npx --yes markdownlint-cli@0.39.0 --config docs/reports/.markdownlint.json docs/reports/GSIFI_AGI_ASI_GOVERNANCE_BLUEPRINT_2026_2030.md docs/reports/GSIFI_GOVERNANCE_ARTIFACTS_RUNBOOK.md
check-gsifi-governance: validate-gsifi-governance validate-gsifi-governance-module test-gsifi-governance lint-gsifi-governance
.PHONY: governance-test governance-reports-validate governance-reports-validate-json governance-reports-validate-json-check governance-check
.PHONY: governance-test governance-reports-validate governance-validate-json governance-validate-json-check governance-check
governance-test:
python3 -m unittest discover tool_tests
governance-reports-validate:
python3 tools/validate_governance_reports.py
governance-reports-validate-json:
python3 tools/validate_governance_reports.py --json
governance-reports-validate-json-check:
python3 tools/validate_governance_reports.py --json > /tmp/governance_validation.json
python3 -c 'import json; p=json.load(open("/tmp/governance_validation.json", "r", encoding="utf-8")); assert p.get("status")=="passed", f"Validator JSON status not passed: {p}"; print("Validator JSON status is passed.")'
governance-check: governance-test governance-reports-validate governance-reports-validate-json-check
governance-check: governance-test governance-validate governance-validate-json-check
.PHONY: governance-setup governance-deps-check governance-lint governance-schema-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-check: governance-test governance-reports-validate governance-validate-json-check
.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-schema-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
PYTHON ?= python3
.PHONY: gov-manifest gov-manifest-check gov-validate gov-validate-json gov-lint gov-dashboard-check gov-selftest gov-selftest-discover gov-suite gov-suite-json gov-suite-report gov-suite-ci gov-clean
gov-manifest:
$(PYTHON) governance_blueprint/validation/generate_artifact_manifest.py
gov-manifest-check:
$(PYTHON) governance_blueprint/validation/generate_artifact_manifest.py --check
gov-validate:
$(PYTHON) governance_blueprint/validation/validate_artifacts.py
gov-validate-json:
$(PYTHON) governance_blueprint/validation/validate_artifacts.py --json
gov-lint:
$(PYTHON) governance_blueprint/validation/lint_python_sources.py
gov-dashboard-check:
$(PYTHON) governance_blueprint/validation/validate_dashboard_links.py
gov-selftest:
$(PYTHON) governance_blueprint/validation/selftest_validate_artifacts.py
$(PYTHON) governance_blueprint/validation/selftest_generate_artifact_manifest.py
$(PYTHON) governance_blueprint/validation/selftest_run_validation_suite.py
$(PYTHON) -m unittest discover governance_blueprint/validation -p 'selftest_*.py'
gov-selftest-discover:
$(PYTHON) -m unittest discover -s governance_blueprint/validation -p "selftest_*.py"
gov-suite:
$(PYTHON) governance_blueprint/validation/run_validation_suite.py
gov-suite-json:
$(PYTHON) governance_blueprint/validation/run_validation_suite.py --json-report governance-artifact-validation-report.json
@echo "Wrote governance-artifact-validation-report.json"
gov-suite-report:
$(PYTHON) governance_blueprint/validation/run_validation_suite.py --json-report governance-artifact-validation-report.json --suite-report governance-validation-suite-report.json
@echo "Wrote governance-artifact-validation-report.json and governance-validation-suite-report.json"
gov-suite-ci:
$(PYTHON) governance_blueprint/validation/run_validation_suite.py --quiet --json-report governance-artifact-validation-report.json --suite-report governance-validation-suite-report.json
@echo "Wrote governance-artifact-validation-report.json and governance-validation-suite-report.json (quiet mode)"
gov-clean:
$(PYTHON) -c "from pathlib import Path; import shutil; report=Path('governance-artifact-validation-report.json'); suite=Path('governance-validation-suite-report.json'); report.exists() and report.unlink(); suite.exists() and suite.unlink(); [shutil.rmtree(p) for p in Path('governance_blueprint/validation').rglob('__pycache__') if p.is_dir()]"
.PHONY: daily-gsifi-governance-validate daily-gsifi-governance-test daily-gsifi-governance-ci daily-gsifi-governance-checks daily-gsifi-governance-evidence daily-gsifi-governance-report daily-gsifi-governance-pycompile
daily-gsifi-governance-validate:
python tools/validate_governance_artifacts.py
daily-gsifi-governance-test:
pytest -q test_governance_snippets.py test_validate_governance_artifacts.py test_run_gsifi_governance_checks.py test_generate_gsifi_governance_report.py test_daily_gsifi_governance_workflow.py
daily-gsifi-governance-ci:
mkdir -p artifacts/test-results
python tools/run_gsifi_governance_checks.py --junitxml=artifacts/test-results/gsifi-governance-tests.xml --emit-json=artifacts/test-results/gsifi-governance-run-summary.json
daily-gsifi-governance-checks:
python tools/run_gsifi_governance_checks.py
daily-gsifi-governance-evidence:
mkdir -p artifacts/test-results
python tools/run_gsifi_governance_checks.py --junitxml=artifacts/test-results/gsifi-governance-tests.xml --emit-json=artifacts/test-results/gsifi-governance-run-summary.json
daily-gsifi-governance-report:
python tools/generate_gsifi_governance_report.py
daily-gsifi-governance-pycompile:
python -m py_compile tools/validate_governance_artifacts.py tools/run_gsifi_governance_checks.py tools/generate_gsifi_governance_report.py test_governance_snippets.py test_validate_governance_artifacts.py test_run_gsifi_governance_checks.py test_generate_gsifi_governance_report.py test_daily_gsifi_governance_workflow.py
.PHONY: governance-docs-lint governance-docs-test governance-docs-check
governance-docs-lint:
bash scripts/lint_governance_docs.sh
bash scripts/lint_governance_docs.sh all
governance-docs-test:
bash tests/test_lint_governance_docs.sh
governance-docs-check: governance-docs-lint governance-docs-test
.PHONY: gstack-setup gstack-validate gstack-validate-strict gstack-validate-json gstack-validate-json-check gstack-test gstack-check gstack-ci gstack-clean
gstack-setup:
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
gstack-validate:
python3 gstack_artifacts/validate_artifacts.py --root gstack_artifacts
gstack-validate-strict:
python3 gstack_artifacts/validate_artifacts.py --root gstack_artifacts --strict-schema
gstack-validate-json:
mkdir -p artifacts/validation
python3 gstack_artifacts/validate_artifacts.py --root gstack_artifacts --json --report-path artifacts/validation/gstack-validation.json
gstack-validate-json-check: gstack-validate-json
python3 -c "import json; p=json.load(open('artifacts/validation/gstack-validation.json')); assert p.get('status')=='passed', p; print('gstack-validation.json status=passed')"
gstack-test:
PYTHONPATH=. python3 -m unittest tests.test_validate_artifacts
gstack-check: gstack-test gstack-validate gstack-validate-json-check
gstack-test-ci:
mkdir -p artifacts/test-results
bash -lc "set -o pipefail; PYTHONPATH=. python3 -m unittest tests.test_validate_artifacts | tee artifacts/test-results/gstack-unittest.log"
gstack-ci: gstack-setup gstack-test-ci gstack-validate-strict gstack-validate-json-check
gstack-clean:
rm -f artifacts/validation/gstack-validation.json artifacts/test-results/gstack-unittest.log
.PHONY: validate-regulator-blueprint-artifacts test-regulator-blueprint-artifacts check-regulator-blueprint-artifacts
validate-regulator-blueprint-artifacts:
python scripts/validate_regulator_blueprint_artifacts.py
test-regulator-blueprint-artifacts:
pytest -q tests/test_validate_regulator_blueprint_artifacts.py tests/test_run_blueprint_artifact_checks.py
check-regulator-blueprint-artifacts:
bash scripts/run_blueprint_artifact_checks.sh --skip-install