feat(intention-ttl): 意图 TTL — intention 类 + expires_at 跨五层落盘 + 过期负分降档(非删除,ZHIYI_INTENTION_TTL 门控)
- Go model/IPC/FTS 通道/SQLite/API 写入(RFC3339 严判 400)+ Rust struct/schema/builder/6×读侧 col_str - recall 降档块在 MMR 之前(选择与展示共用同一套分数),过期 intention rerank 分置 -1 → 展示分 -0.445 - 关态 intentionExpired 恒 false ⇒ 降档块零赋值;AC2 HEAD vs 新版同库同 sidecar 现采基线 fresh 逐位一致 - 单测:关态逐位/开态下沉且在场/负分压过全部正常分/纯度(他类、未过期、空=永久) - 回滚:env 置 0 或 unset(每调用读 env,无需重启);磁盘列 additive 保留不删 t_88cc9cb8
This commit is contained in:
@@ -315,6 +315,10 @@ func (a *API) WriteMemory(w http.ResponseWriter, r *http.Request) {
|
||||
EmbeddingModel string `json:"embedding_model"`
|
||||
ScriptVersion string `json:"script_version"`
|
||||
Confidence *float64 `json:"confidence"`
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:可选到期时间(ISO8601/RFC3339)。不传 = 空 =
|
||||
// 永久有效(现状不变)。非法格式 ⇒ 400 拒写(写入侧严判,读侧宽容判不误伤)。
|
||||
// category=intention 时本列即意图生命周期;到期只降档不删除。
|
||||
ExpiresAt string `json:"expires_at"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
respondError(w, 400, "invalid body")
|
||||
@@ -324,6 +328,14 @@ func (a *API) WriteMemory(w http.ResponseWriter, r *http.Request) {
|
||||
respondError(w, 400, "content too short (<8 chars)")
|
||||
return
|
||||
}
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:expires_at 非空必须是合法 RFC3339(写入侧严判,
|
||||
// 空 = 永久有效 = 现状)。非法直接 400,不落一条永不降档的坏意图。
|
||||
if req.ExpiresAt != "" {
|
||||
if _, perr := time.Parse(time.RFC3339, req.ExpiresAt); perr != nil {
|
||||
respondError(w, 400, "invalid expires_at (want RFC3339/ISO8601): "+perr.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
// 2026-10-16 t_5ad3f843:meta-note 门禁(同 Commit;默认关闭=零行为变化)。
|
||||
if skip, reason := metanote.ShouldSkip(req.Content); skip {
|
||||
log.Printf("[metanote] write_memory rejected: agent=%s reason=%s content=%.60s", req.AgentID, reason, req.Content)
|
||||
@@ -418,6 +430,8 @@ func (a *API) WriteMemory(w http.ResponseWriter, r *http.Request) {
|
||||
ScriptVersion: scriptVer,
|
||||
Confidence: req.Confidence,
|
||||
ConfidenceSource: confidenceSource,
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:已通过 400 校验的到期时间(空 = 永久 = 现状)。
|
||||
ExpiresAt: req.ExpiresAt,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package models
|
||||
|
||||
// intention_ttl_test.go — 2026-11-07 t_88cc9cb8 意图 TTL(category=intention + expires_at)
|
||||
//
|
||||
// 锁定两件事(回归闸门):
|
||||
// 1. MemoryRecord / RecallResult 都携带 ExpiresAt 且 JSON 键名 = "expires_at"
|
||||
// —— 键名是 IPC payload 与 Rust builder `r["expires_at"]` 的契约,改键名 = 静默丢字段。
|
||||
// 2. omitempty:不传 = JSON 无此键 = 永久有效(关态/存量行为不变的序列化前提)。
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExpiresAt_JSONKeyContract(t *testing.T) {
|
||||
rec := MemoryRecord{ID: "m1", Category: "intention", ExpiresAt: "2026-11-08T00:00:00Z"}
|
||||
b, err := json.Marshal(rec)
|
||||
if err != nil {
|
||||
t.Fatalf("marshal: %v", err)
|
||||
}
|
||||
s := string(b)
|
||||
if !strings.Contains(s, `"expires_at":"2026-11-08T00:00:00Z"`) {
|
||||
t.Fatalf("✗ MemoryRecord JSON 缺 expires_at 契约键:%s", s)
|
||||
}
|
||||
// 回环:反序列化读回
|
||||
var got MemoryRecord
|
||||
if err := json.Unmarshal(b, &got); err != nil {
|
||||
t.Fatalf("unmarshal: %v", err)
|
||||
}
|
||||
if got.ExpiresAt != "2026-11-08T00:00:00Z" {
|
||||
t.Fatalf("✗ 回环 ExpiresAt=%q", got.ExpiresAt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestExpiresAt_OmitEmptyMeansPermanent(t *testing.T) {
|
||||
// 不传 = JSON 不带键(Rust as_str().unwrap_or("") ⇒ 空 = 永久有效)
|
||||
b, err := json.Marshal(MemoryRecord{ID: "m2", Category: "distilled"})
|
||||
if err != nil {
|
||||
t.Fatalf("marshal: %v", err)
|
||||
}
|
||||
if strings.Contains(string(b), "expires_at") {
|
||||
t.Fatalf("✗ 未声明时不应输出 expires_at 键(存量兼容):%s", b)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecallResult_ExpiresAtPassthrough(t *testing.T) {
|
||||
// RecallResult 直通("响应值==库值"判据的序列化前提)
|
||||
b, err := json.Marshal(RecallResult{ID: "m3", ExpiresAt: "2026-12-01T00:00:00+08:00"})
|
||||
if err != nil {
|
||||
t.Fatalf("marshal: %v", err)
|
||||
}
|
||||
if !strings.Contains(string(b), `"expires_at":"2026-12-01T00:00:00+08:00"`) {
|
||||
t.Fatalf("✗ RecallResult JSON 缺 expires_at:%s", b)
|
||||
}
|
||||
// 空 = omitempty 不输出(关态响应逐字节兼容)
|
||||
b2, _ := json.Marshal(RecallResult{ID: "m4"})
|
||||
if strings.Contains(string(b2), "expires_at") {
|
||||
t.Fatalf("✗ 空 ExpiresAt 不应输出键(响应兼容):%s", b2)
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,16 @@ type MemoryRecord struct {
|
||||
ValidFrom string `json:"valid_from,omitempty"`
|
||||
ValidTo string `json:"valid_to,omitempty"`
|
||||
Provenance string `json:"provenance,omitempty"`
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL(Hy-Memory L7 INTENTION / 遗忘研究「有效期而非删除」):
|
||||
// 时间敏感事实带有效期,到期【降级】而非删除。
|
||||
// Category="intention" + ExpiresAt(RFC3339;空 = 永久有效)
|
||||
// 读路径判据:门控开且 category=intention 且 ExpiresAt<now ⇒ 召回排序降到最低档
|
||||
// (仍在结果里,non-lossy)。关态(ZHIYI_INTENTION_TTL≠1)行为逐位不变。
|
||||
// 与 ValidTo 的分工:ValidTo 是 bi-temporal 语义终点(到期不入 top-k,
|
||||
// ZHIYI_BITEMPORAL 门控);ExpiresAt 是意图生命周期(到期只降档,本卡新增)。
|
||||
// 存量行缺省空串(等同永久有效)。五层落盘纪律:Go model/IPC + Rust struct/schema/
|
||||
// builder/读侧,缺一层 = 静默丢字段(t_3ada332b 事故同款)。
|
||||
ExpiresAt string `json:"expires_at,omitempty"`
|
||||
}
|
||||
|
||||
// HitEvent 真实 outcome 的 append-only 事件(GA-P0-4 t_bb10e8bc)。
|
||||
@@ -224,6 +234,10 @@ type RecallResult struct {
|
||||
// 实测 42.8% 有真指针、其中 99.9% 能找回原文 ⇒ 调用方可据此回溯完整上下文,
|
||||
// 解决「只给 35 字结论、答不了为什么/怎么做」。空=无溯源(存量/legacy)。
|
||||
DerivedFrom string `json:"derived_from,omitempty"`
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:把库列 expires_at 直通给调用方。
|
||||
// 空 = 未声明/永久(存量)。仅观测口径 + AC 回环证据("响应值==库值"),
|
||||
// 排序效果由 intentionTtlEnabled() 门控的降档逻辑决定,与本字段展示无关。
|
||||
ExpiresAt string `json:"expires_at,omitempty"`
|
||||
}
|
||||
|
||||
// RerankResult rerank 重排后的单条结果。
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package storage_test
|
||||
|
||||
// intention_ttl_e2e_test.go — 2026-11-07 t_88cc9cb8 意图 TTL 跨五层回归闸门
|
||||
//
|
||||
// 为什么必须存在(bitemporal_e2e_test.go 同款教训):单测走内存 model / SQLite 全绿,
|
||||
// 但 Go payload 缺键 / Rust schema 缺列 / 读侧断链 ⇒ 生产静默 no-op。
|
||||
// 本测试经**真实 Rust sidecar**(LanceDB)写 expires_at ⇒ 读回 ⇒ 断言非空且等值。
|
||||
// 今后「只改 Go 不改 Rust / 只改 Rust 不改 payload / 只改写不改建读」都会红。
|
||||
//
|
||||
// 跑法(需先起 sidecar,拷贝库副本,勿指生产):
|
||||
// zhiyi-consolidate --mode socket --socket /tmp/mw-ttl.sock --data-dir /tmp/mw-ttldata
|
||||
// ZHIYI_INTENTION_TTL_SOCK=/tmp/mw-ttl.sock go test -run TestIntentionTTLE2E -v ./internal/storage/
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/xiaoxue/memoryweave/internal/models"
|
||||
"github.com/xiaoxue/memoryweave/internal/storage"
|
||||
)
|
||||
|
||||
func TestIntentionTTLE2E(t *testing.T) {
|
||||
sock := os.Getenv("ZHIYI_INTENTION_TTL_SOCK")
|
||||
if sock == "" {
|
||||
t.Skip("ZHIYI_INTENTION_TTL_SOCK 未设置,跳过(需要 sidecar 在跑)")
|
||||
}
|
||||
const ns = "intention-ttl-go-e2e"
|
||||
rc := storage.NewRustLanceDBClient(sock, nil)
|
||||
|
||||
vec := make([]float32, 1024)
|
||||
for i := range vec {
|
||||
vec[i] = 0.03
|
||||
}
|
||||
now := time.Now().UTC()
|
||||
expiredAt := now.Add(-24 * time.Hour).Format(time.RFC3339) // 已过期,验证真实落盘
|
||||
validAt := now.Add(72 * time.Hour).Format(time.RFC3339)
|
||||
|
||||
mk := func(id, exp string) models.MemoryRecord {
|
||||
return models.MemoryRecord{
|
||||
ID: id, AgentID: "hermes-a06", Namespace: ns,
|
||||
Content: "意图 TTL 端到端样本(expires_at 应落盘并可读回)" + id,
|
||||
Category: "intention", Vector: vec,
|
||||
Tier: "normal", Importance: 1.0, QualityScore: 0.9,
|
||||
Version: 1, Freshness: "fresh",
|
||||
Source: "test:intention-ttl-e2e",
|
||||
EmbeddingModel: "bge-m3", ScriptVersion: "ttl-e2e",
|
||||
ExpiresAt: exp,
|
||||
CreatedAt: now, UpdatedAt: now,
|
||||
}
|
||||
}
|
||||
|
||||
t.Run("AC1_写入两条intention", func(t *testing.T) {
|
||||
if err := rc.InsertMemory(mk("ttl-e2e-expired", expiredAt)); err != nil {
|
||||
t.Fatalf("InsertMemory(expired) 失败: %v", err)
|
||||
}
|
||||
if err := rc.InsertMemory(mk("ttl-e2e-valid", validAt)); err != nil {
|
||||
t.Fatalf("InsertMemory(valid) 失败: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("AC2_Search读回expires_at等于写入值", func(t *testing.T) {
|
||||
rows, err := rc.Search("memories", vec, 30, ns)
|
||||
if err != nil {
|
||||
t.Fatalf("Search 失败: %v", err)
|
||||
}
|
||||
want := map[string]string{"ttl-e2e-expired": expiredAt, "ttl-e2e-valid": validAt}
|
||||
got := map[string]string{}
|
||||
for i := range rows {
|
||||
if _, ok := want[rows[i].ID]; ok {
|
||||
got[rows[i].ID] = rows[i].ExpiresAt
|
||||
}
|
||||
}
|
||||
for id, w := range want {
|
||||
if g, ok := got[id]; !ok {
|
||||
t.Fatalf("✗ %s 读不回来(Search 命中 %d 条)—— 写入链路断", id, len(rows))
|
||||
} else if g != w {
|
||||
t.Fatalf("✗ %s ExpiresAt=%q 期望 %q —— Rust schema 缺列或读回断链(生产 no-op 根因)", id, g, w)
|
||||
}
|
||||
}
|
||||
t.Logf("✓ Search 回环:两条 expires_at 均非空且等于写入值")
|
||||
})
|
||||
|
||||
t.Run("AC3_Scan读回同值", func(t *testing.T) {
|
||||
rows, err := rc.Scan(50, ns)
|
||||
if err != nil {
|
||||
t.Fatalf("Scan 失败: %v", err)
|
||||
}
|
||||
n := 0
|
||||
for i := range rows {
|
||||
if rows[i].ID == "ttl-e2e-expired" && rows[i].ExpiresAt == expiredAt {
|
||||
n++
|
||||
}
|
||||
if rows[i].ID == "ttl-e2e-valid" && rows[i].ExpiresAt == validAt {
|
||||
n++
|
||||
}
|
||||
}
|
||||
if n != 2 {
|
||||
t.Fatalf("✗ Scan 路径 expires_at 回环缺条(命中 %d/2)—— scan 解包或输出映射断链", n)
|
||||
}
|
||||
t.Logf("✓ Scan 回环:scan 读侧接线完好")
|
||||
})
|
||||
|
||||
t.Run("AC4_GetRecordByID单行读回", func(t *testing.T) {
|
||||
rec, err := rc.GetRecordByID("memories", "ttl-e2e-expired")
|
||||
if err != nil {
|
||||
t.Fatalf("GetRecordByID 失败: %v", err)
|
||||
}
|
||||
if rec == nil {
|
||||
t.Fatalf("✗ GetRecordByID 返回 nil(行不存在?AC1 已写)")
|
||||
}
|
||||
if rec.ExpiresAt != expiredAt {
|
||||
t.Fatalf("✗ GetRecordByID ExpiresAt=%q 期望 %q", rec.ExpiresAt, expiredAt)
|
||||
}
|
||||
if rec.Category != "intention" {
|
||||
t.Fatalf("✗ Category=%q 期望 intention", rec.Category)
|
||||
}
|
||||
t.Logf("✓ GetRecordByID 单行读回:expires_at=%s category=%s", rec.ExpiresAt, rec.Category)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package storage
|
||||
|
||||
// intention_ttl_recall_test.go — 2026-11-07 t_88cc9cb8 意图 TTL 召回降档判据
|
||||
//
|
||||
// 复用 recall_bitemporal_test.go 的假后端设施(nsRecordingLance + newNSTestPipeline),
|
||||
// 全程零网络/零磁盘。判据(对应卡上 AC):
|
||||
// A(AC2 关态) ZHIYI_INTENTION_TTL=0:开/关前后 id 顺序逐位一致,过期 intention 不降档
|
||||
// B(AC3 开态) =1:过期 intention 名次确实下沉,且仍在结果里(non-lossy,不是被删)
|
||||
// C(判据纯度) 非 intention 类带过期 expires_at 不受影响;未过期 intention 不降档
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/xiaoxue/memoryweave/internal/models"
|
||||
)
|
||||
|
||||
// 复用 newNSTestPipeline 预置缓存的 query(nsTestQuery):pipeline 的 Embedder
|
||||
// 只对该串预置了向量缓存,换新 query 会真发 HTTP(embedder endpoint=never)。
|
||||
// 内容命中与否不影响本判据(降档发生在 rerank 之后,与词面无关)。
|
||||
const ttlTestQuery = nsTestQuery
|
||||
|
||||
func ttlRows() []models.MemoryRecord {
|
||||
expired := time.Now().Add(-24 * time.Hour).Format(time.RFC3339)
|
||||
valid := time.Now().Add(72 * time.Hour).Format(time.RFC3339)
|
||||
return []models.MemoryRecord{
|
||||
{ID: "int_expired", Content: "这周在 Berlin 见客户(临时意图)", Category: "intention", ExpiresAt: expired},
|
||||
{ID: "int_valid", Content: "下周去 Tokyo 出差(临时意图)", Category: "intention", ExpiresAt: valid},
|
||||
{ID: "fact_perm", Content: "牧尘常驻北京", Category: "user_pref"},
|
||||
{ID: "fact_other_expired", Content: "别的类带了过期时间也不该降", Category: "distilled", ExpiresAt: expired},
|
||||
}
|
||||
}
|
||||
|
||||
func ttlIDs(res []models.RecallResult) []string {
|
||||
var out []string
|
||||
for _, r := range res {
|
||||
out = append(out, r.ID)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func rankOf(ids []string, id string) int {
|
||||
for i, x := range ids {
|
||||
if x == id {
|
||||
return i + 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func TestIntentionTTL_OffStatesBitwiseIdentical(t *testing.T) {
|
||||
t.Setenv("ZHIYI_INTENTION_TTL", "0")
|
||||
rows := ttlRows()
|
||||
|
||||
fake1 := &nsRecordingLance{rows: rows}
|
||||
p1 := newNSTestPipeline(t, fake1)
|
||||
run1, err := p1.Recall(ttlTestQuery, "test-ns", 10, 0.0)
|
||||
if err != nil {
|
||||
t.Fatalf("recall run1: %v", err)
|
||||
}
|
||||
fake2 := &nsRecordingLance{rows: rows}
|
||||
p2 := newNSTestPipeline(t, fake2)
|
||||
run2, err := p2.Recall(ttlTestQuery, "test-ns", 10, 0.0)
|
||||
if err != nil {
|
||||
t.Fatalf("recall run2: %v", err)
|
||||
}
|
||||
ids1, ids2 := ttlIDs(run1), ttlIDs(run2)
|
||||
if strings.Join(ids1, ",") != strings.Join(ids2, ",") {
|
||||
t.Fatalf("✗ AC2 关态:两次召回 id 顺序不一致(应逐位相同)\n run1=%v\n run2=%v", ids1, ids2)
|
||||
}
|
||||
if rankOf(ids1, "int_expired") == 0 {
|
||||
t.Fatalf("✗ AC2 关态:过期 intention 应原样在场,实际缺失:%v", ids1)
|
||||
}
|
||||
// 关态下 int_expired 名次 = 开态基线的参照:这里断言它未被负分挤走(在场即可,
|
||||
// 具体名次下沉证据由开态用例给出 before/after)。
|
||||
t.Logf("✓ AC2 关态:id 顺序逐位一致 %v(过期条在场、行为零变化)", ids1)
|
||||
}
|
||||
|
||||
func TestIntentionTTL_OnDemotesExpiredButKeepsIt(t *testing.T) {
|
||||
rows := ttlRows()
|
||||
|
||||
// before:同一数据集在关态下跑一遍拿名次基线(= 改前行为,env 关=代码路径与 HEAD 逐位一致)
|
||||
t.Setenv("ZHIYI_INTENTION_TTL", "0")
|
||||
fakeOff := &nsRecordingLance{rows: rows}
|
||||
before, err := newNSTestPipeline(t, fakeOff).Recall(ttlTestQuery, "test-ns", 4, 0.0)
|
||||
if err != nil {
|
||||
t.Fatalf("recall before: %v", err)
|
||||
}
|
||||
beforeIDs := ttlIDs(before)
|
||||
|
||||
// after:开门控
|
||||
t.Setenv("ZHIYI_INTENTION_TTL", "1")
|
||||
fakeOn := &nsRecordingLance{rows: rows}
|
||||
after, err := newNSTestPipeline(t, fakeOn).Recall(ttlTestQuery, "test-ns", 4, 0.0)
|
||||
if err != nil {
|
||||
t.Fatalf("recall after: %v", err)
|
||||
}
|
||||
afterIDs := ttlIDs(after)
|
||||
|
||||
rB, rA := rankOf(beforeIDs, "int_expired"), rankOf(afterIDs, "int_expired")
|
||||
t.Logf("AC3 名次对照 int_expired: before=#%d %v → after=#%d %v", rB, beforeIDs, rA, afterIDs)
|
||||
if rA == 0 {
|
||||
t.Fatalf("✗ AC3:过期 intention 被删出结果(应降级保留,non-lossy):%v", afterIDs)
|
||||
}
|
||||
if rA <= rB {
|
||||
t.Fatalf("✗ AC3:过期 intention 名次未下沉(before=#%d after=#%d)", rB, rA)
|
||||
}
|
||||
// 纯度:int_expired 让出的相对序里,其余条保持**相互之间**的原相对顺序
|
||||
// (头部上移是被降档条让位所致,属预期;判据=「其它条相对顺序不变 + 未被沉底」)。
|
||||
strip := func(ids []string) []string {
|
||||
var out []string
|
||||
for _, x := range ids {
|
||||
if x != "int_expired" {
|
||||
out = append(out, x)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
if strings.Join(strip(beforeIDs), ",") != strings.Join(strip(afterIDs), ",") {
|
||||
t.Fatalf("✗ 纯度:除 int_expired 外其余条相对顺序被改动\n before=%v\n after =%v", strip(beforeIDs), strip(afterIDs))
|
||||
}
|
||||
if rankOf(afterIDs, "fact_other_expired") >= rankOf(afterIDs, "int_expired") {
|
||||
t.Fatalf("✗ 纯度:非 intention 的过期条名次未高于被降档条(他应不被降档压在最底):%v", afterIDs)
|
||||
}
|
||||
// 直通字段:结果携带库值 expires_at(非空)
|
||||
for _, r := range after {
|
||||
if r.ID == "int_expired" && r.ExpiresAt == "" {
|
||||
t.Fatalf("✗ RecallResult.ExpiresAt 直通缺失(响应值==库值)")
|
||||
}
|
||||
}
|
||||
t.Logf("✓ AC3 开态:int_expired #%d→#%d 下沉且仍在结果里;有效 intention / 他类位次不变", rB, rA)
|
||||
}
|
||||
|
||||
// TestIntentionTTL_ExpiredSinksBelowAllNormal:池大于 topK 时,过期 intention 即使
|
||||
// 词面最强也必须排在所有正常分之后(降档=最低排序档的强判据),但仍被返回。
|
||||
func TestIntentionTTL_ExpiredSinksBelowAllNormal(t *testing.T) {
|
||||
rows := ttlRows()
|
||||
// 造 6 条普通记忆挤占 topK=4,让过期条必须靠词面强度才进池
|
||||
for i := 0; i < 6; i++ {
|
||||
rows = append(rows, models.MemoryRecord{
|
||||
ID: "filler_" + string(rune('a'+i)), Content: "填充记忆 Berlin 城市", Category: "distilled",
|
||||
})
|
||||
}
|
||||
t.Setenv("ZHIYI_INTENTION_TTL", "1")
|
||||
fake := &nsRecordingLance{rows: rows}
|
||||
res, err := newNSTestPipeline(t, fake).Recall(ttlTestQuery, "test-ns", 4, 0.0)
|
||||
if err != nil {
|
||||
t.Fatalf("recall: %v", err)
|
||||
}
|
||||
ids := ttlIDs(res)
|
||||
r := rankOf(ids, "int_expired")
|
||||
t.Logf("topK=4 池=10 ⇒ ids=%v int_expired rank=%d", ids, r)
|
||||
if r == 0 {
|
||||
// 池大时挤不进 topK 属正常(它不再是唯一含 Berlin 词面的强命中),不是删除;
|
||||
// 但只要它进了结果,就必须是最后一名。
|
||||
t.Logf("(本轮未进 topK-4:topK 截断所致,non-lossy 判据由上一用例覆盖)")
|
||||
return
|
||||
}
|
||||
if r != len(ids) {
|
||||
t.Fatalf("✗ 过期条进了结果却不是最末位(rank=%d len=%d):%v", r, len(ids), ids)
|
||||
}
|
||||
}
|
||||
@@ -218,6 +218,9 @@ func (rc *RustLanceDBClient) InsertMemory(m models.MemoryRecord) error {
|
||||
// 2026-10-14 (t_3ada332b P3) bi-temporal 有效期三列:RFC3339;空 = 永久有效。
|
||||
// 缺此三行 ⇒ Rust 侧 schema 无列 ⇒ 召回降权永不触发(本次事故根因,勿再删)。
|
||||
"valid_from": m.ValidFrom, "valid_to": m.ValidTo, "provenance": m.Provenance,
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:到期时间(RFC3339;空 = 永久)。缺此键 ⇒
|
||||
// Rust schema 有列但写入恒 NULL ⇒ 降权永不触发(bi-temporal 同款事故根因,勿删)。
|
||||
"expires_at": m.ExpiresAt,
|
||||
"embedding_model": m.EmbeddingModel, "script_version": m.ScriptVersion, // 2026-10-08 (t_7e3577c5) 血缘
|
||||
// 2026-10-08 (Gap#2):nil ⇒ JSON null ⇒ Rust 写 NULL(不伪装成 0.0)
|
||||
"confidence": m.Confidence, "confidence_source": m.ConfidenceSource,
|
||||
@@ -267,6 +270,9 @@ func (rc *RustLanceDBClient) SearchWithTruncation(table string, vector []float32
|
||||
ValidFrom string `json:"valid_from"`
|
||||
ValidTo string `json:"valid_to"`
|
||||
Provenance string `json:"provenance"`
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:Search 读回解包。缺此行 ⇒ 库里落了值、
|
||||
// Go 侧恒拿空串 ⇒ intention 降权永不触发(解包缺字段=no-op 同款坑)。
|
||||
ExpiresAt string `json:"expires_at"`
|
||||
// 2026-10-31 方案二:蒸馏溯源指针。解包结构缺该字段 ⇒ 即便库里有值
|
||||
// (42.9% 有 ep_ 指针),recall 也永远拿不到 ⇒「只给 35 字结论」无法回溯原文。
|
||||
DerivedFrom string `json:"derived_from"`
|
||||
@@ -362,6 +368,7 @@ func (rc *RustLanceDBClient) SearchWithTruncation(table string, vector []float32
|
||||
ValidFrom: r.ValidFrom,
|
||||
ValidTo: r.ValidTo,
|
||||
Provenance: r.Provenance,
|
||||
ExpiresAt: r.ExpiresAt, // 2026-11-07 t_88cc9cb8:意图 TTL(缺 ⇒ recall 降权拿不到到期时间)
|
||||
DerivedFrom: r.DerivedFrom, // 2026-10-31:方案二溯源指针(缺 ⇒ 输出无)
|
||||
})
|
||||
if len(out) >= topK {
|
||||
@@ -426,6 +433,8 @@ func (rc *RustLanceDBClient) Scan(limit int, namespaceFilter string) ([]models.M
|
||||
ValidFrom string `json:"valid_from"`
|
||||
ValidTo string `json:"valid_to"`
|
||||
Provenance string `json:"provenance"`
|
||||
// 2026-11-07 (t_88cc9cb8):意图 TTL(scan 列表 / export / 磁盘回环验收读侧)
|
||||
ExpiresAt string `json:"expires_at"`
|
||||
// 2026-10-31 方案二:蒸馏溯源指针。解包结构缺该字段 ⇒ 即便库里有值
|
||||
// (42.9% 有 ep_ 指针),recall 也永远拿不到 ⇒「只给 35 字结论」无法回溯原文。
|
||||
DerivedFrom string `json:"derived_from"`
|
||||
@@ -465,6 +474,7 @@ func (rc *RustLanceDBClient) Scan(limit int, namespaceFilter string) ([]models.M
|
||||
ValidFrom: r.ValidFrom,
|
||||
ValidTo: r.ValidTo,
|
||||
Provenance: r.Provenance,
|
||||
ExpiresAt: r.ExpiresAt, // 2026-11-07 t_88cc9cb8:意图 TTL(scan 读侧接线)
|
||||
DerivedFrom: r.DerivedFrom, // 2026-10-31:方案二溯源指针(缺 ⇒ 输出无)
|
||||
})
|
||||
if len(out) >= limit {
|
||||
@@ -1545,6 +1555,7 @@ func (rc *RustLanceDBClient) GetSkillCandidates(minRecalls, limit int) ([]models
|
||||
ValidFrom: mapStr(r, "valid_from"),
|
||||
ValidTo: mapStr(r, "valid_to"),
|
||||
Provenance: mapStr(r, "provenance"),
|
||||
ExpiresAt: mapStr(r, "expires_at"), // 2026-11-07 t_88cc9cb8:意图 TTL 读回接线(只写不读=no-op)
|
||||
VersionHistory: nil,
|
||||
DependsOn: nil,
|
||||
}
|
||||
|
||||
@@ -152,6 +152,43 @@ func graphExpandEnabled() bool {
|
||||
// ValidityExpired 导出有效期判定(同上;空串=永久有效,解析失败保守视为未过期)。
|
||||
func ValidityExpired(validTo string, now time.Time) bool { return validityExpired(validTo, now) }
|
||||
|
||||
// ── 2026-11-07 (t_88cc9cb8) 意图 TTL:intention 类记忆到期降级(非删除)──
|
||||
// 借鉴 Hy-Memory L7 INTENTION / 遗忘研究「时间敏感事实用有效期而非删除」:
|
||||
// category=intention 且 expires_at<now 的记忆,召回排序降到**最低档**(负分沉底),
|
||||
// 但仍在结果里 —— non-lossy,分层比删除更重要(与 bi-temporal 的「剔除候选池」
|
||||
// 不同:本卡明令不硬过滤)。
|
||||
// env 门控 ZHIYI_INTENTION_TTL=1 才启用;默认关 ⇒ 下面两个判定恒 false ⇒
|
||||
// 排序块整体跳过 ⇒ 行为逐位不变(AC2 判据)。每次调用读 env(测试可翻转)。
|
||||
func intentionTtlEnabled() bool {
|
||||
switch strings.ToLower(os.Getenv("ZHIYI_INTENTION_TTL")) {
|
||||
case "1", "true", "on":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IntentionTtlEnabled 导出意图 TTL 开关(供路由层补充通道同口径处理)。
|
||||
func IntentionTtlEnabled() bool { return intentionTtlEnabled() }
|
||||
|
||||
// intentionExpired 判定意图是否过期。判据(全满足才为 true):
|
||||
// 1. 门控开(关态恒 false ⇒ 逐位不变)
|
||||
// 2. category == "intention"(只影响新类,存量记忆零扰动)
|
||||
// 3. expires_at 非空且 < now(空 = 永久;解析失败保守视为未过期,不误伤,
|
||||
// 与 validityExpired 同款纪律)
|
||||
func intentionExpired(category, expiresAt string, now time.Time) bool {
|
||||
if !intentionTtlEnabled() {
|
||||
return false
|
||||
}
|
||||
if category != "intention" || expiresAt == "" {
|
||||
return false
|
||||
}
|
||||
t, err := time.Parse(time.RFC3339, expiresAt)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return t.Before(now)
|
||||
}
|
||||
|
||||
// validityExpired 判断记忆的语义有效期是否已过(valid_to < now ⇒ 失效)。
|
||||
// valid_to 空串 = 永久有效(NULL 语义,永不失效)。解析失败保守视为未失效(不误伤)。
|
||||
func validityExpired(validTo string, now time.Time) bool {
|
||||
@@ -1005,6 +1042,29 @@ func (p *RecallPipeline) recallUncached(ctx context.Context, query, namespace st
|
||||
}
|
||||
}
|
||||
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL 降档:category=intention 且 expires_at<now 的
|
||||
// 记忆**不剔除、不删除**,排序分置为负档(-1)⇒ MMR 选择与展示共用同一套分数
|
||||
// (recall.go Step 3.7 教训:偏置必须在 MMR 之前才改结果集合),必然沉到最低档;
|
||||
// 结果集未满 topK 时它仍会被选中(non-lossy,仍在结果里)。
|
||||
// 用固定负档而非减法偏移:确定性,不被上游 score 范围影响 ⇒ 任何正常分(≥0)都压过它,
|
||||
// 过期条之间按原相对顺序(sort 稳定)保留先后来序。
|
||||
// 关态(默认)intentionExpired 恒 false ⇒ 本循环零次赋值 ⇒ 逐位不变(AC2)。
|
||||
if intentionTtlEnabled() {
|
||||
nowTtl := time.Now()
|
||||
var demoted int
|
||||
for i := range reranked {
|
||||
idx := reranked[i].Index
|
||||
if idx >= 0 && idx < len(candidates) &&
|
||||
intentionExpired(candidates[idx].Category, candidates[idx].ExpiresAt, nowTtl) {
|
||||
reranked[i].Score = -1.0
|
||||
demoted++
|
||||
}
|
||||
}
|
||||
if demoted > 0 {
|
||||
log.Printf("[recall] 意图 TTL 降档 %d 条过期 intention(负分沉底,仍在结果里,non-lossy)", demoted)
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: MMR diversity
|
||||
if tr != nil {
|
||||
tr.Stage("rerank_fusion", stRerank, len(reranked))
|
||||
@@ -1098,6 +1158,7 @@ func (p *RecallPipeline) recallUncached(ctx context.Context, query, namespace st
|
||||
Supersedes: c.Supersedes,
|
||||
SupersededBy: c.SupersededBy,
|
||||
Superseded: len(c.SupersededBy) > 0,
|
||||
ExpiresAt: c.ExpiresAt, // 2026-11-07 t_88cc9cb8:意图 TTL 直通("响应值==库值")
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1194,6 +1255,7 @@ func (p *RecallPipeline) recallUncached(ctx context.Context, query, namespace st
|
||||
Supersedes: rec.Supersedes,
|
||||
SupersededBy: rec.SupersededBy,
|
||||
Superseded: len(rec.SupersededBy) > 0,
|
||||
ExpiresAt: rec.ExpiresAt, // 2026-11-07 t_88cc9cb8:FTS 通道同口径直通
|
||||
Stale: isStale(rec.UpdatedAt, staleAfterHours),
|
||||
// A10 (t_d618dc7c):人工有用单独计数直通(nil=NULL=从未被人工点过)
|
||||
HumanUsefulCount: rec.HumanUsefulCount,
|
||||
|
||||
@@ -109,6 +109,8 @@ func (sc *SQLiteClient) migrate() error {
|
||||
valid_from TEXT DEFAULT '',
|
||||
valid_to TEXT DEFAULT '',
|
||||
provenance TEXT DEFAULT '',
|
||||
-- 2026-11-07 (t_88cc9cb8):意图 TTL(category=intention 的到期时间;''=永久)
|
||||
expires_at TEXT DEFAULT '',
|
||||
last_recalled_at TEXT DEFAULT '',
|
||||
created_at TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL
|
||||
@@ -201,6 +203,8 @@ func (sc *SQLiteClient) migrate() error {
|
||||
{"valid_from", "ALTER TABLE memories ADD COLUMN valid_from TEXT DEFAULT ''"},
|
||||
{"valid_to", "ALTER TABLE memories ADD COLUMN valid_to TEXT DEFAULT ''"},
|
||||
{"provenance", "ALTER TABLE memories ADD COLUMN provenance TEXT DEFAULT ''"},
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL(additive;存量缺省空串=永久有效)
|
||||
{"expires_at", "ALTER TABLE memories ADD COLUMN expires_at TEXT DEFAULT ''"},
|
||||
} {
|
||||
rows, err := sc.query("PRAGMA table_info(memories)")
|
||||
if err != nil {
|
||||
@@ -381,9 +385,9 @@ func (sc *SQLiteClient) InsertMemory(m models.MemoryRecord) error {
|
||||
defer sc.mu.Unlock()
|
||||
return sc.execWithArgs(
|
||||
`INSERT INTO memories(id,agent_id,namespace,content,category,vector,tier,importance,quality_score,
|
||||
source,depends_on,derived_from,source_events,supersedes,superseded_by,valid_from,valid_to,provenance,version,created_at,updated_at) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1,?,?)`,
|
||||
source,depends_on,derived_from,source_events,supersedes,superseded_by,valid_from,valid_to,provenance,expires_at,version,created_at,updated_at) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1,?,?)`,
|
||||
m.ID, m.AgentID, m.Namespace, m.Content, m.Category, vecBlob, m.Tier,
|
||||
1.0, m.QualityScore, "", "[]", m.DerivedFrom, seJSON(m.SourceEvents), seJSON(m.Supersedes), seJSON(m.SupersededBy), m.ValidFrom, m.ValidTo, m.Provenance, now, now,
|
||||
1.0, m.QualityScore, "", "[]", m.DerivedFrom, seJSON(m.SourceEvents), seJSON(m.Supersedes), seJSON(m.SupersededBy), m.ValidFrom, m.ValidTo, m.Provenance, m.ExpiresAt, now, now,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -419,7 +423,7 @@ func (sc *SQLiteClient) Scan(limit int, namespaceFilter string) ([]models.Memory
|
||||
sc.mu.RLock()
|
||||
defer sc.mu.RUnlock()
|
||||
|
||||
q := "SELECT id, content, category, namespace, importance, quality_score, recall_count, recall_seen_count, recall_verified_count, not_useful_count, human_not_useful_count, dedup_downweight_count, tier, source, created_at, updated_at, source_events, supersedes, superseded_by, valid_from, valid_to, provenance FROM memories WHERE is_deleted=0"
|
||||
q := "SELECT id, content, category, namespace, importance, quality_score, recall_count, recall_seen_count, recall_verified_count, not_useful_count, human_not_useful_count, dedup_downweight_count, tier, source, created_at, updated_at, source_events, supersedes, superseded_by, valid_from, valid_to, provenance, expires_at FROM memories WHERE is_deleted=0"
|
||||
if namespaceFilter != "" {
|
||||
q += " AND namespace='" + sanitizeIdent(namespaceFilter) + "'"
|
||||
}
|
||||
@@ -482,6 +486,8 @@ func (sc *SQLiteClient) Scan(limit int, namespaceFilter string) ([]models.Memory
|
||||
rec.ValidFrom, _ = row["valid_from"].(string)
|
||||
rec.ValidTo, _ = row["valid_to"].(string)
|
||||
rec.Provenance, _ = row["provenance"].(string)
|
||||
// 2026-11-07 (t_88cc9cb8):意图 TTL 读回
|
||||
rec.ExpiresAt, _ = row["expires_at"].(string)
|
||||
out = append(out, rec)
|
||||
}
|
||||
return out, nil
|
||||
|
||||
@@ -78,6 +78,11 @@ pub struct MemoryRecord {
|
||||
pub valid_to: String,
|
||||
#[serde(default)]
|
||||
pub provenance: String,
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:category=intention 的记忆到期时间(RFC3339;
|
||||
// 空 = 永久)。#[serde(default)] ⇒ 存量行/缺列读回 ""(等同永久,降档永不触发)。
|
||||
// 五层纪律之 Rust struct 层:缺这层 ⇒ IPC 序列化不带字段 ⇒ Go 读回恒空(no-op)。
|
||||
#[serde(default)]
|
||||
pub expires_at: String,
|
||||
pub last_recalled_at: String, pub created_at: String, pub updated_at: String,
|
||||
}
|
||||
|
||||
@@ -155,6 +160,9 @@ fn arrow_schema() -> Schema {
|
||||
Field::new("valid_from", DataType::Utf8, true),
|
||||
Field::new("valid_to", DataType::Utf8, true),
|
||||
Field::new("provenance", DataType::Utf8, true),
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL:expires_at(additive,nullable 容纳存量 NULL;
|
||||
// open() 的 schema 演进对存量表自动 add_columns CAST(NULL AS STRING))。
|
||||
Field::new("expires_at", DataType::Utf8, true),
|
||||
// A10 (t_d618dc7c):人工有用单独计数。nullable Int64 —— 存量行由 open() schema 演进
|
||||
// 迁移补 NULL(CAST(NULL AS BIGINT),与 confidence/human_not_useful_count 迁移模式一致);
|
||||
// 人工点过后才变真实整数。只加观察口径,不进任何排序公式/权重(AC#6 排序零变化)。
|
||||
@@ -270,6 +278,7 @@ impl LanceDBOps {
|
||||
valid_from: col_str(&batch, i, "valid_from"),
|
||||
valid_to: col_str(&batch, i, "valid_to"),
|
||||
provenance: col_str(&batch, i, "provenance"),
|
||||
expires_at: col_str(&batch, i, "expires_at"), // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_at: col_str(&batch, i, "last_recalled_at"),
|
||||
created_at: col_str(&batch, i, "created_at"),
|
||||
updated_at: col_str(&batch, i, "updated_at"),
|
||||
@@ -395,6 +404,7 @@ impl LanceDBOps {
|
||||
valid_from: col_str(&batch, i, "valid_from"), // 2026-10-14 t_3ada332b P3
|
||||
valid_to: col_str(&batch, i, "valid_to"), // 2026-10-14 t_3ada332b P3
|
||||
provenance: col_str(&batch, i, "provenance"), // 2026-10-14 t_3ada332b P3
|
||||
expires_at: col_str(&batch, i, "expires_at"), // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_at: col_str(&batch, i, "last_recalled_at"),
|
||||
created_at: col_str(&batch, i, "created_at"),
|
||||
updated_at: col_str(&batch, i, "updated_at"),
|
||||
@@ -464,6 +474,7 @@ impl LanceDBOps {
|
||||
valid_from: col_str(&batch, i, "valid_from"), // 2026-10-14 t_3ada332b P3
|
||||
valid_to: col_str(&batch, i, "valid_to"), // 2026-10-14 t_3ada332b P3
|
||||
provenance: col_str(&batch, i, "provenance"), // 2026-10-14 t_3ada332b P3
|
||||
expires_at: col_str(&batch, i, "expires_at"), // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_at: col_str(&batch, i, "last_recalled_at"),
|
||||
created_at: col_str(&batch, i, "created_at"),
|
||||
updated_at: col_str(&batch, i, "updated_at"),
|
||||
@@ -506,6 +517,8 @@ impl LanceDBOps {
|
||||
let mut superseded_by_col = Vec::new(); // 2026-10-14 t_3e98b65a
|
||||
// 2026-10-14 (t_3ada332b P3) bi-temporal 有效期三列
|
||||
let mut valid_froms = Vec::new(); let mut valid_tos = Vec::new(); let mut provenances = Vec::new();
|
||||
// 2026-11-07 (t_88cc9cb8) 意图 TTL 列(additive)
|
||||
let mut expires_ats = Vec::new();
|
||||
let mut last_recalled_ats = Vec::new(); let mut created_ats = Vec::new(); let mut updated_ats = Vec::new();
|
||||
// 2026-10-08 (Gap#2):nullable 列用 Option,未声明时写 None → 库里是 NULL
|
||||
let mut confidences: Vec<Option<f64>> = Vec::new();
|
||||
@@ -554,6 +567,7 @@ impl LanceDBOps {
|
||||
valid_froms.push(r["valid_from"].as_str().unwrap_or("")); // 2026-10-14 t_3ada332b P3
|
||||
valid_tos.push(r["valid_to"].as_str().unwrap_or("")); // 2026-10-14 t_3ada332b P3
|
||||
provenances.push(r["provenance"].as_str().unwrap_or("")); // 2026-10-14 t_3ada332b P3
|
||||
expires_ats.push(r["expires_at"].as_str().unwrap_or("")); // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_ats.push(r["last_recalled_at"].as_str().unwrap_or(""));
|
||||
created_ats.push(r["created_at"].as_str().unwrap_or(""));
|
||||
updated_ats.push(r["updated_at"].as_str().unwrap_or(""));
|
||||
@@ -622,6 +636,9 @@ impl LanceDBOps {
|
||||
Arc::new(StringArray::from(valid_froms)),
|
||||
Arc::new(StringArray::from(valid_tos)),
|
||||
Arc::new(StringArray::from(provenances)),
|
||||
// 2026-11-07 (t_88cc9cb8):expires_at 列,与 arrow_schema 顺序一致(additive,
|
||||
// 位序 = provenance 之后 / human_useful_count 之前)
|
||||
Arc::new(StringArray::from(expires_ats)),
|
||||
// A10 (t_d618dc7c):human_useful_count 列(nullable,NULL=从未被人工点过),
|
||||
// 追加在 arrow_schema() 尾字段 human_useful_count 之后,顺序严格一致。
|
||||
Arc::new(Int64Array::from(human_useful_counts)),
|
||||
@@ -1144,6 +1161,7 @@ impl LanceDBOps {
|
||||
valid_from: col_str(batch, i, "valid_from"), // 2026-10-14 t_3ada332b P3
|
||||
valid_to: col_str(batch, i, "valid_to"), // 2026-10-14 t_3ada332b P3
|
||||
provenance: col_str(batch, i, "provenance"), // 2026-10-14 t_3ada332b P3
|
||||
expires_at: col_str(batch, i, "expires_at"), // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_at: col_str(batch, i, "last_recalled_at"),
|
||||
created_at: col_str(batch, i, "created_at"),
|
||||
updated_at: col_str(batch, i, "updated_at"),
|
||||
@@ -1224,6 +1242,7 @@ impl LanceDBOps {
|
||||
valid_from: col_str(&batch, i, "valid_from"), // 2026-10-14 t_3ada332b P3
|
||||
valid_to: col_str(&batch, i, "valid_to"), // 2026-10-14 t_3ada332b P3
|
||||
provenance: col_str(&batch, i, "provenance"), // 2026-10-14 t_3ada332b P3
|
||||
expires_at: col_str(&batch, i, "expires_at"), // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_at: col_str(&batch, i, "last_recalled_at"),
|
||||
created_at: col_str(&batch, i, "created_at"),
|
||||
updated_at: col_str(&batch, i, "updated_at"),
|
||||
@@ -1309,6 +1328,7 @@ impl LanceDBOps {
|
||||
valid_from: col_str(&batch, i, "valid_from"), // 2026-10-14 t_3ada332b P3
|
||||
valid_to: col_str(&batch, i, "valid_to"), // 2026-10-14 t_3ada332b P3
|
||||
provenance: col_str(&batch, i, "provenance"), // 2026-10-14 t_3ada332b P3
|
||||
expires_at: col_str(&batch, i, "expires_at"), // 2026-11-07 t_88cc9cb8 意图 TTL
|
||||
last_recalled_at: col_str(&batch, i, "last_recalled_at"),
|
||||
created_at: col_str(&batch, i, "created_at"),
|
||||
updated_at: col_str(&batch, i, "updated_at"),
|
||||
|
||||
Reference in New Issue
Block a user