Skip to content

refactor(knowledge): move catalog and chunk values to Asset - #235

Merged
kl3inIT merged 4 commits into
mainfrom
refactor/modulith-asset-retrieval-values
Aug 1, 2026
Merged

refactor(knowledge): move catalog and chunk values to Asset#235
kl3inIT merged 4 commits into
mainfrom
refactor/modulith-asset-retrieval-values

Conversation

@kl3inIT

@kl3inIT kl3inIT commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • move Knowledge catalog projections, normalized text chunks, and pgvector encoding from Retrieval to Asset ownership
  • update Retrieval, Asset Registry, API, and Worker consumers to depend on Asset-owned root contracts
  • update JPQL constructor projections and move focused tests with their owners
  • add a failing-first architecture regression and refresh exact temporary boundary assertions

Verification

  • compileJava
  • focused moved-value, catalog, chunk, and Modulith tests
  • full :core:test :apps:api:test :apps:worker:test
  • docs operating-model check
  • Node 24.15 release check (37 tests)
  • terminating clean test (99 tasks)
  • post-main-merge focused/docs/release rerun
  • mechanical source, migration, diff, and zero-old-import checks

Scope

21 changed paths including 4 recognized renames (code PR, below 100-file limit).

Summary by CodeRabbit

  • Refactor

    • Consolidated knowledge catalog, text-chunk, and vector value ownership under the Asset domain.
    • Updated catalog, ingestion, registry, and retrieval integrations to use the consolidated contracts.
    • Clarified architecture and module documentation.
  • Tests

    • Added architectural checks to enforce module boundaries.
    • Updated affected tests to reflect the reorganized knowledge components.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kl3inIT, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 983bfe45-4c58-4262-9fd3-908ca1d044c6

📥 Commits

Reviewing files that changed from the base of the PR and between d537404 and 6fbc695.

