@fanchao8609/agent_brain_sync 1.19.3 → 1.19.4
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.
- package/package.json +1 -1
- package/src/todo/structure.js +10 -2
package/package.json
CHANGED
package/src/todo/structure.js
CHANGED
|
@@ -185,13 +185,21 @@ export function enforceBrainFormat(text, spec, prev) {
|
|
|
185
185
|
const tLines = t.split('\n');
|
|
186
186
|
const bad = checkFileShape(fname, t).filter(
|
|
187
187
|
(it) => it.code !== 'STRAY-BLANK-LINE' &&
|
|
188
|
-
|
|
188
|
+
// ★ 孤儿缩进行**不吃存量豁免**(2026-10-18 用户要求)。
|
|
189
|
+
// 超长断点/奇怪条目放行存量是因为「没有安全的自动修法」;
|
|
190
|
+
// 而孤儿行是**确定性的坏数据**(子项没有父项,语义已丢),放行 = 让损坏持续。
|
|
191
|
+
// 宁可写不进去让人看见,也不要静默接受。
|
|
192
|
+
(it.code === 'TODO-ORPHAN-CHILD' ||
|
|
193
|
+
!(prevSig !== null && prevSig.has(sigOfLine(tLines[it.line - 1] || '')))),
|
|
189
194
|
);
|
|
190
195
|
if (bad.length) {
|
|
196
|
+
const onlyOrphan = bad.every((it) => it.code === 'TODO-ORPHAN-CHILD');
|
|
191
197
|
throw new Error(
|
|
192
198
|
`✗ ${fname} 格式不合规(写入被拒):\n` +
|
|
193
199
|
bad.map((it) => ` · ${it.msg}`).join('\n') +
|
|
194
|
-
|
|
200
|
+
(onlyOrphan
|
|
201
|
+
? `\n 出路:子任务必须挂在主任务下。给删掉的父任务行恢复一行任务行,或把那几条子项一起删掉。`
|
|
202
|
+
: `\n 出路:内容归入现有标签,或走对应入口(页 → concepts/ 等子目录 + index 登记;流水 → abs log;经验 → abs note)。`),
|
|
195
203
|
);
|
|
196
204
|
}
|
|
197
205
|
};
|