Skip to content

Commit fa5ced5

Browse files
committed
feat(agent-workspace): guide correction follow-up from managed memory state
1 parent e73b5c6 commit fa5ced5

10 files changed

Lines changed: 86 additions & 25 deletions

docs/diataxis/en/explanation/agent-conversation-focus-mode-plan.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,14 @@ Mitigation:
453453
This delivery path already replaced "generic conversation enhancement" and most of its early pane-contract phases are now integrated on `main`.
454454
The immediate remaining priority is no longer basic focus/path shell delivery.
455455
It is conversation-product hardening on top of the shipped shell.
456+
`M8.22` already closed the minimum correction-flow gap by turning missing managed-memory state into explicit next-step guidance.
456457

457458
Priority order:
458459

459-
1. correction-flow closure on top of managed-memory state visibility,
460-
2. operator-facing visibility for conversation-memory and correction actions,
461-
3. stronger focus-mode / learning-path action surfaces tied to the active conversation atom,
462-
4. only then deeper personalization work,
463-
5. markdown-reader improvements only when they clearly compound the same study loop.
460+
1. operator-facing visibility for conversation-memory and correction actions,
461+
2. stronger focus-mode / learning-path action surfaces tied to the active conversation atom,
462+
3. only then deeper personalization work,
463+
4. markdown-reader improvements only when they clearly compound the same study loop.
464464

465465
## Related Pages
466466

docs/diataxis/en/explanation/development-progress-dashboard.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Current top priority is not feature-count expansion.
1818
Current top priority is **conversation-product hardening on top of the already-green backend baseline**:
1919

2020
- keep backend sufficiency as a standing decision gate rather than an active execution lane,
21-
- close the correction/product/operator gap exposed after `M8.20-M8.21`,
22-
- narrow the next budget to correction-flow closure, operator-facing visibility, and stronger focus/path action surfaces,
23-
- keep remote `main` CI interpretation evidence-based: latest `3a1926a` workflows are green.
21+
- keep closing the correction/product/operator gap exposed after `M8.20-M8.22`,
22+
- treat `M8.22` as the minimum correction-flow closure baseline and move the remaining near-term budget into operator-facing visibility and stronger focus/path action surfaces,
23+
- keep remote `main` CI interpretation evidence-based: the latest fully completed `main` workflow set (`3a1926a`) is green, and the newer `e73b5c6` push remains non-red with `Migration Gates` still running at refresh time.
2424

2525
## Current Mainline Snapshot (2026-04-21 M8.18)
2626

@@ -106,6 +106,20 @@ Execution anchor:
106106
- backend targeted-read filter metadata,
107107
- runtime managed-memory state messaging for present vs missing managed keys.
108108

109+
## Latest Mainline Increment (2026-04-21 M8.22 Correction Follow-Up Guidance Lane)
110+
111+
- Converted targeted managed-memory state reads into explicit correction-flow guidance without widening backend scope:
112+
- missing `conversation_note:{atomId}` now maps to the existing `Store Memory Note` action label,
113+
- missing `conversation_correction:{atomId}` now maps to the existing `Record Correction` action label.
114+
- Kept the slice intentionally bounded:
115+
- no new backend route, persistence model, or mutation contract was introduced,
116+
- runtime guidance is derived from the already-landed `matchedKeys` / `missingKeys` state metadata.
117+
- Runtime assistant summaries now close the minimum next-step gap after managed-memory inspection:
118+
- targeted reads report present vs missing managed keys,
119+
- when managed state is missing, the assistant now tells the operator which existing correction-flow action should happen next.
120+
- Expanded regression coverage for:
121+
- runtime managed-memory state messaging with explicit next-step guidance.
122+
109123
## Latest Mainline Increment (2026-04-14 M1 Baseline)
110124

111125
- Added first `AgentConversationAPI` contract surface:

docs/diataxis/en/explanation/local-backend-sufficiency-and-escalation-plan.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ Recommended next product order:
244244

245245
1. conversation-product hardening:
246246
- extend explicit conversation memory APIs beyond the current snapshot/read/managed-key inspection and note/correction/eviction surface,
247-
- first close correction / feedback flows on top of the newly landed present/missing managed-state visibility,
248-
- then add operator-facing visibility for conversation-memory and correction actions,
247+
- the minimum correction / feedback closure is now integrated through explicit next-step guidance on missing managed state,
248+
- next add operator-facing visibility for conversation-memory and correction actions,
249249
- then harden stronger agent action surfaces around focus mode and learning path.
250250
2. markdown-reader improvement:
251251
- only when it clearly compounds knowledge review or focus-mode study loops.

