Skip to content

Add governance artifact schemas, validator, samples, tests, and CI workflow#101

Merged
OneFineStarstuff merged 2 commits into
mainfrom
codex/develop-agi-governance-strategy-for-g-sifis
Jun 1, 2026
Merged

Add governance artifact schemas, validator, samples, tests, and CI workflow#101
OneFineStarstuff merged 2 commits into
mainfrom
codex/develop-agi-governance-strategy-for-g-sifis

Conversation

@OneFineStarstuff

@OneFineStarstuff OneFineStarstuff commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a machine-readable governance artifact standard and automated validation pipeline so BBOM and ARRE artifacts can be schema- and semantics-checked before deployment.
  • Supply example artifacts and a reference blueprint to accelerate adoption and regulator-facing evidence production.
  • Integrate validation into CI so repository contributions are automatically checked for schema/semantic regressions.

Description

  • Add a JSON Schema for BBOM (schemas/bbom.schema.json) and ARRE records (schemas/arre_record.schema.json) and example artifacts (artifacts/bbom/sample_tier0_fraud.json, examples/arre/sample_t0_sanctions_002.json).
  • Implement a validator CLI at tools/validate_ai_governance_artifacts.py that performs schema validation, semantic checks (e.g., threshold violations, period inversion, duplicate evidence hashes), produces a JSON report, and returns meaningful exit codes.
  • Add unit tests covering schema validation, semantic checks, malformed JSON handling, custom directory args, and failure summaries in tests/test_governance_validator.py.
  • Add CI workflow /.github/workflows/governance-artifacts.yml that installs dependencies, runs the validator and pytest, and uploads the generated .reports/governance-validation.json artifact, plus a README GOVERNANCE_ARTIFACTS_README.md with quickstart instructions.

Testing

  • Unit tests were added and exercised via pytest -q tests/test_governance_validator.py, covering schema errors, semantic rule violations, malformed JSON resilience, duplicate evidence detection, and schema-load failure handling, and they passed in CI.
  • The CI job runs python -m pip install -r requirements-governance.txt pytest and python tools/validate_ai_governance_artifacts.py --report-file .reports/governance-validation.json as part of validation and uploads the report as the governance-validation-report artifact.
  • The validator CLI is exercised by tests that call main() and run_validation() to assert correct exit codes (0 for pass, 2 for validation failures) and report contents.

Codex Task

Summary by Sourcery

Introduce machine-readable AI governance artifacts with a validator CLI, tests, documentation, and CI integration for BBOM and ARRE evidence records.

New Features:

  • Add JSON Schemas and sample artifacts for BBOM and ARRE governance records to standardize AI control evidence.
  • Provide a Python-based validator CLI that enforces schema compliance and semantic rules for BBOM and ARRE artifacts and emits a structured JSON report.

Enhancements:

  • Document an implementation-grade AGI/ASI governance blueprint and a governance artifacts quickstart to guide G-SIFI adoption and integration.
  • Expose a reusable tools package namespace for governance-related automation utilities.

CI:

  • Add a GitHub Actions workflow that installs governance dependencies, runs the validator and its tests, and uploads the validation report as a build artifact.

Documentation:

  • Add an AGI/ASI governance blueprint and governance artifacts README describing the control model, schemas, validator usage, and CI recommendations.

Tests:

  • Introduce unit tests for the governance validator covering happy paths, schema failures, semantic violations, malformed JSON, schema load failures, and exit-code behavior.

Chores:

  • Add governance-specific dependency specification for the validator tooling.

Summary by CodeRabbit

  • New Features

    • Added automated governance artifact validation in CI/CD pipeline
    • Introduced formal schema definitions for behavioral bills of materials and control records
    • New validation tool with semantic checks for governance artifacts
  • Documentation

    • Added comprehensive governance blueprint (2026–2030) with implementation guidelines, control frameworks, and regulatory templates
    • Added quickstart guide for governance artifacts and validation
  • Tests

    • Added comprehensive test suite for artifact validation
  • Chores

    • Added jsonschema dependency

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-one-fine-starstuff-github-io Ready Ready Preview, Comment, Open in v0 Jun 1, 2026 9:26am

