convention/cron-wiki-sync

Wiki Sync 规范(2026-05-03 更新)

目标

将 session highlights 里的知识内化到 wiki 分类文件,而不是只堆日志。

Obsidian Local REST API

  • API Key: 047e84eb941910b7ae221ea6b458fbd6c9b2bbfbeab654e05a59893520cd29f9
  • Base: http://100.83.112.84:27123
  • Endpoint: POST /vault/{filename}.md
  • Header: Authorization: Bearer {key}
  • Content-Type: text/markdown

同步优先级

  1. 优先使用 Obsidian Local REST API
  2. 如果 API 失败(连接错误或”Could not determine home directory”):使用 SCP fallback
  3. 如果都失败:保存到本地 ~/.hermes/hermes-wiki/draft-{date}.mdD:\\hermes\\sessions\\wiki-draft-{date}.md

SCP Fallback 路径

scp -i ~/.ssh/id_ed25519_hermes \
  ~/.hermes/hermes-wiki/{filename}.md \
  sozo@100.83.112.84:'H:\\My Drive\\Jakephone\\Obsidian Vault\\'

知识分类规则

类别内容
env/平台、环境、工具、路径
project/项目状态、配置、IDs
skill/技能流程、调试方法
convention/工作流规范、调度规则
user/用户偏好、沟通风格

Known Issues

  • ⚠️ check_recent_chat.sh scheduler bug RECURRING (2026-05-05): The fix in scheduler.py line 482 was documented as applied at 00:02 on May 5, but scheduler.py does not exist in ~/.hermes/. Timeouts occurred again at 02:03 and 03:25. Need to locate and properly fix scheduler.py on the actual running instance.
  • sqlite3 超时:如果 check_recent_chat.sh 脚本超时(120s),可能是 hermes.db 的 messages 表过大。检查:sqlite3 ~/.hermes/hermes.db "SELECT COUNT(*) FROM messages;"
  • 脚本本身很快(文件 stat + 简单 sqlite 查询),超时通常是 DB 查询卡住 或 scheduler.py bug
  • Job ID: ee43bb83e0ef
  • Schedule: 0 */3 * * * (每3小时)
  • 脚本: check_recent_chat.sh
  • 技能: llm-wiki

convention/cron-wiki-sync

Wiki Sync 规范(2026-05-03 更新)

目标

将 session highlights 里的知识内化到 wiki 分类文件,而不是只堆日志。

Obsidian Local REST API

  • API Key: 047e84eb941910b7ae221ea6b458fbd6c9b2bbfbeab654e05a59893520cd29f9
  • Base: http://100.83.112.84:27123
  • Endpoint: POST /vault/{filename}.md
  • Header: Authorization: Bearer {key}
  • Content-Type: text/markdown

同步优先级

  1. 优先使用 Obsidian Local REST API
  2. 如果 API 失败(连接错误或”Could not determine home directory”):使用 SCP fallback
  3. 如果都失败:保存到本地 ~/.hermes/hermes-wiki/draft-{date}.mdD:\\hermes\\sessions\\wiki-draft-{date}.md

SCP Fallback 路径

scp -i ~/.ssh/id_ed25519_hermes \
  ~/.hermes/hermes-wiki/{filename}.md \
  sozo@100.83.112.84:'H:\\My Drive\\Jakephone\\Obsidian Vault\\'

知识分类规则

类别内容
env/平台、环境、工具、路径
project/项目状态、配置、IDs
skill/技能流程、调试方法
convention/工作流规范、调度规则
user/用户偏好、沟通风格

Known Issues

⚠️ Network Isolation in Cron Context (2026-05-10)

