Skip to content

rdt-model-govern

Pulls stewardship metadata (owner, data steward, classification, PII flags, SLA, and terms of use) from Collibra for a given entity. This metadata feeds into rdt-model-compile to produce governance-enriched data contracts.

PropertyValue
Binaryrdt-model-govern
Pipeline phase2 — Enrich
NetworkCollibra REST API (stub until A07)
CredentialsTBD — waiting on A07
ThreadingAsync
OutputPrinted to stdout

Subcommands:

SubcommandDescriptionImplemented
pullPull governance metadata for an entityYes (stub)

Usage - Pull governance metadata (dry-run):

Terminal window
export RDT_TARGET=dev
rdt-model-govern --dry-run pull --entity waste-tracking

Output:

[dry-run] govern pull: entity=waste-tracking
[dry-run] owner: Environmental Data Office
[dry-run] steward: Maria Schmidt
[dry-run] data_classification: Internal
[dry-run] pii: false
[dry-run] sla_days: 1
[dry-run] terms_of_use: Restricted to Roche internal use. Not for external distribution.

Usage - Pull governance metadata (standard mode):

Terminal window
export RDT_TARGET=dev
rdt-model-govern pull --entity waste-tracking

Output:

entity: waste-tracking
owner: Environmental Data Office
steward: Maria Schmidt
data_classification: Internal
pii: false
sla_days: 1
terms_of_use: Restricted to Roche internal use. Not for external distribution.

Global flags:

FlagShortEnvDescription
--target-tRDT_TARGETRequired. dev, test, or prod
--entity-eEntity slug (required for pull)
--dry-run-nPrint what would be pulled without making API calls
--quiet-qSuppress [target: dev] header line
--config-cPath to roche-data.toml (default: ./roche-data.toml)

Configuration: Collibra base URL is configured in roche-data.toml. Leave blank until A07 resolves.

[collibra]
base_url = "" # TBD — waiting for A07 (issue #25)

Governance metadata fields:

FieldTypeDescription
entity_idstringEntity slug this record belongs to
ownerstringBusiness owner (team or person responsible for the data product)
stewardstringData steward (accountable for data quality and governance)
data_classificationstringRoche classification: Public, Internal, Confidential, Restricted
piibooleanWhether the entity contains personally identifiable information
sla_daysintegerFreshness SLA in days — data older than this triggers a G3 alert
terms_of_usestringUsage terms for downstream consumers. Defaults to "Contact data owner for terms of use" when Collibra omits the field

Fixture data: While A07 is unresolved, responses come from: cli/common/src/clients/fixtures/collibra/waste-tracking.json

{
"entity_id": "waste-tracking",
"owner": "Environmental Data Office",
"steward": "Maria Schmidt",
"data_classification": "Internal",
"pii": false,
"sla_days": 1,
"terms_of_use": "Restricted to Roche internal use. Not for external distribution."
}

To add a fixture for a new entity, create cli/common/src/clients/fixtures/collibra/{entity-slug}.json following the same structure, then add a match arm to StubCollibraClient::load_fixture in cli/common/src/clients/collibra.rs.

Error handling:

Error: no Collibra fixture found for entity 'new-entity'

The stub client has no fixture for this entity. Add one to cli/common/src/clients/fixtures/collibra/new-entity.json before running.

Error: --entity is required for this command

Pass -e <entity-slug> or --entity <entity-slug>.

This is informational output to stderr. Suppress it with --quiet or -q.

Integration with rdt-model-compile: The governance metadata pulled here feeds directly into rdt-model-compile contract. The compile binary calls StubCollibraClient internally — you do not need to run rdt-model-govern separately as a pipeline step in the current implementation. This module exists as a standalone audit and inspection tool.

When A07 resolves, the compile binary will accept a --governance-path pointing to a governance JSON file exported by this tool.