@semanticdiff-com

semanticdiff-com Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/governance-artifacts.yml  0% smaller
  AGI_ASI_GSIFI_Blueprint_2026_2030.md Unsupported file format
  GOVERNANCE_ARTIFACTS_README.md Unsupported file format
  artifacts/bbom/sample_tier0_fraud.json  0% smaller
  examples/arre/sample_t0_sanctions_002.json  0% smaller
  requirements-governance.txt Unsupported file format
  schemas/arre_record.schema.json  0% smaller
  schemas/bbom.schema.json  0% smaller
  tests/test_governance_validator.py  0% smaller
  tools/__init__.py  0% smaller
  tools/validate_ai_governance_artifacts.py  0% smaller

@gitnotebooks

gitnotebooks Bot commented Jun 1, 2026

Copy link
Copy Markdown

@code-genius-code-coverage

Copy link
Copy Markdown

The files' contents are under analysis for test generation.

@sourcery-ai

sourcery-ai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces JSON Schemas and sample artifacts for BBOM and ARRE governance records, a Python-based validator CLI with schema and semantic checks plus JSON reporting, unit tests around validator behavior, CI workflow wiring validation into PRs, and documentation for running the validator locally and in CI.

Flow diagram for governance artifact validator CLI

flowchart LR
  A[Start main] --> B[parse_args]
  B --> C[run_validation]
  C --> D[load_json bbom.schema.json]
  C --> E[load_json arre_record.schema.json]
  D --> F{schema load ok?}
  E --> F
  F -- no --> G[Set fatal_error schema_load_failure in summary]
  G --> H[Return errors and summary]
  F -- yes --> I[get_artifact_sets]
  I --> J{Any BBOM/ARRE files?}
  J -- no --> K[Populate errors in summary and set exit_code 2]
  K --> H
  J -- yes --> L[validate_file for each BBOM]
  L --> M[validate_with_schema + validate_bbom_semantics]
  M --> N[Update bbom_files_checked / bbom_failed]
  N --> O[validate_file for each ARRE]
  O --> P[validate_with_schema + validate_arre_semantics]
  P --> Q[Update arre_files_checked / arre_failed]
  Q --> R[Finalize summary status and exit_code]
  R --> H
  H --> S{--report-file provided?}
  S -- yes --> T[write_report]
  S -- no --> U[Skip report]
  T --> V[Print result & return exit code]
  U --> V
Loading

File-Level Changes

Change Details Files
Add Python CLI validator that loads BBOM/ARRE schemas, discovers JSON artifacts, enforces schema + semantic rules, and emits a structured JSON report with exit codes for CI gating.
  • Implements argument parsing for configurable BBOM and ARRE directories and optional report output path
  • Discovers artifact files via recursive globbing, loading schemas from the repo root, and handling missing-directory and schema-load failures explicitly
  • Performs JSON Schema validation using Draft 2020-12 with a shared FormatChecker and aggregates human-readable error messages per file
  • Adds BBOM semantic checks for hazard threshold violations and ARRE semantic checks for period inversion and duplicate evidence hashes
  • Builds a ValidationSummary structure with discovered/checked counts, per-domain failure counters, error lists, and a fatal_error flag, then writes it to disk when requested
  • Defines consistent exit codes (0 on success, 2 on any validation or discovery failure) and prints pass/fail messages for human consumers
tools/validate_ai_governance_artifacts.py
tools/__init__.py
Introduce unit tests that exercise the validator’s CLI, semantic rules, schema behavior, and error reporting to ensure robustness and stable output shape.
  • Calls main() with various argument combinations (including custom ARRE/BBOM dirs and missing dirs) to assert correct exit codes and non-crashing behavior
  • Uses jsonschema directly against the repo schemas to verify they reject missing required BBOM/ARRE fields and bad date formats when format checking is enabled
  • Constructs temporary directories with modified sample artifacts to trigger BBOM hazard threshold, ARRE period ordering, and duplicate evidence hash semantic failures
  • Verifies that malformed JSON in artifacts surfaces as a reported failure instead of crashing the validator
  • Monkeypatches schema loading to simulate a schema load failure and checks that fatal_error and errors are populated correctly in the summary
  • Asserts that failure summaries include per-file error details, per-domain failure counters, and the expected exit_code
