Repository navigation
fix(session): report native compaction ref count correctly - #1514
Conversation
[bot] 🏷 PR review — verified clean, ready to merge (merge stays human-only per repo rules). ① Original issue (#1513) — direction checkConfirmed the bug at the source before reviewing the fix: ② Regression review — existing behaviors on touched paths
③ Code reviewOne-line fix at the decision point, correct API for counting object keys. Test change is minimal and idiomatic (optional param with default preserves the existing signature). ④ Test validity — independently reproducedI did NOT just trust the PR description; I ran the counterfactual myself: temporarily restored the old ⑤ Local verification (the part missing from your WSL environment)On branch head
⑥ Diff cleanliness & auto-merge gate (§7.4)2 files, +6/-4, every line serves the PR's purpose — no generated/lockfile churn, no whitespace noise. All eight auto-merge gates hold: single-module scoped 结论:修复了 native compaction 诊断日志读取普通对象 @quifox — welcome! Nice first contribution: minimal diff, correct root-cause targeting, and an honest verification section. The maintainer can merge whenever. |
|
Verified on a Linux host (your WSL couldn't reach npm, so these were run for you): full Two things worth calling out: the assertion pins the exact surviving count ( A parallel fix (#1515) was opened independently before this one landed; it's being closed in favor of this PR (external contributions take precedence for identical fixes, and yours is the tighter diff). ✅ Ready to merge — Fixes #1513. |
|
Update: this fix just landed via #1515, which was merged about a minute before this PR's disposition — the To be explicit about what your contribution was worth: your diagnosis was exactly right, your one-line fix was independently verified correct (5/5 + typecheck + mutation-red), and your test shape — threading the logger through the existing |
[bot] 🏷 Confirmed both threads line up on our end:
Nothing else pending from review. Merge is yours to execute per repo rules — after it lands, 结论:#1515 已确认按“外部贡献优先”关闭、无遗留工作;本 PR 双路验证一致(mutation check 均只红新断言),审查完毕,等待人工合并即可。 |
Summary
Object.keys(prunedByRaw).lengthinstead of reading.lengthfrom a plain object.Fixes #1513
Verification
node --import tsx --test tests/compaction-archive.test.ts— 5 passed.prunedByRaw.lengthexpression restored temporarily, the new assertion fails as expected; restoring the fix returns the suite to 5/5.npm ci/npm run typecheck/npm run buildwere not rerun locally because the WSL environment currently cannot reach the npm registry and the Docker Desktop backend is unavailable. No dependency or build configuration changes are included in this PR.