Repository navigation
refactor(memory): split LanceDB plugin entry - #113772
Conversation
8475a0b to
d4cd5cd
Compare
|
Land-ready proof for head
Known proof gaps: none. ClawSweeper rank-up move handled: |
|
Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 1:55 PM ET / 17:55 UTC. ClawSweeper reviewWhat this changesThis PR splits the bundled LanceDB memory plugin’s 2,106-line entry module into embeddings, CLI, capture/sanitization, and policy modules while retaining manifest registration, lifecycle hooks, and live configuration resolution in the entry file. Merge readinessKeep open for normal maintainer review. The branch is a focused, behavior-neutral internal refactor that preserves the LanceDB plugin entrypoint while extracting cohesive implementation areas; the supplied focused tests, hosted full checks, and PR-local follow-up commit support the intended boundary. Its Priority: P3 Review scores
Verification
How this fits togetherThe LanceDB memory plugin receives agent lifecycle and CLI inputs, resolves plugin configuration and embeddings, then captures and recalls long-term memory through its storage and tool paths. The entry module is the plugin loader boundary, while the extracted modules implement internal policy and data-processing work. flowchart LR
A[Agent lifecycle and CLI inputs] --> B[LanceDB plugin entry]
B --> C[Configuration and lifecycle hooks]
C --> D[Embeddings and LanceDB storage]
C --> E[Capture policy and sanitization]
D --> F[Recall and memory tools]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Other -1. Total -4 across 6 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or refresh this branch against current Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is an internal refactor, not a report of broken runtime behavior. The relevant verification is preservation of existing plugin behavior through focused tests and boundary checks. Is this the best way to solve the issue? Yes. Keeping the plugin-loader entry and long-lived hooks in AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6f1950ec1a1b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refactor(memory): split LanceDB plugin entry * refactor(memory): keep hooks in plugin entry
What Problem This Solves
The LanceDB memory plugin entry had grown to 2,106 lines and mixed manifest registration, embeddings, CLI parsing, capture policy, transport-envelope sanitization, tools, and lifecycle hooks in one file. That made the plugin difficult to review and kept it on the max-lines suppression baseline.
Why This Change Was Made
This behavior-neutral refactor keeps manifest registration, long-lived typed hooks, and live runtime config resolution in
extensions/memory-lancedb/index.ts, while moving embeddings, CLI parsing/registration, capture policy, and transport-envelope sanitization into focused modules. The sanitizer remains one intact plugin-owned block because it mirrors private core envelope contracts that bundled plugins cannot import directly.Beyond the split
User Impact
No user-visible behavior, config, storage schema, protocol, dependency, or lazy-import behavior changes. Maintainers get smaller modules with the same manifest entry contract, hook ownership, and public named exports.
Evidence
+1479/-1482; tests+0/-0; overall+1479/-1483.node scripts/run-vitest.mjs extensions/memory-lancedb/index.test.ts— 137/137 tests passed.node scripts/run-vitest.mjs src/plugins/contracts/boundary-invariants.test.ts— 13/13 tests passed.node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --timing-json -- bash -lc 'corepack pnpm deadcode:exports && corepack pnpm check:changed && corepack pnpm build'— passed on Blacksmith Testboxtbx_01kyd5gqrrqchb3z6twb4qemwb; deadcode exports, extension prod/test typechecks, lint, formatting, max-lines ratchet, plugin boundaries, SDK contracts, import cycles, and full build all green (run). No[INEFFECTIVE_DYNAMIC_IMPORT]..agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output— clean, no accepted/actionable findings (0.98 confidence).origin/main@a1d666fdc3f; numstat unchanged.The first hosted run correctly caught that typed hook registration must remain in the manifest entry and that extraction-only exports were unused. The final structure incorporates both findings without changing contract inventories or weakening gates.
Bugs Found
None.
Placement Findings
None. The envelope sanitizer intentionally stays plugin-local: its comments identify the private core producer contracts it mirrors, while the extension boundary forbids importing those internals.
Baseline
Removed
extensions/memory-lancedb/index.tsfromconfig/max-lines-baseline.txt; every resulting file is under budget (largest: 665 lines).AI-assisted maintainer-commissioned refactor; the implementation and proof were reviewed before submission.