Repository navigation
Description
Detail Bug Report
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_REVIEWand 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 theAPPROVEDbranch — thePENDING_REVIEWbranch ignores thereconstructHistoryflag 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
LLMModeldoes not store explicit submission fields (e.g.,registeredAt/registeredBy), soupdatedAt/updatedByare 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 intoPENDING_REVIEW(newestPENDING_REVIEWwhose predecessor is notPENDING_REVIEW). This logic is simply not invoked for currently-pending models, even whenreconstructHistory=true. - Callers use
reconstructHistory=truefor 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
APPROVEDbranch 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity