Skip to content

refactor(knowledge): close Source Ledger module - #210

Merged
kl3inIT merged 2 commits into
mainfrom
refactor/modulith-close-source-ledger
Aug 1, 2026
Merged

refactor(knowledge): close Source Ledger module#210
kl3inIT merged 2 commits into
mainfrom
refactor/modulith-close-source-ledger

Conversation

@kl3inIT

@kl3inIT kl3inIT commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • close the knowledge.sourceledger nested application module
  • restrict outgoing dependencies to ACL API, the Knowledge storage named interface, organization, permission, and shared/error contracts
  • replace the migration-state assertion with an executable closed-module assertion

Verification

  • initial closed-module probe and explicit allowlist both pass modules.verify()
  • focused Source Ledger, Connector, API, Worker, and Modulith tests (1m47s)
  • :core:test (1m24s)
  • python scripts/check_docs.py (399 Markdown files, 8 mirrored domain pairs)
  • pnpm release:check (37 release-policy tests)
  • ./gradlew.bat --no-daemon clean test (6m30s, 108 tasks)
  • cached diff hygiene

Scope

  • 5 changed files
  • includes production module metadata and tests; not a docs-only PR

Summary by CodeRabbit

  • Refactor
    • Closed the Source Ledger module boundary and documented its restricted public API.
    • Defined the approved module dependencies for Source Ledger.
  • Tests
    • Updated architectural verification to confirm the Source Ledger module is closed.
  • Documentation
    • Added a changelog entry describing the finalized module boundary and dependency policy.

@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: 49 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: 977efb6a-ea17-4f30-b269-fa8c01f3c22a

📥 Commits

Reviewing files that changed from the base of the PR and between c1b6c75 and c697934.

⛔ 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 (2)
  • .tegami/close-source-ledger-module.md
  • core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
📝 Walkthrough

Walkthrough

The Source Ledger module now has a closed boundary with explicit allowed dependencies. Its documentation and changelog reflect the boundary. Modulith verification now asserts that the module is closed.

Changes

Source Ledger Boundary

Layer / File(s) Summary
Declare the closed module boundary
core/src/main/java/com/orgmemory/core/knowledge/sourceledger/package-info.java, .tegami/close-source-ledger-module.md
The module changes from OPEN to CLOSED and allowlists ACL, storage, organization, permission, shared, and shared error dependencies. Documentation and the changelog describe the restricted API.
Verify the closed module state
core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
The Modulith test now asserts that the Source Ledger module is not open.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the refactor and the specific Source Ledger module change.
Description check ✅ Passed The description covers the outcome, dependency restrictions, verification evidence, scope, and documentation checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 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-close-source-ledger

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
close-source-ledger-module.md Close the Source Ledger module boundary
close-source-ledger-module.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: 2

🤖 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 @.tegami/close-source-ledger-module.md:
- Around line 11-12: Add or link an architecture challenge record for the Source
Ledger boundary described in close-source-ledger-module.md, documenting the
independent challenge and rejected alternatives for the closed public API and
dependency allowlist decision. Preserve the existing outcome while connecting it
to the repository’s established decision-governance flow.

In `@core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java`:
- Around line 44-47: Update sourceLedgerIsAClosedNestedModule() to assert the
exact allowed-dependencies set for the Source Ledger module: knowledge.acl,
knowledge::storage, organization, permission, shared, and shared::error.
Preserve the existing isOpen() assertion and modules.verify() behavioral check.
🪄 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: 1eb47b7e-33cb-4394-83f9-d2c07252b29d

📥 Commits

Reviewing files that changed from the base of the PR and between daeeb75 and c1b6c75.

⛔ Files ignored due to path filters (2)
  • docs/increments/active/2026-07-31-spring-modulith-package-refactor/design.md is excluded by !docs/**
  • docs/increments/active/2026-07-31-spring-modulith-package-refactor/plan.md is excluded by !docs/**
📒 Files selected for processing (3)
  • .tegami/close-source-ledger-module.md
  • core/src/main/java/com/orgmemory/core/knowledge/sourceledger/package-info.java
  • core/src/test/java/com/orgmemory/core/ModulithVerificationTests.java
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Backend · Java 25
🧰 Additional context used
📓 Path-based instructions (3)
**/*

📄 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:

  • core/src/main/java/com/orgmemory/core/knowledge/sourceledger/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:

  • core/src/main/java/com/orgmemory/core/knowledge/sourceledger/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/sourceledger/package-info.java
🔇 Additional comments (4)
core/src/main/java/com/orgmemory/core/knowledge/sourceledger/package-info.java (2)

12-18: LGTM!


6-11: 🗄️ Data Integrity & Integration

No change needed for the ACL dependency declaration.

knowledge.acl has no explicit @NamedInterface, and with an open module the default dependency target is the module’s root-package API (knowledge.acl::). The current knowledge.acl dependency is not allowing all internal package types.

			> Likely an incorrect or invalid review comment.
.tegami/close-source-ledger-module.md (1)

1-9: LGTM!

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

4-4: LGTM!

Comment thread .tegami/close-source-ledger-module.md
@kl3inIT
kl3inIT merged commit 4feaf5c 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