refactor: 删掉随 agent 化失效的 applyUnderstandingCorrection,原位留已知偏差说明

顾问纠正某段理解时,改造前它会同时改写该段的 semantic_anchor;现在走
record_advisor_note 只落成分段约束,锚点不跟着改。纠正内容仍会进诊断/复检的
paragraph_constraints,所以不是静默丢失,但与原行为有差——写在原函数位置而不是
只记在方案文档里,读代码的人能看见。
This commit is contained in:
LuminousRuoxi
2026-09-11 10:26:04 +08:00
parent 94a26227c1
commit bdc6a53f81
+5 -12
View File
@@ -770,18 +770,11 @@ function handleAction(action){
renderEntryEssay();
}
}
function applyUnderstandingCorrection(text){
const idx = parseParagraphIndex(text);
if(idx===null || !analysis || !analysis.paragraphs[idx]){
globalConstraints.push(text);
return {scope:'global', label:'文章理解的补充'};
}
analysis.paragraphs[idx].natural_meaning_zh = text;
analysis.paragraphs[idx].semantic_anchor = text;
const pid = pidOf(idx);
(paragraphConstraints[pid]=paragraphConstraints[pid]||[]).push(text);
return {scope:pid, label:`${paragraphLabel(idx)} 的理解`};
}
// 原先这里是 applyUnderstandingCorrection:顾问在理解态说「第三段重点不是……」时,
// 它把这句话同时写进 analysis.paragraphs[i] 的 natural_meaning_zh / semantic_anchor 和
// paragraphConstraints。Agent 化之后这条输入走 record_advisor_note,只落成分段约束,
// **锚点不再跟着改**(纠正内容仍会进诊断/复检的 paragraph_constraints)。
// 这是已知偏差,不是遗漏:要不要补一个带 anchor 更新的「纠正理解」工具待定。
function applyDiagnosisConstraint(text){
const raw = text.trim();
const idx = parseParagraphIndex(raw);