stable-harness 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +10 -0
  2. package/docs/0.1.0-p0-runtime-control-plane-plan.zh.md +171 -0
  3. package/docs/0.1.0-retry-policy.zh.md +87 -0
  4. package/docs/0.1.0-stable-runtime-development-roadmap.zh.md +393 -0
  5. package/docs/0.1.0-tool-guard-benchmark.zh.md +42 -0
  6. package/docs/adapter-contract.md +199 -0
  7. package/docs/architecture/backend-comparison.md +41 -0
  8. package/docs/architecture/runtime-events.md +263 -0
  9. package/docs/architecture/runtime-events.zh.md +248 -0
  10. package/docs/architecture/system-architecture.zh.md +435 -0
  11. package/docs/compatibility-matrix.md +139 -0
  12. package/docs/engineering-rules.md +111 -0
  13. package/docs/evaluation/0.1.0-bfcl-targeted-model-matrix.zh.md +1632 -0
  14. package/docs/evaluation/0.1.0-bfcl-targeted-review-matrix.zh.md +1952 -0
  15. package/docs/evaluation/0.1.0-bfcl-tool-guard.zh.md +1427 -0
  16. package/docs/granite-tool-calling-comparison.zh.md +206 -0
  17. package/docs/guides/getting-started.md +126 -0
  18. package/docs/guides/index.md +40 -0
  19. package/docs/guides/integration-guide.md +126 -0
  20. package/docs/guides/operator-runbook.md +153 -0
  21. package/docs/guides/workspace-authoring.md +212 -0
  22. package/docs/implementation-blueprint.md +233 -0
  23. package/docs/memory/0.1.0-memory-design.zh.md +719 -0
  24. package/docs/memory/0.1.0-step-09-deepagents-native-memory.zh.md +146 -0
  25. package/docs/memory/0.1.0-step-09-langmem-shaped-provider.zh.md +169 -0
  26. package/docs/memory/0.1.0-step-09-memory-adapter-projection.zh.md +123 -0
  27. package/docs/memory/0.1.0-step-09-memory-contract.zh.md +169 -0
  28. package/docs/memory/0.1.0-step-09-memory-governance-approval.zh.md +143 -0
  29. package/docs/memory/0.1.0-step-09-memory-lifecycle-hooks.zh.md +150 -0
  30. package/docs/memory/0.1.0-step-09-memory-maintenance-boundary.zh.md +118 -0
  31. package/docs/memory/0.1.0-step-09-memory-persistence-boundary.zh.md +118 -0
  32. package/docs/product/adoption-playbook.md +145 -0
  33. package/docs/product/market-positioning.md +137 -0
  34. package/docs/product-boundary.md +258 -0
  35. package/docs/protocols/http-runtime.md +37 -0
  36. package/docs/protocols/langgraph-compatible.md +107 -0
  37. package/docs/protocols/openai-compatible.md +121 -0
  38. package/docs/tooling/0.1.0-bettercall-tool-quality.zh.md +231 -0
  39. package/package.json +3 -1
