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.
| Property | Value |
|---|---|
| Binary | rdt-model-govern |
| Pipeline phase | 2 — Enrich |
| Network | Collibra REST API (stub until A07) |
| Credentials | TBD — waiting on A07 |
| Threading | Async |
| Output | Printed to stdout |
Subcommands:
| Subcommand | Description | Implemented |
|---|---|---|
pull | Pull governance metadata for an entity | Yes (stub) |
Usage - Pull governance metadata (dry-run):
export RDT_TARGET=devrdt-model-govern --dry-run pull --entity waste-trackingOutput:
[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):
export RDT_TARGET=devrdt-model-govern pull --entity waste-trackingOutput:
entity: waste-trackingowner: Environmental Data Officesteward: Maria Schmidtdata_classification: Internalpii: falsesla_days: 1terms_of_use: Restricted to Roche internal use. Not for external distribution.Global flags:
| Flag | Short | Env | Description |
|---|---|---|---|
--target | -t | RDT_TARGET | Required. dev, test, or prod |
--entity | -e | — | Entity slug (required for pull) |
--dry-run | -n | — | Print what would be pulled without making API calls |
--quiet | -q | — | Suppress [target: dev] header line |
--config | -c | — | Path 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:
| Field | Type | Description |
|---|---|---|
entity_id | string | Entity slug this record belongs to |
owner | string | Business owner (team or person responsible for the data product) |
steward | string | Data steward (accountable for data quality and governance) |
data_classification | string | Roche classification: Public, Internal, Confidential, Restricted |
pii | boolean | Whether the entity contains personally identifiable information |
sla_days | integer | Freshness SLA in days — data older than this triggers a G3 alert |
terms_of_use | string | Usage 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:
no Collibra fixture found for entity
Section titled “no Collibra fixture found for entity”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.
--entity is required for this command
Section titled “--entity is required for this command”Error: --entity is required for this commandPass -e <entity-slug> or --entity <entity-slug>.
[target: dev] printed unexpectedly
Section titled “[target: dev] printed unexpectedly”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.