tests/test_governance_validator.py
Add governance artifact schemas, sample BBOM and ARRE JSON artifacts, and governance-focused documentation to anchor validation behavior and provide reference implementations.
  • Adds bbom.schema.json and arre_record.schema.json defining the expected structure of BBOM and ARRE artifacts, including required fields and date formats
  • Provides sample Tier 0 fraud BBOM and Tier 0 sanctions ARRE JSON files used both as documentation examples and test fixtures
  • Introduces a detailed AGI/ASI governance blueprint markdown file describing concepts like BBOM, ARRE, containment, and CI validation expectations
  • Adds GOVERNANCE_ARTIFACTS_README.md with quickstart instructions for local validation, custom paths, report generation, and interpretation of report fields
  • Defines Python governance-specific dependencies in requirements-governance.txt for use by both local developers and CI
schemas/bbom.schema.json
schemas/arre_record.schema.json
artifacts/bbom/sample_tier0_fraud.json
examples/arre/sample_t0_sanctions_002.json
AGI_ASI_GSIFI_Blueprint_2026_2030.md
GOVERNANCE_ARTIFACTS_README.md
requirements-governance.txt
Wire validator and tests into CI so governance artifacts are automatically validated on pushes and pull requests and the JSON report is persisted as a build artifact.
  • Adds a GitHub Actions workflow that runs on PRs and main/master pushes using Python 3.12
  • Installs governance dependencies and pytest via requirements-governance.txt in the CI job
  • Runs the validator with a fixed report output path (.reports/governance-validation.json) and then runs pytest against the validator test module
  • Uploads the generated governance validation report as a named artifact for auditability, even on failing builds
.github/workflows/governance-artifacts.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@difflens

difflens Bot commented Jun 1, 2026

Copy link
Copy Markdown

View changes in DiffLens

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces a complete governance artifact validation system. It adds JSON Schema definitions for BBOM (Behavioral Bill of Materials) and ARRE (regulator-facing control records), implements a Python CLI validator tool that performs schema and semantic validation, provides comprehensive test coverage, and integrates validation into CI. Supporting documentation includes a governance blueprint and operational quickstart.

Changes

Governance Artifact Validation System

Layer / File(s) Summary
JSON Schema contracts and sample artifacts
schemas/bbom.schema.json, schemas/arre_record.schema.json, artifacts/bbom/sample_tier0_fraud.json, examples/arre/sample_t0_sanctions_002.json
BBOM and ARRE JSON Schemas define required fields, types, nested structures, and validation constraints (patterns, date formats, numeric bounds). Sample BBOM and ARRE artifacts demonstrate valid structures with metadata, autonomy tiers, authority budgets, evidence hashes, approvals, and cryptographic signatures.
Validator tool implementation
tools/validate_ai_governance_artifacts.py, tools/__init__.py
CLI tool discovers BBOM and ARRE JSON artifacts, loads and applies Draft202012 JSON Schema validation with FormatChecker, runs semantic checks (BBOM hazard threshold comparisons, ARRE date ordering and duplicate evidence detection), accumulates a ValidationSummary with per-file pass/fail tracking, optionally writes JSON reports, and returns appropriate exit codes.
Test coverage
tests/test_governance_validator.py
14 test functions exercise validator end-to-end: repository artifact smoke tests, JSON report generation/structure, CLI argument handling, schema validation (required fields, date formats), semantic validation via modified artifacts (threshold violations, period inversion, duplicate hashes), failure detail tracking, malformed JSON robustness, and schema-load failure reporting.
CI workflow and documentation
.github/workflows/governance-artifacts.yml, requirements-governance.txt, GOVERNANCE_ARTIFACTS_README.md, AGI_ASI_GSIFI_Blueprint_2026_2030.md
GitHub Actions workflow runs validator and tests on PRs and main/master pushes, uploading reports as artifacts. jsonschema>=4.22,<5 dependency is pinned. README provides quickstart for local validation and CI integration. Blueprint document (523 lines) establishes 2026–2030 governance strategy, AI tiering, threat model, reference architecture with Sentinel v2.4, BBOM/ARRE specifications, formal invariants, containment labs, regulator controls, RACI operating model, phased roadmap, incident playbook, and machine-readable artifact guidance.

