mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-11-04 00:07:28 +00:00
docs: 第二层改名 Cold Context,清理四组已不存在的符号名
## 问题 README 与两份 ARCHITECTURE / OVERVIEW 仍在用旧称「Document 层」, 而第二层早已改名 cold context(工具名 `coldcontext_query` / `coldcontext_commit`)。 不止是层名。文档里引用的四个符号在代码里**一个都不存在**: | 文档里写的 | 代码里实际 | |---|---| | `docStore.ContextToDoc` | `coldcontextStore.ContextToColdContext` | | `FindColdDocs` | `FindColdContexts` | | `docToTriples` | `coldDocToTriples` | | `docStore.SetVectorizer` | (已无此调用,embedder 构造期注入) | 四处都用 `grep -rn "\b名字\b" --include=*.go` 确认过:旧名 0 处,新名各自 4 处。 ## 改了什么 - `assets/docs/zh/ARCHITECTURE.md` 13 处、`en/ARCHITECTURE.md` 15 处 - `assets/docs/zh|en/OVERVIEW.md` 各 3 处 - README 两版:「文档层」→「冷上下文层」 - `assets/branding/mascot-xiaozhai-guide.md` 的丝带配色表(三色分别对应三层) ## 顺带修正层号 ARCHITECTURE 用的是 **L1 Context / L2 Cold Context / L3 Stable**, 我上一版 README 写成了 L0/L1/L2 —— 少了一层,且与架构文档对不上。已改为 L1/L2/L3。 ## 顺带修掉断掉的交叉引用 `internal/agent/core/toolcall.go` 与 `recallcoldcontext_test.go` 的注释写 「ARCHITECTURE「记忆流转」② Document 层的读取分支」,指的正是刚改名的节。 不改就成了悬空引用。三个测试函数名(`TestContextToDoc` 等)指向已删函数,一并改名。 ## 验证 - 全仓 `grep` 旧名:`*.md` / `*.go` 均 0 处(排除 build/third_party/.pi) - `go build ./...` ✓ - `go test ./internal/memory/coldcontext/ ./internal/agent/core/` ✓
This commit is contained in:
@ -2,7 +2,7 @@ package core
|
||||
|
||||
// L2 → L1 召回协议的判据。
|
||||
//
|
||||
// 依据(assets/docs/zh/ARCHITECTURE.md「记忆流转」② Document 层的读取分支):
|
||||
// 依据(assets/docs/zh/ARCHITECTURE.md「记忆流转」② 冷上下文 Cold Context 的读取分支):
|
||||
//
|
||||
// coldcontext_query → Consume(读取并删除)
|
||||
// → 逐条 context.Append{Timestamp: 原始时间戳, Source: 原来源}
|
||||
|
||||
@ -1159,7 +1159,7 @@ func (a *Agent) executeDocTool(tc agentAPI.ToolCall) string {
|
||||
for i, d := range docs {
|
||||
// 召回 = 把事件(连同它持有的块)迁回 L1,不是造一条新事件。
|
||||
//
|
||||
// ARCHITECTURE「记忆流转」② Document 层:
|
||||
// ARCHITECTURE「记忆流转」② 冷上下文 Cold Context:
|
||||
// coldcontext_query → Consume(读取并删除)
|
||||
// → 逐条 context.Append{Timestamp: 原始时间戳, Source: 原来源}
|
||||
n := a.restoreDocEvents(d, plan.Evict[d.ID])
|
||||
@ -1414,7 +1414,7 @@ func (a *Agent) currentFingerprint() string {
|
||||
//
|
||||
// ## 依据
|
||||
//
|
||||
// ARCHITECTURE「记忆流转」② Document 层的读取分支:
|
||||
// ARCHITECTURE「记忆流转」② 冷上下文 Cold Context 的读取分支:
|
||||
//
|
||||
// coldcontext_query → Consume(读取并删除)
|
||||
// → 逐条 context.Append{Timestamp: 原始时间戳, Source: 原来源}
|
||||
|
||||
@ -67,7 +67,7 @@ func TestQuery(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestContextToDoc(t *testing.T) {
|
||||
func TestContextToColdContext(t *testing.T) {
|
||||
dir, err := os.MkdirTemp("", "doc_ctx_*")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -98,7 +98,7 @@ func TestContextToDoc(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFindColdDocs(t *testing.T) {
|
||||
func TestFindColdContexts(t *testing.T) {
|
||||
dir, err := os.MkdirTemp("", "doc_cold_*")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -361,7 +361,7 @@ func TestRemoveNonexistent(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestContextToDocContentPreservesRawToolOutput(t *testing.T) {
|
||||
func TestContextToColdContextContentPreservesRawToolOutput(t *testing.T) {
|
||||
dir, err := os.MkdirTemp("", "doc_toolclean_*")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user