memory-doctor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory Doctor
Memory Doctor
bm doctorThis skill needs a shell with the (or ) command.
bmbasic-memorybm doctor此 skill 需要一个可使用 (或 )命令的 shell。
bmbasic-memoryWhen to Use
何时使用
- Search misses a note the user knows exists, or returns the same note twice
- A note was saved but its file did not change, or the reverse
- The user asks whether Basic Memory is working, or to "check" or "fix" it
- After a crash, an interrupted import, or moving a project's folder
- 搜索未找到用户明确知道存在的笔记,或返回了同一笔记两次
- 笔记已保存,但对应文件没有变化,或者情况相反
- 用户询问 Basic Memory 是否正常工作,或要求“检查”或“修复”它
- 发生崩溃、导入被中断,或移动了项目的文件夹之后
Run It
运行方式
Start with the report alone. It is fast and has a stable JSON shape:
bash
bm doctor --skip-self-test --jsonAdd to check one project. Without , doctor
also runs a self-test: it writes, indexes and searches a note in a throwaway
sandbox, which takes a few seconds and proves the install itself works. Run it
when the report is clean but something still seems broken.
--project NAME--skip-self-test先只运行报告。它速度很快,且输出具有稳定的 JSON 结构:
bash
bm doctor --skip-self-test --json添加 可检查单个项目。如果不使用 ,doctor 还会运行自检:它会在一个一次性沙箱中写入、索引并搜索一条笔记,耗时数秒,可证明安装本身能够正常工作。当报告看起来正常但仍有问题时,请运行它。
--project NAME--skip-self-testRead the Report
阅读报告
json
{
"projects": [
{
"name": "work",
"findings": [
{
"check": "search_index",
"severity": "error",
"summary": "1 search row does not match a current note, observation or relation.",
"evidence": ["entity id=99, entity_id=99"],
"action": {"kind": "reindex_search", "full": true},
"command": "bm reindex --search --full --project work"
}
],
"has_errors": true
}
],
"skipped_cloud_projects": ["research"],
"self_test": {"outcome": "skipped"},
"has_errors": true
}| Severity | Meaning | What to do |
|---|---|---|
| Will not go away without a fix | Offer the |
| Needs attention, may recover on its own | Offer the |
| Expected while work is in progress | Mention it; a running server finishes it, and the |
Indexing catches up in the background. A duplicate, missing or extra search row
is a while file indexing is still running, because the pass may clear
it, and becomes an once indexing has settled. If the report has only findings, nothing is wrong. When no
Basic Memory server is running, nothing indexes in the background, so offer the
on an finding too.
warningerrorinfocommandinfoCloud projects are listed under : they are indexed on the
server, and local commands cannot fix them.
skipped_cloud_projectsjson
{
"projects": [
{
"name": "work",
"findings": [
{
"check": "search_index",
"severity": "error",
"summary": "1 search row does not match a current note, observation or relation.",
"evidence": ["entity id=99, entity_id=99"],
"action": {"kind": "reindex_search", "full": true},
"command": "bm reindex --search --full --project work"
}
],
"has_errors": true
}
],
"skipped_cloud_projects": ["research"],
"self_test": {"outcome": "skipped"},
"has_errors": true
}| 严重程度 | 含义 | 该怎么做 |
|---|---|---|
| 如果不修复就不会自行消失 | 提供 |
| 需要关注,可能自行恢复 | 如果有 |
| 工作进行中时的预期状态 | 简要说明即可;运行中的服务会完成处理,而该 |
索引会在后台追平进度。在文件索引仍在运行时,搜索行重复、缺失或多余属于 ,因为这一轮处理可能会清除它;索引稳定后,它会变成 。如果报告只有 类发现,则说明没有问题。没有 Basic Memory 服务运行时,后台不会进行任何索引,因此对于 类发现,也应提供相应的 。
warningerrorinfoinfocommand云项目会列在 下:它们在服务器上进行索引,本地命令无法修复这些问题。
skipped_cloud_projectsFix
修复
- Summarize the findings for the user in plain words: which project, what is wrong, and what the fix does. Group findings that share a command.
- Show each exactly as doctor printed it and ask before running it.
commandre-reads every file in the project and can take a while on a large one.bm reindex --search --full - Run the commands the user approves.
- Run again and confirm the findings are gone.
bm doctor --skip-self-test --json
When a finding has no , do not invent one. Say what the evidence shows
(for example, which files changed on disk while a newer save was waiting) and
let the user decide.
command- 用通俗语言向用户总结发现:哪个项目存在什么问题,以及该修复会做什么。将共用同一命令的发现归为一组。
- 完全按照 doctor 输出的形式显示每个 ,并在运行前征求用户同意。
command会重新读取项目中的每个文件,在大型项目中可能耗时较长。bm reindex --search --full - 运行用户批准的命令。
- 再次运行 ,确认这些发现已消失。
bm doctor --skip-self-test --json
当某项发现没有 时,不要自行编造命令。说明证据所显示的内容(例如,磁盘上哪些文件发生了变化,而较新的保存操作仍在等待),并让用户自行决定。
commandExit Codes
退出码
bm doctor当没有错误且自检通过(或被跳过)时, 的退出码为 0;其他情况下为 1。 和 永远不会导致命令失败。
bm doctorwarninginfo