refactor(consolidation): extract reflectMemoryInSnapshot helper#10
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::consolidatewith a single named helperreflectMemoryInSnapshot(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-scoperegression tests (the two-group and three-group same-title collisions added in #9) still pass, andnpm run buildis clean.Verify
Refs #747, upstream PR rohitg00/agentmemory#748.