docs/diataxis/zh/explanation/agent-conversation-focus-mode-plan.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,14 @@
441441
这条交付链已经替代“泛化对话增强”,且其早期 pane-contract 阶段已在 `main` 集成。
442442
当前第一优先级已经不再是基础 focus/path 壳层交付,
443443
而是建立在该壳层之上的 conversation-product 加固。
444+
`M8.22` 已经通过“把缺失托管记忆状态转成显式下一步提示”补上最小 correction-flow 缺口。
444445

445446
优先顺序:
446447

447-
1. 围绕托管记忆状态可见性收口 correction-flow closure,
448-
2. 增加 conversation-memory / correction action 的 operator-facing visibility,
449-
3. 继续加固绑定当前会话 atom 的 focus-mode / learning-path action surface,
450-
4. 之后才进入更深的 personalization 工作,
451-
5. Markdown 阅读器提升只有在能明确复利同一学习闭环时才进入前列。
448+
1. 增加 conversation-memory / correction action 的 operator-facing visibility,
449+
2. 继续加固绑定当前会话 atom 的 focus-mode / learning-path action surface,
450+
3. 之后才进入更深的 personalization 工作,
451+
4. Markdown 阅读器提升只有在能明确复利同一学习闭环时才进入前列。
452452

453453
## 关联页面
454454

docs/diataxis/zh/explanation/development-progress-dashboard.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
当前重心是 **建立在已转绿 backend 基线之上的 conversation-product 加固**
1919

2020
- 让 backend sufficiency 继续作为常驻 decision gate,而不是继续占用主动执行预算,
21-
- 收口 `M8.20-M8.21` 之后暴露出的 correction / product / operator 缺口,
22-
- 将下一段预算明确收敛到 correction-flow closureoperator-facing visibility 与更强的 focus/path action surface,
23-
- 远端 `main` CI 解释继续基于代码事实:当前 `3a1926a` 最新工作流为绿色
21+
- 持续收口 `M8.20-M8.22` 之后暴露出的 correction / product / operator 缺口,
22+
- `M8.22` 视作最小 correction-flow closure 基线,把剩余近端预算转向 operator-facing visibility 与更强的 focus/path action surface,
23+
- 远端 `main` CI 解释继续基于代码事实:最近一组已完整结束的 `main` 工作流(`3a1926a`)为绿色,而更新的 `e73b5c6` 推送在刷新时也保持非红,仅 `Migration Gates` 仍在执行
2424

2525
## 当前主线快照(2026-04-21 M8.18)
2626

@@ -106,6 +106,20 @@
106106
- backend 定向读取过滤元数据,
107107
- runtime 托管记忆状态消息对“已存在/缺失”键的断言。
108108

109+
## 主线最新增量(2026-04-21 M8.22 Correction Follow-Up Guidance 链路)
110+
111+
- 已在不扩大 backend 范围的前提下,把定向托管记忆状态读取升级为显式 correction-flow 提示:
112+
- 缺失 `conversation_note:{atomId}` 时,运行时会映射到现有 `Store Memory Note` 动作标签,
113+
- 缺失 `conversation_correction:{atomId}` 时,运行时会映射到现有 `Record Correction` 动作标签。
114+
- 范围仍然刻意保持收敛:
115+
- 没有新增 backend 路由、持久化模型或 mutation contract,
116+
- 当前提示完全基于已经落地的 `matchedKeys` / `missingKeys` 状态元数据推导。
117+
- runtime assistant 摘要现在补上了托管记忆检查后的最小下一步缺口:
118+
- 定向读取继续报告已存在 / 缺失的托管 key,
119+
- 一旦托管状态缺失,assistant 会明确指出下一步应执行的既有 correction-flow 动作。
120+
- 回归覆盖同步扩展到:
121+
- runtime 托管记忆状态消息对显式下一步提示的断言。
122+
109123
## 主线最新增量(2026-04-14 M1 基线)
110124

111125
- 已新增第一版 `AgentConversationAPI` 合同面:

