-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add framework-neutral data management evidence profiles #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
13
commits into
cursor/ontology-catalog-plane-90aa
Choose a base branch
from
feat/data-management-evidence-profile
base: cursor/ontology-catalog-plane-90aa
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9665847
test: define data management evidence profile acceptance
seonghobae 213d469
test: define data management evidence migration contract
seonghobae b718dc4
feat: add data management evidence contracts
seonghobae fca89bf
feat: add normalized data management evidence schema
seonghobae 6cdd29e
feat: add data management evidence stores
seonghobae 474c7f0
feat: add data management evidence service
seonghobae a9b352c
ci: apply and verify data management route patch
seonghobae eb6f538
test: isolate data management evidence state
seonghobae ca03130
test: verify relational data management evidence parity
seonghobae 56b0ad2
test: require explicit cross-tenant denial
seonghobae 2e97e20
feat: expose data management evidence routes (apply one-shot patch in…
seonghobae 44a8bf4
chore: retrigger review scheduler on green checks
seonghobae 6cba648
fix(data-mgmt): review hardening — FK pragma, classification CHECK, docs
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| -- Framework-neutral data-management evidence profile (3NF, 2+ word snake_case). | ||
| -- | ||
| -- This migration stores CWL-owned ownership, critical-element, quality-rule, | ||
| -- and observation facts. It deliberately does not reproduce licensed | ||
| -- DAMA-DMBOK or DCAM framework prose, questions, scoring, or evidence lists. | ||
|
|
||
| SET search_path = public; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS data_owner_assignments ( | ||
| data_owner_assignment_id TEXT PRIMARY KEY, | ||
| catalog_object_id TEXT NOT NULL REFERENCES catalog_objects (catalog_object_id), | ||
| tenant_reference TEXT NOT NULL, | ||
| owner_subject TEXT NOT NULL, | ||
| owner_display_name TEXT NOT NULL, | ||
| valid_from TIMESTAMPTZ NOT NULL, | ||
| valid_to TIMESTAMPTZ, | ||
| evidence_reference TEXT NOT NULL CHECK (evidence_reference LIKE 'https://%'), | ||
| truth_status TEXT NOT NULL | ||
| CHECK (truth_status IN ('authoritative', 'observed', 'inferred', 'proposed')), | ||
| recorded_at TIMESTAMPTZ NOT NULL DEFAULT now(), | ||
| UNIQUE (catalog_object_id, owner_subject, valid_from), | ||
| CHECK (valid_to IS NULL OR valid_to > valid_from) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS data_owner_assignments_object_idx | ||
| ON data_owner_assignments (tenant_reference, catalog_object_id); | ||
| CREATE INDEX IF NOT EXISTS data_owner_assignments_active_idx | ||
| ON data_owner_assignments (tenant_reference, catalog_object_id, valid_to); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS critical_data_elements ( | ||
| critical_data_element_id TEXT PRIMARY KEY, | ||
| catalog_object_id TEXT NOT NULL REFERENCES catalog_objects (catalog_object_id), | ||
| tenant_reference TEXT NOT NULL, | ||
| element_key TEXT NOT NULL, | ||
| display_name TEXT NOT NULL, | ||
| definition_text TEXT NOT NULL, | ||
| data_classification TEXT NOT NULL | ||
| CHECK (data_classification IN ( | ||
| 'public', 'internal', 'confidential', 'restricted_pii', 'restricted_financial' | ||
| )), | ||
| evidence_reference TEXT NOT NULL CHECK (evidence_reference LIKE 'https://%'), | ||
| truth_status TEXT NOT NULL | ||
| CHECK (truth_status IN ('authoritative', 'observed', 'inferred', 'proposed')), | ||
| recorded_at TIMESTAMPTZ NOT NULL DEFAULT now(), | ||
| UNIQUE (catalog_object_id, element_key) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS critical_data_elements_object_idx | ||
| ON critical_data_elements (tenant_reference, catalog_object_id); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS data_quality_rules ( | ||
| data_quality_rule_id TEXT PRIMARY KEY, | ||
| critical_data_element_id TEXT NOT NULL | ||
| REFERENCES critical_data_elements (critical_data_element_id), | ||
| catalog_object_id TEXT NOT NULL REFERENCES catalog_objects (catalog_object_id), | ||
| tenant_reference TEXT NOT NULL, | ||
| rule_code TEXT NOT NULL, | ||
| rule_description TEXT NOT NULL, | ||
| metric_code TEXT NOT NULL, | ||
| threshold_operator TEXT NOT NULL, | ||
| threshold_value NUMERIC NOT NULL, | ||
| unit_code TEXT NOT NULL, | ||
| evidence_reference TEXT NOT NULL CHECK (evidence_reference LIKE 'https://%'), | ||
| truth_status TEXT NOT NULL | ||
| CHECK (truth_status IN ('authoritative', 'observed', 'inferred', 'proposed')), | ||
| recorded_at TIMESTAMPTZ NOT NULL DEFAULT now(), | ||
| UNIQUE (critical_data_element_id, rule_code) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS data_quality_rules_element_idx | ||
| ON data_quality_rules (tenant_reference, critical_data_element_id); | ||
| CREATE INDEX IF NOT EXISTS data_quality_rules_object_idx | ||
| ON data_quality_rules (tenant_reference, catalog_object_id); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS data_quality_observations ( | ||
| data_quality_observation_id TEXT PRIMARY KEY, | ||
| data_quality_rule_id TEXT NOT NULL REFERENCES data_quality_rules (data_quality_rule_id), | ||
| critical_data_element_id TEXT NOT NULL | ||
| REFERENCES critical_data_elements (critical_data_element_id), | ||
| catalog_object_id TEXT NOT NULL REFERENCES catalog_objects (catalog_object_id), | ||
| tenant_reference TEXT NOT NULL, | ||
| source_observation_id TEXT NOT NULL, | ||
| observed_value NUMERIC NOT NULL, | ||
| observed_at TIMESTAMPTZ NOT NULL, | ||
| quality_status TEXT NOT NULL, | ||
| evidence_reference TEXT NOT NULL CHECK (evidence_reference LIKE 'https://%'), | ||
| truth_status TEXT NOT NULL | ||
| CHECK (truth_status IN ('authoritative', 'observed', 'inferred', 'proposed')), | ||
| recorded_at TIMESTAMPTZ NOT NULL DEFAULT now(), | ||
| UNIQUE (data_quality_rule_id, source_observation_id) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS data_quality_observations_rule_idx | ||
| ON data_quality_observations (tenant_reference, data_quality_rule_id, observed_at); | ||
| CREATE INDEX IF NOT EXISTS data_quality_observations_object_idx | ||
| ON data_quality_observations (tenant_reference, catalog_object_id, observed_at); | ||
|
|
||
| INSERT INTO schema_migrations (migration_id) | ||
| VALUES ('0003_data_management_evidence') | ||
| ON CONFLICT (migration_id) DO NOTHING; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.