Backend-first agentic data model registry core.
Project description
martenweave-core
Backend-first agentic data model registry.
Turns data models into a structured, traceable, validated, AI-ready model knowledge layer. This repository contains the canonical model registry, deterministic validation, generated SQLite index, safe AI patch proposals, and Git-friendly model files.
SAP migration and Master Data Management are the first domain pack and proof case, not the product boundary. The core works for generic data models: domains, entities, attributes, relationships, datasets, mappings, rules, evidence, decisions, and change proposals.
No user-facing UI is included. This is a CLI-driven, backend/core library designed to be embedded in pipelines, IDEs, local API processes, MCP servers, and agent workflows.
Status
- Current source version:
0.4.1 - Package name:
martenweave-core - Public site and docs: https://martenweave.github.io/
- PyPI publishing is intentionally gated by the trusted-publisher release workflow. Until a package is published, install from source as shown below.
Core Principles
- Canonical files are the source of truth. Markdown + YAML frontmatter objects live in
model/. - Generated index is disposable. SQLite and JSONL outputs are rebuildable from canonical files.
- Deterministic validation first. Every object is validated for IDs, types, references, and domain context rules before indexing.
- AI must not silently mutate. AI creates
PatchProposalobjects for human review. Approved changes becomeChangeRequests. - Local-first. No cloud dependencies, no SaaS lock-in.
What Martenweave is / is not
| Is | Is not |
|---|---|
| A backend-first model registry for data modeling, migration, and governance | A SAP-only tool |
| A canonical file store with generated indexes | A database-first MDM platform |
| A validator-gated, proposal-first editing workflow | A workflow engine |
| A local-first CLI and embeddable library | A SaaS platform |
| AI-assisted, with human approval required for changes | An autonomous AI agent that mutates models |
Quickstart
Martenweave Core requires Python 3.11+.
Install from Source
git clone https://github.com/metalhatscats/martenweave-core.git
cd martenweave-core
python -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/modelops --help
Setup
Choose one style and use it throughout:
Option A — use the venv executable directly (recommended for copy-paste):
python -m venv .venv
.venv/bin/python -m pip install -e .
# Then use .venv/bin/modelops for every command
Option B — activate the venv once:
python -m venv .venv
source .venv/bin/activate
pip install -e .
# Then use bare modelops for every command
The examples below use Option A. Replace .venv/bin/modelops with modelops if you chose Option B.
# Install
.venv/bin/python -m pip install -e .
# Scaffold a new repository
.venv/bin/modelops init ./my-model
# Validate canonical files
.venv/bin/modelops validate --repo ./my-model
# Build SQLite index + JSONL exports
.venv/bin/modelops build-index --repo ./my-model --jsonl
# Check index freshness
.venv/bin/modelops index-fresh --repo ./my-model
# Health report and scorecard
.venv/bin/modelops health --repo ./my-model
.venv/bin/modelops scorecard --repo ./my-model
# Impact and trace analysis
.venv/bin/modelops impact FEP-S4-KNVV-KDGRP --repo ./my-model
.venv/bin/modelops trace ATTR-CUST-SALES-CUSTOMER-GROUP --repo ./my-model
# Search and query
.venv/bin/modelops search "Customer Group" --repo ./my-model
.venv/bin/modelops query --type Attribute --repo ./my-model
# Diff against another repository
.venv/bin/modelops diff ./my-model ./other-model
# Propose a patch from a note
.venv/bin/modelops propose-patch --from ./note.md --repo ./my-model
# Clean generated artifacts (dry-run first)
.venv/bin/modelops clean --repo ./my-model --dry-run
First 15 Minutes
For a step-by-step walkthrough using the included examples, see docs/first-15-minutes.md.
For a release-grade demo path that exercises validation, indexing, search, trace, impact, gaps, scorecards, and proposal dry-runs, see docs/demo-quickstart-flow.md.
Command Reference
| Command | Purpose |
|---|---|
init |
Scaffold a new model repository |
profile-dataset |
Profile a CSV/XLSX dataset and save the profile |
gaps |
Detect dataset-to-model gaps against FieldEndpoints |
import-drive |
Import a CSV/XLSX file from Google Drive and profile it |
import-sheet |
Import a Google Sheet as a PatchProposal |
sources |
List registered external sources |
source-show |
Show one registered source |
infer-model |
Infer draft model objects from a dataset profile |
validate |
Run deterministic validation on canonical files |
build-index |
Build SQLite index and optional JSONL exports |
clean |
Remove generated artifacts from a repository |
index-fresh |
Check whether the generated index is stale |
health |
Show repository health report |
doctor |
Run diagnostics for version, config, paths, index freshness, and validation |
scorecard |
Show governance readiness scorecard |
owners |
Ownership coverage and steward workload |
analyze |
Analyze model completeness, risk, and readiness |
gap-report |
Consolidated gap summary across all sources |
trace |
Trace upstream/downstream relationships for an object |
impact |
Generate impact report for an object or proposal |
propose-patch |
Create a PatchProposal from a note |
serve |
Start the optional local API server |
mcp |
Start the optional MCP server for agent integration |
import-model-sheet |
Import spreadsheet edits as a PatchProposal |
export-model |
Export canonical objects to CSV or XLSX |
export-schema |
Export JSON Schema for canonical object types |
export-sheets |
Export canonical model objects to Google Sheets |
git-bundle |
Generate a GitHub-ready change bundle |
publish-issue |
Publish an issue draft to GitHub |
publish-pr |
Publish a git bundle as a GitHub pull request |
audit-log |
Query the append-only audit log |
usage-report |
Show aggregated usage report from telemetry |
docs-build |
Generate static Markdown docs from the index |
config-guard |
Scan for secrets and configuration guardrail issues |
diff |
Compare two model repositories |
search |
Search indexed objects by keyword |
query |
Run structured queries over the index |
migrate |
Migrate canonical objects to the current schema version |
issue-draft |
Generate GitHub-ready issue drafts |
change-request |
Create and manage ChangeRequests |
notifications |
Preview notification recipients |
decisions |
Browse and inspect Decision objects |
proposal |
Review and apply PatchProposals |
assessment |
Run migration model readiness assessment workflows |
serve and mcp are local integration surfaces for APIs, tools, and agents. They do not provide a
hosted product UI or browser application.
Use --help on any command for full options:
.venv/bin/modelops <command> --help
Assessment Example
.venv/bin/modelops assessment run --repo examples/customer_bp_model --out generated/assessment/customer-bp
Example Models
Both example directories contain a working modelops.config.yaml and can be run without init.
Customer / Business Partner Model
The examples/customer_bp_model/ directory contains the first domain pack: a full canonical model slice for SAP Business Partner → Customer:
Business Partner -> Customer -> Customer Sales Area -> Customer Group -> KNVV-KDGRP
Supplier / Vendor Model
The examples/supplier_vendor_model/ directory contains a second domain pack for SAP Supplier / Vendor master data:
Supplier -> Vendor Central -> LFA1/KTOKK, LFB1/ZTERM, LFM1/SPERR
Run validation against either:
.venv/bin/modelops validate --repo examples/customer_bp_model
.venv/bin/modelops validate --repo examples/supplier_vendor_model
Architecture
modelops.config.yaml # Repository configuration
model/ # Canonical Markdown + YAML objects
DOMAIN-*.md
ENTITY-*.md
ATTR-*.md
FEP-*.md
MAP-*.md
...
generated/ # Disposable artifacts
modelops.db # SQLite index
search_documents.jsonl # Search export
lineage_edges.jsonl # Lineage export
audit_events.jsonl # Audit log
usage_events.jsonl # Application usage telemetry
ai_usage_events.jsonl # AI provider usage telemetry
data/samples/ # Sample datasets for profiling
Domain Rules (SAP example)
The first domain pack includes SAP-specific context rules:
Attributeis business meaning.FieldEndpointis physical representation.AttributeUsagelinks anAttributeto a specific business context.Mappinglinks source and targetFieldEndpoints.KNVVfields must be incustomer_sales_areacontext.KNB1fields must be incustomer_company_codecontext.KNVPfields must be incustomer_partner_functioncontext.BUT000fields must be inbp_centralcontext.
Future domain packs can add their own validation rules without changing core concepts.
Documentation
See docs/README.md for the full documentation index, including architecture docs, developer guides, product playbooks, and the Data Model Book.
Development
# Run tests
.venv/bin/python -m pytest
# Lint
.venv/bin/python -m ruff check .
# Release smoke across bundled examples
bash scripts/release_smoke.sh
Release and public-readiness docs:
- docs/release-checklist.md
- docs/release-notes-first-public-rc.md
- docs/release-validation-evidence.md
- docs/open-source-readiness.md
- docs/known-limitations.md
License
MIT. See docs/licensing-and-commercial-use.md for the current commercial-use clarification and future licensing options.
Project details
Release history Release notifications | RSS feed
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 martenweave_core-0.4.1.tar.gz.
File metadata
- Download URL: martenweave_core-0.4.1.tar.gz
- Upload date:
- Size: 301.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e38eb8e8f3d5b33d59464f30af10dd061c0b9d59cd52317ee4a4c0d41acb1796
|
|
| MD5 |
77d909089082881877089051990caf80
|
|
| BLAKE2b-256 |
756214028435f5584edfb2a8960a6012cd905da4992e607cd002386305c5eba4
|
Provenance
The following attestation bundles were made for martenweave_core-0.4.1.tar.gz:
Publisher:
release.yml on metalhatscats/martenweave-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
martenweave_core-0.4.1.tar.gz -
Subject digest:
e38eb8e8f3d5b33d59464f30af10dd061c0b9d59cd52317ee4a4c0d41acb1796 - Sigstore transparency entry: 1929760196
- Sigstore integration time:
-
Permalink:
metalhatscats/martenweave-core@c0b77ad5251a50e252bb348648014e39beb2524e -
Branch / Tag:
refs/tags/v0.4.1a1 - Owner: https://github.com/metalhatscats
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c0b77ad5251a50e252bb348648014e39beb2524e -
Trigger Event:
push
-
Statement type:
File details
Details for the file martenweave_core-0.4.1-py3-none-any.whl.
File metadata
- Download URL: martenweave_core-0.4.1-py3-none-any.whl
- Upload date:
- Size: 232.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08af3e9b47ed23c42429223bc5929c86921bda23fd0934147650c7f99363f03a
|
|
| MD5 |
6c396744c16986ca9f4c9f3285c4f7c6
|
|
| BLAKE2b-256 |
af2bca12177b393f0f513012a5d75b6eb1965b65c7d74e2080e28cb4a0d51c91
|
Provenance
The following attestation bundles were made for martenweave_core-0.4.1-py3-none-any.whl:
Publisher:
release.yml on metalhatscats/martenweave-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
martenweave_core-0.4.1-py3-none-any.whl -
Subject digest:
08af3e9b47ed23c42429223bc5929c86921bda23fd0934147650c7f99363f03a - Sigstore transparency entry: 1929760369
- Sigstore integration time:
-
Permalink:
metalhatscats/martenweave-core@c0b77ad5251a50e252bb348648014e39beb2524e -
Branch / Tag:
refs/tags/v0.4.1a1 - Owner: https://github.com/metalhatscats
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c0b77ad5251a50e252bb348648014e39beb2524e -
Trigger Event:
push
-
Statement type: