AskaEth
066319f9c6
fix(memory): 复审 r2 返工 —— 真实「记住 X」路径钉 long,断言改为能打红
复审 r2 = p2-2items 全在「RememberManual 钉 long」那半,两条指向同一件事:
**我以为修好的人工路径实际没修**。逐条:
P2-1 上一版断言是**空断言**:夹具正文「记住她喜欢喝咖啡」含「记住」⇒
extract_retention.go 的护栏① 直接放行 ⇒ 默认落点本来就是 long,因此删掉
store.go 的 pin 仍然绿。
→ extract_test.go 的 TestStore_RememberManual_正常 改为一对语料:
「我正在测通道」(N7,规则真会判 temp)+「记住她喜欢喝咖啡」(正文保留契约),
并同时断言档位、`ExpiresAt` 零值、以及**落库列** `(retention_tier, expires_at)`。
P2-2 pin 钉在零生产调用方的方法上:真实路径是 ManualExtractor.Extract(无可用
LLM 出口时的生产回退)→ persistMemories → AddScoped → Add,而 rememberDirective
**先剥掉「记住」前缀** ⇒ 护栏① 永远看不到它。改前实测:记住今天下雨了→temp/n6、
记住我正在测通道→temp/n7、记住现在几点了→temp/n4(均 +7 天)。
→ extract.go 的 ManualExtractor.Extract 在**产出侧**显式置
`RetentionTier: RetentionLong`(并在注释里写清「不能靠护栏①」的原因)。
store.go 的 RememberManual pin 保留(两条独立的契约点)。
→ 新增 TestManualExtractorItemsStayLongTerm:四条正文过 Extract →
复刻 persistMemories 的溯源覆盖 → AddScoped 落库 → 断言**落库列**
`(long, 空串)`。
**变异证据(删掉两处 pin 后实测)**:
--- FAIL: TestManualExtractorItemsStayLongTerm
extract_test.go:167: 「记住今天下雨了」全链落库 =
(tier="temp", expires_at="2026-11-02T05:34:20.844624200Z"), want (long, 空串)
--- FAIL: TestStore_RememberManual_正常
extract_test.go:99: RememberManual("我正在测通道") 的档位 = "temp", want "long"
恢复 pin 后两条均 PASS。
回归:go build ./... + go vet ./... + go test -count=1 ./internal/runtime/memory/...
./internal/db/... ./cmd/cyrene/ 全绿;go test -race ./internal/runtime/memory/ 绿。
2026-10-26 13:36:15 +08:00
..
2026-10-04 14:14:05 +08:00
2026-10-06 21:16:23 +08:00
2026-10-06 14:12:27 +08:00
2026-10-13 22:12:11 +08:00
2026-10-06 09:03:53 +08:00
2026-10-04 19:15:12 +08:00
2026-10-06 21:16:21 +08:00
2026-09-06 05:07:13 +08:00
2026-10-06 14:12:27 +08:00
2026-09-09 00:08:29 +08:00
2026-10-13 20:24:21 +08:00
2026-10-26 13:36:15 +08:00
2026-10-06 21:48:48 +08:00
2026-10-07 18:50:45 +08:00
2026-10-24 22:02:11 +08:00
2026-10-03 16:08:51 +08:00
2026-10-03 21:33:40 +08:00
2026-10-03 16:08:52 +08:00
2026-10-24 20:21:22 +08:00
2026-10-06 14:12:25 +08:00
2026-10-05 11:36:18 +08:00
2026-10-24 19:33:33 +08:00
2026-10-06 14:12:27 +08:00