⛔ Files ignored due to path filters (1)
  • docs/increments/active/2026-07-31-spring-modulith-package-refactor/plan.md is excluded by !docs/**
📒 Files selected for processing (1)
  • core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
📝 Walkthrough

Walkthrough

Knowledge catalog, text-chunk, and pgvector value types now belong to knowledge.asset. API, worker, registry, and retrieval consumers use the relocated types. Modulith tests and architecture documentation enforce the updated module boundary.

Changes

Asset ownership migration

Layer / File(s) Summary
Asset-owned value contracts
core/src/main/java/com/orgmemory/core/knowledge/asset/*
Moves KnowledgeCatalogItem, KnowledgeTextChunk, and PgVectorLiteral into the asset package. Updates asset repository projections and package documentation.
Consumer package updates
apps/api/..., apps/worker/..., core/src/main/java/com/orgmemory/core/{assetregistry,knowledge/retrieval}/..., core/src/test/...
Updates imports and test references to use asset-owned values.
Module boundary validation
ARCHITECTURE.md, core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java, .tegami/*, core/src/main/java/com/orgmemory/core/knowledge/retrieval/package-info.java
Documents and tests Asset ownership and the revised module dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes the summary and verification sections but omits the required Documentation impact section and its explanation. Add the Documentation impact section, complete its checklist items, and explain why public documentation does not change if applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: moving catalog and chunk values to Asset ownership.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/modulith-asset-retrieval-values

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Tegami

This repository uses Tegami to manage releases. When your changes affect published packages, add a changelog file under .tegami/ before merging.

Create a changelog → · Changelog format

Release preview

Package Bump Version
orgmemory minor 0.1.10.2.0

Changelogs in this PR

Changelog Title
asset-owned-catalog-chunk-values.md Move catalog and chunk values to Knowledge Asset
asset-owned-catalog-chunk-values.md Improvements

Run pnpm run tegami locally to create a changelog interactively.

Managed by Tegami.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java`:
- Around line 606-624: Update knowledgeAssetOwnsItsCatalogAndChunkValues() to
retain the existing negative dependency checks and add positive assertions that
the imported asset package contains
com.orgmemory.core.knowledge.asset.KnowledgeCatalogItem, KnowledgeTextChunk, and
PgVectorLiteral. Ensure the test fails when any relocated class is missing, not
only when legacy retrieval dependencies are present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 48bd4368-7717-4a8a-87d6-cd7996086d98

📥 Commits

Reviewing files that changed from the base of the PR and between cc81858 and d537404.

⛔ Files ignored due to path filters (1)
  • docs/increments/active/2026-07-31-spring-modulith-package-refactor/plan.md is excluded by !docs/**
📒 Files selected for processing (20)
  • .tegami/asset-owned-catalog-chunk-values.md
  • ARCHITECTURE.md
  • apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java
  • apps/api/src/test/java/com/orgmemory/api/assetregistry/AssetRegistryIntegrationTests.java
  • apps/worker/src/main/java/com/orgmemory/worker/ingestion/SourceIngestionProcessor.java
  • core/src/main/java/com/orgmemory/core/assetregistry/CapabilityPackService.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeAssetVersionRepository.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeCatalogItem.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeChunkDraftAssembler.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeChunkProjectionStore.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeTextChunk.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/PgVectorLiteral.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/package-info.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogService.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/SecureKnowledgeRetrievalStore.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/package-info.java
  • core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
  • core/src/test/java/com/orgmemory/core/knowledge/asset/KnowledgeChunkDraftAssemblerTests.java
  • core/src/test/java/com/orgmemory/core/knowledge/asset/PgVectorLiteralTests.java
  • core/src/test/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogServiceTests.java
💤 Files with no reviewable changes (3)
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeChunkDraftAssembler.java
  • core/src/test/java/com/orgmemory/core/knowledge/asset/KnowledgeChunkDraftAssemblerTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeChunkProjectionStore.java
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Backend · Java 25
  • GitHub Check: Web · Node 24
🧰 Additional context used
📓 Path-based instructions (4)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Treat the repository and runtime evidence as the engineering system of record; do not treat chat or Northstar as authoritative.
Before changing a domain, read its specification, test-coverage document, and applicable decision filenames.
Material decisions about domain boundaries, authorization, persistence, publication, concurrency, cache isolation, parity scope, or deployment require an independent architecture challenge and documented alternatives before implementation.
Do not use completed increment documents as the source for current behavior; use them only for history or archaeology.
Before using unfamiliar Spring Boot, Spring Modulith, Spring AI, Gradle, React, Vite, Tailwind, TypeScript, Next.js, or Fumadocs APIs, consult current official documentation, Context7, and the relevant verification skill.
Read docs/guidelines/agent-safety.md before retrieval, AI, MCP, permission, upload, graph, or export work; never commit secrets or customer data.
Keep ddl-auto=validate and pair every persisted-model change with a Flyway migration.
Use the testing harness; a terminating clean test is the JVM context gate, and bootRun is not verification.

Files:

  • apps/worker/src/main/java/com/orgmemory/worker/ingestion/SourceIngestionProcessor.java
  • apps/api/src/test/java/com/orgmemory/api/assetregistry/AssetRegistryIntegrationTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeAssetVersionRepository.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/SecureKnowledgeRetrievalStore.java
  • ARCHITECTURE.md
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/package-info.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/PgVectorLiteral.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogService.java
  • apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java
  • core/src/main/java/com/orgmemory/core/assetregistry/CapabilityPackService.java
  • core/src/test/java/com/orgmemory/core/knowledge/asset/PgVectorLiteralTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeTextChunk.java
  • core/src/test/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogServiceTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeCatalogItem.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/package-info.java
  • core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

Apply IDE inspection only to edited backend Java files.

Files:

  • apps/worker/src/main/java/com/orgmemory/worker/ingestion/SourceIngestionProcessor.java
  • apps/api/src/test/java/com/orgmemory/api/assetregistry/AssetRegistryIntegrationTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeAssetVersionRepository.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/SecureKnowledgeRetrievalStore.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/package-info.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/PgVectorLiteral.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogService.java
  • apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java
  • core/src/main/java/com/orgmemory/core/assetregistry/CapabilityPackService.java
  • core/src/test/java/com/orgmemory/core/knowledge/asset/PgVectorLiteralTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeTextChunk.java
  • core/src/test/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogServiceTests.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeCatalogItem.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/package-info.java
  • core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
core/src/main/java/com/orgmemory/core/{authorization,knowledge,permission}/**/*.java

⚙️ CodeRabbit configuration file

core/src/main/java/com/orgmemory/core/{authorization,knowledge,permission}/**/*.java: Treat PostgreSQL ACL evidence as canonical and OpenFGA as the relationship
authorization decision point. Authorization must fail closed. Filtering
must happen before ranking, LIMIT, graph traversal, answer generation,
export, and citation rendering. Flag metadata or timing leak paths.

