Skip to content

Commit 9a67274

Browse files
Add explicit fallback-path test for missing jsonschema
1 parent 4c7a1a3 commit 9a67274

12 files changed

Lines changed: 1012 additions & 24 deletions

artifacts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ check-all:
1515
$(PYTHON) check_all.py --json
1616

1717
test:
18-
cd .. && $(PYTHON) -m pytest -q unit_tests/test_artifacts_validation.py
18+
cd .. && $(PYTHON) -m pytest -q unit_tests/test_artifacts_validation.py unit_tests/test_validate_board_ai_roadmap.py
1919

2020
# `check-all` already runs semantic validation and manifest verification.
2121
all: manifest-check check-all test

artifacts/README.md

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
# Governance Artifacts Usage Guide
22

3-
This folder contains machine-readable assets for enterprise and regulator-facing AI governance workflows.
3+
This folder contains machine-readable assets for enterprise and
4+
regulator-facing AI governance workflows.
45

56
## Files
67

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.
8+
- `annex-iv-dossier-schema-v1.json`: JSON Schema for EU AI Act Annex IV
9+
dossier payloads.
10+
- `control-catalog-v1.json`: control inventory with ownership, cadence,
11+
severity, and framework mappings.
912
- `roadmap-2026-2030.yaml`: phased implementation and milestone plan.
1013
- `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.
14+
- `enterprise-civilizational-agi-asi-blueprint-2026-2030.md`:
15+
implementation blueprint narrative.
16+
- `examples/annex-iv-dossier-example.json`: sample payload conforming to
17+
Annex IV schema.
18+
- `artifact-manifest-v1.json`: SHA-256 checksum manifest for tamper-evident
19+
packaging.
20+
- `data/board-ai-roadmap-2026-2030.json`: board roadmap facts (financials,
21+
domains, jurisdictions, stage gates).
22+
- `schemas/board-ai-roadmap-schema-v1.json`: JSON Schema for board roadmap
23+
artifact.
24+
- `validate_board_ai_roadmap.py`: schema validator for board roadmap artifact.
25+
- `manifest-targets-v1.json`: canonical tracked-file list used by manifest
26+
build and validation.
27+
- `schemas/manifest-targets-schema-v1.json`: JSON Schema for
28+
manifest-target metadata.
29+
- `schemas/artifact-manifest-schema-v1.json`: JSON Schema for produced
30+
checksum manifests.
31+
- `schemas/check-all-result-schema-v1.json`: JSON Schema for unified check
32+
JSON output.
33+
- `validate_artifacts.py`: parser and semantic validation utility.
1934
- `build_manifest.py`: manifest regeneration utility.
20-
- `requirements-artifacts.txt`: pinned runtime/test dependencies for artifact checks.
35+
- `requirements-artifacts.txt`: pinned runtime/test dependencies for artifact
36+
checks.
2137
- `Makefile`: convenience targets for local artifact validation workflows.
2238

2339
## Validation
@@ -34,23 +50,36 @@ Machine-readable JSON mode:
3450
python artifacts/validate_artifacts.py --json
3551
```
3652

53+
Validate board roadmap artifact:
54+
55+
```bash
56+
python artifacts/validate_board_ai_roadmap.py
57+
```
58+
3759
Skip checksum validation (for local editing before manifest regeneration):
3860

3961
```bash
4062
python artifacts/validate_artifacts.py --skip-manifest
4163
```
4264

43-
On validation failure with `--json`, output is `{ "status": "error", "error": "..." }` and exit code is `1`.
65+
On validation failure with `--json`, output is:
4466

45-
Exit behavior: all CLI tools return `0` on success and `1` on validation/check failure.
67+
```json
68+
{"status": "error", "error": "..."}
69+
```
70+
71+
Exit behavior: all CLI tools return `0` on success and `1` on
72+
validation/check failure.
4673