Both the Obsidian Local REST API (http://100.83.112.84:27123) AND SSH/SCP to PC (100.83.112.84) timeout in cron job context. This is Termux cron network namespace isolation — both paths are blocked even though they work fine in interactive sessions.

Confirmed failures in cron context:

  • API: curl exits 28 (connection timeout)
  • SCP: ssh exits 255 (connection timeout)
  • Both work fine in interactive Termux sessions

Current fallback: Save to local draft (~/.hermes/hermes-wiki/draft/wiki-draft-{date}.md). Manual sync needed after returning to interactive session.

Dream Consolidation — vault-keeper Integration (2026-05-19)

The two systems are 串联 (series), not competing:

03:30  dream-consolidation.py  → 提取 session 知识 → knowledge_buffer.json
03:35  vault-keeper.py sync    → 同步 buffer → Obsidian vault
04:00  vault-keeper 3h sync    → buffer 已空,显示 "nothing to sync" (正常)

“Buffer empty” 是正常状态,不是错误 — 说明上一次 sync 成功清空了 buffer。

Knowledge Categories for Wiki

categoryWiki targetNotes
skillskill/{name}.md技能文档
decisiondecisions/decision-log.md重要决策及理由
bug_fixprojects/{project}-complete.md项目 bug 修复
envenv/{name}.md环境配置
dailydaily/{YYYY-MM-DD}.md每日日志
project_noteprojects/{project}.md项目进展

Wiki Sync Rules (2026-05-19)

  • 优先写入 wiki 分类skill/convention/env/projects/
  • 遵守 frontmatter 规范:title, created, updated, tags, sources
  • 每个页面至少 2 个 wikilinks 到其他相关页面
  • 保留原有快速沉淀层decisions/decision-log.mddaily/ 继续追加
  • 更新 index.md:新增页面必须在索引中体现

Cron Job Architecture

JobScheduleScriptRole
vault-keeper 3h sync0 1,4,7,10,13,16,19,22 * * *vault-keeper.py同步 buffer → vault
dream-consolidation30 3 * * *dream-consolidation.py提取 session → buffer

Job ID (removed): 8a183e5876f0 (daily-consolidation.sh — script not found, removed 2026-05-19)

  • 脚本本身很快(文件 stat + 简单 sqlite 查询),超时通常是 DB 查询卡住 或 scheduler.py bug
  • Job ID: ee43bb83e0ef
  • Schedule: 0 */3 * * * (每3小时)
  • 脚本: check_recent_chat.sh
  • 技能: llm-wiki

convention/cron-wiki-sync

Wiki Sync 规范(2026-05-03 更新)

目标

将 session highlights 里的知识内化到 wiki 分类文件,而不是只堆日志。

Obsidian Local REST API

  • API Key: 047e84eb941910b7ae221ea6b458fbd6c9b2bbfbeab654e05a59893520cd29f9
  • Base: http://100.83.112.84:27123
  • Endpoint: POST /vault/{filename}.md
  • Header: Authorization: Bearer {key}
  • Content-Type: text/markdown

同步优先级

  1. 优先使用 Obsidian Local REST API
  2. 如果 API 失败(连接错误或”Could not determine home directory”):使用 SCP fallback
  3. 如果都失败:保存到本地 ~/.hermes/hermes-wiki/draft-{date}.mdD:\\hermes\\sessions\\wiki-draft-{date}.md

SCP Fallback 路径

scp -i ~/.ssh/id_ed25519_hermes \
  ~/.hermes/hermes-wiki/{filename}.md \
  sozo@100.83.112.84:'H:\\My Drive\\Jakephone\\Obsidian Vault\\'

知识分类规则

类别内容
env/平台、环境、工具、路径
project/项目状态、配置、IDs
skill/技能流程、调试方法
convention/工作流规范、调度规则
user/用户偏好、沟通风格

Known Issues

⚠️ Network Isolation in Cron Context (2026-05-10)

Both the Obsidian Local REST API (http://100.83.112.84:27123) AND SSH/SCP to PC (100.83.112.84) timeout in cron job context. This is Termux cron network namespace isolation — both paths are blocked even though they work fine in interactive sessions.

Confirmed failures in cron context:

  • API: curl exits 28 (connection timeout)
  • SCP: ssh exits 255 (connection timeout)
  • Both work fine in interactive Termux sessions

Current fallback: Save to local draft (~/.hermes/hermes-wiki/draft/wiki-draft-{date}.md). Manual sync needed after returning to interactive session.

  • ⚠️ check_recent_chat.sh scheduler bug RECURRING (2026-05-06): Timeouts continue (now 13th at 06:02). Script works directly but times out in cron. Root cause in scheduler.py subprocess execution — NOT in script logic.
  • ⚠️ Dream task recursive loop bug (2026-05-06 06:02): Dream task reads session files and accidentally reads its own active session → recursive feedback loop → timeout. Fix: use sessions.json instead of *.json files. See skill/llm-wiki-dream-bug.md.
  • sqlite3 超时:如果 check_recent_chat.sh 脚本超时(120s),可能是 hermes.db 的 messages 表过大。检查:sqlite3 ~/.hermes/hermes.db "SELECT COUNT(*) FROM messages;"

Dream Task Scheduler Info

  • Job ID: ee43bb83e0ef
  • Schedule: 0 */3 * * * (每3小时)
  • 脚本: check_recent_chat.sh
  • 技能: cron-wiki-sync (注意:不要用 llm-wiki — 该名称不会解析到 convention category 下的 skill,应直接使用 cron-wiki-sync)

⚠️ skill: llm-wiki 不会解析到 cron-wiki-sync

尽管 cron-wiki-sync SKILL.md 的 triggers 包含 llm-wiki,但 cron job scheduler 按名称直接查找根级 skill 时无法找到它。根级存在 skills/llm-wiki/ 但它与 cron-wiki-sync 是不同 skill。正确做法:cron job 直接设置 skill: cron-wiki-sync**。


Dream Consolidation + vault-keeper Integration (2026-05-19)

The two systems are 串联 (series), not competing:

03:30  dream-consolidation.py  →  提取 session 知识 → knowledge_buffer.json
03:35  vault-keeper.py sync   →  同步 buffer → Obsidian vault
04:00  vault-keeper 3h sync   →  buffer 已空,显示 "nothing to sync" (正常)

“Buffer empty” 是正常状态,不是错误 — 说明上一次 sync 成功清空了 buffer。

Cron Job Architecture

JobScheduleScriptRole
vault-keeper 3h sync0 1,4,7,10,13,16,19,22 * * *vault-keeper.py同步 buffer → vault
dream-consolidation30 3 * * *dream-consolidation.py提取 session → buffer

Removed job: 8a183e5876f0 (daily-consolidation.sh — script not found, removed 2026-05-19)