Skip to content

Commit 429a83d

Browse files
committed
Add enterprise bundle and release quality gates
1 parent c4d1fc6 commit 429a83d

30 files changed

Lines changed: 1135 additions & 41 deletions

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
test:
14+
name: Python ${{ matrix.python-version }}
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version:
20+
- "3.11"
21+
- "3.12"
22+
- "3.13"
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install RelayX
34+
run: |
35+
python -m pip install --upgrade pip
36+
python -m pip install -e .
37+
38+
- name: Version smoke test
39+
run: relayx --no-banner --version
40+
41+
- name: Unit tests
42+
run: python -m unittest discover -s tests
43+
44+
- name: Quality gate
45+
run: relayx --no-banner quality-gate --project-root . --format json --out relayx-quality-gate.json
46+
47+
- name: Wheel build smoke test
48+
run: python -m pip wheel . --no-deps -w dist
49+
50+
- name: Wheel install smoke test
51+
run: |
52+
python -m pip install --force-reinstall dist/relayx-*.whl
53+
relayx --no-banner --version
54+
55+
- name: Upload quality gate report
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: relayx-quality-gate-${{ matrix.python-version }}
60+
path: relayx-quality-gate.json

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release Gate
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
release-gate:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install build tooling
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install build
26+
python -m pip install -e .
27+
28+
- name: Check tag matches package version
29+
if: startsWith(github.ref, 'refs/tags/')
30+
run: |
31+
python - <<'PY'
32+
import pathlib
33+
import tomllib
34+
import os
35+
36+
tag = os.environ["GITHUB_REF_NAME"]
37+
version = tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["version"]
38+
expected = f"v{version}"
39+
if tag != expected:
40+
raise SystemExit(f"tag {tag!r} does not match package version {expected!r}")
41+
PY
42+
43+
- name: Unit tests
44+
run: python -m unittest discover -s tests
45+
46+
- name: Quality gate
47+
run: relayx --no-banner quality-gate --project-root . --format json --out relayx-quality-gate.json
48+
49+
- name: Build source and wheel distributions
50+
run: python -m build
51+
52+
- name: Install wheel smoke test
53+
run: |
54+
python -m pip install --force-reinstall dist/relayx-*.whl
55+
relayx --no-banner --version
56+
57+
- name: Upload release artifacts
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: relayx-release-artifacts
61+
path: |
62+
dist/*
63+
relayx-quality-gate.json

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
__pycache__/
22
*.py[cod]
33
*.egg-info/
4+
build/
5+
dist/
46
.pytest_cache/
57
.mypy_cache/
68
.ruff_cache/
79
.venv/
810
venv/
911
.DS_Store
1012
work/
11-

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ telemetry.
8484
CSV, OPSEC policy, and route report artifacts.
8585
- Enterprise outputs for graph analysis, SIEM ingestion, spreadsheet review,
8686
HTML/Markdown reporting, scan diffing, and remediation impact simulation.
87+
- Enterprise bundle generation with manifest, artifact hashes, schema status,
88+
optional route report, and release-ready handoff metadata.
89+
- CI and release quality gates for package metadata, schema contracts, JSON
90+
fixtures, enterprise docs, GitHub workflows, wheel builds, and install smoke
91+
tests.
8792

8893
## Install
8994

@@ -152,8 +157,10 @@ Export enterprise artifacts:
152157
```bash
153158
relayx export --result result.json --format opengraph --out relayx-opengraph.json
154159
relayx export --result result.json --format jsonl --out relayx-events.jsonl
160+
relayx bundle --result result.json --out-dir relayx-bundle
155161
relayx diff old-result.json new-result.json --format json --out relayx-diff.json
156162
relayx simulate-fixes result.json --control smb_signing --format json
163+
relayx quality-gate --project-root .
157164
```
158165

159166
Validate schema and evidence contracts:
@@ -186,8 +193,10 @@ relayx lab-profile Generate a calibration profile draft from corpuses
186193
relayx validate Run guarded active validation for one path
187194
relayx profiles List bundled RelayX profiles
188195
relayx export Export graph, JSONL, CSV, report, or diagram artifacts
196+
relayx bundle Write a validated enterprise handoff bundle
189197
relayx diff Compare two RelayX result files
190198
relayx simulate-fixes Simulate remediation impact on relay paths
199+
relayx quality-gate Run local CI and release quality gates
191200
relayx schema List or validate schema and evidence contracts
192201
relayx opsec List or inspect OPSEC policies
193202
relayx modules List execution module manifests
@@ -227,6 +236,10 @@ Markdown, Mermaid, and enterprise export payloads are kept machine-clean.
227236
- `jsonl`: one event per line for SIEM and blue-team pipelines.
228237
- `opengraph`: custom BloodHound/OpenGraph-style graph with RelayX node and
229238
edge kinds.
239+
- `bundle-manifest`: validated enterprise bundle manifest with hashes and
240+
schema status.
241+
- `quality-gate`: CI and release gate report for package, fixture, docs, and
242+
workflow checks.
230243

231244
## Schema Contracts
232245

@@ -240,7 +253,7 @@ relayx schema validate --kind module-manifest fixtures/execution_modules
240253

241254
Supported kinds include `result`, `evidence`, `lab-profile`, `lab-corpus`,
242255
`execution-record`, `module-manifest`, `opsec-policy`, `route-report`,
243-
`opengraph`, `jsonl`, and `csv`.
256+
`bundle-manifest`, `quality-gate`, `opengraph`, `jsonl`, and `csv`.
244257
Validation reports explain invalid fields by path and return exit code `2` when
245258
an artifact does not satisfy the selected contract.
246259

docs/CLI.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ relayx help safety
1414
relayx help scan
1515
relayx help run
1616
relayx help schema
17+
relayx help bundle
18+
relayx help quality-gate
1719
relayx --no-banner help
1820
```
1921

@@ -30,7 +32,8 @@ relayx help export --format json
3032
- Analysis: `calculus`, `controls`, `fixes`, `plan`, `calibrate`,
3133
`compare-baseline`, `lab-corpus`, `lab-profile`
3234
- Validation: `validate`, `source-check`, `source-plan`, `run`
33-
- Enterprise: `profiles`, `report`, `export`, `diff`, `simulate-fixes`
35+
- Enterprise: `profiles`, `report`, `export`, `bundle`, `diff`,
36+
`simulate-fixes`, `quality-gate`
3437
- Modules: `modules`, `module-plan`
3538
- Contracts: `schema`
3639
- Policy: `opsec`
@@ -60,9 +63,23 @@ relayx schema validate --kind jsonl relayx-events.jsonl
6063

6164
Supported schema kinds are `result`, `evidence`, `lab-profile`, `lab-corpus`,
6265
`execution-record`, `module-manifest`, `opsec-policy`, `route-report`,
63-
`opengraph`, `jsonl`, and `csv`.
66+
`bundle-manifest`, `quality-gate`, `opengraph`, `jsonl`, and `csv`.
6467
Invalid artifacts return exit code `2`.
6568

69+
## Enterprise Bundle And Quality Gate
70+
71+
```bash
72+
relayx bundle --result result.json --out-dir relayx-bundle
73+
relayx bundle --result result.json --out-dir relayx-bundle --formats opengraph,jsonl,csv
74+
relayx quality-gate --project-root .
75+
relayx quality-gate --project-root . --format json --out relayx-quality-gate.json
76+
```
77+
78+
`relayx bundle` writes a validated handoff directory with a manifest, artifact
79+
hashes, schema status, and optional route report. `relayx quality-gate` is the
80+
local CI/release gate for package metadata, fixtures, schema contracts,
81+
enterprise documentation, and GitHub workflow coverage.
82+
6683
## Execution Adapter SDK
6784

6885
`relayx modules` and `relayx module-plan` expose both module manifests and the

docs/ENTERPRISE_OUTPUTS.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ defenders, reporting workflows, SIEM pipelines, and graph tooling.
99
relayx export --result result.json --format opengraph --out relayx-opengraph.json
1010
relayx export --result result.json --format jsonl --out relayx-events.jsonl
1111
relayx export --result result.json --format csv --out relayx.csv
12+
relayx bundle --result result.json --out-dir relayx-bundle
1213
relayx diff old-result.json new-result.json --format json --out relayx-diff.json
1314
relayx simulate-fixes result.json --control smb_signing --format json
1415
relayx routes --result result.json --format json --out relayx-routes.json
16+
relayx quality-gate --project-root . --format json --out relayx-quality-gate.json
1517
relayx schema validate --kind opengraph relayx-opengraph.json
1618
relayx schema validate --kind jsonl relayx-events.jsonl
1719
relayx schema validate --kind csv relayx.csv
1820
relayx schema validate --kind route-report relayx-routes.json
21+
relayx schema validate --kind bundle-manifest relayx-bundle/manifest.json
22+
relayx schema validate --kind quality-gate relayx-quality-gate.json
1923
```
2024

2125
## OpenGraph
@@ -37,6 +41,21 @@ relay readiness context does not collide with AD or Azure entity kinds.
3741

3842
This is the preferred format for SIEM and blue-team pipelines.
3943

44+
## Enterprise Bundle
45+
46+
`relayx bundle` writes a complete handoff directory from one result file. The
47+
default bundle contains the canonical RelayX result, OpenGraph, JSONL, CSV,
48+
HTML, Markdown, Mermaid, and a route report when source metadata is available.
49+
50+
The bundle also writes `manifest.json`. The manifest records each artifact's
51+
relative path, format, schema kind, schema validation status, byte size, and
52+
SHA256 hash. It is intended to be archived with the engagement evidence set and
53+
validated with:
54+
55+
```bash
56+
relayx schema validate --kind bundle-manifest relayx-bundle/manifest.json
57+
```
58+
4059
## Route Reports
4160

4261
`relayx routes` emits a route and pivot awareness report. It records modeled
@@ -57,6 +76,23 @@ relayx schema validate --kind csv relayx.csv
5776
Validation reports include path-level errors and warnings. Use `--format json`
5877
for CI and ingestion pipeline checks.
5978

79+
## Quality Gate
80+
81+
`relayx quality-gate` is the local CI and release gate. It validates package
82+
metadata, schema catalog coverage, JSON fixtures, schema fixture directories,
83+
enterprise output matrix coverage, documentation coverage, and GitHub Actions
84+
workflow presence. Failed gates return exit code `2`.
85+
86+
```bash
87+
relayx quality-gate --project-root . --format json --out relayx-quality-gate.json
88+
relayx schema validate --kind quality-gate relayx-quality-gate.json
89+
```
90+
91+
The GitHub CI workflow runs unit tests, the quality gate, wheel build smoke
92+
tests, and wheel install smoke tests. The release workflow repeats those gates
93+
and verifies that a `v*` tag matches the package version before building source
94+
and wheel distributions.
95+
6096
## Diff
6197

6298
`relayx diff` compares stable path fingerprints:

docs/INSTALL.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,20 @@ relayx --version
3131

3232
1. Update `relayx.__version__` and `pyproject.toml`.
3333
2. Run the full unit test suite.
34-
3. Validate JSON fixtures.
34+
3. Run the RelayX quality gate.
3535
4. Build a wheel and source distribution.
36-
5. Smoke-test `pipx install dist/*.whl`.
36+
5. Smoke-test the generated wheel.
3737
6. Tag the release in GitHub.
3838

3939
```bash
4040
python3 -m unittest discover -s tests
41-
for f in fixtures/*.json fixtures/lab_profiles/*.json fixtures/execution_modules/*.json; do python3 -m json.tool "$f" >/dev/null; done
41+
relayx --no-banner quality-gate --project-root . --format json --out relayx-quality-gate.json
42+
relayx schema validate --kind quality-gate relayx-quality-gate.json
4243
python3 -m build
43-
pipx install --force dist/relayx-*.whl
44+
python3 -m pip install --force-reinstall dist/relayx-*.whl
45+
relayx --no-banner --version
4446
```
47+
48+
The GitHub CI workflow runs unit tests, `relayx quality-gate`, wheel build, and
49+
wheel install smoke tests. The release workflow repeats those checks and
50+
verifies that `v*` tags match the package version.

docs/README.fr.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ echec.
8080
CSV, OPSEC policy et route report.
8181
- Exports entreprise pour graph analysis, ingestion SIEM, revue CSV, rapports
8282
HTML/Markdown, scan diff et simulation d'impact de remediation.
83+
- Generation d'enterprise bundle avec manifest, hashes d'artefacts, schema
84+
status, route report optionnel et metadonnees de handoff release-ready.
85+
- Quality gates CI/release pour package metadata, schema contracts, fixtures
86+
JSON, documentation entreprise, GitHub workflows, wheel builds et install
87+
smoke tests.
8388

8489
## Installation
8590

@@ -148,8 +153,10 @@ Exporter des artefacts entreprise :
148153
```bash
149154
relayx export --result result.json --format opengraph --out relayx-opengraph.json
150155
relayx export --result result.json --format jsonl --out relayx-events.jsonl
156+
relayx bundle --result result.json --out-dir relayx-bundle
151157
relayx diff old-result.json new-result.json --format json --out relayx-diff.json
152158
relayx simulate-fixes result.json --control smb_signing --format json
159+
relayx quality-gate --project-root .
153160
```
154161

155162
Valider les schemas et le contrat evidence :
@@ -182,8 +189,10 @@ relayx lab-profile Genere un draft de calibration profile depuis corpus
182189
relayx validate Lance une validation active controlee pour un chemin
183190
relayx profiles Liste les profils RelayX integres
184191
relayx export Exporte graph, JSONL, CSV, rapport ou diagramme
192+
relayx bundle Ecrit un enterprise handoff bundle valide
185193
relayx diff Compare deux resultats RelayX
186194
relayx simulate-fixes Simule l'impact des remediations sur les chemins
195+
relayx quality-gate Lance les quality gates CI et release locaux
187196
relayx schema Liste ou valide schemas et contrats evidence
188197
relayx opsec Liste ou inspecte les politiques OPSEC
189198
relayx modules Liste les manifests de modules d'execution
@@ -224,6 +233,10 @@ pipelines.
224233
- `jsonl` : un evenement par ligne pour SIEM et pipelines blue team.
225234
- `opengraph` : graphe custom de style BloodHound/OpenGraph avec nodes et
226235
edges RelayX.
236+
- `bundle-manifest` : manifest d'enterprise bundle avec hashes et schema
237+
status.
238+
- `quality-gate` : rapport de gate CI/release pour package, fixtures, docs et
239+
workflows.
227240

228241
## Contrats de schema
229242

@@ -237,9 +250,9 @@ relayx schema validate --kind module-manifest fixtures/execution_modules
237250

238251
Les kinds supportes incluent `result`, `evidence`, `lab-profile`, `lab-corpus`,
239252
`execution-record`, `module-manifest`, `opsec-policy`, `route-report`,
240-
`opengraph`, `jsonl` et `csv`. Les rapports de validation expliquent les champs
241-
invalides par chemin et renvoient un exit code `2` lorsque l'artefact ne
242-
respecte pas le contrat choisi.
253+
`bundle-manifest`, `quality-gate`, `opengraph`, `jsonl` et `csv`. Les rapports
254+
de validation expliquent les champs invalides par chemin et renvoient un exit
255+
code `2` lorsque l'artefact ne respecte pas le contrat choisi.
243256

244257
## Calibration laboratoire
245258

0 commit comments

Comments
 (0)