@fanchao8609/agent_brain_sync 1.7.4 → 1.7.5

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/store.js +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanchao8609/agent_brain_sync",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "agent-brain-sync: 跨会话 AI 编码记忆 — hook 纯触发 + CLI/MCP 读写 .brain markdown 图谱, 防并发写保护。",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/store.js CHANGED
@@ -765,8 +765,16 @@ export async function cmdLint({ dir }) {
765
765
  for (const pg of pages) {
766
766
  if (!pg.hasFrontmatter) issues.push(`NO-FRONTMATTER: ${pg.rel}`);
767
767
  for (const ln of pg.links) {
768
- if (/slug|Name|name|Date|页面名$/.test(ln)) issues.push(`TEMPLATE-LINK: ${pg.rel} -> [[${ln}]]`);
769
- if (!names.has(ln)) issues.push(`DEAD-LINK: ${pg.rel} -> [[${ln}]]`);
768
+ // 两类都不是真链接,只报 TEMPLATE-LINK(且不短路就会再报一次 DEAD-LINK,同一条报两遍):
769
+ // ① 模板占位: `[[页面名]]` / `[[slug]]` / `[[Name]]` —— 模板没填
770
+ // ② 描述语法时引用的字面量: `[[<slug>]]` —— 尖括号不是合法 wikilink 字符,
771
+ // 而是任务描述在解释格式(如 “在 ### 归档 段留下 [[<slug>]] 完成任务 N 条”)。
772
+ // 单靠关键字(slug/name)分辨不了两者,故额外认尖括号形态。
773
+ if (/^<.+>$/.test(ln) || /slug|Name|name|Date|页面名$/.test(ln)) {
774
+ issues.push(`TEMPLATE-LINK: ${pg.rel} -> [[${ln}]]`);
775
+ } else if (!names.has(ln)) {
776
+ issues.push(`DEAD-LINK: ${pg.rel} -> [[${ln}]]`);
777
+ }
770
778
  }
771
779
  // ORPHAN: sources/ 暂存页与 todo 归档页豁免。前者是暂存线索(提炼成 concept 前天然孤立),
772
780
  // 后者是历史数据倾倒(已登记在 index.md,就是图谱入口,无需再制造双链)。