mongo-x-ray-risk
Known-risks knowledge base for x-ray: a ChromaDB-backed vector search that matches analysis findings against known MongoDB risks.
This is an optional plugin: it ships the ingest command to load the risk register, the search
command to look risks up by name, and the analysis plugins (healthcheck, log, gmd) detect it at
runtime — when it is installed, their reports are enriched with matched risks; when it is missing,
the enrichment is silently skipped.
Install
pip install mongo-x-ray mongo-x-ray-risk
Usage
Load a risk register CSV into the ChromaDB knowledge base:
x-ray ingest risk_register.csv
# start from an empty register, then ingest
x-ray ingest --clear risk_register.csv
# clear the register without ingesting (no CSV needed)
x-ray ingest --clear
Check whether a risk is already known by searching the Name column
(case-insensitive substring match). Prints the Name and Risk description
of every matching risk; exits 0 when something matches, 1 when nothing does:
x-ray search "Replication Lag"
x-ray search replication
The CSV must have the columns ID, Risk level, Impact, Name, Risk description
(UTF-8, a BOM is tolerated; header names are matched case-insensitively). Any
other columns, such as Other Notes, are ignored. Rows without an ID or a
Name are skipped; entries with an existing ID are replaced. The data is
stored under ~/.x-ray/chroma.
Once ingested, the plugin is used automatically by the other plugins — no CLI flags needed. It also exposes a small API for tooling:
from mongo_x_ray_risk import Risk, load_risks_from_csv, ingest_risks, match_risk, enrich_test_results
Development
Requires Python 3.10+, MongoDB 5.0 or later, and the mongo-x-ray core package.
make unit-test # run the unit tests
make lint # ruff check + ruff format --check
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mongo_x_ray_risk-2.0.0.tar.gz.
File metadata
- Download URL: mongo_x_ray_risk-2.0.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3cb3df5b237c787258b4f55d83515cfa4e69a1f785862042633f6fcfe594012
|
|
| MD5 |
74eabfeeac0cfa58639d41ce9c11ae21
|
|
| BLAKE2b-256 |
af9f293c49139665869414edc4df2f6abbc9b064251e5968aa4d960f1d0db171
|
Provenance
The following attestation bundles were made for mongo_x_ray_risk-2.0.0.tar.gz:
Publisher:
publish-pypi.yml on zhangyaoxing/mongo-x-ray-risk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mongo_x_ray_risk-2.0.0.tar.gz -
Subject digest:
d3cb3df5b237c787258b4f55d83515cfa4e69a1f785862042633f6fcfe594012 - Sigstore transparency entry: 2668262897
- Sigstore integration time:
-
Permalink:
zhangyaoxing/mongo-x-ray-risk@14929fe3466cb5d4008f46c0f34211b5f560ccd3 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/zhangyaoxing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@14929fe3466cb5d4008f46c0f34211b5f560ccd3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mongo_x_ray_risk-2.0.0-py3-none-any.whl.
File metadata
- Download URL: mongo_x_ray_risk-2.0.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0236b0022a52d42bc7bd3ab2051ecebbe743110f4ccc9ff8e9cc7873356bb09
|
|
| MD5 |
60a9650dc77b4b9689a6b6a4021e1719
|
|
| BLAKE2b-256 |
a650337e0db9314d0ea6a7b63d58bbf3f5e711b3d45d7e031ec95253903cd886
|
Provenance
The following attestation bundles were made for mongo_x_ray_risk-2.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on zhangyaoxing/mongo-x-ray-risk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mongo_x_ray_risk-2.0.0-py3-none-any.whl -
Subject digest:
b0236b0022a52d42bc7bd3ab2051ecebbe743110f4ccc9ff8e9cc7873356bb09 - Sigstore transparency entry: 2668262913
- Sigstore integration time:
-
Permalink:
zhangyaoxing/mongo-x-ray-risk@14929fe3466cb5d4008f46c0f34211b5f560ccd3 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/zhangyaoxing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@14929fe3466cb5d4008f46c0f34211b5f560ccd3 -
Trigger Event:
release
-
Statement type: