Skip to content

refactor(memory): split QMD manager by domain - #113659

Merged
steipete merged 2 commits into
mainfrom
codex/r2-qmd
Jul 25, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/r2-qmd

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The QMD memory manager had grown to 2,314 lines, combining construction, lifecycle, file watching, update and embed coordination, search execution, result normalization, and file/status IO in one production module. That exceeded the max-lines budget and made those responsibilities hard to review independently.

Why This Change Was Made

This behavior-neutral refactor keeps QmdMemoryManager as the stable public facade while moving its existing implementation into cohesive protected domain bases: core state/construction, helpers, sync and lease coordination, lifecycle/watch handling, search support, search execution, and IO/status. The inherited instance and prototype shape deliberately remains intact because the consolidated QMD tests exercise internal timing, lease, DB, and export invariants without requiring any test changes.

Every resulting production file is below 500 lines, so the qmd-manager.ts max-lines baseline entry is removed. No config, protocol, storage schema, fallback, runtime import mode, or user-visible behavior changes.

User Impact

No user-visible impact. This reduces the QMD manager's review and maintenance surface while preserving current search, sync, watcher, session export, embedding, and status behavior.

Evidence

  • Numstat: overall +2293/-2296 (net -3); production TypeScript +2293/-2295 (net -2); tests +0/-0; max-lines baseline +0/-1.
  • Resulting production files: 24-493 lines each; qmd-manager.ts is 24 lines.
  • node scripts/run-vitest.mjs extensions/memory-core/src/memory/qmd-manager.test.ts extensions/memory-core/src/memory/qmd-manager.slugified-paths.test.ts extensions/memory-core/src/memory/qmd-manager.timer-leak.test.ts extensions/memory-core/src/memory/search-manager.test.ts — 4 files passed, 209 tests passed.
  • node scripts/check-changed.mjs -- config/max-lines-baseline.txt extensions/memory-core/src/memory/qmd-manager.ts extensions/memory-core/src/memory/qmd-manager-base.ts extensions/memory-core/src/memory/qmd-manager-helpers.ts extensions/memory-core/src/memory/qmd-manager-io.ts extensions/memory-core/src/memory/qmd-manager-lifecycle.ts extensions/memory-core/src/memory/qmd-manager-search-support.ts extensions/memory-core/src/memory/qmd-manager-search.ts extensions/memory-core/src/memory/qmd-manager-sync.ts — passed on Blacksmith Testbox, including formatting, extension and extension-test typechecks, extension/script lint, max-lines ratchet, package/plugin boundaries, and import-cycle checks.
  • corepack pnpm build — passed on Blacksmith Testbox; no [INEFFECTIVE_DYNAMIC_IMPORT] warning.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output — clean, no accepted/actionable findings, overall confidence 0.97.

@steipete
steipete marked this pull request as ready for review July 25, 2026 12:49
@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core size: XL maintainer Maintainer-authored PR labels Jul 25, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper congested-publisher exception: the latest published review is still a review started placeholder for pre-rebase head 000d18b770ce477d338ffd414ad12f996bd83c61, and no completed review or Rank-up moves: list has been published for the final rebased head bf60db178930fb57e7b2d764cf620b30f1cf9be7.

The pre-rebase exact head completed the full CI/check matrix green. The final head is the same two commits rebased cleanly onto current origin/main; fresh focused proof is 209/209 tests, and fresh branch autoreview is clean at 0.98 confidence. Proceeding under the fleet's documented ClawSweeper congested-publisher exception rather than silently merging past a missing review.

@steipete

Copy link
Copy Markdown
Contributor Author

Final-head update to the documented ClawSweeper congested-publisher exception: branch protection required one more clean rebase for unrelated docs/start/getting-started.md drift. The latest ClawSweeper output is still only a review started placeholder for pre-rebase head 000d18b770ce477d338ffd414ad12f996bd83c61; no completed review or Rank-up moves: list has been published for final head 35ff9c273f31a710755294cc2aa606afcc6d0a76.

The pre-rebase exact head completed the full CI/check matrix green. The final head is the same two commits rebased cleanly onto current origin/main; fresh focused proof is 209/209 tests, and fresh branch autoreview is clean at 0.98 confidence. Proceeding under the fleet's documented exception rather than silently merging past a missing review.

@steipete
steipete merged commit 9a7a579 into main Jul 25, 2026
114 checks passed
@steipete
steipete deleted the codex/r2-qmd branch July 25, 2026 13:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 26, 2026
* refactor(memory): split QMD manager by domain

* refactor(memory): keep QMD base types private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant