get_governance_status
Report which governance dimensions the model defines. Returns model_id, model_label, has_governance, and active dimensions.
schema_path必填
io.github.SemanticDataCharter由 GitHub 账号 SemanticDataCharter 发布v4.3.1更新于 Nov 2, 2026
Governance validation for Semantic Data Charter instances; returns OASIS XACML decisions.
面向 Semantic Data Charter 实例的治理咨询引擎,让助手校验工作流、认证、参与方/角色与溯源规则,并得到 PERMIT/DENY/INDETERMINATE 决策。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
W3C standards-based governance advisory engine for Semantic Data Charter instances.
A Python library that validates governance content in XML data instances against governance components defined in the SDC data model. If the model defines governance (workflow, attestation, party/role, provenance, audit), the instance must carry that content - and this library validates it.
Returns decisions using OASIS XACML semantics: PERMIT, DENY, or INDETERMINATE.
No framework dependency. No middleware. A function call.
SDC data models (XSD) can optionally include governance components: Workflow state machines, Attestation authority requirements, Party/Role constraints, Provenance requirements, and Audit definitions. These are part of the data model, not a separate governance layer.
When governance components are defined, every XML data instance must carry the corresponding governance content. This library validates that content against the model:
If the model does not define governance components, the result is PERMIT - no governance to enforce.
sdcvalidator and sdcgovernance are separate, independent libraries. There is no hook, no chaining, no automatic invocation of one from the other.
Both libraries read the schema from the instance. Agents call each one independently, at different points in a workflow, in whatever order the operational logic requires. A single workflow may involve multiple calls to both libraries.
Governance components are discovered by their position in the DMType root (fixed RM slots: workflow, attestation, party/role, audit, and related), not by CUID2 identity. Once a slot is found, its content is validated by vocabulary binding against the relevant standard (PROV-O, SCXML, VC, DPV). Any component occupying the right slot and bound to the right vocabulary is recognized - whether it comes from the Default project or was custom-built.
Every decision produces a W3C PROV record and a SHA-256 hash-chained receipt.
What happens after the decision is the agent's responsibility. sdcgovernance issues the decision and the receipt. The operational response - routing, escalation, notification, halting - is customer business logic that varies per implementation.
Python API - for direct integration:
MCP Server - for any agent framework:
A client configuration needs only "command": "uvx", "args": ["sdcgovernance"].
The MCP server exposes governance as tools that agents call. The agent runs the loop. sdcgovernance advises.
Pure Python. No Django. No middleware. No web framework dependency.
validate_governance() at data entry boundaries.Production-ready. Available on PyPI under Apache 2.0.
rdflib - RDF/PROV record generationpyshacl - SHACL constraint validationApache 2.0
来源:README.md,提交 abf62ec
Report which governance dimensions the model defines. Returns model_id, model_label, has_governance, and active dimensions.
schema_path必填Get valid next states from the current workflow state. Returns list of valid transitions with target state info and path(s).
schema_path必填instance_path必填Evaluate whether a specific workflow transition is permitted. Returns PERMIT/DENY/INDETERMINATE with receipt.
actorschema_path必填target_state必填instance_path必填Full governance validation of an instance against its model. Returns decision, has_governance, errors, dimensions_validated.
schema_path必填instance_pathRecord a provenance event as a W3C PROV-O record. Returns the PROV record content.
agent_refentity_idsystem_idagent_name必填descriptionactivity_type必填entity_hash_afterentity_hash_beforeEvaluate a DMN decision table against instance context. Name the table by table_id (and table_version; the highest registered version when omitted) for a governed evaluation, or pass it inline as table_json for an ad-hoc one. Returns decision, matched_rules, reasoning, errors, the table's identity and content hash, and a tamper-evident Receipt whose receipt_hash covers table_id, table_version and table_hash as well as context_hash. instance_path is optional: when omitted, the decision is evaluated against extra_context alone, which is the path external context-only consumers (e.g. MTCP Evidence Packs) should use. Pass previous_hash to chain receipts; the caller is responsible for chain persistence.
table_idtable_jsoninstance_idcontext_hashextra_contextinstance_pathprevious_hashtable_versioninstance_versionRegister a decision table under a stable table_id and an immutable version, so evaluate_decision can name it and every Receipt it produces records which policy version applied. Returns table_id, version, table_hash (SHA-256 of the table's RFC 8785 canonical JSON), domain and policy. Registering the same content again under the same id and version is a no-op; different content under an existing id and version is refused: register it as a new version. Persists to the server's tables directory when one is configured.
domainpolicyversion必填table_id必填table_json必填List the registered decision tables: table_id, version, table_hash, domain, policy and registered_at for each version, lowest version first. Filter by table_id or domain. With table_id the full table JSON of each version is included, which is how a receipt's table_id and table_version are resolved back to the rules that applied.
domaintable_idVerify the integrity of an MTCP Evidence Pack by recomputing its evidence_pack_hash. Returns valid (bool), computed_hash, and expected_hash. Canonicalization follows RFC 8785: keys sorted, no whitespace, comma-colon separators, UTF-8.
evidence_pack必填已满足适用检查项的 90%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
from sdcgovernance import validate_governance
result = validate_governance("model.xsd", "instance.xml")
print(result.decision) # PERMIT, DENY, or INDETERMINATEprint(result.has_governance) # True if model defines governance componentsprint(result.errors) # list of governance validation errorsprint(result.receipt) # tamper-evident decision receiptsdcvalidator (structural validation) Does the instance conform to the XSD schema? Single-pass. Instance in, pass/fail out.
sdcgovernance (governance advisory) Does the model define governance components? If yes: does the instance carry valid governance content? Conversational. Agents query multiple times during a workflow.from sdcgovernance import validate_governance
result = validate_governance("model.xsd", "instance.xml")sdcgovernance # what an MCP registry client runs (uvx sdcgovernance)sdcgovernance mcp # the same, spelled like the other Semantic Data Charter serverssdcgovernance serve --mcp # still works for existing client configurationssrc/sdcgovernance/├── __init__.py # Public API: validate_governance()├── engine.py # GovernanceEngine - the decision engine agents query├── model_inspector.py # Inspect SDC model for governance components├── workflow.py # Validate workflow transitions in instance├── attestation.py # Validate attestation content in instance├── party_role.py # Validate party/role constraints in instance├── provenance.py # Validate provenance/audit records + PROV generation + DPV retention policy├── decision.py # DMN decision table evaluation + content hash├── tables.py # Decision table registry: id, version, hash; files on disk├── receipts.py # Decision receipt chain (hash-chained)├── shacl_runtime.py # SHACL cross-entity constraint validation└── mcp_server.py # MCP server exposing governance tools to any agentpip install sdcgovernance