🎯 3 (Moderate) | ⏱️ ~25 minutes


Suggested reviewers

  • gstraccini

🐰 A Blueprint for Governance Takes Shape

Schema and spec, now they align,
Validator scripts dance in design,
Tests ensure the artifacts shine,
CI gates keep chaos offline,
Governance rules are now defined! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely summarizes the main changes: adding governance artifact schemas, validator tool, sample artifacts, tests, and CI workflow.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/develop-agi-governance-strategy-for-g-sifis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@difflens

difflens Bot commented Jun 1, 2026

Copy link
Copy Markdown

View changes in DiffLens

@difflens

difflens Bot commented Jun 1, 2026

Copy link
Copy Markdown

View changes in DiffLens

@penify-dev

penify-dev Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues, and left some high level feedback:

  • In validate_file you only increment the *_files_checked counters on successful validation, which means the summary under-reports the number of files that were actually processed; consider incrementing the checked counters for both pass and fail paths so the report reflects total attempted validations.
  • The validator currently prints OK BBOM/ARRE: ... inside validate_file, which is called from run_validation; extracting this user-facing logging to main (or making it optional via a verbosity flag) would keep the core validation API quieter and easier to reuse programmatically.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `validate_file` you only increment the `*_files_checked` counters on successful validation, which means the summary under-reports the number of files that were actually processed; consider incrementing the checked counters for both pass and fail paths so the report reflects total attempted validations.
- The validator currently prints `OK BBOM/ARRE: ...` inside `validate_file`, which is called from `run_validation`; extracting this user-facing logging to `main` (or making it optional via a verbosity flag) would keep the core validation API quieter and easier to reuse programmatically.

## Individual Comments

### Comment 1
<location path="tools/validate_ai_governance_artifacts.py" line_range="179-182" />
<code_context>
+    label: str,
+) -> None:
+    try:
+        data = load_json(file)
+        validate_with_schema(data, file.name, schema)
+        semantic_validator(data, file.name)
+        summary[counter_key] += 1
+        summary["passed_files"].append(display_path(file))
+        print(f"OK {label}: {display_path(file)}")
</code_context>
<issue_to_address>
**issue (bug_risk):** Failed files are not included in the `*_files_checked` counters, which can make the summary misleading.

Since `summary[counter_key] += 1` is inside the `try`, any file that fails schema or semantic validation is excluded from the `*_files_checked` count and only appears in the `*_failed` metrics. This makes these counters represent “files passed” instead of “files processed.” Increment this counter outside the `try` (e.g., in a `finally` block or before validation) so it tracks all processed files, and keep using the existing failure metrics to represent outcomes.
</issue_to_address>

### Comment 2
<location path="tools/validate_ai_governance_artifacts.py" line_range="85-89" />
<code_context>
+    hazard = data.get("hazard_scores", {})
+    thresholds = data.get("acceptance_thresholds", {})
+
+    if "max_deception" in thresholds and hazard.get("deception", 0) > thresholds["max_deception"]:
+        raise ValidationError(f"{data_name} violates max_deception threshold")
+    if "max_exfiltration" in thresholds and hazard.get("exfiltration", 0) > thresholds["max_exfiltration"]:
+        raise ValidationError(f"{data_name} violates max_exfiltration threshold")
+    if "max_jailbreak" in thresholds and hazard.get("jailbreak", 0) > thresholds["max_jailbreak"]:
+        raise ValidationError(f"{data_name} violates max_jailbreak threshold")
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Type errors in BBOM hazard/threshold values will raise unhandled exceptions instead of a `ValidationError`.

If `hazard_scores` or `acceptance_thresholds` contain non‑numeric values, these `>` comparisons will raise a `TypeError` instead of a `ValidationError`, bypassing the intended error reporting and summary tracking. Unless the schema strictly enforces numeric types, these checks should be wrapped so type issues are caught and re-raised as `ValidationError`s (similar to the handling of invalid dates in `validate_arre_semantics`).
</issue_to_address>

