Governance & Audit
Governance: One command to run all validation checks
Audit: Track all governance operations for compliance
What Is Ranex Governance?
Ranex Governance orchestrates all validation subsystems:
- Compliance Engine - Standards enforcement
- Structure Validator - Architecture rules
- Security Scanner - Vulnerability detection
- ARBITER - Test integrity validation

Ranex validation subsystems and what they detect in user code
Full Governance Check
Run comprehensive validation:
ranex govern check
Output:
π‘οΈ Full Governance Check
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Target: /home/user/myproject
Time: 2025-11-29 14:18:29
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Compliance Check
Status: PASS
Score: 92/100
ποΈ Structure Check
Status: PASS
π Security Check
Status: PASS
Vulnerabilities: 0
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Result: PASSED
Score: 92/100
Options
| Option | Description |
|---|---|
--json | Output as JSON for CI/CD |
--verbose, -v | Detailed output |
[PATH] | Target path (default: current directory) |
Pre-Commit Hook
Block bad commits before they happen:
ranex govern pre-commit
Output (pass):
β
Pre-commit validation passed
Checks: structure, security, compliance
Duration: 45ms
Output (fail):
β Pre-commit validation FAILED
ββββββββββββββββββββββββββββββββββββββββββββββββ
Failed checks:
- Security: 2 vulnerabilities found
- Structure: 1 violation
Commit blocked. Fix issues and try again.
ββββββββββββββββββββββββββββββββββββββββββββββββ
Set Up Git Hook
# Add to .git/hooks/pre-commit
#!/bin/bash
ranex govern pre-commit
Security Scanning
Ranex includes a SAST (Static Application Security Testing) scanner:

SAST scanner detecting SQL injection and hardcoded secrets in user code

Dependency vulnerability scan - detecting CVEs in pyyaml and sqlalchemy

Architecture violation - forbidden folder detected, enforcing vertical slice architecture
Audit Trail
All governance operations are logged for compliance.
Query Audit Trail
ranex audit query
Output:
π Audit Trail
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββ¬βββββββββββββββ¬ββββββββββ¬βββββββββββ
β Timestamp β Operation β Result β User β
ββββββββββββββββββββββββΌβββββββββββββββΌββββββββββΌβββββββββββ€
β 2025-11-29 14:20:00 β govern check β PASS β developerβ
β 2025-11-29 14:18:30 β pre-commit β PASS β developerβ
β 2025-11-29 14:15:00 β scan β PASS β developerβ
ββββββββββββββββββββββββ΄βββββββββββββββ΄ββββββββββ΄βββββββββββ
Filter Audit Results
# By action type
ranex audit query --action govern
# By time range
ranex audit query --since 24h
# By result
ranex audit query --result FAIL
CI/CD Integration
GitHub Actions
name: Governance Check
on: [push, pull_request]
jobs:
governance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Ranex
run: pip install ranex
- name: Run Governance Check
run: ranex govern check --json > governance.json
- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: governance-report
path: governance.json
GitLab CI
governance:
image: python:3.12
script:
- pip install ranex
- ranex govern check
- ranex govern pre-commit
Commands Reference
| Command | Description |
|---|---|
ranex govern check | Full governance validation |
ranex govern pre-commit | Pre-commit hook validation |
ranex govern transition | Validate phase transition |
ranex audit query | Query audit trail |
ranex audit export | Export audit log |
Next Steps
- ARBITER Testing - Test integrity validation
- Attestation System - Compliance certificates
- CLI Reference - All commands