Skip to content

refactor(core): introduce FrilVault facade and reduce public surface#81

Merged
mors119 merged 2 commits into
FrilLab:mainfrom
mors119:refactor/app-api
Jun 19, 2026
Merged

refactor(core): introduce FrilVault facade and reduce public surface#81
mors119 merged 2 commits into
FrilLab:mainfrom
mors119:refactor/app-api

Conversation

@mors119

@mors119 mors119 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactor core app entry and note request API.

Type of Change

  • feat
  • fix
  • docs
  • refactor
  • test
  • chore

Required

  • cargo check passes
  • cargo fmt --all --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test passes

Checklist

  • Code builds successfully
  • Tests pass
  • Documentation updated

Summary by CodeRabbit

  • Refactor
    • Reorganized internal module structure and improved encapsulation
    • Updated core library service APIs with refined request types
    • Removed Node.js native bindings from the workspace; CLI functionality remains unchanged

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mors119, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 39 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3bc8feb0-c045-49eb-ad59-7d47a78c306a

📥 Commits

Reviewing files that changed from the base of the PR and between 9e4020d and b8c8dfa.

📒 Files selected for processing (2)
  • apps/vscode-extension/scripts/build-native.js
  • apps/vscode-extension/src/extension.ts
📝 Walkthrough

Walkthrough

The PR removes the frilvault-node N-API crate from the workspace and deletes all its source. It renames AddNoteInput to AddNoteRequest throughout frilvault-core, restructures the crate's public module surface by introducing a new app module with re-exports, updates service factory return types from anyhow::Result to FrilVaultResult, and rewires all CLI command imports from the removed local crate::app to frilvault_core directly.

Changes

Core API restructuring, DTO rename, and frilvault-node removal

Layer / File(s) Summary
Remove frilvault-node crate
Cargo.toml, crates/frilvault-node/Cargo.toml, crates/frilvault-node/src/lib.rs
Removes crates/frilvault-node from workspace members and deletes all N-API exported functions (add_line_note, list_notes, update_note, delete_note, search_notes, workspace_stats, workspace_health, repair_suggestions, apply_repairs) and the crate's manifest.
Rename AddNoteInput → AddNoteRequest in DTO and entity layer
crates/frilvault-core/src/note/dto/add_note_request.rs, crates/frilvault-core/src/note/dto/mod.rs, crates/frilvault-core/src/note/entity/mod.rs, crates/frilvault-core/src/note/entity/note.rs
Renames the struct, adds add_note_request to the dto module with wildcard re-export alongside note_view, removes add_note_input from entity module declarations and re-exports, and updates Note::new to accept AddNoteRequest.
Restructure frilvault-core public API and service factories
crates/frilvault-core/src/lib.rs, crates/frilvault-core/src/constants.rs, crates/frilvault-core/src/app/mod.rs, crates/frilvault-core/src/app/frilvault.rs
Introduces pub mod app with pub use app::* in lib.rs, changes constants/parser/runtime/storage/workspace from pub mod to private, comments out SCHEMA_VERSION, and updates create_note_service and create_workspace_service return types from anyhow::Result to FrilVaultResult with adjusted VaultContext ownership.
Update NoteService and rewire CLI commands
crates/frilvault-core/src/note/note_service.rs, apps/frilvault-cli/src/main.rs, apps/frilvault-cli/src/command/*.rs, apps/frilvault-cli/src/output.rs
Makes vault_context field private in NoteService, updates add_note parameter to AddNoteRequest, removes mod app from CLI crate root, and rewires all CLI command imports (add, delete, doctor, list, repair, search, stats, update) from crate::app to frilvault_core.
Update all tests to use AddNoteRequest
crates/frilvault-core/src/tests/*
Updates imports and add_note/Note::new call sites across all test modules (note_entity_test, note_service_test, repair_engin_test, vault_context_test, workspace_index_repository_test, yaml_repository_test) to use AddNoteRequest instead of AddNoteInput.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • FrilLab/frilvault#38: Defines the original AddNoteInput struct and NoteService::add_note API that this PR renames to AddNoteRequest.
  • FrilLab/frilvault#68: Adds the VS Code extension native bridge that depends on the frilvault-node crate being removed here.
  • FrilLab/frilvault#57: Reorganizes the core note/workspace module surfaces that this PR further restructures by making sub-modules private and introducing the app re-export.

Poem

🐇 Snip snip goes the node crate's cord,
AddNoteInput swapped for Request restored,
The app module blooms with re-exports bright,
And CLI commands now point to core just right.
Hop hop, the workspace trimmed and neat —
One rabbit's refactor, quite complete! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 67.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main refactoring objective: introducing a FrilVault facade and reducing the public surface of the API, which is demonstrated throughout the changeset via module visibility changes, re-exports, and service factory relocations.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@mors119 mors119 merged commit a8bafdc into FrilLab:main Jun 19, 2026
3 checks passed
@mors119 mors119 deleted the refactor/app-api branch June 19, 2026 12:42
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