Skip to content

feat: add framework-neutral data management evidence profiles - #75

Draft
seonghobae wants to merge 13 commits into
cursor/ontology-catalog-plane-90aafrom
feat/data-management-evidence-profile
Draft

feat: add framework-neutral data management evidence profiles#75
seonghobae wants to merge 13 commits into
cursor/ontology-catalog-plane-90aafrom
feat/data-management-evidence-profile

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Closes #74.

Intent

Add the first buyer-visible Data Management Evidence Profile above the tenant-bound catalog plane. A buyer can assign a data owner, register Critical Data Elements, define measurable Data Quality rules, record immutable observations, and retrieve an explainable completeness profile with the next missing action.

Dependency and ownership

This PR is stacked on #73 exact source head bfa409f8971a3b28aac31ec7bca371fa94f7f07f. It writes only semantic-data-portal and must not integrate before #73. Any parent movement invalidates descendant evidence and requires a fresh stack candidate.

  • semantic-data-portal owns data-context evidence and the profile read model.
  • Domain products remain authoritative for business values and operational controls.
  • enterprise-architecture-core will own target capability, funding, and improvement initiatives.
  • context-graph-contracts will provide released framework-neutral interoperability contracts after its protected stack integrates.

No DAMA-DMBOK or DCAM proprietary prose, official challenge questions, scoring criteria, assessment workbook content, or licensed evidence lists are embedded.

Planned vertical slice

3NF, two-or-more-word snake_case tables:

  • data_owner_assignments
  • critical_data_elements
  • data_quality_rules
  • data_quality_observations

Endpoints:

  • assign an effective-dated data owner
  • register a Critical Data Element under a catalog dataset
  • define a threshold-bearing Data Quality rule
  • append an evidence-backed observation
  • retrieve /data-management-profile with factors, counts, policy evidence, and the first exact next action

TDD state

RED acceptance preceded production implementation:

  • missing migration: 0003 data-management evidence migration is required
  • missing buyer route: 404 Not Found for /data-management-profile

Contracts, migration, stores, and service behavior are now present. A bounded one-shot branch workflow is applying the small src/sdp/api.py registration patch, running the focused acceptance and compileall, then deleting itself before committing. This PR remains Draft and non-green until that workflow completes and the exact resulting head passes repository Tests, fuzz, Security Scan, SAST, review, migration, and coverage gates.

Non-negotiable behavior

  • purpose-bound policy evaluation before every read/write
  • tenant isolation without existence leakage
  • raw PII usable only under authorization; no indiscriminate masking
  • append-only observations with HTTPS evidence references
  • truth status preserved; inferred/proposed evidence never auto-promoted
  • in-memory and SQL stores enforce matching uniqueness contracts
  • exact-current-head verification only; no predecessor evidence transfer

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 86c18fc6-b8e1-43d0-a215-991f8036dc1e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Work only on exact head 56b0ad2fd3c74a140aea0e5ece3b6c8738a674fd of this Draft stack branch. Do not merge, retarget, or modify #73.

The branch still contains a write-capable one-shot workflow .github/workflows/apply-data-management-routes.yml; remove it and apply its intended API registration directly in reviewed source. Preserve the already-recorded RED evidence (missing migration and 404 profile route), then make the narrow GREEN change:

  1. Add the four data-management draft imports from sdp_core.data_management_evidence and the five service imports from sdp.data_management_evidence to src/sdp/api.py.
  2. Register these purpose-bound routes using _plane_actor, returning .model_dump() and mapping PermissionError→403, KeyError→404, ValueError→400:
    • POST /plane/catalog-objects/{catalog_object_id}/data-owner-assignments
    • POST /plane/catalog-objects/{catalog_object_id}/critical-data-elements
    • POST /plane/critical-data-elements/{critical_data_element_id}/quality-rules
    • POST /plane/quality-rules/{data_quality_rule_id}/observations
    • GET /plane/catalog-objects/{catalog_object_id}/data-management-profile
  3. Delete .github/workflows/apply-data-management-routes.yml; do not replace it with any branch writer or mutation workflow.
  4. Run the focused API, evidence, migration, and SQL acceptance, then the complete repository suite, compileall, exact production statement/branch coverage, and public docstring gate available in the repository. Preserve the stack and all feat: ontology/catalog plane above the document KG (#13) #73 contracts.
  5. Commit only the bounded source/test/doc changes required by failures. Keep the PR Draft and report exact-head evidence; do not approve or merge.

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…line)

Applies the route registration that the one-shot apply-data-management-routes
workflow was meant to land, then removes that self-modifying workflow:
- /plane/catalog-objects/{id}/data-owner-assignments (POST)
- /plane/catalog-objects/{id}/critical-data-elements (POST)
- /plane/critical-data-elements/{id}/quality-rules (POST)
- /plane/quality-rules/{id}/observations (POST)
- /plane/catalog-objects/{id}/data-management-profile (GET)

Fixes surfaced by its verify step:
- conftest now snapshot/restores the catalog-plane store so tenant-isolation
  tests cannot collide on object_slug with earlier tests.
- migration contract test asserts whitespace-collapsed SQL and the actual
  column-level FK form instead of alignment-fragile literals.

Full suite: 286 passed, 9 skipped.
@seonghobae
seonghobae marked this pull request as ready for review August 25, 2026 16:31
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

devin-ai-integration[bot]

This comment was marked as resolved.

- data_management_store._open_engine now enables PRAGMA foreign_keys=ON on
  SQLite so unit-test engines enforce the same cross-tenant/parent-row
  guarantees as Postgres in production.
- migration 0003 adds a DB-level CHECK for data_classification, matching the
  DataClassification Literal (public/internal/confidential/restricted_pii/
  restricted_financial).
- README API list + implementation-compliance matrix now include the five
  /plane evidence endpoints.
- build_data_management_profile documents the contractual factor asymmetry:
  ownership requires an active effective-time window; CDE/rule require
  authoritative truth; observations accept observed truth by nature.

Full suite: 262 passed.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment on lines +347 to +350
def __init__(self, database_dsn: str) -> None:
"""Open the configured relational database."""

self._engine = _open_engine(database_dsn)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Relational store engines never disposed

RelationalDataManagementStore.__init__ opens a SQLAlchemy engine and never disposes it. The reopen tests build several instances against the same DSN, each leaking a pool. This mirrors the existing catalog_plane_store pattern, so behavior is consistent, but repeated set_data_management_store(...) calls accumulate pools.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

"rule_description": record.rule_description,
"metric_code": record.metric_code,
"threshold_operator": record.threshold_operator,
"threshold_value": str(record.threshold_value),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: SQLite numeric affinity can lose decimal precision

insert_data_quality_rule and insert_data_quality_observation bind str(Decimal) into NUMERIC columns. SQLite gives non-integer values REAL affinity, so a value like 0.50 is stored as a float and re-read via _decimal(str(value)), losing exactness for high-precision decimals. Postgres NUMERIC preserves them; SQLite is only used in tests here.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae
seonghobae marked this pull request as draft August 26, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant