Version: 0.9.39.dev.260423

后端:
1. 记忆系统移除 todo_hint 类型——随口记已由 Task 系统承接,todo_hint 语义重叠且无完成追踪
- 全链路清理:常量、校验、默认重要度、30 天 TTL、读取预算、LLM 抽取提示词枚举
- 总预算从四类收缩为三类(preference / constraint / fact)

2. 记忆抽取触发点从 chat-persist 移至 graph-completion——避免随口记消息被误提取为 constraint/preference
- chat-persist consumer 不再自动入队 memory.extract.requested,仅负责聊天历史落库
- graph 完成后新增条件发布:检测 UsedQuickNote 标记,调用过 quick_note_create 则跳过记忆抽取
- ResetForNextRun 重置 UsedQuickNote,防止跨轮残留导致后续正常消息记忆抽取被误跳过

3. 任务类查询接口返回 items 补充数据库主键 ID(前端拖拽编排依赖此字段)

前端:
4. 排程视图新增手动编排模式——侧边栏任务块拖拽入周课表 + 悬浮删除热区 + 建议块虚线标识
- TaskClassSidebar 拖拽发起 + 预览态嵌入时间格式化(含周次/星期)
- WeekPlanningBoard 外部拖入 / 内部移动 / 悬浮删除区交互
- ScheduleView 手动编排状态机(进入/退出/取消/覆盖确认)+ apply 时同步处理新增与删除
This commit is contained in:
Losita
2026-04-23 23:07:04 +08:00
parent 53e2602df4
commit ba8e8e2a82
23 changed files with 640 additions and 154 deletions

View File

