Skip to content

refactor(memory-lancedb): separate shared policy data - #196265

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/lancedb-policy-data-owner
Nov 27, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/lancedb-policy-data-owner

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Closes #196263

What Problem This Solves

LanceDB shared categories and text limits currently belong to configuration parsing, coupling policy consumers to that executable owner.

User Impact

No user-visible behavior change. Defaults, configured limits, categories, validation/errors, capture/recall authority and storage lifecycle remain unchanged.

Why This Change Was Made

Move the existing tuple/type and 500/1000 defaults verbatim into one private import-free data owner. Configuration and policy consume the limits, index consumes the categories while retaining configuration, and the store uses a type-only category import. Old private config exports are removed without aliases.

This removes one policy-to-config runtime edge and one erased store-type-to-config edge. The type edge is not runtime work. Index still imports config; no startup, bundle-size, CPU, memory or latency gain is claimed. The landed query-schema ownership from #196227 stays intact.

Evidence

  • Signed reviewed head: 7e33cf3dbfb7caf82bd82f3e3b9e5650d3bd296d; source base: cc5c2914c58bde53e0ef708620071213bce06ce8.
  • Exact five-file scope, 12 additions / 15 deletions: +152 bytes / -3 LF. New data owner is exactly 255 bytes / five LF; tuple order/readonly inference and defaults are byte-identical. Existing bodies and all 22 plugin test files are preserved.
  • Complete caller/private-contract census: only the four original consumers use these declarations. Package metadata, manifest, public SDK subpaths and default plugin export are unchanged.
  • Pinned formatter and normal human-signed commit hooks passed with no drift.
  • Fresh full precommit autoreview: one complete pass, no findings (0.99). Fresh complete clean committed-range local ClawSweeper: all five files, no truncation/cache hit, no findings (0.96). Source-only review is not runtime proof.
  • All six requested LanceDB suites passed on the signed head with a task-owned frozen installation (66 tests). Five-file format and lint, SDK export registration, extension import checks and the owning extension package typecheck passed.
  • The normal package build passed. A fresh-state smoke test loaded the emitted extension, checked its registration entry point and ordered categories, and exercised default limits, explicit overrides, nonfinite fallback and out-of-range rejection.
  • Fresh independent source review found no actionable defect. The manual draft run stopped at runner selection before product checks because its historical controller lacks the configured Boat backend. Ordinary PR CI still needs to pass.
  • Tests are unchanged and no performance claim is made; no matched cost study applies. No test allocation, baseline or assertion change.

@vincentkoc vincentkoc self-assigned this Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-lancedb Extension: memory-lancedb size: XS labels Nov 9, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR moves LanceDB categories and text-limit defaults from configuration parsing into a private, import-free module.

Example: LanceDB runs without explicit captureMaxChars or recallMaxChars settings.

  • Before: Capture defaults to 500 characters and recall to 1000 characters, with shared declarations owned by config.ts.
  • After: The same limits apply, with shared declarations owned by memory-policy-data.ts.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is focused and appears correct, but pending execution and package validation limit readiness confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-preserving refactor is outside the ordinary contributor proof gate; supplied evidence establishes source equivalence, while the draft explicitly leaves execution and package qualification pending.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored request approves this narrow ownership cleanup, and the patch matches that direction without adding behavior, options, or public API.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored draft open: the private declaration move is coherent and introduces no identified defect, but its requested validation remains pending.

Priority: P3
Reviewed head: 7e33cf3dbfb7caf82bd82f3e3b9e5650d3bd296d

Before merge

  • Complete next step - The PR author should complete the requested config, index, policy, auto-recall, recall-service, and startup suites plus static, build/package, and exact-head CI/security qualification before marking this PR ready.

Findings

None.

Agent review details

How this fits together

The LanceDB plugin accepts configuration and agent memory operations, applies capture and recall policy, and reads or writes agent-scoped memories; this change only relocates shared declarations consumed by those layers.

flowchart TD
  D[Shared policy data] --> C[Configuration parser]
  D --> P[Capture and recall policy]
  D --> E[Plugin entrypoint]
  C --> E
  P --> E
  E --> S[LanceDB store]
  S --> M[Agent scoped memories]
Loading

Technical review

Best possible solution:

Complete the existing draft’s validation and retain the verbatim private declaration move with unchanged behavior and public contracts.

Do we have a high-confidence way to reproduce the issue?

There is no reported runtime bug to reproduce; source inspection confirms the policy-to-config dependency targeted by the requested refactor.

Is this the best way to solve the issue?

The move is the smallest complete cutover for the approved scope: one import-free declaration owner, all consumers migrated, and no duplicate policy or retained aliases.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7554b069a703.

Provenance checked

  • Shared category declarations keeps the original intent (30338ce: The historical config-helper extraction grouped shared configuration declarations; this PR preserves their values and types while separating data from executable parsing.)
  • Capture and recall defaults keeps the original intent (feat/memory lancedb configurable capture limit en #16641: The capture-limit change made eligibility configurable; commit 32d76e2 subsequently bounded recall embedding queries with a 1000-character default.)
  • Policy and query ownership keeps the original intent (refactor(memory): split LanceDB plugin entry #113772: The earlier entrypoint split created focused policy modules; the later query-schema cleanup established a separate schema owner that this patch leaves intact.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit cc5c291 adds extensions/memory-lancedb/lancedb-schema.ts:4 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cc5c2914c58b; files: extensions/memory-lancedb/lancedb-schema.ts)

PR surface

Source -3. Total -3 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 12 15 -3
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 12 15 -3

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal dependency cleanup with no intended user-visible behavior change or claimed performance improvement.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the requested unchanged consumer suites, owning static checks, emitted-package qualification, and exact-head CI/security before marking the draft ready.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 9, 2026, 4:38 PM ET / 21:38 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 27, 2026 13:04
@vincentkoc
vincentkoc merged commit 30a48f6 into main Nov 27, 2026
230 of 233 checks passed
@vincentkoc
vincentkoc deleted the refactor/lancedb-policy-data-owner branch November 27, 2026 13:19
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-lancedb Extension: memory-lancedb P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(memory-lancedb): separate shared policy data from config parsing

1 participant