Compliance Suite¶
This page introduces the runnable verification layer that backs MGP compatibility claims.
Install¶
cd compliance
../.venv/bin/python -m pip install -r requirements.txt
Or install everything at once from the repository root:
make install
Run¶
In-Memory Adapter¶
cd compliance
../.venv/bin/python -m pytest
File Adapter¶
cd compliance
MGP_ADAPTER=file ../.venv/bin/python -m pytest
Graph Adapter¶
cd compliance
MGP_ADAPTER=graph ../.venv/bin/python -m pytest
PostgreSQL Adapter¶
cd compliance
MGP_ADAPTER=postgres MGP_POSTGRES_DSN=postgresql://postgres:postgres@127.0.0.1:5432/mgp ../.venv/bin/python -m pytest
Or run all three at once:
make test-all
From the repository root:
make testrunspython -m pytest compliancefor the selectedMGP_ADAPTERmake test-allrepeats that same full suite formemory,file, andgraph
What This Verifies¶
- JSON schema conformance
- OpenAPI and schema alignment for shared wire-level fields
- contract drift checks across OpenAPI, README version markers, and reference gateway routes
- Core operation behavior
- Lifecycle and retention behavior
- Conflict behavior
- Access decision behavior
- Adapter compatibility and round-trip consistency
- Search result consumption contract
- Dedupe / upsert / merge reference behavior
- Delete / purge lifecycle semantics
- Audit correlation fields
- Interoperability endpoints for batch / export / import / sync
Test Groups¶
Core compliance groups:
schema/test_schema_validation.pycore/test_core_operations.pysearch/test_search_results.pylifecycle/test_lifecycle.pylifecycle/test_delete_purge.pyconflicts/test_conflicts.pyaccess/test_access_control.pyaudit/test_audit_contract.pydedupe/test_dedupe_upsert.pyadapters/test_adapter_compat.py
Optional protocol feature groups included in the reference suite:
interop/test_bulk_sync_export.pylifecycle/test_protocol_lifecycle.py
These groups are optional at the ecosystem level, but the reference gateway and this repository's default pytest commands exercise them whenever the implementation supports the feature set under test.
Conformance Profiles¶
When describing compatibility, prefer the profile names from Conformance Profiles:
CoreLifecycleInteropExternalService
Repository interpretation:
- the in-repo
memory,file, andgraphmatrix demonstratesCore,Lifecycle, andInterop postgrescan validate the same profiles locally whenMGP_POSTGRES_DSNis configuredExternalServiceapplies to service-backed adapters such asMem0andZep, which require real provider environments for end-to-end validation
Capability interpretation note:
- the gateway may expose a broader HTTP surface than one backend supports natively
- adapter manifests must still report backend-native capability truthfully even when the gateway can emulate part of the behavior
Interpreting Results¶
Passing the full suite means an implementation satisfies the MGP compliance expectations for:
- schema validity
- endpoint behavior
- governance semantics
- adapter manifest correctness
CI runs the full suite against:
memoryfilegraph
make lint complements the pytest suite by running schema validation, OpenAPI validation, and contract-drift checks before the broader test matrix.
What "MGP Compliant" Means¶
Compliance means the implementation passes the published pytest suite in this directory against the defined MGP schemas and reference HTTP behavior.