Skip to content

refactor(consolidation): extract reflectMemoryInSnapshot helper#10

Merged
MarvinFS merged 1 commit into
mainfrom
fix/747-consolidate-refactor
May 31, 2026
Merged

refactor(consolidation): extract reflectMemoryInSnapshot helper#10
MarvinFS merged 1 commit into
mainfrom
fix/747-consolidate-refactor

Conversation

@MarvinFS
Copy link
Copy Markdown
Owner

What

Follow-up to PR #9 (issue #747 dedup fix), mirroring the cleanup made on the upstream PR rohitg00/agentmemory#748 in response to CodeRabbit review.

Replaces the two inline WHAT-style comments at the create/evolve sites in mem::consolidate with a single named helper reflectMemoryInSnapshot(snapshot, memory, supersededMemory?). The snapshot-maintenance intent is now carried by the function name, and the in-place-replace rationale (the dedup match keys on title alone, so a superseded row left in the array would be re-matched and spawn a second latest) lives in one doc comment on the helper.

Why

The repo guideline src/**/*.{ts,js}: "No code comments explaining WHAT — use clear naming instead". CodeRabbit flagged the inline comments on the upstream PR; this keeps both repos consistent.

Behavior

Unchanged. Pure refactor - the two call sites now delegate to the helper. The consolidate-project-scope regression tests (the two-group and three-group same-title collisions added in #9) still pass, and npm run build is clean.

Verify

npm install --legacy-peer-deps
npm run build
npm test -- test/consolidate-project-scope.test.ts

Refs #747, upstream PR rohitg00/agentmemory#748.

Address CodeRabbit review on #748: replace the two inline WHAT-style
comments at the create/evolve sites with a single named helper,
reflectMemoryInSnapshot, so the snapshot-maintenance intent is carried
by the function name and the in-place-replace rationale lives in one
doc comment. Behavior is unchanged; the consolidate-project-scope
regression tests still pass.

Signed-off-by: MarvinFS <MarvinFS@users.noreply.github.com>
@MarvinFS MarvinFS merged commit b276123 into main May 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant