Skip to content

fix(types): remove duplicate source property in RetentionScore interface#287

Closed
fuleinist wants to merge 1 commit into
rohitg00:mainfrom
fuleinist:fix/duplicate-source-property
Closed

fix(types): remove duplicate source property in RetentionScore interface#287
fuleinist wants to merge 1 commit into
rohitg00:mainfrom
fuleinist:fix/duplicate-source-property

Conversation

@fuleinist
Copy link
Copy Markdown

@fuleinist fuleinist commented May 11, 2026

Summary

Duplicate source property in RetentionScore interface (src/types.ts):

export interface RetentionScore {
  memoryId: string;
  source?: "episodic" | "semantic";  // line 835 — original
  ...
  source?: "episodic" | "semantic";  // line 842 — duplicate (shadowing)
}

TypeScript silently accepts duplicate property declarations, but the later declaration shadows the earlier one. Any code reading retentionScore.source gets unpredictable behavior depending on object creation order.

Fix: Remove the duplicate on line 842.

Testing

npm run typecheck  # should pass, no duplicate property warning

Issue

Fixes #277

Summary by CodeRabbit

  • Refactor
    • Updated internal data tracking structures to capture additional metrics on data access patterns, including access frequency and timing information.

Review Change Stack

Duplicate on line 842 was shadowing the original on line 835,
making retention score reads unpredictable. Removes the duplicate
per issue rohitg00#277.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aac35f27-5d99-40b2-88e2-d6283ee4e10d

📥 Commits

Reviewing files that changed from the base of the PR and between ec84ff8 and bc507a7.

📒 Files selected for processing (1)
  • src/types.ts
💤 Files with no reviewable changes (1)
  • src/types.ts

📝 Walkthrough

Walkthrough

The PR updates the RetentionScore interface in src/types.ts by adding three new optional fields: reinforcementBoost, lastAccessed, and accessCount. These fields extend the data contract for memory retention scoring to capture reinforcement signals and access history.

Changes

Retention Score Type Extension

Layer / File(s) Summary
Type Definition Update
src/types.ts
RetentionScore interface expanded to add reinforcementBoost, lastAccessed, and accessCount fields for tracking reinforcement metrics and access patterns.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • rohitg00/agentmemory#132: Modifies the same RetentionScore interface in src/types.ts, introducing source-based eviction routing logic alongside retention field management.

Poem

🐰 Three fields now bloom in scores retained,
Reinforcement counts, access times gained,
The shape expands to hold what's true,
More data flows through memory's brew! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'remove duplicate source property' but the changes show additions of reinforcementBoost, lastAccessed, and accessCount fields without removing any duplicate. Verify whether the actual change is removing a duplicate source property or adding new fields, then update the title to accurately reflect the implemented changes.
Linked Issues check ⚠️ Warning Issue #277 requires removing a duplicate source property declaration, but the changes show new fields being added instead of removing the duplicate. Address issue #277 by removing the duplicate source property declaration on line ~842 as specified in the issue.
Out of Scope Changes check ⚠️ Warning Adding reinforcementBoost, lastAccessed, and accessCount fields is out of scope for issue #277, which only requires removing a duplicate source property. Remove the out-of-scope field additions and focus solely on removing the duplicate source property declaration to stay aligned with issue #277.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

@fuleinist is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@rohitg00
Copy link
Copy Markdown
Owner

Thanks for the report. This was already resolved by #326 (commit cba234d, 2026-05-13) — current src/types.ts:853-869 has only the single source?: declaration with the #124 backwards-compat JSDoc kept. Re-running this diff against main would be a no-op, so closing as stale.

@rohitg00 rohitg00 closed this May 20, 2026
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.

CRITICAL: Duplicate source property in RetentionScore interface

2 participants