4774
The validator performs:
75+
4876
1. JSON/YAML/XML parse checks.
4977
2. Required key checks for schema, roadmap, and controls.
50-
3. Annex IV sample semantic checks (types, required fields, enum values, date format).
78+
3. Annex IV sample semantic checks (types, required fields, enum values,
79+
date format).
5180
4. Control mapping cross-reference checks (no unknown control IDs).
5281
5. Regulator XML required section checks.
53-
6. Roadmap milestone date-range checks (20262030).
82+
6. Roadmap milestone date-range checks (2026-2030).
5483
7. Manifest checksum checks for all tracked artifacts.
5584
8. Manifest coverage checks (no missing or unexpected files).
5685

@@ -86,7 +115,8 @@ python artifacts/check_all.py
86115
python artifacts/check_all.py --json
87116
```
88117

89-
`check_all --json` includes `schema_version`, `checked_at` (UTC ISO-8601), `manifest_fresh`, `validation_ok`, and `errors`.
118+
`check_all --json` includes `schema_version`, `checked_at`
119+
(UTC ISO-8601), `manifest_fresh`, `validation_ok`, and `errors`.
90120

91121
## Makefile shortcuts
92122

@@ -99,6 +129,7 @@ make -C artifacts all
99129
```
100130

101131
Other useful shortcuts:
132+
102133
- `make manifest-check`
103134
- `make validate`
104135
- `make check-all`
@@ -107,9 +138,13 @@ Other useful shortcuts:
107138
## Test
108139

109140
```bash
110-
python -m pytest -q unit_tests/test_artifacts_validation.py
141+
python -m pytest -q unit_tests/test_artifacts_validation.py \
142+
unit_tests/test_validate_board_ai_roadmap.py
111143
# or from artifacts/: make test
112144
```
113145

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.
146+
CI note: `.github/workflows/artifact-validation.yml` supports
147+
`workflow_dispatch` for on-demand re-validation, runs
148+
`make -C artifacts all` as the canonical validation entrypoint, and triggers
149+
on changes to `artifacts/**`, `unit_tests/**`, `pytest.ini`, and the
150+
workflow file.

