[PR #1864] [MERGED] Auto-vectorize Lorebook Keeper updates #5324

Closed
opened 2026-10-22 04:15:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1864
Author: @cha1latte
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @cha1latte

Base: refactor ← Head: feat/issue-1854-keeper-auto-vectorize


📝 Commits (2)

  • 1b20d9e Auto-vectorize Lorebook Keeper updates
  • df4d0e7 Trigger CI with updated PR body

📊 Changes

4 files changed (+357 additions, -11 deletions)

View changed files

📝 src-tauri/src/commands/storage/prompts.rs (+158 -3)
➕ src/features/catalog/lorebooks/lib/lorebook-keeper-updates.test.ts (+129 -0)
📝 src/features/catalog/lorebooks/lib/lorebook-keeper-updates.ts (+62 -7)
📝 src/shared/api/lorebook-command-api.ts (+8 -1)

📄 Description

Linked issue

Closes #1854

Why this change

  • Lorebook Keeper clears stale embeddings when it creates or changes entries, but users had to remember to manually re-vectorize afterward for semantic matching.

What changed

  • Added best-effort auto-vectorization after Lorebook Keeper creates or modifies an entry.
  • Limited the vectorization command to the Keeper-touched entry IDs instead of re-vectorizing the whole lorebook.
  • Allowed the vectorize command to use the configured default embedding connection when no explicit connection is supplied.
  • Added regression coverage for create/update/failure/delete paths and targeted vectorization.

Refactor impact

Primary owner:

  • Catalog lorebooks, with shared API and Rust storage command support.

Impact areas reviewed:

  • Lorebook Keeper apply flow
  • Manual lorebook vectorization command behavior
  • Remote-capable lorebook_vectorize command surface

Boundary notes:

  • Feature code calls the focused shared API wrapper.
  • Rust storage owns provider/vector persistence.
  • Engine code stays React-free and unchanged.

Pressure points touched:

  • src-tauri/src/commands/storage/prompts.rs
  • src/features/catalog/lorebooks/lib/lorebook-keeper-updates.ts
  • src/shared/api/lorebook-command-api.ts

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran pnpm test src/features/catalog/lorebooks/lib/lorebook-keeper-updates.test.ts.
  • Codex ran cargo test --manifest-path src-tauri/Cargo.toml vectorize_lorebook --workspace.
  • Codex ran pnpm check.
  • Live embedding-provider verification was not performed in this environment.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • No new UI or discoverable surface; this extends existing Lorebook Keeper and semantic vectorization behavior.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A - no visible UI changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1864 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `feat/issue-1854-keeper-auto-vectorize` --- ### 📝 Commits (2) - [`1b20d9e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1b20d9eee4a4379120b960a581fdbfc268111c06) Auto-vectorize Lorebook Keeper updates - [`df4d0e7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/df4d0e77282fc79a7e094bbd182027f6c9ab19f3) Trigger CI with updated PR body ### 📊 Changes **4 files changed** (+357 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/prompts.rs` (+158 -3) ➕ `src/features/catalog/lorebooks/lib/lorebook-keeper-updates.test.ts` (+129 -0) 📝 `src/features/catalog/lorebooks/lib/lorebook-keeper-updates.ts` (+62 -7) 📝 `src/shared/api/lorebook-command-api.ts` (+8 -1) </details> ### 📄 Description ## Linked issue Closes #1854 ## Why this change - Lorebook Keeper clears stale embeddings when it creates or changes entries, but users had to remember to manually re-vectorize afterward for semantic matching. ## What changed - Added best-effort auto-vectorization after Lorebook Keeper creates or modifies an entry. - Limited the vectorization command to the Keeper-touched entry IDs instead of re-vectorizing the whole lorebook. - Allowed the vectorize command to use the configured default embedding connection when no explicit connection is supplied. - Added regression coverage for create/update/failure/delete paths and targeted vectorization. ## Refactor impact Primary owner: - Catalog lorebooks, with shared API and Rust storage command support. Impact areas reviewed: - Lorebook Keeper apply flow - Manual lorebook vectorization command behavior - Remote-capable `lorebook_vectorize` command surface Boundary notes: - Feature code calls the focused shared API wrapper. - Rust storage owns provider/vector persistence. - Engine code stays React-free and unchanged. Pressure points touched: - `src-tauri/src/commands/storage/prompts.rs` - `src/features/catalog/lorebooks/lib/lorebook-keeper-updates.ts` - `src/shared/api/lorebook-command-api.ts` ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `pnpm test src/features/catalog/lorebooks/lib/lorebook-keeper-updates.test.ts`. - Codex ran `cargo test --manifest-path src-tauri/Cargo.toml vectorize_lorebook --workspace`. - Codex ran `pnpm check`. - Live embedding-provider verification was not performed in this environment. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - No new UI or discoverable surface; this extends existing Lorebook Keeper and semantic vectorization behavior. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A - no visible UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:15 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5324
No description provided.