Skip to content

Fixes #34710: Start memories as Unprocessed - #34717

Merged
pmbrull merged 5 commits into
mainfrom
pmbrull/memory-unprocessed-default
Oct 7, 2026
Merged

pmbrull merged 5 commits into
mainfrom
pmbrull/memory-unprocessed-default

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #34710

Follow-up to #34647. Creating a memory without entityStatus now starts it as Unprocessed, so a newly captured assumption does not immediately become trusted grounding.

Approved memories retain their approval when their content is amended. Reprocessing requires an explicit transition back to Unprocessed. Context Center shows Approved and Unprocessed memories by default, and the overview and sidebar counts use the same filter.

Type of change:

  • Breaking change (the default status of newly created memories changes)

High-level design:

  • Reuse the existing Unprocessed entity status in ContextMemoryRepository; allow pending memories to be approved, rejected, superseded, or archived, and allow reviewed memories to be explicitly requeued.
  • Preserve existing stored statuses and the existing behavior of PUT/PATCH requests that omit the stage. An answer edit on an Approved memory does not silently requeue it.
  • Keep ordinary search and grounding restricted to Approved memories. Show pending memories through Context Center's explicit status filters, including its overview and sidebar badge. Pending memories cannot propose glossary terms.
  • Update schema descriptions and regenerate the corresponding TypeScript models. No migration is needed: no field, enum value, or stored representation is added, and existing rows are not reclassified.
  • Make trusted search, ontology, MCP, and Most Cited dashboard test fixtures explicitly Approved. A narrow search-fixture hook in BaseEntityIT keeps generic default-stage and omitted-stage PUT tests exercising requests that omit entityStatus.

Rollout: clients that require immediately trusted memories must explicitly send entityStatus: "Approved", or approve a pending memory after processing. Existing producers that already supply Approved keep their behavior. This PR supplies the OSS lifecycle foundation; candidate-only reconciliation and conflict review tasks belong to the companion application work, rather than introducing another status here.

Tests:

Use cases covered

  • A create request that omits its stage returns Unprocessed.
  • Pending memories can be resolved, and reviewed memories can be explicitly requeued.
  • Approving a pending memory, editing its answer, and then requeueing it preserves the reviewed content and changes the stage only when requested.
  • A PUT without a stage preserves the current lifecycle and retirement metadata.
  • Ordinary search, visibility controls, MCP retrieval, and ontology proposals continue to use explicitly approved fixtures.
  • Pending memories appear in the default UI view, display their status, cannot propose terms, and disappear when the Unprocessed filter is removed.
  • Existing status/search/author/sort combinations and linked-memory modal navigation continue to work.
  • The overview includes Unprocessed memories, its View All Memories navigation works with only pending memories, and Most Cited excludes an Unprocessed memory even when its citation count is higher. Dashboard tests create and clean their own fixtures.

Unit tests

  • Added/updated tests for the changed logic.
  • Backend: 59 passed across ContextMemoryStatusTransitionTest, ContextMemoryLifecycleTest, EntityRepositoryEntityStatusTest, ContextMemorySchemaTest, and ContextMemoryReconcilerTest.
  • Frontend: 26 passed across ContextCenterMemoriesPage.test.tsx, CreateMemoryModal.test.tsx, and useContextCenterBadges.test.tsx.
  • Measured JaCoCo coverage: 100% of changed executable repository lines (7/7). The focused unit run covers 4.27% of the full ContextMemoryRepository class; its database behavior is exercised by the integration suite below.
  • Measured Jest line coverage: 77.49% for ContextCenterMemoriesPage.tsx and 100% for useContextCenterBadges.ts. The page-wide figure includes existing handlers outside this change.

Backend integration tests

  • Added/updated API integration tests.
  • 242 passed, 26 skipped, 0 failures/errors across ContextMemoryIT, ContextMemoryLifecycleIT, ContextMemoryAnchorIT, OntologyChangeSetIT, and McpContextMemoryVisibilityIT using isolated PostgreSQL and Elasticsearch containers.
  • ContextMemoryLifecycleIT includes the default-status and approval/edit/requeue regression scenarios.