artifacts/artifact-manifest-v1.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
"files": {
33
"annex-iv-dossier-schema-v1.json": "191c3442f4b372e8fb400640648841fb4d63aecdfb791d0b1b230a65a384ffe1",
44
"control-catalog-v1.json": "56328ecaed2af4d832e993accb3b85d63d69f93eece4f10de08f0c82f71729d8",
5+
"data/board-ai-roadmap-2026-2030.json": "47ce2ce17cfc41f525b96a33c4969370d6cdbf0af37cb4a452fb5792de66843d",
56
"enterprise-civilizational-agi-asi-blueprint-2026-2030.md": "12684e460b4f33a49d74e66eaa1400aab85e4dd6879e262e06ac932be7c3f3e3",
67
"examples/annex-iv-dossier-example.json": "fd914a07bf2691d9de262907953890ba353b23fe159d07a8b53eee1e6d16b1e2",
78
"regulator-report-template.xml": "62c55a96b60bbc4592f0ad273ee1cca6e25eac6a437fb047dfb08bdf5baeab2d",
8-
"roadmap-2026-2030.yaml": "2297c95faefe22ff03cb9aa7d104be232fa0269b831cb231f5b7f0ab0ed86369"
9+
"roadmap-2026-2030.yaml": "2297c95faefe22ff03cb9aa7d104be232fa0269b831cb231f5b7f0ab0ed86369",
10+
"schemas/board-ai-roadmap-schema-v1.json": "bff5e947f78ec5d4d8bb49e8414e077a5d4b8144962272e9720598ddb63ba4dc",
11+
"validate_board_ai_roadmap.py": "e2f685259f72771dfcbd48609965f98bbadf219934825518833b9e59c3613954"
912
},
10-
"generated_at": "2026-04-26T03:26:37+00:00",
13+
"generated_at": "2026-04-29T05:06:47+00:00",
1114
"version": "1.1"
1215
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"schema_version": "board-ai-roadmap-v1",
3+
"program": {
4+
"name": "G-SIB AI Transformation",
5+
"period": "2026-2030",
6+
"investment_usd_billion": 2.8,
7+
"value_target_usd_billion": 4.2,
8+
"irr_hurdle_percent": 18,
9+
"discount_rate_percent": 10
10+
},
11+
"financials": {
12+
"illustrative_net_cash_flows_usd_billion": {
13+
"2026": -0.8,
14+
"2027": -0.7,
15+
"2028": 0.5,
16+
"2029": 1.05,
17+
"2030": 1.35
18+
},
19+
"npv_usd_billion": 0.63,
20+
"payback_years": 4.2
21+
},
22+
"domains": [
23+
"governance",
24+
"infrastructure",
25+
"risk_controls",
26+
"customer_experience",
27+
"operations",
28+
"trading_markets"
29+
],
30+
"jurisdictions": {
31+
"US": [
32+
"SR 11-7",
33+
"OCC",
34+
"CFPB"
35+
],
36+
"EU": [
37+
"EU AI Act",
38+
"GDPR",
39+
"EBA guidance"
40+
],
41+
"UK": [
42+
"PRA",
43+
"FCA",
44+
"SM&CR",
45+
"Operational resilience"
46+
],
47+
"APAC": [
48+
"MAS FEAT",
49+
"HKMA",
50+
"Cross-border data governance"
51+
]
52+
},
53+
"stage_gates": [
54+
{
55+
"gate": "Gate 1",
56+
"target": "2026-Q2",
57+
"focus": "Foundation readiness"
58+
},
59+
{
60+
"gate": "Gate 2",
61+
"target": "2027-Q2",
62+
"focus": "Controlled customer deployment"
63+
},
64+
{
65+
"gate": "Gate 3",
66+
"target": "2028-Q4",
67+
"focus": "Industrialized compliance"
68+
},
69+
{
70+
"gate": "Gate 4",
71+
"target": "2029-Q4",
72+
"focus": "High-impact scale"
73+
}
74+
]
75+
}