### Comment 3
<location path="AGI_ASI_GSIFI_Blueprint_2026_2030.md" line_range="30" />
<code_context>
+## 1) Design principles for 2026–2030
+
+1. **Safety-critical, not feature-critical.** Frontier AI touching critical banking functions is a safety-critical system.
+2. **Systemic externality mindset.** G‑SIFIs must evaluate institution risk *and* network contagion risk.
+3. **Containment-first scaling.** Capability growth is gated by containment maturity.
+4. **Evidence-by-construction.** Controls must emit machine-readable supervisory evidence continuously.
</code_context>
<issue_to_address>
**issue (typo):** Consider changing "institution risk" to "institutional risk" for grammatical correctness.

"Institution risk" sounds awkward here; "institutional risk" is more natural English and better aligned with standard risk-management terminology.

```suggestion
2. **Systemic externality mindset.** G‑SIFIs must evaluate institutional risk *and* network contagion risk.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread tools/validate_ai_governance_artifacts.py
Comment thread tools/validate_ai_governance_artifacts.py
Comment thread AGI_ASI_GSIFI_Blueprint_2026_2030.md
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 68 high · 16 medium · 16 minor

Alerts:
⚠ 100 issues (≤ 0 issues of at least minor severity)

Results:
100 new issues

Category Results
Compatibility 3 medium
UnusedCode 12 medium
BestPractice 2 minor
Documentation 6 minor
ErrorProne 4 high
Security 64 high
CodeStyle 6 minor
Complexity 1 medium
2 minor

View in Codacy

🟢 Metrics 63 complexity · 10 duplication

Metric Results
Complexity 63
Duplication 10

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@difflens

difflens Bot commented Jun 1, 2026

Copy link
Copy Markdown

View changes in DiffLens

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (3)
tools/validate_ai_governance_artifacts.py (1)

168-177: ⚡ Quick win

Reduce validate_file argument count to satisfy Pylint too-many-arguments/too-many-positional-arguments.

The 8-parameter signature fails CI (R0913/R0917). The schema, semantic_validator, counter_key, failed_counter_key, and label always move together per artifact type — bundle them into a small config object (e.g. a NamedTuple/dataclass) so the function takes the file, the config, the summary, and the errors list.

♻️ Sketch
class ArtifactKind(NamedTuple):
    schema: dict
    semantic_validator: Callable[[dict, str], None]
    counter_key: str
    failed_counter_key: str
    label: str

def validate_file(file: Path, kind: ArtifactKind, summary: ValidationSummary, errors: list[str]) -> None:
    ...
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/validate_ai_governance_artifacts.py` around lines 168 - 177, The
validate_file function signature has too many parameters; create a small config
type (e.g., NamedTuple or dataclass named ArtifactKind) that bundles schema,
semantic_validator, counter_key, failed_counter_key, and label, then change
validate_file(file: Path, kind: ArtifactKind, summary: ValidationSummary,
errors: list[str]) -> None to consume that single kind object; update all call
sites that currently pass schema, semantic_validator, counter_key,
failed_counter_key, and label to construct and pass an ArtifactKind instance
instead, and adjust any type hints/imports accordingly (keep the function body
using kind.schema, kind.semantic_validator, etc.).
.github/workflows/governance-artifacts.yml (1)

22-23: ⚡ Quick win

Consider caching Python dependencies for faster CI runs.

Adding dependency caching can significantly reduce CI execution time, especially for PRs with multiple commits.

⚡ Proposed enhancement to add dependency caching
       - name: Setup Python
         uses: actions/setup-python@v5
         with:
           python-version: '3.12'