Files:

  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeAssetVersionRepository.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/SecureKnowledgeRetrievalStore.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/package-info.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/PgVectorLiteral.java
  • core/src/main/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogService.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeTextChunk.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeCatalogItem.java
  • core/src/main/java/com/orgmemory/core/knowledge/asset/package-info.java
apps/api/src/main/java/**/*.java

⚙️ CodeRabbit configuration file

apps/api/src/main/java/**/*.java: Enforce the browser-BFF and resource-server boundaries. Authentication
must resolve an active internal actor through the explicit issuer and
subject binding. Reject identity, tenant, roles, or permissions supplied
by request payloads, JWT email, or untrusted JWT role claims.

Files:

  • apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java
🧠 Learnings (2)
📚 Learning: 2026-07-24T22:53:12.988Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 40
File: apps/api/src/main/java/com/orgmemory/api/knowledge/CitationContentController.java:0-0
Timestamp: 2026-07-24T22:53:12.988Z
Learning: For OrgMemory knowledge content handling in the API, treat `KnowledgeContentType` as the single closed policy (source of truth) for: canonical storage media type, browser-safe response media type, upload eligibility rules, and inline disposition behavior. Do not duplicate or bypass these decisions in controllers/services; route media-type and disposition logic through `KnowledgeContentType`. Specifically, Markdown should be stored with the canonical media type `text/markdown`, but served as `text/plain` when returning browser-safe citation preview content.

Applied to files:

  • apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java
📚 Learning: 2026-07-26T05:46:47.443Z
Learnt from: kl3inIT
Repo: kl3inIT/OrgMemory PR: 61
File: apps/mcp/src/main/java/com/orgmemory/mcp/McpSecurityConfiguration.java:50-52
Timestamp: 2026-07-26T05:46:47.443Z
Learning: In OrgMemory, treat the `apps/mcp` and `apps/api` as independent protocol adapter modules. When adjusting OAuth/wire-level scopes, do not introduce a shared Java constant or create a code dependency from `apps/mcp` to `apps/api` solely to deduplicate scope values. Instead, keep OAuth/scope constants adapter-local (e.g., in the relevant adapter/security configuration classes) and ensure cross-adapter consistency via automated realm/OAuth/authorization tests, rather than via shared wiring-level constants or cross-module references.

Applied to files:

  • apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java
🔇 Additional comments (17)
core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeCatalogItem.java (1)

1-6: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeTextChunk.java (1)

1-6: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/asset/KnowledgeAssetVersionRepository.java (1)

3-3: LGTM!

Also applies to: 21-21, 47-47

core/src/main/java/com/orgmemory/core/knowledge/asset/package-info.java (1)

6-8: LGTM!

apps/api/src/main/java/com/orgmemory/api/knowledge/KnowledgeCatalogController.java (1)

4-4: LGTM!

apps/api/src/test/java/com/orgmemory/api/assetregistry/AssetRegistryIntegrationTests.java (1)

58-58: LGTM!

apps/worker/src/main/java/com/orgmemory/worker/ingestion/SourceIngestionProcessor.java (1)

28-28: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogService.java (1)

3-3: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/asset/PgVectorLiteral.java (1)

1-5: LGTM!

Also applies to: 35-36

core/src/main/java/com/orgmemory/core/assetregistry/CapabilityPackService.java (1)

3-3: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/retrieval/SecureKnowledgeRetrievalStore.java (1)

3-3: LGTM!

core/src/test/java/com/orgmemory/core/knowledge/retrieval/KnowledgeCatalogServiceTests.java (1)

9-9: LGTM!

ARCHITECTURE.md (1)

134-136: LGTM!

core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java (1)

700-704: LGTM!

Also applies to: 749-757, 774-776

core/src/test/java/com/orgmemory/core/knowledge/asset/PgVectorLiteralTests.java (1)

1-1: LGTM!

core/src/main/java/com/orgmemory/core/knowledge/retrieval/package-info.java (1)

6-8: LGTM!

.tegami/asset-owned-catalog-chunk-values.md (1)

1-14: LGTM!

Comment thread core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java Outdated
@kl3inIT
kl3inIT merged commit c29cc75 into main Aug 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant