Skip to main content

mongo-x-ray-risk

CI PyPI

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

mongo_x_ray_risk-2.0.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mongo_x_ray_risk-2.0.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

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

Hashes for mongo_x_ray_risk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d3cb3df5b237c787258b4f55d83515cfa4e69a1f785862042633f6fcfe594012
MD5 74eabfeeac0cfa58639d41ce9c11ae21
BLAKE2b-256 af9f293c49139665869414edc4df2f6abbc9b064251e5968aa4d960f1d0db171

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mongo_x_ray_risk-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mongo_x_ray_risk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0236b0022a52d42bc7bd3ab2051ecebbe743110f4ccc9ff8e9cc7873356bb09
MD5 60a9650dc77b4b9689a6b6a4021e1719
BLAKE2b-256 a650337e0db9314d0ea6a7b63d58bbf3f5e711b3d45d7e031ec95253903cd886

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page