|
| 1 | +# Governance Artifacts Usage Guide |
| 2 | + |
| 3 | +This folder contains machine-readable assets for enterprise and regulator-facing AI governance workflows. |
| 4 | + |
| 5 | +## Files |
| 6 | + |
| 7 | +- `annex-iv-dossier-schema-v1.json`: JSON Schema for EU AI Act Annex IV dossier payloads. |
| 8 | +- `control-catalog-v1.json`: control inventory with ownership, cadence, severity, and framework mappings. |
| 9 | +- `roadmap-2026-2030.yaml`: phased implementation and milestone plan. |
| 10 | +- `regulator-report-template.xml`: regulator-ready report skeleton. |
| 11 | +- `enterprise-civilizational-agi-asi-blueprint-2026-2030.md`: implementation blueprint narrative. |
| 12 | +- `examples/annex-iv-dossier-example.json`: sample payload conforming to Annex IV schema. |
| 13 | +- `manifest-targets-v1.json`: canonical tracked-file list used by manifest build and validation. |
| 14 | +- `schemas/manifest-targets-schema-v1.json`: JSON Schema for manifest-target metadata. |
| 15 | +- `schemas/artifact-manifest-schema-v1.json`: JSON Schema for produced checksum manifests. |
| 16 | +- `schemas/check-all-result-schema-v1.json`: JSON Schema for unified check JSON output. |
| 17 | +- `artifact-manifest-v1.json`: SHA-256 checksum manifest for tamper-evident packaging. |
| 18 | +- `validate_artifacts.py`: parser + semantic validation utility. |
| 19 | +- `build_manifest.py`: manifest regeneration utility. |
| 20 | +- `requirements-artifacts.txt`: pinned runtime/test dependencies for artifact checks. |
| 21 | +- `Makefile`: convenience targets for local artifact validation workflows. |
| 22 | + |
| 23 | +## Validation |
| 24 | + |
| 25 | +Human-readable mode: |
| 26 | + |
| 27 | +```bash |
| 28 | +python artifacts/validate_artifacts.py |
| 29 | +``` |
| 30 | + |
| 31 | +Machine-readable JSON mode: |
| 32 | + |
| 33 | +```bash |
| 34 | +python artifacts/validate_artifacts.py --json |
| 35 | +``` |
| 36 | + |
| 37 | +Skip checksum validation (for local editing before manifest regeneration): |
| 38 | + |
| 39 | +```bash |
| 40 | +python artifacts/validate_artifacts.py --skip-manifest |
| 41 | +``` |
| 42 | + |
| 43 | +On validation failure with `--json`, output is `{ "status": "error", "error": "..." }` and exit code is `1`. |
| 44 | + |
| 45 | +Exit behavior: all CLI tools return `0` on success and `1` on validation/check failure. |
| 46 | + |
| 47 | +The validator performs: |
| 48 | +1. JSON/YAML/XML parse checks. |
| 49 | +2. Required key checks for schema, roadmap, and controls. |
| 50 | +3. Annex IV sample semantic checks (types, required fields, enum values, date format). |
| 51 | +4. Control mapping cross-reference checks (no unknown control IDs). |
| 52 | +5. Regulator XML required section checks. |
| 53 | +6. Roadmap milestone date-range checks (2026–2030). |
| 54 | +7. Manifest checksum checks for all tracked artifacts. |
| 55 | +8. Manifest coverage checks (no missing or unexpected files). |
| 56 | + |
| 57 | +## Regenerate checksum manifest |
| 58 | + |
| 59 | +```bash |
| 60 | +python artifacts/build_manifest.py |
| 61 | +``` |
| 62 | + |
| 63 | +Supports reproducible builds via `SOURCE_DATE_EPOCH`. |
| 64 | + |
| 65 | +Verify manifest freshness without rewriting: |
| 66 | + |
| 67 | +```bash |
| 68 | +python artifacts/build_manifest.py --check |
| 69 | +python artifacts/build_manifest.py --check --json |
| 70 | +``` |
| 71 | + |
| 72 | +## Install dependencies |
| 73 | + |
| 74 | +```bash |
| 75 | +pip install -r artifacts/requirements-artifacts.txt |
| 76 | +# or: |
| 77 | +cd artifacts && make deps |
| 78 | +# or from repo root: |
| 79 | +make -C artifacts deps |
| 80 | +``` |
| 81 | + |
| 82 | +## Unified check |
| 83 | + |
| 84 | +```bash |
| 85 | +python artifacts/check_all.py |
| 86 | +python artifacts/check_all.py --json |
| 87 | +``` |
| 88 | + |
| 89 | +`check_all --json` includes `schema_version`, `checked_at` (UTC ISO-8601), `manifest_fresh`, `validation_ok`, and `errors`. |
| 90 | + |
| 91 | +## Makefile shortcuts |
| 92 | + |
| 93 | +```bash |
| 94 | +cd artifacts |
| 95 | +make all |
| 96 | +# Optional: override interpreter, e.g. PYTHON=python3.12 make all |
| 97 | +# or from repo root: |
| 98 | +make -C artifacts all |
| 99 | +``` |
| 100 | + |
| 101 | +Other useful shortcuts: |
| 102 | +- `make manifest-check` |
| 103 | +- `make validate` |
| 104 | +- `make check-all` |
| 105 | +- `make test` |
| 106 | + |
| 107 | +## Test |
| 108 | + |
| 109 | +```bash |
| 110 | +python -m pytest -q unit_tests/test_artifacts_validation.py |
| 111 | +# or from artifacts/: make test |
| 112 | +``` |
| 113 | + |
| 114 | + |
| 115 | +CI note: `.github/workflows/artifact-validation.yml` supports `workflow_dispatch` for on-demand re-validation, runs `make -C artifacts all` as the canonical validation entrypoint, and triggers on changes to `artifacts/**`, `unit_tests/**`, `pytest.ini`, and the workflow file itself. |
0 commit comments