Ingestion integration tests

  • Not applicable — no ingestion behavior or connector changes; schemas only change descriptions.

Playwright (UI) tests

  • Updated playwright/e2e/Features/ContextCenterMemoryLifecycle.spec.ts and ContextCenterDashboard.spec.ts with pending-memory and Approved-only citation coverage.

ContextCenterDashboard.spec.ts: 9 passed; ContextCenterMemoryLifecycle.spec.ts: 4 passed in Chromium against the changed OSS service and UI (64.7 seconds total, no retries). Both tests that failed in CI now pass.

The pillar navigation test also passed independently with no Approved memories present; its own Unprocessed fixture enables the Memories link. Playwright lint and the changed-file UI checkstyle checks passed.

The isolated integration-test server's authentication metadata was set to basic for browser testing; its default openmetadata provider is not rendered by the UI. Production authentication code is unchanged.

Manual testing performed

Reviewed the captured browser flow against the isolated local OSS stack as admin. The API and UI steps were executed by the integration and browser tests, rather than by hand:

  1. Create a memory while omitting entityStatus; verify the returned Unprocessed stage and its visibility under the default two-status filter.
  2. Open its details; verify the Unprocessed label and absence of the Propose Term action.
  3. Remove Unprocessed from the filter; verify the view shows Approved and hides the pending memory.
  4. Approve a pending memory through the API, amend its answer without setting a stage, and verify it remains Approved. Explicitly set Unprocessed and verify its answer is retained.

Also verified: backend reactor install and integration-test compilation, schema/model regeneration, focused UI ESLint, and all commit-time JSON, Java formatting, UI formatting, license, and Tailwind gates.

UI screen recording / screenshots:

unprocessed-memory.webm

Pending memory details show Unprocessed and do not offer Propose Term

Checklist:

  • I have read the contributing guidelines.
  • My PR title is Fixes #34710: Start memories as Unprocessed.
  • My PR is linked to a GitHub issue via Fixes #34710 above.
  • Lifecycle/search fixture intent is documented where needed.
  • For JSON Schema changes: explained why a migration is not needed.
  • For UI changes: attached the captured recording and screenshot above.
  • Added/updated relevant unit, integration, and Playwright tests and listed the results above.
  • Added the Backward-Incompatible-Change label.

New memories must await processing before they ground agent responses.
Keep approved edits trusted until explicitly requeued.

BREAKING CHANGE: memory creation without entityStatus starts Unprocessed
instead of Approved. Trusted producers can still set Approved explicitly.
Existing statuses and PUT requests that omit the stage are preserved.

Fixes #34710
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 6, 2026
@pmbrull
pmbrull marked this pull request as ready for review October 6, 2026 06:30
Copilot AI balanced review requested due to automatic review settings October 6, 2026 06:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 836 → 836
- 0 added, 0 removed, 8 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/ContextCenterUtil.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts
  openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/table.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/topic.ts
  openmetadata-ui/src/main/resources/ui/src/pages/ContextCenterPage/ContextCenterMemoriesPage/ContextCenterMemoriesPage.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

Copilot AI balanced review requested due to automatic review settings October 6, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 75%
75.7% (117086/154652) 61.48% (72101/117263) 62.82% (24021/38233)

@pmbrull
pmbrull added this pull request to the merge queue Oct 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — merge_conflict (2026-10-06T11:39:27Z)

The entry left the queue before it was built, so no checks ran against it.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 12:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · New memories default to Unprocessed, changing API creation and grounding eligibility.

Implements default Unprocessed status for newly created memories so assumptions don't immediately become trusted grounding. Approved memories retain their status when edited, and explicit transitions are required for reprocessing. Changes include lifecycle management in ContextMemoryRepository, UI visibility filters in Context Center, and comprehensive test coverage across backend integration, unit, and Playwright tests—all passing with no issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-06T17:33:38Z)

Blocked the queue: py-tests-status

  • py-tests-postgres — py-tests-status, python / Verify Expected Jobs, python / Integration Tests (shard-1)

This branch was previously deployed

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

Labels

Backward-Incompatible-Change Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New memories should await processing before grounding

4 participants