diff --git a/docs/Q4_VM部署验收记录.md b/docs/Q4_VM部署验收记录.md index 84d6105..7ff6d8d 100644 --- a/docs/Q4_VM部署验收记录.md +++ b/docs/Q4_VM部署验收记录.md @@ -82,3 +82,18 @@ - VM smoke:使用 AstrBot 实际 Python 对 Q5 源码只读编译通过,用户记忆合同输出 `Q5_SMOKE_OK user_memory`。 - VM pytest:运行时未提供 `pytest`,因此未宣称 VM pytest 全量通过;本地排除普通陪伴宿主依赖的全量 `142 tests` 通过。 - 回滚:停止服务后恢复上述 `plugin-before`,保持 `plugin_data/astrbot_plugin_memory_companion_ops` 不变,再启动并复核服务与 Archivist。 + +## Q6 只读用户事实 Bridge VM 部署验收 — 7530774(2026-07-25) + +- Forgejo:`origin/ops-main` 已推进到 `7530774`(`feat: add read-only user fact bridge`)。 +- 发布包:`/tmp/memory-q6-7530774.tar.gz`。 +- 本地与 VM SHA-256:`766dcb98bbd6a4598478653db4ab03dad1df24ec8f74f12e35ef5ced67e07bd8`。 +- 部署备份:`/var/lib/astrbot/ops-replace-backups/20260726-022018-q6-7530774/plugin-before`;该目录名由 VM 主机时间生成。 +- 替换范围:仅替换 `/var/lib/astrbot/data/plugins/astrbot_plugin_memory_companion_ops`。 +- 数据保护:`/var/lib/astrbot/data/plugin_data/astrbot_plugin_memory_companion_ops` 保留,`memory_companion.db` 存在,未执行数据库迁移。 +- 运行状态:`astrbot.service active`,`NRestarts=0`,最近 10 分钟日志 `Traceback=0`。 +- 插件加载:`astrbot_plugin_memory_companion_ops (1.6.2-ops.2)` 已加载。 +- Archivist:`source=memory_companion version=1.6.2-ops.2 available=True search=True`。 +- Q6 VM smoke:`Q6_VM_SMOKE_OK`;VM `compileall` 通过。 +- 回滚:停止服务后恢复上述 `plugin-before`,保持独立 `plugin_data` 不变,再启动并复核服务与 Archivist。 +- 未执行:VM pytest;VM 当前 Python 环境未安装 pytest。 diff --git a/docs/运维记忆错题本.md b/docs/运维记忆错题本.md index 35ec42c..55f8e65 100644 --- a/docs/运维记忆错题本.md +++ b/docs/运维记忆错题本.md @@ -135,3 +135,13 @@ - 修复或规避:新增 `query_user_facts` 和能力探测;要求私聊用户 ID、群聊用户 ID 与群 ID;结果只接受明确的 `user_memory`,保留时间元数据;Bridge 缺失返回空结果和 warning。 - 预防规则:用户事实查询必须显式绑定 user/scope,禁止把缺失域、Bot 自有域、混合域或日历历史视为用户记忆;只读查询不得写库。 - 验证证据:`tests/test_q6_user_fact_bridge.py` 已补齐能力、降级、scope 和非用户域过滤测试;`compileall` 与模块导入检查通过;pytest 当前环境未安装,未虚报测试通过。 + +## 2026-07-25 — Q6 VM 部署验收与远程脚本编码 + +- 阶段:Q6 记忆侧 Bridge 部署验收 +- 类型:部署 / 环境 / API契约 +- 现象:部署脚本通过 PowerShell here-string 发送到 VM 时,首行带 UTF-8 BOM,导致远程 shell 报 `set: command not found`,验收脚本首个 `printf` 也被 BOM 影响。 +- 根因:远程 shell 输入不是文件写回,但 PowerShell here-string 仍携带 BOM;脚本主体后续命令继续执行,不能把单条首命令失败误判为完整脚本成功。 +- 修复或规避:部署结果以独立只读命令复核;后续远程脚本必须使用 BOM-free 字节流;关键步骤使用 `set -euo pipefail` 并检查每个阶段退出码。 +- 预防规则:远程 shell 脚本禁止直接使用可能带 BOM 的中文 PowerShell 字符串;部署后必须独立核对包哈希、备份、数据目录、服务状态、重启次数、插件加载、Archivist 和 traceback。 +- 验证证据:提交 `7530774` 已部署;包 SHA-256 一致;备份和 `memory_companion.db` 存在;`astrbot.service active`;`NRestarts=0`;`Traceback=0`;`Q6_VM_SMOKE_OK`;Archivist `available=True search=True`。