Skip to content

[Detail Bug] AI Governance: Pending LLM model submissions show last edit as the submission event #39140

In review

Description

@detail-app

Detail Bug Report

https://app.detail.dev/org_3377c26d-da48-4ccd-b83a-22c542f4fe83/bugs/bug_0f726f52-4ce1-4d3a-962e-f112120805fe

Introduced in #29710 by @harshach on Jul 6, 2026

Summary

  • Context: The AI governance activity feed (GovernanceActivity) synthesizes timeline events for AI assets; for LLM models it derives the "Submitted to Risk Council for review" event from governance state, reconstructing the original submission from version history when needed.
  • Bug: When an LLM model's current status is PENDING_REVIEW and the model was edited after originally being submitted for review, the feed reports the last edit's timestamp and author as the submission event, because history reconstruction (llmSubmissionFromHistory) is only invoked in the APPROVED branch — the PENDING_REVIEW branch ignores the reconstructHistory flag entirely.
  • Actual vs. expected: The single-entity timeline shows "Submitted to Risk Council for review" at the time of the post-submission edit attributed to the editor, instead of the original submission time and submitter — the exact drift that was already fixed for approved models in PR Fixes #35056: recover original LLM model submission from version history in governance timeline #35119 (issue [Detail Bug] AI Governance timeline shows wrong LLM model submission event after edits while in review #35056).
  • Impact: Governance audit trails are wrong: the Risk Council timeline misattributes who submitted a model for review and when, for every pending model that receives any edit while awaiting review — a normal occurrence in a review queue.

Code with Bug

openmetadata-service/src/main/java/org/openmetadata/service/resources/ai/GovernanceActivity.java (llmGovernance()):

if (llm.getGovernanceStatus() != null && llm.getUpdatedAt() != null) {
  if (llm.getGovernanceStatus() == LLMModel.GovernanceStatus.PENDING_REVIEW) {
    registeredAt = llm.getUpdatedAt();          // <-- BUG 🔴 uses last edit's timestamp; ignores history reconstruction
    registeredBy = llm.getUpdatedBy();          // <-- BUG 🔴 attributes submission to last editor
  } else if (llm.getGovernanceStatus() == LLMModel.GovernanceStatus.APPROVED) {
    approvedAt = llm.getUpdatedAt();
    approvedBy = llm.getUpdatedBy();
    if (reconstructHistory) {
      LlmSubmission submission = llmSubmissionFromHistory(llm);   // approved-only recovery
      registeredAt = submission.registeredAt();
      registeredBy = submission.registeredBy();
    }
  }
}

Explanation

  • LLMModel does not store explicit submission fields (e.g., registeredAt/registeredBy), so updatedAt/updatedBy are used as a proxy.
  • Any edit while the model is pending updates updatedAt/updatedBy, so the pending branch incorrectly rewrites the "Submitted for review" event to reflect the most recent edit.
  • The code already contains correct reconstruction logic (llmSubmissionFromHistory) that walks version history to find the original transition into PENDING_REVIEW (newest PENDING_REVIEW whose predecessor is not PENDING_REVIEW). This logic is simply not invoked for currently-pending models, even when reconstructHistory=true.
  • Callers use reconstructHistory=true for the single-entity timeline, so users see the incorrect attribution in the per-model governance timeline.

Codebase Inconsistency

  • The same file implements history reconstruction for the APPROVED branch specifically to avoid this drift after post-submission edits; the pending branch exhibits the same drift but lacks the reconstruction call.

Recommended Fix

In llmGovernance(), honor reconstructHistory for PENDING_REVIEW and use llmSubmissionFromHistory(llm) with fallback to updatedAt/updatedBy when history cannot be read (mirroring the existing approved-path approach). Add a test where the current version is still PENDING_REVIEW and has a post-submission edit, asserting the submission event uses the original submitter/time.

History

This bug was introduced in commit a5e801e (PR #29710, "feat(ai-governance): dashboard/activity fields + approval workflow"). The faulty behavior persisted through later changes (including PR #35119) because history reconstruction was only applied to APPROVED models and not extended to the PENDING_REVIEW branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions