Skip to content

fix(memory): repair search package boundaries - #173641

Merged
steipete merged 2 commits into
mainfrom
ci/fix1-memory-core-package-boundaries
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
ci/fix1-memory-core-package-boundaries

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Related: #172681

What Problem This Solves

Fixes the memory-core package contracts broken when search primitives moved to the database engine.

User Impact

Memory-core declares the Kysely runtime dependency its search implementation uses. The existing SDK storage facade exports the native vector loader directly from its engine owner. Search behavior and SDK export names stay unchanged.

Why This Change Was Made

The search migration added three Kysely value imports without updating memory-core's manifest, and the private memory-host storage barrel directly reached into core. Declare the already pinned Kysely 0.29.6 in the owning plugin and move the existing loader re-export to the SDK facade. Remove the private barrel forwarding path. No new dependency version, SDK subpath, contract allowance, or test change.

The first PR head routed the loader through the schema-only SQLite bridge. CI correctly caught three wrapper closure failures because that expanded the bridge's import graph. The final change restores that bridge exactly and keeps vector loading on the existing SDK storage surface; the wrapper inventory remains unchanged.

Evidence

Both unchanged package contract files reproduced the main failures (2 failed / 510 passed). The first-head wrapper regressions also reproduced locally (3 failed / 18 passed).

The revised patch passes all 542 cases across six files: 512 package contracts, six native loader cases, three memory-core KNN cases through the SDK facade, and 21 wrapper closure cases. All use the repository runner with --maxWorkers=1. Targeted source-graph types, core lint, formatting, frozen installation and P2 review pass. PR CI supplies broad build and packaging proof.

Declare the existing Kysely pin for memory-core search and route the moved
sqlite-vec loader through the private host package SQLite bridge. Repairs
the two unchanged fast-contract failures introduced by #172681 without
changing search behavior, SDK exports, or contract allowances.

Proof: 512 plugin contracts, 6 native loader cases and 3 KNN cases pass;
targeted types, core lint, formatting, frozen install and P2 review pass.
@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@steipete
steipete marked this pull request as ready for review October 16, 2026 01:54
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 92095a067f24da6e7c60091317c6d07e8cc6c6b3
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

  • pnpm-lock.yaml
  • extensions/memory-core/package.json

Carefully review these changes before merging.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T02:14:41.899180Z 92095a0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

steipete added a commit that referenced this pull request Oct 16, 2026
Hourly 38832586414 exposed exports left public after the file-transfer
classifier and engine-owned memory search migrations. Keep those helpers
private, along with the unused plugin-state read alias and install-action
DOM alias; their implementations and actual consumers remain intact.

Model the documented standalone Doctor proof as a real executable entry
and use the production-shaped dynamic chat route import in its existing
test. Preserve every route export and assertion; add no Knip ignores.

The requested three audits reproduced on main 4cf3df6. With the
reviewed candidate, production/script exports and all unused-file scans
pass; full-tree exports only reports TranscriptTestHost, covered by the
active ready PR #173575. After proof, omit the lazy-error/loading adapter
hunks because new ready PR #173638 deletes those files. Their findings
remain until that PR lands. Memory package repair #173641 is independent;
this commit changes no dependencies, SQL, or engine contracts.

Proof: 151 tests across 12 focused files, each invoked with
pnpm test <file> --maxWorkers=1; summed wall time 548.15s. The changed
router-outlet-legacy.test.tsx passed in 23.00s with all assertions retained.
Core, scripts, extensions, UI, memory-core and UI-app test typechecks pass,
as do targeted typed lint, boundary lint, formatting and diff checks.
Stale generated SDK declarations were regenerated normally before the
memory package typecheck passed. Isolated P2 review: scoped-clean.
Export the existing engine-owned vector loader directly from its SDK
storage facade and remove the private package forwarding path. Keep the
schema-only host bridge unchanged so PR wrapper consumers do not acquire
vector-loader imports. No wrapper inventory or contract allowance changes.

The initial route reproduced three wrapper closure failures locally.
The revised six-file proof passes all 542 cases; targeted types, core lint,
formatting and P2 review pass.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR declares memory-core’s existing Kysely dependency and routes SQLite vector-loader exports through the private host bridge.

Example: Installing memory-core with its declared dependencies and importing its search implementation.

  • Before: Search imports Kysely 0.29.6 without declaring it in memory-core’s runtime dependencies.
  • After: The manifest and lockfile declare Kysely 0.29.6 for memory-core.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The repair has clear value and focused validation, but a confirmed extracted-wrapper import failure blocks merge.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports contract, native-loader, and KNN validation, while exact-head CI independently exposes the wrapper regression.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Memory search relies on a runtime dependency missing from its owning plugin manifest, while its host storage barrel violates the established core-import boundary.
Reason: This maintainer-authored repair restores existing contracts without adding options, changing search behavior, or expanding the public SDK.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this useful maintainer-authored repair open; the new bridge export introduces a confirmed PR-wrapper dependency-closure failure that needs a focused inventory fix.

Priority: P2
Reviewed head: cabe160bb1ee078a72c2bf42e91b2934e77dbce2

Before merge

  • [P2] Include the vector loader in the extracted wrapper inventory (P2) - This static re-export adds sqlite-vec.ts to every consumer of the SQLite bridge, including the PR wrapper’s extracted schema dependencies. scripts/pr-lib/wrapper-components.txt includes this bridge but omits src/infra/database-engine/sqlite-vec.ts, so extracted execution cannot resolve the new import. Exact-head CI confirms both the missing inventory entry and unresolved bridge import in the existing wrapper closure tests. Add the loader to the canonical inventory so the package-boundary fix does not break extracted wrapper execution.

Findings

  • [P2] [P2] Include the vector loader in the extracted wrapper inventory — packages/memory-host-sdk/src/host/openclaw-runtime-sqlite.ts:31-34

Tests

  • Missing end-to-end proof: The existing extracted-wrapper closure checks fail on this head and must pass after completing its source inventory.
Agent review details

How this fits together

Memory-core consumes search and storage helpers through Plugin SDK facades; the private memory host package bridges those helpers to core database-engine implementations.

flowchart LR
  A[Memory core search] --> B[Plugin SDK facade]
  B --> C[Memory host storage barrel]
  C --> D[SQLite runtime bridge]
  D --> E[Database engine loader]
  F[PR wrapper extraction] --> D
Loading

Technical review

Best possible solution:

Keep the package-boundary repair and include the newly reachable vector loader in the PR wrapper’s canonical inventory.

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

The existing dependency and package-boundary contracts expose the original defects directly; exact-head CI additionally records the introduced extracted-wrapper import failure, without requiring local execution.

Is this the best way to solve the issue?

The dependency declaration and bridge routing restore the intended ownership boundaries, but the bridge’s expanded import graph must also be reflected in wrapper extraction.

Full review comments:

  • [P2] [P2] Include the vector loader in the extracted wrapper inventory — packages/memory-host-sdk/src/host/openclaw-runtime-sqlite.ts:31-34
    This static re-export adds sqlite-vec.ts to every consumer of the SQLite bridge, including the PR wrapper’s extracted schema dependencies. scripts/pr-lib/wrapper-components.txt includes this bridge but omits src/infra/database-engine/sqlite-vec.ts, so extracted execution cannot resolve the new import. Exact-head CI confirms both the missing inventory entry and unresolved bridge import in the existing wrapper closure tests. Add the loader to the canonical inventory so the package-boundary fix does not break extracted wrapper execution.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 74b7df7e5546.

Provenance checked

  • Memory storage loader export keeps the original intent (20b5969: Move native sqlite-vec loading into the database engine while keeping memory search policy with its existing callers.)
  • SQLite host bridge keeps the original intent (20b5969: The search migration already routed engine schema helpers through this bridge; the repair follows that established ownership boundary.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test test/scripts/pr-wrapper-source-closure.test.ts
  • pnpm test test/scripts/eager-import-closure.test.ts
  • pnpm test src/plugins/contracts/extension-package-project-boundaries.test.ts src/plugins/contracts/extension-runtime-dependencies.contract.test.ts
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 20b5969 adds packages/memory-host-sdk/src/host/openclaw-runtime-sqlite.ts:30 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 20b5969cd832; files: packages/memory-host-sdk/src/host/openclaw-runtime-sqlite.ts)

PR surface

Source +4, Config +1, Other +3. Total +8 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 5 1 +4
Tests 0 0 0 0
Docs 0 0 0 0
Config 1 1 0 +1
Generated 0 0 0 0
Other 1 3 0 +3
Total 4 9 1 +8

Labels

Label changes:

  • add P2: This is a narrow package-contract repair with a confirmed, mechanically repairable regression in maintainer tooling.
  • add merge-risk: 🚨 automation: The added static bridge export makes the extracted PR wrapper depend on a source module absent from its canonical inventory.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a narrow package-contract repair with a confirmed, mechanically repairable regression in maintainer tooling.
  • merge-risk: 🚨 automation: The added static bridge export makes the extracted PR wrapper depend on a source module absent from its canonical inventory.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 October 15, 2026, 10:10 PM ET / October 16, 2026, 02:10 UTC.

@steipete
steipete merged commit 01cf74e into main Oct 16, 2026
135 checks passed
@steipete
steipete deleted the ci/fix1-memory-core-package-boundaries branch October 16, 2026 02:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
Hourly 38832586414 exposed exports left public after the file-transfer
classifier and engine-owned memory search migrations. Keep those helpers
private, along with the unused plugin-state read alias and install-action
DOM alias; their implementations and actual consumers remain intact.

Model the documented standalone Doctor proof as a real executable entry
and use the production-shaped dynamic chat route import in its existing
test. Preserve every route export and assertion; add no Knip ignores.

The requested three audits reproduced on main 93c11c2. With the
reviewed candidate, production/script exports and all unused-file scans
pass; full-tree exports only reports TranscriptTestHost, covered by the
active ready PR openclaw#173575. After proof, omit the lazy-error/loading adapter
hunks because new ready PR openclaw#173638 deletes those files. Their findings
remain until that PR lands. Memory package repair openclaw#173641 is independent;
this commit changes no dependencies, SQL, or engine contracts.

Proof: 151 tests across 12 focused files, each invoked with
pnpm test <file> --maxWorkers=1; summed wall time 548.15s. The changed
router-outlet-legacy.test.tsx passed in 23.00s with all assertions retained.
Core, scripts, extensions, UI, memory-core and UI-app test typechecks pass,
as do targeted typed lint, boundary lint, formatting and diff checks.
Stale generated SDK declarations were regenerated normally before the
memory package typecheck passed. Isolated P2 review: scoped-clean.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
* fix(memory): keep search runtime dependencies package-owned

Declare the existing Kysely pin for memory-core search and route the moved
sqlite-vec loader through the private host package SQLite bridge. Repairs
the two unchanged fast-contract failures introduced by openclaw#172681 without
changing search behavior, SDK exports, or contract allowances.

Proof: 512 plugin contracts, 6 native loader cases and 3 KNN cases pass;
targeted types, core lint, formatting, frozen install and P2 review pass.

* fix(memory): keep vector loading off the schema bridge

Export the existing engine-owned vector loader directly from its SDK
storage facade and remove the private package forwarding path. Keep the
schema-only host bridge unchanged so PR wrapper consumers do not acquire
vector-loader imports. No wrapper inventory or contract allowance changes.

The initial route reproduced three wrapper closure failures locally.
The revised six-file proof passes all 542 cases; targeted types, core lint,
formatting and P2 review pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files extensions: memory-core Extension: memory-core merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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.

1 participant