artifacts/manifest-targets-v1.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"roadmap-2026-2030.yaml",
77
"regulator-report-template.xml",
88
"enterprise-civilizational-agi-asi-blueprint-2026-2030.md",
9-
"examples/annex-iv-dossier-example.json"
9+
"examples/annex-iv-dossier-example.json",
10+
"data/board-ai-roadmap-2026-2030.json",
11+
"schemas/board-ai-roadmap-schema-v1.json",
12+
"validate_board_ai_roadmap.py"
1013
]
1114
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pyyaml==6.0.2
22
pytest==9.0.3
3+
jsonschema==4.25.1
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://example.com/schemas/board-ai-roadmap-schema-v1.json",
4+
"title": "Board AI Roadmap Schema v1",
5+
"type": "object",
6+
"required": [
7+
"schema_version",
8+
"program",
9+
"financials",
10+
"domains",
11+
"jurisdictions",
12+
"stage_gates"
13+
],
14+
"properties": {
15+
"schema_version": {
16+
"type": "string",
17+
"const": "board-ai-roadmap-v1"
18+
},
19+
"program": {
20+
"type": "object",
21+
"required": [
22+
"name",
23+
"period",
24+
"investment_usd_billion",
25+
"value_target_usd_billion",
26+
"irr_hurdle_percent",
27+
"discount_rate_percent"
28+
],
29+
"properties": {
30+
"name": {"type": "string", "minLength": 1},
31+
"period": {"type": "string", "pattern": "^\\d{4}-\\d{4}$"},
32+
"investment_usd_billion": {"type": "number", "minimum": 0},
33+
"value_target_usd_billion": {"type": "number", "minimum": 0},
34+
"irr_hurdle_percent": {"type": "number", "minimum": 0},
35+
"discount_rate_percent": {"type": "number", "minimum": 0}
36+
},
37+
"additionalProperties": false
38+
},
39+
"financials": {
40+
"type": "object",
41+
"required": [
42+
"illustrative_net_cash_flows_usd_billion",
43+
"npv_usd_billion",
44+
"payback_years"
45+
],
46+
"properties": {
47+
"illustrative_net_cash_flows_usd_billion": {
48+
"type": "object",
49+
"required": ["2026", "2027", "2028", "2029", "2030"],
50+
"additionalProperties": false,
51+
"properties": {
52+
"2026": {"type": "number"},
53+
"2027": {"type": "number"},
54+
"2028": {"type": "number"},
55+
"2029": {"type": "number"},
56+
"2030": {"type": "number"}
57+
}
58+
},
59+
"npv_usd_billion": {"type": "number"},
60+
"payback_years": {"type": "number", "minimum": 0}
61+
},
62+
"additionalProperties": false
63+
},
64+
"domains": {
65+
"type": "array",
66+
"minItems": 1,
67+
"items": {"type": "string", "minLength": 1}
68+
},
69+
"jurisdictions": {
70+
"type": "object",
71+
"required": ["US", "EU", "UK", "APAC"],
72+
"additionalProperties": false,
73+
"properties": {
74+
"US": {"$ref": "#/$defs/nonEmptyStringArray"},
75+
"EU": {"$ref": "#/$defs/nonEmptyStringArray"},
76+
"UK": {"$ref": "#/$defs/nonEmptyStringArray"},
77+
"APAC": {"$ref": "#/$defs/nonEmptyStringArray"}
78+
}
79+
},
80+
"stage_gates": {
81+
"type": "array",
82+
"minItems": 1,
83+
"items": {
84+
"type": "object",
85+
"required": ["gate", "target", "focus"],
86+
"properties": {
87+
"gate": {"type": "string", "minLength": 1},
88+
"target": {"type": "string", "pattern": "^\\d{4}-Q[1-4]$"},
89+
"focus": {"type": "string", "minLength": 1}
90+
},
91+
"additionalProperties": false
92+
}
93+
}
94+
},
95+
"$defs": {
96+
"nonEmptyStringArray": {
97+
"type": "array",
98+
"minItems": 1,
99+
"items": {"type": "string", "minLength": 1}
100+
}
101+
},
102+
"additionalProperties": false
103+
}

artifacts/validate_artifacts.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525

2626
if __package__ in (None, ""):
2727
from manifest_utils import load_manifest_targets_from_dir, sha256_file
28+
from validate_board_ai_roadmap import validate as validate_board_ai_roadmap
2829
else:
2930
from .manifest_utils import load_manifest_targets_from_dir, sha256_file
31+
from .validate_board_ai_roadmap import validate as validate_board_ai_roadmap
3032
REQUIRED_REPORT_SECTION_IDS = {
3133
"scope",
3234
"obligations",
@@ -209,13 +211,18 @@ def run_validation(include_manifest: bool = True) -> dict:
209211
validate_control_catalog(controls)
210212
validate_roadmap(roadmap)
211213
validate_report_template(ARTIFACTS_DIR / "regulator-report-template.xml")
214+
validate_board_ai_roadmap(
215+
ARTIFACTS_DIR / "schemas" / "board-ai-roadmap-schema-v1.json",
216+
ARTIFACTS_DIR / "data" / "board-ai-roadmap-2026-2030.json",
217+
)
212218

213219
checks = {
214220
"schema_documents": "pass",
215221
"annex_iv_example": "pass",
216222
"control_catalog": "pass",
217223
"roadmap": "pass",
218224
"report_template": "pass",
225+
"board_ai_roadmap": "pass",
219226
"manifest": "skipped",
220227
}
221228

0 commit comments

Comments
 (0)