@@ -22,8 +22,6 @@ const (
DefaultReadPreferenceLimit = 5
// DefaultReadFactLimit 是 fact 默认预算上限。
DefaultReadFactLimit = 5
// DefaultReadTodoHintLimit 是 todo_hint 默认预算上限。
DefaultReadTodoHintLimit = 3
)
// Config 是记忆模块配置对象Day1 首版)。
@@ -39,7 +37,6 @@ type Config struct {
ReadConstraintLimit int
ReadPreferenceLimit int
ReadFactLimit int
ReadTodoHintLimit int
InjectRenderMode string
ExtractPrompt string
@@ -112,11 +109,6 @@ func (c Config) EffectiveReadFactLimit() int {
return normalizePositiveLimit(c.ReadFactLimit, DefaultReadFactLimit)
}
// EffectiveReadTodoHintLimit 返回 todo_hint 生效预算。
func (c Config) EffectiveReadTodoHintLimit() int {
return normalizePositiveLimit(c.ReadTodoHintLimit, DefaultReadTodoHintLimit)
}
// EffectiveReadMode 返回生效读取模式。
func (c Config) EffectiveReadMode() string {
return NormalizeReadMode(c.ReadMode)
@@ -127,12 +119,11 @@ func (c Config) EffectiveInjectRenderMode() string {
return NormalizeInjectRenderMode(c.InjectRenderMode)
}
// TotalReadBudget 返回类记忆的总预算上限。
// TotalReadBudget 返回类记忆的总预算上限。
func (c Config) TotalReadBudget() int {
return c.EffectiveReadConstraintLimit() +
c.EffectiveReadPreferenceLimit() +
c.EffectiveReadFactLimit() +
c.EffectiveReadTodoHintLimit()
c.EffectiveReadFactLimit()
}
func normalizePositiveLimit(value int, defaultValue int) int {

View File

@@ -9,8 +9,6 @@ const (
MemoryTypeConstraint = "constraint"
// MemoryTypeFact 表示一般事实类记忆。
MemoryTypeFact = "fact"
// MemoryTypeTodoHint 表示近期待办线索类记忆。
MemoryTypeTodoHint = "todo_hint"
)
const (
@@ -28,7 +26,6 @@ var validMemoryTypes = map[string]struct{}{
MemoryTypePreference: {},
MemoryTypeConstraint: {},
MemoryTypeFact: {},
MemoryTypeTodoHint: {},
}
var validDecisionActions = map[string]struct{}{

View File

@@ -133,7 +133,7 @@ func buildMemoryExtractSystemPrompt(override string) string {
“message_intent”: “chitchat|task_request|knowledge_qa|preference|personal_fact|standing_instruction”,
“facts”: [
{
“memory_type”: “preference|constraint|fact|todo_hint”,
“memory_type”: “preference|constraint|fact”,
“title”: “短标题”,
“content”: “完整事实内容”,
“confidence”: 0.0,
@@ -303,8 +303,6 @@ func defaultImportanceByType(memoryType string) float64 {
return 0.85
case memorymodel.MemoryTypeConstraint:
return 0.95
case memorymodel.MemoryTypeTodoHint:
return 0.8
default:
return 0.6
}

View File

@@ -31,7 +31,6 @@ func LoadConfigFromViper() memorymodel.Config {
ReadConstraintLimit: viper.GetInt("memory.read.constraintLimit"),
ReadPreferenceLimit: viper.GetInt("memory.read.preferenceLimit"),
ReadFactLimit: viper.GetInt("memory.read.factLimit"),
ReadTodoHintLimit: viper.GetInt("memory.read.todoHintLimit"),
// 决策层配置:默认关闭,灰度开启后才会生效。
DecisionEnabled: viper.GetBool("memory.decision.enabled"),
@@ -64,7 +63,6 @@ func LoadConfigFromViper() memorymodel.Config {
cfg.ReadConstraintLimit = cfg.EffectiveReadConstraintLimit()
cfg.ReadPreferenceLimit = cfg.EffectiveReadPreferenceLimit()
cfg.ReadFactLimit = cfg.EffectiveReadFactLimit()
cfg.ReadTodoHintLimit = cfg.EffectiveReadTodoHintLimit()
cfg.ReadMode = cfg.EffectiveReadMode()
cfg.InjectRenderMode = cfg.EffectiveInjectRenderMode()

View File

@@ -224,7 +224,6 @@ func normalizeRetrieveMemoryTypes(raw []string) []string {
return []string{
memorymodel.MemoryTypeConstraint,
memorymodel.MemoryTypePreference,
memorymodel.MemoryTypeTodoHint,
memorymodel.MemoryTypeFact,
}
}
@@ -297,8 +296,6 @@ func scoreRetrievedItem(item model.MemoryItem, now time.Time) float64 {
score += 0.12
case memorymodel.MemoryTypePreference:
score += 0.08
case memorymodel.MemoryTypeTodoHint:
score += 0.05
}
return score
}

View File

@@ -267,7 +267,6 @@ func applyTypeBudget(items []memorymodel.ItemDTO, cfg memorymodel.Config, caller
memorymodel.MemoryTypeConstraint: cfg.EffectiveReadConstraintLimit(),
memorymodel.MemoryTypePreference: cfg.EffectiveReadPreferenceLimit(),
memorymodel.MemoryTypeFact: cfg.EffectiveReadFactLimit(),
memorymodel.MemoryTypeTodoHint: cfg.EffectiveReadTodoHintLimit(),
}
usedByType := make(map[string]int, len(budgetByType))
result := make([]memorymodel.ItemDTO, 0, minInt(len(items), hardCap))
@@ -306,8 +305,6 @@ func renderMemoryTypeLabelForDedup(memoryType string) string {
return "偏好"
case memorymodel.MemoryTypeConstraint:
return "约束"
case memorymodel.MemoryTypeTodoHint:
return "待办线索"
case memorymodel.MemoryTypeFact:
return "事实"
default:

View File

@@ -47,8 +47,6 @@ func scoreRankedItem(item memorymodel.ItemDTO, now time.Time) float64 {
score += 0.15
case memorymodel.MemoryTypePreference:
score += 0.10
case memorymodel.MemoryTypeTodoHint:
score += 0.05
}
return score
}

View File

@@ -119,8 +119,6 @@ func defaultImportanceByType(memoryType string) float64 {
return 0.85
case memorymodel.MemoryTypeConstraint:
return 0.95
case memorymodel.MemoryTypeTodoHint:
return 0.8
default:
return 0.6
}

View File

@@ -326,9 +326,6 @@ func (r *Runner) syncVectorDeletes(ctx context.Context, memoryIDs []int64) {
func resolveMemoryTTLAt(base time.Time, memoryType string) *time.Time {
switch memoryType {
case memorymodel.MemoryTypeTodoHint:
t := base.Add(30 * 24 * time.Hour)
return &t
case memorymodel.MemoryTypeFact:
t := base.Add(180 * 24 * time.Hour)
return &t