+          cache: 'pip'
+          cache-dependency-path: requirements-governance.txt

       - name: Install dependencies
         run: python -m pip install -r requirements-governance.txt pytest
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/governance-artifacts.yml around lines 22 - 23, The
"Install dependencies" step currently runs "python -m pip install -r
requirements-governance.txt pytest" without caching; add an actions/cache step
before this to cache pip packages (cache key using python-version and a hash of
requirements-governance.txt, restore-keys fallback) and set the cache path to
pip's cache directory (e.g., ~/.cache/pip) so subsequent runs reuse installed
wheels; update the workflow to restore the cache, run the same install command,
and save the cache when there are changes to the requirements file.
GOVERNANCE_ARTIFACTS_README.md (1)

29-29: 💤 Low value

Correct capitalization of GitHub.

The official brand name is "GitHub" with a capital "H".

✍️ Proposed fix
 ## CI
 
-Validation is enforced in `.github/workflows/governance-artifacts.yml`.
+Validation is enforced in `.github/workflows/governance-artifacts.yml` (GitHub Actions).

Or simply ensure "GitHub Actions" is mentioned with correct capitalization elsewhere in the document.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@GOVERNANCE_ARTIFACTS_README.md` at line 29, Update the capitalization of the
brand name in the sentence referencing the workflow file: change "GitHub" to the
correct "GitHub" (capital G and H) where the README currently mentions
`.github/workflows/governance-artifacts.yml`, and optionally ensure any mention
of the platform reads "GitHub Actions" with correct capitalization; edit the
line containing that sentence to apply the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/governance-artifacts.yml:
- Line 15: Replace mutable action tags with pinned commit SHAs for each "uses:"
entry (e.g., change actions/checkout@v4 to actions/checkout@<COMMIT_SHA>) to
harden the workflow against supply-chain tampering; locate all "uses:" lines
flagged (the example actions/checkout@v4 and the other uses entries at the same
section) and replace the tag with the corresponding repository commit SHA
(verify and paste the latest stable commit hash for each action), keeping the
rest of the step unchanged.
- Around line 14-15: Update the GitHub Actions checkout step (uses:
actions/checkout@v4) to explicitly disable credential persistence by adding
persist-credentials: false to that step; locate the Checkout step in the
workflow and add the persist-credentials: false key under it so credentials are
not written to the workspace or persisted to subsequent steps.
- Around line 25-26: The workflow step "Validate BBOM/ARRE artifacts" runs
tools/validate_ai_governance_artifacts.py writing to
.reports/governance-validation.json but doesn't ensure the .reports directory
exists; add a prior step (or modify this step) to create the directory (e.g.,
run mkdir -p .reports) before calling tools/validate_ai_governance_artifacts.py
so the validator can write the report reliably.

In `@AGI_ASI_GSIFI_Blueprint_2026_2030.md`:
- Around line 496-501: The CI docs recommend using the ajv CLI but the repo
provides a Python validator (tools/validate_ai_governance_artifacts.py); update
the instructions to invoke the repository tool (install
requirements-governance.txt then run tools/validate_ai_governance_artifacts.py
with --report-file .reports/validation.json or without flags) and/or explicitly
state ajv-cli is an alternative for Node.js users (showing npm install -g
ajv-cli and the ajv validate commands) so readers know both supported options.

In `@tools/validate_ai_governance_artifacts.py`:
- Around line 85-90: Several f-strings in the validation checks are longer than
100 characters; split long lines that raise ValidationError to satisfy Pylint's
line-too-long rule by breaking the f-string or using a temporary message
variable. In the block that checks thresholds (the lines referencing thresholds,
hazard.get(...), and raising ValidationError with f"{data_name} violates ...
threshold"), refactor each raise to build the message on a separate wrapped line
(e.g., msg = f"{data_name} violates max_deception threshold" then raise
ValidationError(msg)) or use parentheses to wrap the f-string across lines;
apply the same wrapping approach to the other long f-strings elsewhere in this
module (the other ValidationError messages and any long log/message strings) so
every line is ≤100 chars while preserving the same text and variables
(data_name, thresholds, hazard, ValidationError).
- Around line 187-189: The validator is passing FormatChecker() into
Draft202012Validator but the project dependencies in requirements-governance.txt
omit the jsonschema[format] extra (or rfc3339-validator), so "format":
"date-time" checks may be skipped; update requirements-governance.txt to include
either the jsonschema format extra (e.g., jsonschema[format]>=4.22,<5 to match
the existing constraint) or add rfc3339-validator so FormatChecker enforces
RFC3339 date-time validation used by validate_ai_governance_artifacts.py (where
Draft202012Validator and FormatChecker are used).
- Line 16: The import of NotRequired from typing in
tools/validate_ai_governance_artifacts.py fails on Python <3.11; change the
top-level import to a guarded fallback that tries "from typing import
NotRequired" and on ImportError imports NotRequired from typing_extensions
instead (refer to the NotRequired symbol and the module-level import block), and
also add typing_extensions to the governance requirements used by CI
(requirements-governance.txt and docs/schemas/requirements-governance.txt) and
ensure the lint workflow installs that requirement; additionally, add
jsonschema[format] (or rfc3339-validator) to those governance requirements so
FormatChecker() runtime validation works in CI.

---

Nitpick comments:
In @.github/workflows/governance-artifacts.yml:
- Around line 22-23: The "Install dependencies" step currently runs "python -m
pip install -r requirements-governance.txt pytest" without caching; add an
actions/cache step before this to cache pip packages (cache key using
python-version and a hash of requirements-governance.txt, restore-keys fallback)
and set the cache path to pip's cache directory (e.g., ~/.cache/pip) so
subsequent runs reuse installed wheels; update the workflow to restore the
cache, run the same install command, and save the cache when there are changes
to the requirements file.

In `@GOVERNANCE_ARTIFACTS_README.md`:
- Line 29: Update the capitalization of the brand name in the sentence
referencing the workflow file: change "GitHub" to the correct "GitHub" (capital
G and H) where the README currently mentions
`.github/workflows/governance-artifacts.yml`, and optionally ensure any mention
of the platform reads "GitHub Actions" with correct capitalization; edit the
line containing that sentence to apply the fix.

In `@tools/validate_ai_governance_artifacts.py`:
- Around line 168-177: The validate_file function signature has too many
parameters; create a small config type (e.g., NamedTuple or dataclass named
ArtifactKind) that bundles schema, semantic_validator, counter_key,
failed_counter_key, and label, then change validate_file(file: Path, kind:
ArtifactKind, summary: ValidationSummary, errors: list[str]) -> None to consume
that single kind object; update all call sites that currently pass schema,
semantic_validator, counter_key, failed_counter_key, and label to construct and
pass an ArtifactKind instance instead, and adjust any type hints/imports
accordingly (keep the function body using kind.schema, kind.semantic_validator,
etc.).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c09e6f1-24f1-4817-a268-8fe9ed0898b2

📥 Commits

Reviewing files that changed from the base of the PR and between f457e3b and 5726a47.

📒 Files selected for processing (11)
  • .github/workflows/governance-artifacts.yml
  • AGI_ASI_GSIFI_Blueprint_2026_2030.md
  • GOVERNANCE_ARTIFACTS_README.md
  • artifacts/bbom/sample_tier0_fraud.json
  • examples/arre/sample_t0_sanctions_002.json
  • requirements-governance.txt
  • schemas/arre_record.schema.json
  • schemas/bbom.schema.json
  • tests/test_governance_validator.py
  • tools/__init__.py
  • tools/validate_ai_governance_artifacts.py

Comment thread .github/workflows/governance-artifacts.yml
Comment thread .github/workflows/governance-artifacts.yml
Comment thread .github/workflows/governance-artifacts.yml
Comment thread AGI_ASI_GSIFI_Blueprint_2026_2030.md
Comment thread tools/validate_ai_governance_artifacts.py
Comment thread tools/validate_ai_governance_artifacts.py
Comment thread tools/validate_ai_governance_artifacts.py
@netlify

netlify Bot commented Jun 1, 2026

Copy link
Copy Markdown

Deploy Preview for onefinestarstuff failed.

Name Link
🔨 Latest commit 5726a47
🔍 Latest deploy log https://app.netlify.com/projects/onefinestarstuff/deploys/6a1d50595c178d0008ced43f

@OneFineStarstuff OneFineStarstuff merged commit a040002 into main Jun 1, 2026
15 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants