Repository navigation
Fixes #36959: Only Approved glossary terms and metrics reach AI context as governed knowledge - #36990
Conversation
…ntext as governed knowledge Release testing saw Chat answer from an In Review glossary term and call it "the governed glossary definition". Attached knowledge and search-found context already dropped unapproved terms but let metrics of any stage through, and concept context was built for any term or metric. All three now share AIContextBuilder.isGovernedDefinition: Approved or no stage. ADR:2026-11-03-only-approved-definitions-reach-ai-context-as-governed-knowledge Co-Authored-By: Claude Opus 5.5 <[email protected]>
…persona builds without failing - A persona whose selected asset has a Draft metric applied threw: the metrics loop attached the reference of a knowledge item that is now null. Both the article and metric loops go through attachFullKnowledge, which skips it. - Metrics applied or related to an anchor reached AIContext.metrics and the concept's metrics whatever their stage; metricKnowledgeItem now admits only Approved (or stage-less) ones, as the record says. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Vector chunk docs carry no entityStatus, and the finder read a missing stage as "no review workflow applies", so a Draft or In Review term or metric reached find and MCP find_context as governed knowledge through its chunks. A term or metric hit without a stage is now judged on its entity, read once per entity per request, and dropped when that cannot be read. Stamping the stage on chunk docs instead would bump CHUNK_DOC_VERSION, restamping every chunk set on the next reindex, and would still need this read until that backfill ran. ADR:2026-11-03-only-approved-definitions-reach-ai-context-as-governed-knowledge Co-Authored-By: Claude Opus 5.5 <[email protected]>
…is handled Co-Authored-By: Claude Opus 5.5 <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
…oved-definitions # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/aicontext/AIContextFinder.java
Merging main brought a find_context test whose glossary-term hit carries no stage; this PR drops such a hit unless its entity reads Approved. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Review ✅ Approved🟡 Medium risk · Filtering unapproved glossary terms and metrics from AI context could leave answers without useful definitions across search, persona, and anchored requests. Restricts AI context to glossary terms and metrics that are Approved or have no review workflow, so unapproved definitions no longer reach chat as governed knowledge. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #36959
A glossary term or metric now reaches AI context as governed knowledge only when its
entityStatusis Approved or unset (no review workflow applies). AI context had already dropped unapproved glossary terms, but it let metrics of any stage through and built concept context for any term or metric. Chat then presented an In Review term as "the governed glossary definition". Entity details still return an unapproved definition with its stage, and the ai-platform companion names that stage in the answer.Type of change:
High-level design:
AIContextBuilder.isGovernedDefinition.PersonaContextBuilder.fullKnowledgeItem, andattachFullKnowledge, which skips a null item instead of throwing).AIContextFinder).AIContextBuilder.metricKnowledgeItem).AIContextBuilder.hasConceptContext).entityStatus, so the finder reads the stage of a term or metric hit from the entity. That read is cached per entity per request and fails closed if the entity can't be read. Chunk docs aren't stamped instead, because bumpingCHUNK_DOC_VERSIONwould restamp, and possibly re-embed, every chunk set.docs/decisions/2026-11-03-only-approved-definitions-reach-ai-context-as-governed-knowledge.md.Tests:
Use cases covered
Unit tests
GovernedDefinitionTest(8),AIContextFinderTest(9),PersonaContextBuilderTest(25),AIContextBuilderTest(51),ConceptContextCatalogTest(7),AIContextFinderAccessTest(2).cfc0d1f5baa. The 3 chunk guard tests fail with the old rule.Backend integration tests
Not run locally:
make java_affectedselects 76 integration tests. The IT module does not compile against the local snapshot jars. The tests run in the merge queue. No regression IT with an In Review metric was added (AIContextRestIT / PersonaAIContextIT); the unit tests pin each path.UI screen recording:
Not applicable: backend-only change.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.cfc0d1f5baafound one more 🔴: a concept read of an unapproved term returns its description, which the platform rendered as governed. It is fixed in the ai-platform companion, which reads the stage itself, and this record says so (0841407f68b).Regression follow-up (2026-11-04)
ConceptContextIT#pendingDefinitionsKeepTheirStageButHaveNoGovernedConceptContextcreates a glossary term and metric through the normal approval workflow, verifies their actual In Review stage, excludes governed concept context, and checks approved positive controls.GovernedDefinitionTest.96c3ab93f8478390355f50357790132ef681faa8, fresh REVIEW.md pass, no unanswered Important findings. Coverage findings were fixed before this pass.7d7ac24b6e4e274b935954a067dbae7fa61007a3, AIeacb39819e854615b6eebf27b6fa486b4b9beba3, Collatef10b2d235cd4ec4f461a2db409f43a9289d4e3ae. Targeted combined runs are reported here; this does not claim that every planner-selected integration or browser suite ran.Merge readiness (2026-11-06)
main(7f3a740):AIContextFinder.mainplus all five OpenMetadata memory PRs: 288 targeted Java unit tests pass, includingAIContextFinderTestandGovernedDefinitionTest.🤖 Generated with Claude Code