From 887ee7fe643f2afbeab9ea8f0a76ff0bc16dfd2c Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Tue, 13 Oct 2026 18:07:26 +0200 Subject: [PATCH] docs(telemetry): expected_rebuilds is no longer the compaction signal (#607 merge-time fix) Two comments still described the abandoned expected_rebuilds rise rule; setPromptCache no longer reads that field for the compaction stamp. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/usage-telemetry.ts | 2 +- test/usage-telemetry.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usage-telemetry.ts b/src/usage-telemetry.ts index abf4c7a6..6e4ead75 100644 --- a/src/usage-telemetry.ts +++ b/src/usage-telemetry.ts @@ -76,7 +76,7 @@ export interface RawPromptCache { /** Null right after a compaction or tool-result clearing, until the next request records the rewritten size. */ recache_tokens_if_cold?: number | null; misses?: number | null; - /** Cache rebuilds that followed a compaction or a clearing of old tool results (the compaction signal). */ + /** Cache rebuilds that followed a compaction or a clearing of old tool results (counted at the request after one; not read for the compaction stamp). */ expected_rebuilds?: number | null; /** Cache read tokens as a fraction of all input tokens this session, 0-1; null while those counts are all zero. */ hit_ratio?: number | null; diff --git a/test/usage-telemetry.test.ts b/test/usage-telemetry.test.ts index 3d1ee7b8..9d9bb2cd 100644 --- a/test/usage-telemetry.test.ts +++ b/test/usage-telemetry.test.ts @@ -172,7 +172,7 @@ describe('parsePromptCache', () => { // Out-of-range or non-finite values are clamped or dropped, never stored as-is. expect(parsePromptCache({ prompt_cache: { warm: true, hit_ratio: 1.5 } })).toEqual({ warm: true, hitRatio: 1 }); expect(parsePromptCache({ prompt_cache: { warm: true, hit_ratio: -0.2 } })).toEqual({ warm: true, hitRatio: 0 }); - // expected_rebuilds is rounded and floored at 0 (it indexes the compaction rise). + // expected_rebuilds is rounded and floored at 0. expect(parsePromptCache({ prompt_cache: { warm: true, expected_rebuilds: 2.9 } })).toEqual({ warm: true, expectedRebuilds: 3,