Repository navigation
refactor(memory-core): consolidate manager test fixtures - #122671
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 11:18 AM ET / 15:18 UTC. ClawSweeper reviewWhat this changesThe PR replaces duplicated Memory Core manager-test setup with one typed fixture, deletes the narrow helper it subsumes, and table-drives equivalent state cases. Merge readinessNo blocking correctness or security defect was found in this test-only refactor. This maintainer-labelled PR should remain open for owner approval and exact-head merge checks. Priority: P3 Review scores
Verification
How this fits togetherMemory Core manager tests create mocked embedding providers, temporary SQLite and transcript state, then load the Memory Core index manager. The shared fixture supplies that setup and teardown to the manager-focused suites before their assertions run. flowchart LR
A[Manager test suites] --> B[Shared test fixture]
B --> C[Embedding and runtime mocks]
B --> D[Temporary SQLite and transcript state]
C --> E[Memory index manager]
D --> E
E --> F[Test assertions and cleanup]
Decision needed
Why: The patch is a low-risk test-only consolidation, but the maintainer label requires an explicit owner decision rather than automated cleanup. Before merge
Agent review detailsSecurityNone. PR surfaceSource +571, Tests -3198. Total -2627 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical fixture after the owner confirms its cleanup and mock-isolation contract against the current merge result. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test infrastructure rather than reporting a user-facing failure. Is this the best way to solve the issue? Yes: the shared fixture centralizes repeated mock, setup, and cleanup behavior while preserving the suites’ injected runtime boundary; current-base and exact-head checks remain the final merge proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8624b9acb812. LabelsLabel 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
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…2671) * test(memory-core): consolidate manager index fixtures * test(memory-core): table-drive manager state cases * test(memory-core): type shared fixture surface
What Problem This Solves
The memory-core manager suites copied the same embedding mock, mutable provider controls, manager lifecycle cleanup, SQLite teardown, config builder, and transcript seeding across seven files. That duplication added thousands of test lines and made fixture fixes easy to apply inconsistently.
Why This Change Was Made
This consolidates the seven manager suites on one typed
manager-index.test-support.tsfixture. The fixture injects manager runtime functions, registers the existing embedding mock before dynamically loading the manager module, canonicalizes its temporary root, and owns the established cleanup order. Existing High and Medium repetition cases are table-driven as separately named Vitest rows with unchanged assertions.The approved config-helper amendment was used:
test-config-helpers.tsremains unchanged because importing the new manager support from the two custom-mock suites would register its embedding mock and contaminate those suites' intentionally distinct mock factories. The narrowtest-manager-helpers.tsmodule was absorbed and deleted.The guarded provider-lifecycle fallback matrix was intentionally not table-driven. Its optional/thrown case has a unique provider call-order assertion, and combining the required/optional failure paths risked obscuring their distinct retry scheduling; the coordinator explicitly allowed this skip when scheduling preservation was uncertain.
AI-assisted implementation; the resulting code and validation evidence were reviewed before opening this PR.
User Impact
There is no production or user-visible behavior change. Memory-core contributors get one canonical manager test fixture, 2,627 fewer net test/test-support lines, and less risk of lifecycle or mock drift between suites.
Evidence
node scripts/run-vitest.mjs extensions/memory-corenode scripts/check-changed.mjs: passed all selected guards, extension production/test typechecks, full extension lint, sidecar-loader guard, database-first guard, and import-cycle check. Configured remote backends were unavailable, so the wrapper completed through its local fallback with a worktree-scoped heavy-check lock.origin/main: clean, with no accepted/actionable findings.