Skip to content

fix(data): recalibrate checkpoint counters after cleanup#377

Open
Ricky-7-Yan wants to merge 1 commit into
TencentCloud:mainfrom
Ricky-7-Yan:issue157-checkpoint-recalibration-v2
Open

fix(data): recalibrate checkpoint counters after cleanup#377
Ricky-7-Yan wants to merge 1 commit into
TencentCloud:mainfrom
Ricky-7-Yan:issue157-checkpoint-recalibration-v2

Conversation

@Ricky-7-Yan

Copy link
Copy Markdown

Description | 描述

Recalibrates drift-prone checkpoint counters from actual persisted data so cleanup/manual pruning no longer leaves recall_checkpoint.json overstating memory totals.

Related Issue | 关联 Issue

Closes #157

Change Type | 修改类型

  • Bug fix
  • Data consistency improvement
  • Tests added

Self-test Checklist | 自测清单

  • Added CheckpointManager.recalibrateCounters() with VectorStore counts and JSONL fallback
  • Recalibrates counters after local cleanup removes JSONL/VectorStore data
  • Recalibrates once during store startup so existing drift self-heals
  • Caps memories_since_last_persona to the recalibrated L1 total
  • Added unit coverage for JSONL fallback and VectorStore-preferred counts

Verification | 验证

  • npx.cmd vitest run src/utils/checkpoint.test.ts
  • npm.cmd run build
  • git diff --check

@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you for submitting this PR and participating in Tencent Rhino-bird Open-source Training Program!
We have successfully received your submission. The program is currently in full swing, and we will complete the Code Review for you as soon as possible. Please keep an eye on the status notifications for this PR so you can follow up promptly once the review feedback is provided.
Thanks again for your contribution and open-source spirit! 🚀

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.

[good first issue]🎯 fix(data): checkpoint counters never decrease — drift from actual data after cleanup

2 participants