Repository navigation
Fixes #34394: Allow draft conflict review - #34956
Conversation
…y-conflict-drafts
…last review Collate's Memory Reconciliation now revalidates Approved memories once an interval has passed. Two lifecycle gaps blocked it: - Approved could not move to Draft, so a conflict the judge was unsure of, or one across audiences, had no route to a person. Approved -> Draft is now allowed; every retired stage still cannot go back to Draft. - Nothing on the memory said it had been checked. lastReviewedAt records it: becoming Approved sets it (person or reconciliation), creating a memory as Approved sets it, a revalidation sets it, a PUT keeps it, and a change to it is recorded in version history. ADR:2026-10-09-an-approved-memory-can-return-to-review-and-records-its-last-review Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vector leg Collate's per-question memory recall asks hybrid search for the user's UserGlobal, non-Preference, unpinned memories. The lexical leg applied those keys, but VectorSearchQueryBuilder dropped them as unrecognized, so a Preference that was semantically close reached the recall through the knn leg alone (found validating on a local stack: "revenue by region" returned the Currency preference). Chunk documents already carry the three fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Two commits added for Collate's revalidation of Approved memories (open-metadata/openmetadata-collate#7247) and per-question memory recall (open-metadata/openmetadata-collate#7246, open-metadata/ai-platform#1637):
Verification: 🤖 Generated with Claude Code |
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
…e dedicated chunk index The vector leg applies memoryScope, memoryType and pinned, but memory chunks in the dedicated dynamic:false chunk index carried neither the fields nor their mapping, so a query filtering on them matched no chunk there. - VectorDocBuilder writes memoryScope, memoryType and pinned on every memory chunk; CHUNK_DOC_VERSION 7 -> 8 so an existing index gets the additive mapping (keyword, keyword, boolean) and the next Search Reindex restamps it. - The chunk header records the kind and a change to it restamps the chunks: pinning or retyping a memory leaves the fingerprint alone, so without this its chunks would keep the old kind until the next reindex. - The field names live on ContextMemoryIndex, shared by the entity index, the chunk docs and the query builder. Verified on a local stack: after the upgrade the dedicated index answers a UserGlobal / Note+Learning / unpinned query (0 chunks before), and pinning a memory restamped its chunk without a reindex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RDF writer emits every ContextMemory field, and RdfOntologyContractTest requires each written predicate to be declared and marked om:Stored. The new lastReviewedAt field was neither, failing everyWrittenPredicateIsDeclared and writtenPredicatesAreNeverLabeledInferenceOnly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep DAO regression tests with the API they exercise so Collate can compile against upstream main.
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Lifecycle and vector-filter changes could move valid memories out of answer grounding or omit matching memories when chunk metadata is stale. Adds Unprocessed → Draft and Draft → Rejected lifecycle transitions, preserves existing review reasons when entering Draft, and records ✅ 1 closed✅ Bug: Kind filters hit fields absent from chunk docs, dropping vector hits
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ UI Checkstyle Failed❌ Bundle Runtime CheckA route chunk loads but one of its chunks still exports Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
|
|



Describe your changes:
Fixes #34394
Allow conflicting Unprocessed memories to enter Draft review, and allow a person to reject a Draft. Preserve an existing review reason when entering Draft; leaving Draft clears an unchanged stale reason. This lets Collate remove assessed conflicts from its reconciliation queue without changing Approved references or adding another status.
Companions: Collate #6965, AI Platform #1394. Existing ContextMemoryStatus values were introduced in #34785.
Type of change:
High-level design:
N/A — small lifecycle-policy fix. Extend the existing transition map with Unprocessed → Draft and Draft → Rejected. Preserve the reason on incoming Draft transitions and retain reason clearing for outgoing transitions. Approved and archived memories still cannot transition directly to Draft. No schema or migration changes.
Tests:
Use cases covered
Unit tests
Backend integration tests
Local Java test run: FAILED
cf483d50f8ff(baseorigin/main) — uncommitted changes were presentSelected but produced no report:
McpServiceResourceIT (mysql-elasticsearch · parallel)Tests run locally
CompanyContextToolTest(17 passed),ContextMemoryLifecycleTest(20 passed),ContextMemoryReconcilerTest(17 passed),ContextMemoryRepositoryTest(16 passed),ContextMemoryStatusTransitionTest(9 passed),EntityRepositoryEntityStatusTest(27 passed),OntologyMemoryDerivationServiceTest(7 passed),SemanticMemoryDuplicateFinderTest(7 passed)Per-class counts come from failsafe's reports, which can credit a test to the wrong class when classes run concurrently; the step totals above are exact.
integration · mysql-elasticsearch · parallel: 50 classes
AIApplicationResourceIT(40 passed, 7 skipped),AIContextMcpIT(3 passed, 1 skipped),AIContextRestIT(82 passed, 7 skipped),AIFrameworkControlResourceIT(5 passed),AIGovernancePolicyResourceIT(5 passed, 1 skipped),AgentExecutionResourceIT(11 passed, 4 skipped),BaseEntityIT$ListEntityHistoryByTimestampPaginationTest(46 passed, 6 skipped),ConfigResourceIT(14 passed),ContextFileIT(30 passed, 3 skipped),ContextMemoryAnchorIT(1 passed),ContextMemoryIT(18 passed),ContextMemoryLifecycleIT(154 passed, 14 skipped),ContextMemorySourceEntityTiebreakIT(34 passed, 3 skipped),ContextMemoryStatusMigrationIT(1 passed),ConversationResourceIT(8 passed),DatabaseSmokeIT(17 passed, 3 skipped),GlossaryTermInheritedReviewerApprovalIT(5 passed),GlossaryTermMoveApprovalIT(4 passed),GlossaryTermRealizationIT(43 passed, 4 skipped),GlossaryTermRelationAdvancedIT(102 passed, 13 skipped),GlossaryTermRelationEdgeCasesIT(17 passed),GlossaryTermRelationEdgeIT(42 passed, 2 skipped),GlossaryTermRelationFixesIT(32 passed, 1 skipped),GlossaryTermRelationIT(0 passed),GlossaryTermRelationSettingsIT(148 passed, 19 skipped),GlossaryTermRelationSettingsPermissionsIT(17 passed),GlossaryTermRelationUsageIT(5 passed),GlossaryTermRelationsIT(29 passed, 2 skipped),GlossaryTermResourceIT(139 passed, 3 skipped),IngestionPipelineAgentTypeIT(2 passed),KnowledgePageHierarchyIT(1 passed),LLMModelResourceIT(31 passed, 4 skipped),LLMServiceResourceIT(7 passed, 1 skipped),McpContextMemoryVisibilityIT(14 passed, 4 skipped),McpExecutionResourceIT(78 passed, 13 skipped),McpIntegrationIT(9 passed),McpOAuthIT(39 passed),McpPermissionIT(37 passed, 4 skipped),McpSearchIT(2 passed),McpServerResourceIT(62 passed, 1 skipped),McpToolsValidationIT(15 passed, 1 skipped),McpUserContextIT(14 passed, 1 skipped),MetricAssetsIT(26 passed, 2 skipped),OntologyAiResourceIT(9 passed),OntologyChangeSetIT(5 passed),PersonaAIContextIT(5 passed),PromptTemplateResourceIT(35 passed, 3 skipped),SeedDataPresenceIT(4 passed),TableResourceIT(214 passed, 7 skipped),UserResourceIT(91 passed, 6 skipped)Why these tests
area ai-mcp-context←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryLifecycle.java,openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javacalled from entity ContextFile←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javacalled from entity ContextMemory←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryLifecycle.java,openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javacalled from entity GlossaryTerm←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javacalled from entity KnowledgePage←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javacalled from entity OntologyAi←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javacalled from entity OntologyChangeSet←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javachanged test←openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ContextMemoryLifecycleIT.java,openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/ContextMemoryLifecycleTest.java,openmetadata-service/src/test/java/org/openmetadata/service/resources/context/ContextMemoryStatusTransitionTest.javaentity ContextMemory←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextMemoryRepository.javasmoke←code other than a test class changedCommands
mvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=CompanyContextToolTest,ContextMemoryLifecycleTest,ContextMemoryReconcilerTest,ContextMemoryRepositoryTest,ContextMemoryStatusTransitionTest,EntityRepositoryEntityStatusTest,OntologyMemoryDerivationServiceTest,SemanticMemoryDuplicateFinderTest -Dsurefire.failIfNoSpecifiedTests=false mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<50 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=ConversationSchemaMigrationIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf -Dit.test=AgentSparqlResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=falseIngestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Not applicable in this repository — no OSS UI changes. Companion Collate validation passed seven live memory scenarios with retries disabled, including conflicts becoming Draft, unchanged reruns, edits, explicit requeue, approval and rejection. Its PR records the tests run there.
Manual testing performed
UI screen recording / screenshots:
Not applicable — no OSS UI change. The companion Collate PR includes the Draft conflict screenshot.
Checklist:
Summary by Gitar
versionandupdatedAtbefore storingupdatedAtso conditional lifecycle writes stay distinctUnprocessed→DraftandDraft→Rejectedtransitions inContextMemoryRepositorystatusReasonwhen enteringDraftinContextMemoryLifecyclelastReviewedAt, set when a memory becomes Approved or reconciliation revalidates itApproved→Draftso Approved conflicts can return to human reviewmemoryScope,memoryTypeandpinnedfilters to the vector leg inVectorSearchQueryBuildermemoryScope,memoryTypeandpinnedon every chunk, withCHUNK_DOC_VERSIONbumped to 8 for restampingThis will update automatically on new commits.