Skip to content

Commit bd27f48

Browse files
tznthouclaude
andcommitted
chore(release): v0.3.2
Recall query telemetry + hit-rate report tool. Pure instrumentation — no scoring, schema, or recall behaviour changes. Feeds the v0.4.0 batch ordering decision after 7 days of observation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7709f4f commit bd27f48

3 files changed

Lines changed: 83 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,50 @@ more like an iteration counter than a strict SemVer major).
1111

1212
---
1313

14+
## [0.3.2] — 2026-05-21
15+
16+
### Added
17+
18+
- **`recall_query` telemetry for hit-rate analysis.** Every `GET /memory/query`
19+
call now appends one JSONL row to `~/.ccrecall/recall-query.log.jsonl`:
20+
truncated query (80 chars), original `queryLen`, `hitCount`, `projectId`,
21+
`limit`, `maxTokens`. Append failures are swallowed — telemetry must never
22+
affect endpoint response. Two opt-out knobs:
23+
`CCRECALL_RECALL_TELEMETRY_OFF=1` disables writes; `CCRECALL_RECALL_TELEMETRY_PATH`
24+
redirects the log (used by the test suite to keep host telemetry clean).
25+
26+
- **`scripts/recall-hit-rate-report.ts` analysis tool.** Reads the telemetry log
27+
and cross-references the `memories` table to split zero-hit queries into two
28+
buckets — *literal mismatch* (keyword appears in some memory body but FTS5
29+
missed it) vs *truly absent* (keyword nowhere in any memory). Output (markdown
30+
or `--json`): totals, hit rate, zero-hit breakdown, per-project counts,
31+
query-length percentiles, and up to 10 samples per category. Designed as the
32+
L0 quick-fix that feeds the v0.4.0 batch ordering: 1 day of instrumentation +
33+
7 days of observation → evidence-driven decision between `#28` surfacing UX,
34+
`#15` tag first-class + Topic CJK, and `#29` scorer epistemic.
35+
36+
### Why
37+
38+
The cold-rate signal (96/116 memories never recalled, 4 batches of major events
39+
that landed in auto memory instead of ccRecall DB) needs an evidence base before
40+
the v0.4.0 batch can pick a direction. This release is pure instrumentation —
41+
no scoring, schema, or recall behaviour changes — so the 7-day observation
42+
period stays clean.
43+
44+
### Notes
45+
46+
- Privacy: query string is truncated to 80 chars before logging. `queryLen`
47+
preserves the original length so we can still characterise long-query
48+
distribution. Hashing was considered and rejected because hashing would
49+
prevent the substring cross-reference that splits literal-mismatch from
50+
truly-absent.
51+
- Performance: `appendFileSync` runs on the response path; E2E tests assert the
52+
total round-trip stays under 100ms even with telemetry on.
53+
- This release does NOT flip `CCRECALL_SESSION_START_STRATEGY` default — that
54+
ships with v0.4.0 once the metric evidence is in.
55+
56+
---
57+
1458
## [0.3.1] — 2026-05-13
1559

1660
### Fixed

CHANGELOG_ZH.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,44 @@ ccRecall 的重要版本變更記錄在這裡。
88

99
---
1010

11+
## [0.3.2] — 2026-05-21
12+
13+
### 新增
14+
15+
- **`recall_query` telemetry,為 hit-rate 分析鋪基。** 每次 `GET /memory/query`
16+
呼叫現在會 append 一筆 JSONL 到 `~/.ccrecall/recall-query.log.jsonl`:
17+
truncate 過的 query(80 chars)、原始 `queryLen``hitCount``projectId`
18+
`limit``maxTokens`。Append 失敗會被吞掉 — telemetry 絕不能影響 endpoint
19+
回應。兩個 opt-out 開關:`CCRECALL_RECALL_TELEMETRY_OFF=1` 關掉寫入;
20+
`CCRECALL_RECALL_TELEMETRY_PATH` 改寫 log 路徑(test 用,避免污染 host 真實 log)。
21+
22+
- **`scripts/recall-hit-rate-report.ts` 分析腳本。** 讀 telemetry log + 對照
23+
`memories` 表,把 zero-hit query 拆兩桶 — *literal mismatch*(keyword 出現在
24+
某筆 memory body 但 FTS5 沒抓到) vs *truly absent*(keyword 不存在任一
25+
memory)。輸出(markdown 或 `--json`):總數、hit rate、zero-hit 拆分、
26+
per-project 計數、query length 分布、每類最多 10 筆 sample。設計為 L0
27+
quick-fix 餵 v0.4.0 batch 排序:1 天 instrumentation + 7 天觀察 → 用實證
28+
決定 `#28` surfacing UX、`#15` tag first-class + Topic CJK、`#29` scorer
29+
epistemic 之間的優先序。
30+
31+
### 為什麼
32+
33+
Cold rate 訊號(116 筆 memories 96 筆從未召回,4 批重大事件落到 auto memory
34+
而非 ccRecall DB)需要 evidence 基底才能決定 v0.4.0 batch 方向。本版純
35+
instrumentation — 不動 scoring、schema、recall 行為 — 讓 7 天觀察期保持乾淨。
36+
37+
### 備註
38+
39+
- Privacy:query 字串 log 前 truncate 到 80 chars。`queryLen` 保留原長度可看
40+
長 query 分布。考慮過 hashing 但拒絕,因為 hashing 會阻擋拆分 literal
41+
mismatch / truly absent 所需的 substring 對照。
42+
- 效能:`appendFileSync` 跑在 response path 上;E2E test 驗證 telemetry 開
43+
狀態下整段 round-trip 仍 < 100ms。
44+
- 本版****`CCRECALL_SESSION_START_STRATEGY` 預設值 — 等 metric 證據到位後
45+
跟 v0.4.0 一起出。
46+
47+
---
48+
1149
## [0.3.1] — 2026-05-13
1250

1351
### 修正

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tznthou/ccrecall",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "AI memory service for Claude Code — on-demand context injection with metacognition",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)