docs/diataxis/zh/explanation/local-backend-sufficiency-and-escalation-plan.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@
243243

244244
1. conversation-product 加固:
245245
- 在当前 snapshot/read/托管 key 检查与 note/correction/eviction 能力之上继续扩展显式 conversation memory API,
246-
- 先围绕刚落地的“已存在/缺失托管状态可见性”收口 correction / feedback 流程
247-
- 再补 conversation-memory / correction action 的 operator-facing visibility,
248-
- 最后再继续加固围绕 focus mode 与 learning path 的 agent action surface。
246+
- 最小 correction / feedback 收口已经通过“缺失托管状态 -> 显式下一步提示”集成到主线
247+
- 下一步补 conversation-memory / correction action 的 operator-facing visibility,
248+
- 之后再继续加固围绕 focus mode 与 learning path 的 agent action surface。
249249
2. markdown reader 提升:
250250
- 只有在它能明确加强知识 review 或 focus-mode 学习闭环时,再提升优先级。
251251

src/agent_workspace.runtime.behavior.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,7 @@ describe('agent workspace runtime behavior', () => {
18651865
expect(messages.textContent || '').toContain('session/read');
18661866
expect(messages.textContent || '').toContain('present note');
18671867
expect(messages.textContent || '').toContain('missing correction');
1868+
expect(messages.textContent || '').toContain('next Record Correction');
18681869
});
18691870

18701871
test('executes memory write capability, prompts for note text, and persists deterministic key', async () => {

src/frontend/agent_workspace_runtime.js

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,30 @@
197197
return labels.length ? labels.join(', ') : 'none';
198198
}
199199

200+
function summarizeManagedMemoryFollowUpActions(keys) {
201+
const labels = [];
202+
resolveStringArray(keys).forEach((key) => {
203+
if (key.startsWith('conversation_note:')) {
204+
labels.push(
205+
getI18nText(
206+
'agentWorkspace.actions.writeMemoryNote',
207+
'Store Memory Note'
208+
)
209+
);
210+
return;
211+
}
212+
if (key.startsWith('conversation_correction:')) {
213+
labels.push(
214+
getI18nText(
215+
'agentWorkspace.actions.recordMemoryCorrection',
216+
'Record Correction'
217+
)
218+
);
219+
}
220+
});
221+
return Array.from(new Set(labels)).join(', ');
222+
}
223+
200224
function resolveMisconceptionTopK(rawTopK, fallback) {
201225
const numericTopK = Number(rawTopK);
202226
const numericFallback = Number(fallback);
@@ -1501,6 +1525,7 @@
15011525
const targetedMatchKeys = resolveStringArray(filter && filter.matchKeys);
15021526
const matchedKeys = resolveStringArray(filter && filter.matchedKeys);
15031527
const missingKeys = resolveStringArray(filter && filter.missingKeys);
1528+
const followUpActionsSummary = summarizeManagedMemoryFollowUpActions(missingKeys);
15041529
if (operation === 'write') {
15051530
appendMessage(
15061531
'assistant',
@@ -1542,13 +1567,18 @@
15421567
appendMessage(
15431568
'assistant',
15441569
getI18nText(
1545-
'agentWorkspace.messages.memoryTargetedReadLoaded',
1546-
`Memory targeted read loaded (${layer}/${operation}): present ${summarizeMemoryKeyLabels(matchedKeys)}, missing ${summarizeMemoryKeyLabels(missingKeys)}, totals session ${Number.isFinite(sessionCount) ? sessionCount : 0}, unit ${Number.isFinite(unitCount) ? unitCount : 0}, long-term ${Number.isFinite(longTermCount) ? longTermCount : 0}.`,
1570+
followUpActionsSummary
1571+
? 'agentWorkspace.messages.memoryTargetedReadLoadedWithNext'
1572+
: 'agentWorkspace.messages.memoryTargetedReadLoaded',
1573+
followUpActionsSummary
1574+
? `Memory targeted read loaded (${layer}/${operation}): present ${summarizeMemoryKeyLabels(matchedKeys)}, missing ${summarizeMemoryKeyLabels(missingKeys)}, next ${followUpActionsSummary}, totals session ${Number.isFinite(sessionCount) ? sessionCount : 0}, unit ${Number.isFinite(unitCount) ? unitCount : 0}, long-term ${Number.isFinite(longTermCount) ? longTermCount : 0}.`
1575+
: `Memory targeted read loaded (${layer}/${operation}): present ${summarizeMemoryKeyLabels(matchedKeys)}, missing ${summarizeMemoryKeyLabels(missingKeys)}, totals session ${Number.isFinite(sessionCount) ? sessionCount : 0}, unit ${Number.isFinite(unitCount) ? unitCount : 0}, long-term ${Number.isFinite(longTermCount) ? longTermCount : 0}.`,
15471576
{
15481577
layer,
15491578
operation,
15501579
matchedKeysSummary: summarizeMemoryKeyLabels(matchedKeys),
15511580
missingKeysSummary: summarizeMemoryKeyLabels(missingKeys),
1581+
nextActionsSummary: followUpActionsSummary,
15521582
sessionCount: Number.isFinite(sessionCount) ? sessionCount : 0,
15531583
unitCount: Number.isFinite(unitCount) ? unitCount : 0,
15541584
longTermCount: Number.isFinite(longTermCount) ? longTermCount : 0,

src/frontend/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@
295295
"memoryWriteLoaded": "Memory updated ({layer}/{operation}): wrote {mutatedCount} entry, totals session {sessionCount}, unit {unitCount}, long-term {longTermCount}.",
296296
"memoryEvictLoaded": "Memory eviction completed ({layer}/{operation}): removed {evictedCount} entries, targeted keys {removedKeysCount}, totals session {sessionCount}, unit {unitCount}, long-term {longTermCount}.",
297297
"memoryPolicyLoaded": "Memory snapshot loaded ({layer}/{operation}): {entriesCount} entries, evicted {evictedCount}, totals session {sessionCount}, unit {unitCount}, long-term {longTermCount}, recommended {recommendedActionsCount} actions.",
298-
"memoryTargetedReadLoaded": "Memory targeted read loaded ({layer}/{operation}): present {matchedKeysSummary}, missing {missingKeysSummary}, totals session {sessionCount}, unit {unitCount}, long-term {longTermCount}."
298+
"memoryTargetedReadLoaded": "Memory targeted read loaded ({layer}/{operation}): present {matchedKeysSummary}, missing {missingKeysSummary}, totals session {sessionCount}, unit {unitCount}, long-term {longTermCount}.",
299+
"memoryTargetedReadLoadedWithNext": "Memory targeted read loaded ({layer}/{operation}): present {matchedKeysSummary}, missing {missingKeysSummary}, next {nextActionsSummary}, totals session {sessionCount}, unit {unitCount}, long-term {longTermCount}."
299300
}
300301
},
301302
"manual": {

src/frontend/locales/zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@
295295
"memoryWriteLoaded": "记忆已更新({layer}/{operation}):写入 {mutatedCount} 条,总量 session {sessionCount}、unit {unitCount}、long-term {longTermCount}。",
296296
"memoryEvictLoaded": "记忆清理已完成({layer}/{operation}):移除 {evictedCount} 条,命中键 {removedKeysCount} 个,总量 session {sessionCount}、unit {unitCount}、long-term {longTermCount}。",
297297
"memoryPolicyLoaded": "记忆快照已加载({layer}/{operation}):{entriesCount} 条,清理 {evictedCount} 条,总量 session {sessionCount}、unit {unitCount}、long-term {longTermCount},推荐动作 {recommendedActionsCount} 个。",
298-
"memoryTargetedReadLoaded": "定向记忆读取已加载({layer}/{operation}):已命中 {matchedKeysSummary},缺失 {missingKeysSummary},总量 session {sessionCount}、unit {unitCount}、long-term {longTermCount}。"
298+
"memoryTargetedReadLoaded": "定向记忆读取已加载({layer}/{operation}):已命中 {matchedKeysSummary},缺失 {missingKeysSummary},总量 session {sessionCount}、unit {unitCount}、long-term {longTermCount}。",
299+
"memoryTargetedReadLoadedWithNext": "定向记忆读取已加载({layer}/{operation}):已命中 {matchedKeysSummary},缺失 {missingKeysSummary},下一步 {nextActionsSummary},总量 session {sessionCount}、unit {unitCount}、long-term {longTermCount}。"
299300
}
300301
},
301302
"nodes": "节点",

0 commit comments

Comments
 (0)