sdcgovernance

v4.3.1
io.github.SemanticDataCharter/sdcgovernance Checked 4 hours ago Published 1 month ago

Governance validation for Semantic Data Charter instances; returns OASIS XACML decisions.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_governance_status

Report which governance dimensions the model defines. Returns model_id, model_label, has_governance, and active dimensions.

ParameterTypeDescription
schema_path *stringPath to the SDC data model XSD file.

get_allowed_transitions

Get valid next states from the current workflow state. Returns list of valid transitions with target state info and path(s).

ParameterTypeDescription
instance_path *stringPath to the XML instance file containing workflow and current-state.
schema_path *stringPath to the SDC data model XSD file.

evaluate_transition

Evaluate whether a specific workflow transition is permitted. Returns PERMIT/DENY/INDETERMINATE with receipt.

ParameterTypeDescription
instance_path *stringPath to the XML instance file.
schema_path *stringPath to the SDC data model XSD file.
target_state *stringProposed target state symbol.
actorstringIdentity of the actor requesting the transition.

validate_governance

Full governance validation of an instance against its model. Returns decision, has_governance, errors, dimensions_validated.

ParameterTypeDescription
schema_path *stringPath to the SDC data model XSD file.
instance_pathstringPath to the XML instance file. Optional - if omitted, returns model governance status only.

record_provenance

Record a provenance event as a W3C PROV-O record. Returns the PROV record content.

ParameterTypeDescription
activity_type *stringW3C Activity Streams 2.0 type (Create, Update, Accept, etc.)
agent_name *stringName of the agent performing the action.
agent_refstringURI reference for the agent.
descriptionstringHuman-readable description.
entity_hash_afterstringSHA-256 hash after action.
entity_hash_beforestringSHA-256 hash before action.
entity_idstringID of the entity (DM.instance_id).
system_idstringSystem that produced this record.

evaluate_decision

Evaluate 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 Evidenc…

ParameterTypeDescription
context_hashstringSHA-256 hash of the extra_context payload, computed by the caller. Binds the Receipt cryptographically to the context that produced the decision. MTCP consumers pass the Evidence Pack hash here.
extra_contextstringJSON string with additional context key-value pairs.
instance_idstringIdentifier for the entity being evaluated, recorded in the Receipt. For SDC instances this is the DM instance_id (CUID2). For external consumers this is the entity identifier (e.g. an MTCP model_id su…
instance_pathstringPath to the XML instance file for context extraction. Optional. Omit to evaluate against extra_context only.
instance_versionstringVersion of the entity being evaluated, recorded in the Receipt.
previous_hashstring | nullSHA-256 hash of the prior Receipt in the caller's chain. Pass null (default) to start a new chain. The caller is responsible for chain persistence.
table_idstringId of a registered decision table (see register_decision_table and list_decision_tables). Give table_id or table_json, not both.
table_jsonstringJSON string defining the decision table inline, for an ad-hoc evaluation (the Receipt then carries the table's content hash but no id or version). Format: {"name": "...", "hit_policy": "FIRST|UNIQUE|C…
table_versionstringVersion of the registered table. Omit for the highest registered version; the Receipt records the version that was used.

register_decision_table

Register 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.

ParameterTypeDescription
table_id *stringStable identifier, e.g. 'cordova.access-control'. Letters, digits, '.', '_', '-'.
table_json *stringJSON string defining the decision table (same format as evaluate_decision).
version *stringImmutable version label, e.g. '1.0' or '2026-10-18'.
domainstringOptional domain the table governs, e.g. 'retention' or 'escalation'.
policystringOptional policy reference the table implements, e.g. a policy document URI.

list_decision_tables

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.

ParameterTypeDescription
domainstringOnly tables registered under this domain.
table_idstringOnly this table's versions, with their JSON.

verify_evidence_pack

Verify 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.

ParameterTypeDescription
evidence_pack *stringJSON string of the MTCP Evidence Pack including its evidence_pack_hash field. Hash is recomputed over the remaining fields and compared.