@@ -0,0 +1,146 @@
1
+ # 0.1.0 Step 09.7 DeepAgents Native Memory Support
2
+
3
+ ## 目标
4
+
5
+ 本步骤支持 DeepAgents 原生 memory 和 DeepAgents 生态里的 memory substrate。stable-harness 不重新定义这些上游语义,只做 runtime assembly 和 adapter pass-through。
6
+
7
+ ## DeepAgents 原生支持
8
+
9
+ DeepAgents `createDeepAgent` 支持:
10
+
11
+ ```text
12
+ memory?: string[]
13
+ backend?: AnyBackendProtocol | BackendFactory
14
+ store?: BaseStore
15
+ checkpointer?: BaseCheckpointSaver | boolean
16
+ middleware?: AgentMiddleware[]
17
+ skills?: string[]
18
+ ```
19
+
20
+ 其中:
21
+
22
+ - `memory` 是 memory source path 列表,通常指向 `AGENTS.md` 这类文件。
23
+ - `backend` 是 DeepAgents 用来读取 memory/skills/files 的 backend。
24
+ - `store` 是 LangGraph/LangChain long-term store。
25
+ - `checkpointer` 是 run/thread state persistence,不等同于长期记忆。
26
+ - `middleware` 可以直接包含 DeepAgents `createMemoryMiddleware(...)` 产物。
27
+
28
+ ## stable-harness 配置
29
+
30
+ YAML / config 可以写:
31
+
32
+ ```yaml
33
+ config:
34
+ deepagents:
35
+ memory:
36
+ - /memories/user/AGENTS.md
37
+ - /memories/project/AGENTS.md
38
+ skills:
39
+ - /skills/project/
40
+ ```
41
+
42
+ 兼容别名:
43
+
44
+ ```yaml
45
+ config:
46
+ deepagents:
47
+ memorySources:
48
+ - /memories/project/AGENTS.md
49
+ skillSources:
50
+ - /skills/project/
51
+ ```
52
+
53
+ 程序化使用可以直接传对象:
54
+
55
+ ```ts
56
+ agent.config.deepagents = {
57
+ backend,
58
+ store,
59
+ checkpointer,
60
+ middleware: [
61
+ createMemoryMiddleware({ backend, sources: ["/memories/project/AGENTS.md"] })
62
+ ]
63
+ };
64
+ ```
65
+
66
+ ## 边界
67
+
68
+ DeepAgents native memory:
69
+
70
+ ```text
71
+ file/source based memory
72
+ middleware injection
73
+ backend/store/checkpointer substrate
74
+ upstream system prompt integration
75
+ ```
76
+
77
+ stable-harness typed memory:
78
+
79
+ ```text
80
+ MemoryCandidate
81
+ MemoryDecision
82
+ MemoryRecord
83
+ policy
84
+ approval
85
+ persistence
86
+ maintenance
87
+ upstream config mapping
88
+ ```
89
+
90
+ 二者关系:
91
+
92
+ ```text
93
+ stable typed memory -> recall context -> runtime events / adapter context
94
+ DeepAgents native memory -> upstream createDeepAgent params/middleware
95
+ ```
96
+
97
+ 不要把 DeepAgents `memory?: string[]` 当作 stable-harness 的 public memory record schema。
98
+
99
+ ## Sequence Diagram
100
+
101
+ ```mermaid
102
+ sequenceDiagram
103
+ participant Workspace
104
+ participant Adapter as DeepAgents Adapter
105
+ participant DeepAgents as createDeepAgent
106
+ participant Backend as DeepAgents Backend
107
+
108
+ Workspace->>Adapter: config.deepagents.memory / backend / store
109
+ Adapter->>DeepAgents: pass-through createDeepAgent params
110
+ DeepAgents->>Backend: load memory source paths
111
+ Backend-->>DeepAgents: AGENTS.md memory content
112
+ DeepAgents->>DeepAgents: inject native memory into system prompt
113
+ ```
114
+
115
+ ## Flow Chart
116
+
117
+ ```mermaid
118
+ flowchart TD
119
+ A["Agent config"] --> B{"deepagents.memory or memorySources?"}
120
+ B -->|yes| C["Pass memory string[] to createDeepAgent"]
121
+ B -->|no| D["No native DeepAgents memory source"]
122
+ A --> E{"backend/store/checkpointer/middleware?"}
123
+ E -->|yes| F["Pass through upstream objects"]
124
+ E -->|no| G["Use DeepAgents defaults"]
125
+ C --> H["DeepAgents upstream memory middleware"]
126
+ F --> H
127
+ D --> H
128
+ G --> H
129
+ ```
130
+
131
+ ## Verification
132
+
133
+ 本步骤新增测试覆盖:
134
+
135
+ - `deepagents.memory` 透传为 `createDeepAgent({ memory })`。
136
+ - `deepagents.skills` 透传为 `createDeepAgent({ skills })`。
137
+ - `deepagents.backend`、`store`、`checkpointer`、`middleware`、`permissions` 透传。
138
+ - 真实 `deepagents@1.9.1` + 远端 Ollama `granite4.1:3b` 默认路径仍通过。
139
+
140
+ 验证命令:
141
+
142
+ ```text
143
+ npm run check
144
+ npm run check:rules
145
+ npm test
146
+ ```
@@ -0,0 +1,169 @@
1
+ # 0.1.0 Step 09.8 LangMem-Shaped Provider Contract
2
+
3
+ ## 目标
4
+
5
+ 本步骤把 stable-harness 的 memory provider contract 按 LangMem 语义定义,同时允许两个实现方向:
6
+
7
+ - Python LangMem service provider。
8
+ - JS embedded provider。
9
+
10
+ 核心原则:同一套定义,不同 provider 实现。
11
+
12
+ ## Config Surface
13
+
14
+ ```yaml
15
+ memory:
16
+ provider: embedded
17
+ mode:
18
+ hotPathTools: true
19
+ backgroundManager: true
20
+ types:
21
+ semantic: true
22
+ episodic: true
23
+ procedural: true
24
+ approval:
25
+ procedural: true
26
+ sensitive: true
27
+ restricted: true
28
+ defaults:
29
+ scope: workspace
30
+ sensitivity: internal
31
+ ```
32
+
33
+ ## Provider Interface
34
+
35
+ ```text
36
+ MemoryProvider
37
+ ├─ name
38
+ ├─ config
39
+ ├─ propose(input) -> MemoryCandidate[]
40
+ ├─ search(input) -> MemoryRecord[]
41
+ └─ consolidate(input) -> MemoryMaintenanceOperation[]
42
+ ```
43
+
44
+ ## Mode
45
+
46
+ - `hotPathTools`:允许执行路径中暴露 memory search/manage 工具。
47
+ - `backgroundManager`:允许 run 后台做 extraction、consolidation、cleanup。
48
+
49
+ 当前只定义开关,不自动注册工具或后台任务。
50
+
51
+ ## Types
52
+
53
+ - `semantic`:事实、偏好、知识。
54
+ - `episodic`:某次运行、事件、验证结果。
55
+ - `procedural`:未来行为规则和操作流程。
56
+
57
+ Provider 可以提出这些类型,但 stable-harness policy 仍是最终决策层。
58
+
59
+ ## Approval
60
+
61
+ - `procedural`:影响未来行为,默认应审批。
62
+ - `sensitive`:敏感信息,默认应审批。
63
+ - `restricted`:高风险信息,默认应审批或拒绝。
64
+
65
+ ## Embedded JS Provider
66
+
67
+ 当前内置 `createEmbeddedMemoryProvider(config)`:
68
+
69
+ - 不使用 LLM。
70
+ - 根据 typed config 过滤 memory kind。
71
+ - `propose` 生成 `MemoryCandidate`。
72
+ - `search` 通过 `RuntimeMemoryStore.recall`。
73
+ - `consolidate` 把 stale record 转成 archive operation。
74
+
75
+ 它是 MVP,用于本地开发和测试,不替代 LangMem。
76
+
77
+ ## Python LangMem Service Provider
78
+
79
+ 后续 Python service 应实现同一个 contract:
80
+
81
+ ```text
82
+ POST /memory/propose
83
+ POST /memory/search
84
+ POST /memory/consolidate
85
+ GET /health
86
+ ```
87
+
88
+ 服务职责:
89
+
90
+ - 调用 LangMem Python SDK。
91
+ - 做 semantic / episodic / procedural extraction。
92
+ - 做 consolidation suggestion。
93
+ - 返回 candidates 或 maintenance operations。
94
+
95
+ 服务不负责最终 store/reject/review。最终决策仍由 stable-harness policy 和 approval queue 完成。
96
+
97
+ ## Sequence Diagram
98
+
99
+ ```mermaid
100
+ sequenceDiagram
101
+ participant Runtime
102
+ participant Provider as MemoryProvider
103
+ participant Policy as MemoryPolicy
104
+ participant Store as RuntimeMemoryStore
105
+
106
+ Runtime->>Provider: propose(run content)
107
+ Provider-->>Runtime: MemoryCandidate[]
108
+ Runtime->>Policy: decide(candidate)
109
+ Policy-->>Runtime: MemoryDecision
110
+ alt store
111
+ Runtime->>Store: submitCandidate(candidate)
112
+ else review
113
+ Runtime->>Runtime: approval queue
114
+ else reject
115
+ Runtime->>Runtime: audit rejection
116
+ end
117
+ ```
118
+
119
+ ## Flow Chart
120
+
121
+ ```mermaid
122
+ flowchart TD
123
+ A["Run or tool evidence"] --> B{"provider"}
124
+ B -->|embedded| C["JS embedded provider"]
125
+ B -->|langmem-service| D["Python LangMem service"]
126
+ C --> E["MemoryCandidate[]"]
127
+ D --> E
128
+ E --> F["stable-harness MemoryPolicy"]
129
+ F --> G{"decision"}
130
+ G -->|store| H["RuntimeMemoryStore"]
131
+ G -->|review| I["ApprovalQueue"]
132
+ G -->|reject| J["Audit event"]
133
+ ```
134
+
135
+ ## Verification
136
+
137
+ 本步骤新增测试覆盖:
138
+
139
+ - `createEmbeddedMemoryProvider` 接受 LangMem-shaped config。
140
+ - disabled procedural type 会拒绝 procedural candidate。
141
+ - semantic candidate 可以产生并存入 runtime store。
142
+ - provider search 走 runtime store recall。
143
+ - provider consolidate 把 stale record 转为 archive operation。
144
+
145
+ 验证命令:
146
+
147
+ ```text
148
+ npm run check
149
+ npm run check:rules
150
+ npm test
151
+ ```
152
+
153
+ ## 下游验证
154
+
155
+ 本步骤已完成 EasyNet 真实验证:
156
+
157
+ ```text
158
+ cd /Users/boqiangliang/project/easynet
159
+ npm test
160
+ npm run test:botbotgo:full
161
+ ```
162
+
163
+ 真实验证结果:
164
+
165
+ - `npm test` 通过:18 个 contract tests,7 个 real integration tests。
166
+ - `test:botbotgo:full` 通过:8/8 matrix cases。
167
+ - full matrix 明确使用 EasyNet package-local `node_modules/.bin/botbotgo`。
168
+ - 真实模型路径为 EasyNet 配置的远端 Ollama `granite4.1:3b`。
169
+ - 覆盖 owner:orchestra、software、qa、ops、release、research、secretary、k8s。
@@ -0,0 +1,123 @@
1
+ # 0.1.0 Step 09.3 Memory Adapter Boundary
2
+
3
+ ## 目标
4
+
5
+ 本步骤定义 runtime memory 与 DeepAgents adapter 的边界:stable runtime 可以执行 recall 并把 typed memory context 交给 adapter,但 adapter 不把 recall 文本拼进 `systemPrompt`。DeepAgents 原生 memory 能力通过 upstream-native config 或 middleware 接入。
6
+
7
+ ## 设计边界
8
+
9
+ core runtime 负责:
10
+
11
+ - 执行 memory recall。
12
+ - 把 recall records 和 compressed context 放入 `RuntimeAdapterContext.memory`。
13
+ - 发出 `runtime.memory.recall.completed` 和 `runtime.memory.lifecycle` 事件。
14
+
15
+ DeepAgents adapter 负责:
16
+
17
+ - 读取 `RuntimeAdapterContext.memory`。
18
+ - 把 `agent.config.deepagents.memory`、`memorySources`、`middleware`、`store` 等 upstream-native 配置传给 `createDeepAgent`。
19
+ - 不把 stable runtime recall context 写入 prompt。
20
+
21
+ 不做:
22
+
23
+ - 不暴露 DeepAgents `/memories/` 作为 stable-harness public API。
24
+ - 不默认把 memory 注入 prompt。
25
+ - 不从 agent 输出中自动抽取 memory。
26
+ - 不用 memory 改写 routing、tool calling 或 subagent planning。
27
+ - 不把业务领域知识写入 runtime。
28
+
29
+ ## Interface
30
+
31
+ ```text
32
+ RuntimeAdapterContext
33
+ └─ memory?
34
+ ├─ namespace
35
+ ├─ records
36
+ └─ context
37
+
38
+ Agent config
39
+ └─ deepagents
40
+ ├─ memory?: string[]
41
+ ├─ memorySources?: string[]
42
+ ├─ middleware?: unknown[]
43
+ └─ store?: unknown
44
+ ```
45
+
46
+ ## Adapter 行为
47
+
48
+ DeepAgents adapter 的 memory 处理只有两类:
49
+
50
+ - `RuntimeAdapterContext.memory` 保持为 typed runtime context,可用于事件、审计、评估或未来显式 adapter extension。
51
+ - DeepAgents 原生 memory 通过 `agent.config.deepagents` 透传给 upstream `createDeepAgent`。
52
+ - adapter 不拼接 recall 文本到 `systemPrompt`。
53
+
54
+ ## Sequence Diagram
55
+
56
+ ```mermaid
57
+ sequenceDiagram
58
+ participant Runtime
59
+ participant Memory as RuntimeMemoryStore
60
+ participant Adapter as DeepAgents Adapter
61
+ participant Upstream as createDeepAgent
62
+
63
+ Runtime->>Memory: recall(namespace, query)
64
+ Memory-->>Runtime: records + context
65
+ Runtime->>Adapter: run(context.memory)
66
+ Adapter->>Upstream: createDeepAgent(upstream-native memory config)
67
+ ```
68
+
69
+ ## Flow Chart
70
+
71
+ ```mermaid
72
+ flowchart TD
73
+ A["Adapter receives RuntimeAdapterContext"] --> B{"memory context exists?"}
74
+ B --> C["Keep context typed; do not alter prompt"]
75
+ C --> D["Pass deepagents.memory / middleware / store to upstream"]
76
+ D --> E["createDeepAgent(params)"]
77
+ ```
78
+
79
+ ## Verification
80
+
81
+ 本步骤新增测试覆盖:
82
+
83
+ - DeepAgents adapter 不把 runtime memory 写入 prompt。
84
+ - DeepAgents native memory config 仍透传给 upstream,不产生 prompt 注入。
85
+ - adapter 仍通过 upstream `createDeepAgent` 路径执行。
86
+ - stable runtime 仍不暴露 DeepAgents `/memories/`。
87
+ - 安装 `deepagents@1.9.1` 后,adapter 默认路径真实 import 上游包并使用远端 Ollama `granite4.1:3b` 完成一次真实调用。
88
+
89
+ 验证命令:
90
+
91
+ ```text
92
+ npm run check
93
+ npm run check:rules
94
+ npm test
95
+ ```
96
+
97
+ ## 下游验证
98
+
99
+ 本步骤已完成 EasyNet 真实验证:
100
+
101
+ ```text
102
+ cd /Users/boqiangliang/project/easynet
103
+ npm test
104
+ npm run test:botbotgo:full
105
+ ```
106
+
107
+ 真实验证结果:
108
+
109
+ - `npm test` 通过:18 个 contract tests,7 个 real integration tests。
110
+ - `test:botbotgo:full` 通过:8/8 matrix cases。
111
+ - full matrix 明确使用 EasyNet package-local `node_modules/.bin/botbotgo`。
112
+ - 真实模型路径为 EasyNet 配置的远端 Ollama `granite4.1:3b`。
113
+ - stable-harness 自身测试真实调用 `deepagents@1.9.1` + `@langchain/ollama` + `https://ollama-rtx-4070.easynet.world/`。
114
+ - 覆盖 owner:orchestra、software、qa、ops、release、research、secretary、k8s。
115
+ - 覆盖真实工具/数据路径:finance stock report、source analysis、disk investigation、Git/GitHub Actions、Kubernetes readonly investigation、CLI routing。
116
+
117
+ ## 下一步
118
+
119
+ 下一步是 `Step 09.4 Memory Governance And Approval`:
120
+
121
+ - 把 sensitive/restricted memory review 接入 governance approval queue。
122
+ - 为 memory decision 增加 operator-visible audit event。
123
+ - 继续保持模型只能提出 candidate,runtime policy 决定最终动作。
@@ -0,0 +1,169 @@
1
+ # 0.1.0 Step 09.1 长期记忆 Runtime Contract
2
+
3
+ ## 目标
4
+
5
+ 本步骤为 `stable-harness` 建立长期记忆的第一层 runtime contract。它只定义 runtime 应该如何接收、决策、存储、召回和审计 memory,不接管 DeepAgents、OpenAI Agents SDK、Gemini SDK 等上游框架的执行语义。
6
+
7
+ 当前实现刻意保持很小:
8
+
9
+ - `MemoryCandidate`:agent、tool、run 或 operator 提出的待记忆内容。
10
+ - `MemoryDecision`:runtime policy 对候选内容做出的确定性决策。
11
+ - `MemoryRecord`:runtime 接受后的稳定记录。
12
+ - `MemoryPolicy`:决定 store、reject、review 等动作。
13
+ - `RuntimeMemoryStore`:提交候选、直接记忆、召回、列出、更新、归档。
14
+ - `createInMemoryRuntimeMemoryStore`:第一阶段内存实现,用于 contract 测试和后续 adapter 集成前验证。
15
+
16
+ ## 边界
17
+
18
+ `stable-harness` 拥有 memory lifecycle、policy、namespace、approval、audit 和 adapter context。上游框架拥有 agent 执行语义和 prompt/memory 注入方式。
19
+
20
+ 本步骤不实现:
21
+
22
+ - 不实现 DeepAgents `/memories/` 作为 public API。
23
+ - 不把 memory 做成不断增长的 prompt blob。
24
+ - 不用 memory 做自然语言 keyword routing。
25
+ - 不实现业务领域规则,例如股票、新闻、Kubernetes、release、finance。
26
+ - 不 replay 上游 tool call。
27
+ - 不发明第二套 subagent planning language。
28
+ - 不把 vector store 当成 source of truth。
29
+
30
+ ## Interface
31
+
32
+ ```text
33
+ @stable-harness/memory
34
+ ├─ MemoryCandidate
35
+ │ ├─ namespace
36
+ │ ├─ content
37
+ │ ├─ sourceType / sourceRef
38
+ │ ├─ kindHint
39
+ │ ├─ scopeHint
40
+ │ ├─ confidenceHint
41
+ │ ├─ sensitivity
42
+ │ ├─ noStore
43
+ │ └─ provenance / metadata
44
+
45
+ ├─ MemoryDecision
46
+ │ ├─ action
47
+ │ ├─ reason
48
+ │ ├─ kind / scope
49
+ │ ├─ confidence
50
+ │ ├─ retrievalPriority
51
+ │ └─ reviewRequired
52
+
53
+ ├─ MemoryRecord
54
+ │ ├─ id / canonicalKey
55
+ │ ├─ namespace
56
+ │ ├─ kind / scope / status
57
+ │ ├─ content / summary
58
+ │ ├─ confidence
59
+ │ ├─ sourceRefs / tags
60
+ │ ├─ sensitivity
61
+ │ ├─ createdAt / observedAt / lastConfirmedAt
62
+ │ ├─ revision
63
+ │ └─ supersedes / conflictsWith
64
+
65
+ ├─ MemoryPolicy
66
+ │ └─ decide(candidate)
67
+
68
+ └─ RuntimeMemoryStore
69
+ ├─ submitCandidate(candidate)
70
+ ├─ memorize(input)
71
+ ├─ recall(input)
72
+ ├─ list(input)
73
+ ├─ update(input)
74
+ └─ archive(id)
75
+ ```
76
+
77
+ ## 当前 Policy
78
+
79
+ 第一阶段 policy 是 deterministic policy:
80
+
81
+ - `noStore: true` 直接 `reject`。
82
+ - 空内容直接 `reject`。
83
+ - `sensitive` 或 `restricted` 进入 `review`,不直接写入 store。
84
+ - 其他候选内容进入 `store`。
85
+ - 默认 `kind = semantic`,`scope = workspace`,`confidence = 0.6`。
86
+
87
+ 这保证小模型或上游 agent 只能提出候选,最终是否成为 durable memory 由 runtime policy 决定。
88
+
89
+ ## Sequence Diagram
90
+
91
+ ```mermaid
92
+ sequenceDiagram
93
+ participant Source as Agent/Tool/Run
94
+ participant Store as RuntimeMemoryStore
95
+ participant Policy as MemoryPolicy
96
+ participant Record as MemoryRecord
97
+
98
+ Source->>Store: submitCandidate(candidate)
99
+ Store->>Policy: decide(candidate)
100
+ Policy-->>Store: MemoryDecision
101
+ alt action is store
102
+ Store->>Record: create active record
103
+ Store-->>Source: decision + record
104
+ else action is review
105
+ Store-->>Source: decision only
106
+ else action is reject
107
+ Store-->>Source: rejection decision
108
+ end
109
+ ```
110
+
111
+ ## Flow Chart
112
+
113
+ ```mermaid
114
+ flowchart TD
115
+ A["MemoryCandidate"] --> B{"noStore or empty?"}
116
+ B -->|yes| C["reject"]
117
+ B -->|no| D{"sensitive or restricted?"}
118
+ D -->|yes| E["review required"]
119
+ D -->|no| F["store"]
120
+ F --> G["MemoryRecord active"]
121
+ G --> H["recall filters by namespace/scope/kind/status"]
122
+ H --> I["compressed context"]
123
+ ```
124
+
125
+ ## Verification
126
+
127
+ 本步骤已完成的验证:
128
+
129
+ ```text
130
+ npm run check
131
+ npm run check:rules
132
+ npm test
133
+ ```
134
+
135
+ 覆盖内容:
136
+
137
+ - memory direct write。
138
+ - candidate submit。
139
+ - sensitive candidate review。
140
+ - recall records。
141
+ - recall compressed context。
142
+ - governance/tool policy 原有测试未回退。
143
+
144
+ EasyNet 下游真实验证:
145
+
146
+ ```text
147
+ cd /Users/boqiangliang/project/easynet
148
+ npm test
149
+ npm run test:botbotgo:full
150
+ ```
151
+
152
+ 真实验证结果:
153
+
154
+ - EasyNet 使用 `file:../stable-harness` 依赖当前本地 runtime。
155
+ - botbotgo full matrix 明确使用 EasyNet package-local `node_modules/.bin/botbotgo`。
156
+ - 模型路径为远端 Ollama `granite4.1:3b`,配置来自 EasyNet `config/models.yaml`。
157
+ - `npm test` 通过:18 个 contract tests,7 个 real integration tests。
158
+ - `test:botbotgo:full` 通过:8/8 matrix cases。
159
+ - 覆盖 owner:orchestra、software、qa、ops、release、research、secretary、k8s。
160
+ - 覆盖真实工具/数据路径:finance stock report、web/source analysis、disk investigation、Git/GitHub Actions、Kubernetes readonly investigation、CLI routing。
161
+
162
+ ## 下一步
163
+
164
+ 下一步应实现 `Step 09.2 Memory Lifecycle Hooks`:
165
+
166
+ - 在 core runtime 增加 memory event 类型。
167
+ - 在 request lifecycle 中预留 `read-before-plan`、`read-before-finalize`、`write-after-run` hook。
168
+ - hook 只产生 typed events 和 memory candidate,不改变 backend execution semantics。
169
+ - 完成后运行 stable-harness 测试,并接 EasyNet 真实模型、真实工具、真实数据跑完整 E2E。