Repository navigation
Fixed context center bugs - #31118
Conversation
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 717 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 57m 26s ⏱️ Max setup 3m 3s · max shard execution 18m 24s · max shard-job elapsed before upload 24m 38s · reporting 4s 🌐 184.17 requests/attempt · 2.67 app boots/UI scenario · 13.13% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Code Review ✅ Approved 5 resolved / 5 findingsFixes context center bugs by adding navigation and click handlers across dashboard cards, updating file upload error handling, and preserving updater users during file extractions. Resolved issues regarding interactive items, Playwright configuration, folder deep-linking, optional chaining, and dead props. ✅ 5 resolved✅ Bug: RecentItem always interactive, ignores missing onClick
✅ Bug: Playwright baseURL port changed 8585->3000 for whole suite
✅ Edge Case: Folder deep-link param not cleared after selection
✅ Quality: Inconsistent optional-chaining on item.onClick
✅ Quality: onOpenFolder prop is now dead code
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
* Fixed context center bugs * addressed gitar comment * lint fix * minor fix * fixed playwright spec * lint fix * addressed gitar comment * minor fixed * lint fix * minor fix * fixed pagination loader * lint fix
* Fixed context center bugs * addressed gitar comment * lint fix * minor fix * fixed playwright spec * lint fix * addressed gitar comment * minor fixed * lint fix * minor fix * fixed pagination loader * lint fix
…nd an AiProvider seam (open-metadata#32524) * feat(context): restore memory extraction from files and articles behind an AiProvider seam Re-lands the Context Center knowledge-pill extraction pipeline (engines, reconciler, repository hooks, list filters, search-index fields) that open-metadata#30041 reverted, without the Memory Agent, AISettings, or MCP Chat. Extraction now runs behind a pluggable AiProvider seam resolved from llmConfiguration.aiProviderClass: OSS ships LlmAiProvider (one structured completion via the shared LLMCompletionClient, all providers supported); Collate can substitute an agent-platform implementation without any caller changing. The candidate shape (KnowledgePill) is the compatibility boundary between the two engines. Adaptations over the reverted code: - File pipeline rebuilt on the hardened conditional-update service (open-metadata#31118): retry/backoff, contention requeue, RequestEntityCache hygiene now cover the pill stage too. - Extraction gate is llmConfiguration.enabled alone; the AISettings toggles are gone. - AiProviderHolder resolves the configured class via asSubclass and falls back to the built-in provider on ClassCastException instead of crashing (review finding on open-metadata#29360), pinned by a regression test. - FileContextProcessingEngine only treats EntityNotFoundException as file-gone; infrastructure failures now propagate to a Failed status instead of silently marking the file Processed. Co-Authored-By: Claude Fable 5 <[email protected]> * Update generated TypeScript types and dereferenced schemas * refactor(context): drive/ becomes context/center, entity-prompt context becomes context/entity The service-layer package now matches the domain language: everything Context Center (file/article extraction engines, the AiProvider seam, KnowledgePill) lives under context/center, and the AI entity-prompt classes move from the context/ root into context/entity. 'drive' was the legacy storage name; the REST surface already says contextCenter. Mechanical move — no behavior change; all moved-package suites green (48 tests). Co-Authored-By: Claude Fable 5 <[email protected]> * feat(context): reconciliation keeps pill identity across rephrasing and skips cross-source duplicates Extraction previously matched derived pills to stored ones by exact normalized question, so a model that reworded a question between runs retired the old pill and created a new one — losing its usageCount/lastUsedAt and its embedding for an unchanged fact. And nothing looked beyond the source being extracted, so one policy stated in two documents produced two pills. Reconciliation now runs three passes: exact question match, then word-overlap similarity for rephrasings (same gate as the server's duplicate probe — 0.6*question + 0.4*answer Jaccard at 0.85), then creation, where a best-effort search probe checks whether another source's automated pill already states the fact. A rephrase updates in place; a cross-source restatement is skipped and counted. Deliberately deterministic and lexical: the precision gate is word overlap, so vector recall could not change an outcome, only cost more. Semantic paraphrase and contradiction detection belong to the scheduled reconciliation pass, not to extraction time. Manual and chat-authored memories never suppress extraction — a user's private note must not silence a document's knowledge — and a probe failure degrades to creating the pill. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(context): review findings — batched memoryCount, throttle eviction, redundant index put - memoryCount was populated per-entity in setFields but never in either repository's setFieldsInBulk, so a list asking for it got 0/null while GET-by-id returned the real count. Both ContextFile and Page now fill it from one batched MENTIONED_IN query (MemoryCountFetcher), and Page clears it when unrequested like ContextFile already did. - The page extraction throttle evicted a pending page even when the incoming id was already tracked, so one actively-autosaved page could repeatedly cost unrelated pages their run. Evict only when the page is new. - Dropped a duplicate sourceType put in ContextMemoryIndex; the field is already stamped, null-safely, earlier in the same doc build. Co-Authored-By: Claude Fable 5 <[email protected]> * feat(context): memory extraction gets its own switch, independent of llmConfiguration.enabled llmConfiguration.enabled turns on embeddings, Ontology Studio AI and every other completion feature, so a deployment that enabled LLM features for semantic search was also, silently, asking every upload and article edit to spend model calls deriving knowledge pills. Extraction now needs llmConfiguration.memoryExtractionEnabled as well (LLMClientHolder.isMemoryExtractionEnabled = enabled AND extraction flag). Off by default in OpenMetadata: extraction here is unmetered, so it is opt-in and a large upload cannot become unbounded model spend on a self-hosted deployment without someone asking for it. Ontology Studio AI and the RDF endpoints keep reading isEnabled — this switch is extraction's alone. Co-Authored-By: Claude Fable 5 <[email protected]> * Update generated TypeScript types and dereferenced schemas * feat(context): restore the extracted-memories panel and status badges The revert in open-metadata#30041 removed the UI half of knowledge-pill extraction while this branch restored the backend. The memory -> source link survived (the view modal renders sourceEntity), but the source -> memories direction did not, so an article or file had no way to show what was derived from it. Restores the deleted components as they were and re-wires their call sites: - ExtractedMemoriesCard: lists a source's pills via GET /contextCenter/memories?sourceEntityId=..., opens each in the view modal - ArticleStatusBadge / DocumentStatusBadge: extraction status, with the processing error (or partial chunk coverage) as a tooltip - KnowledgePageDetailRightPanel: status row + collapsible memories card - DocumentPreviewPanel: status row, processing-error row, memories card - DocumentsView: "N memories" in the file row, status badge in the actions - ContextMemoryListParams regains sourceFileId/sourceEntityId; KnowledgePage regains processingStatus/processingError DocumentPreviewPanel also regains tw:min-h-0: the memories card is shrink-0, so without it the flex child cannot shrink to the scroll container and the panel body stops scrolling. MemoryStatusBadge and DerivedOntologyCard are deliberately not restored. Both render MemoryProcessingStatus, which tracks the Memory/Ontology Agent derivation rather than pill extraction, and nothing in the service stamps it on this branch — they would render nothing. The schema enum stays frozen, so reviving them needs no schema change. Tests: ExtractedMemoriesCard and KnowledgePageDetailRightPanel had no coverage before and now do (fetch params, empty/error states, view modal, owner-based delete permission, status row gating); DocumentPreviewPanel gains the status, memories and error-row cases; the playwright spec regains its Status assertion. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(context): stamp Processing when an article extraction run starts PageProcessingStatus has always declared Processing, but nothing wrote it: the pipeline went Queued -> Processed/Failed. Because the throttle coalesces autosaves over a five-minute quiet period, the UI badge sat on Queued for minutes and then jumped straight to Processed, with no way to tell a run in flight from one still waiting. Adds ContextProcessingEngine.markProcessing(UUID) -- a no-op by default, called from runExtraction after the shouldProcess hash gate rather than at the top, so an unchanged-content skip stays a single write instead of two. PageContextProcessingEngine overrides it to stamp Processing. FileContextProcessingEngine deliberately does not override it: ContextFileProcessingService already owns the file status flow (Uploaded -> Analyzing -> ExtractingContext -> Processed/Failed/Unsupported). Cost is one extra version-free page write plus a reindex per real run, and none per skip. Known gap, matching the in-memory throttle's existing behaviour for Queued: a JVM death between the Processing stamp and the terminal stamp leaves the article on Processing until its next body edit re-arms the run. The test helper that captured the single page write now captures all of them and asserts on the last, since a real run writes twice. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(context): a deleted source leaves no knowledge pills behind Hard-deleting a Context Center file left its pills in the database forever as soft-deleted rows. A hard delete runs the soft-delete pass first, which soft-deleted the pills; the hard pass then looked them up through deleteExtractedMemories, whose findTo used the default Include.NON_DELETED and so could not see the rows its own soft pass had just hidden. The result was invisible tombstones that still held their FQNs and their search and vector index entries -- exactly what the reconciler's deleteRetired comment argues against. deleteExtractedMemories now looks up with Include.ALL and always hard-deletes, so both delete paths converge on the same outcome: no memories. A pill is derived data, regenerable from its source, so it should not outlive the source in any form. This also makes the behaviour consistent for pages, which cannot soft-delete at all (page.json has no `deleted` property, so supportsSoftDelete is false) and therefore only ever reached the hard hook. restoreExtractedMemories and both restoreAdditionalChildren overrides are removed: with the pills hard-deleted there is nothing left to un-delete. A restored source is expected to re-derive its pills rather than resurrect tombstones. Covered by three ITs in ContextFileIT. They create pills through POST /contextCenter/memories with sourceEntity set, which writes the same MENTIONED_IN edge extraction does, so the cascade is exercised without a model call. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(context): article extraction no longer deletes relatedEntities Every extraction stamp silently wiped an article's related data assets and bumped its version. PageContextProcessingEngine.getPage loaded the page with getFields(""), which leaves the relationship-backed fields null; relatedEntities is in KNOWLEDGE_UPDATE_FIELDS, so the updater read that null as a removal and deleted the HAS rows. The article's own version history recorded it as `fieldsDeleted: relatedEntities` on the first stamp of every run. Loading getPutFields() instead makes the stamp a real read-modify-write, so relatedEntities, parent and children round-trip untouched. This also removes the version churn the surrounding comments say machine extraction avoids: the churn was never processingStatus (already recorded with updateVersion=false), it was the relationship deletion riding along with it. FileContextProcessingEngine keeps getFields(""), which is correct there: ContextFileRepository declares no patch/put fields, so a file has no updater-managed relationship to lose. Confirmed against a running instance -- a file's folder survives extraction. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(context): the duplicate probe can actually return a hit Cross-source dedup never fired. The probe passed the candidate's title, question and answer joined as one query string, and the search layer applies AND semantics to a bare query -- so every word had to occur in a single stored memory. Any one non-matching token returned zero hits, which made duplicateElsewhere unreachable and the "two documents stating one policy yield one pill" guarantee false. Measured on a running instance with two identical uploads: all seven pill pairs score 1.000 against the 0.85 gate, and the run still logged `0 duplicates skipped`. q="Tier B Vendor Requirements" -> 5 hits q="Tier B Vendor Requirements zzzqqqxyz" -> 0 hits q=<the probe's own query> -> 0 hits The query is now an OR of the candidate's distinct words, restoring should-style recall. Precision is unaffected: the reconciler re-scores every hit through the same deterministic Jaccard gate. Recall draws on title and question only. The answer's generic prose dilutes ranking -- including it, an exact duplicate placed 7th of the 10 hits fetched and on a larger corpus would fall out of the window; title plus question ranks that duplicate 2nd, which also matches the gate's own weighting of question over answer. Tokenizing on non-word characters replaces the old operator blacklist and is strictly safer: every clause is now a \w+ run, so candidate text can neither break the query nor smuggle in a lucene operator. The outage was invisible because the probe logs its failures at debug and ContextMemoryReconcilerTest supplies a fake probe, so nothing exercised the real query. New tests pin its shape, which is the whole of the defect. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(context): a rephrased question keeps its pill instead of churning it Reconciliation matched a derived pill to a stored one using DUPLICATE_THRESHOLD, the same 0.85 bar used to suppress a duplicate from another source. That conflates two different questions. Suppressing a duplicate means "another source already states this" and should demand near-verbatim agreement; keeping identity means "the model rephrased my fact", where 0.85 is far too strict -- so a single reworded question orphaned the pill, and re-extraction deleted and recreated most of a document's pills, losing their usageCount/lastUsedAt along the way. Measured on a running instance: editing one number in a seven-pill article produced 6 created, 1 updated, 1 kept, 5 deleted. Scoring each stored pill against its best new match gives 0.85 -> 2 of 7 keep identity 0.70 -> 4 of 7 0.50 -> 6 of 7 The seventh scores 0.175 because the model genuinely dropped that fact, so retiring it is correct and 6 is the ceiling. Splitting out IDENTITY_THRESHOLD at 0.5 reaches it with a wide margin over the true non-match (0.539 vs 0.175). DUPLICATE_THRESHOLD stays at 0.85 for cross-source suppression. The loose bar is safe because removeMostSimilar already claims the best match above the bar rather than the first, so a weaker candidate cannot take a pill a closer one should own -- now stated in its contract, since the bar no longer makes a wrong match implausible on its own. Both measured pairs are covered by tests. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(ui): extract nested ternary in ExtractedMemoriesCard to fix sonarjs/no-nested-conditional Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Rohit0301 <[email protected]> Co-authored-by: Rohit Jain <[email protected]>



Describe your changes:
Screen.Recording.2026-08-07.at.8.00.20.PM.mov
Screen.Recording.2026-08-07.at.8.00.39.PM.mov
Fixes #
I worked on ... because ...
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Summary by Gitar
ContextCenterDashboardPage.tsx,DashboardFoldersCard.tsx,ContextKnowledgePillarCard.tsx).UploadDocumentModal.component.tsx).ContextFileExtractionService.java).This will update automatically on new commits.