2026-07-24 23:12:02 +08:00
|
|
|
|
# Q4 VM 部署验收记录
|
|
|
|
|
|
|
|
|
|
|
|
> 验收日期:2026-07-24(Asia/Shanghai)
|
|
|
|
|
|
> 目标:`agent@192.168.31.215` / AstrBot `4.26.6`
|
|
|
|
|
|
> 提交:`8d21776` (`feat: add temporal awareness to ops memory`)
|
|
|
|
|
|
> 发布版本:`astrbot_plugin_memory_companion_ops 1.6.2-ops.2`
|
|
|
|
|
|
|
|
|
|
|
|
## 1. 发布与备份
|
|
|
|
|
|
|
|
|
|
|
|
- 发布包由 `git archive HEAD` 生成,排除了 `.git`、测试缓存和字节码。
|
|
|
|
|
|
- 本地与 VM `/tmp/memory-q4-8d21776.tar.gz` SHA-256 一致:`ca99bfdbde5e09f47afdfb955ffc87ef30dad510e9f95b2a57570e754fe56518`。
|
|
|
|
|
|
- 部署前停止 `astrbot.service`,代码备份位于:`/var/lib/astrbot/ops-replace-backups/20260724-2300-q4-8d21776/plugin-before`。
|
|
|
|
|
|
- 记忆数据目录单独保留并备份:`/var/lib/astrbot/data/plugin_data/astrbot_plugin_memory_companion_ops`。
|
|
|
|
|
|
- 本次没有数据库迁移;仅替换插件代码目录,记忆数据库和 WAL 未删除。
|
|
|
|
|
|
|
|
|
|
|
|
## 2. 本地验证
|
|
|
|
|
|
|
|
|
|
|
|
| 检查项 | 结果 |
|
|
|
|
|
|
| --- | --- |
|
|
|
|
|
|
| `compileall core tests` | 通过 |
|
|
|
|
|
|
| Q4 时间合同测试 | 13 项通过 |
|
|
|
|
|
|
| 既有 unittest(排除宿主 `astrbot` 依赖的 security_cache 收集项) | 130 项通过 |
|
|
|
|
|
|
| 完整 unittest 入口 | 131 项运行,1 个已知宿主依赖收集错误;不是本次改造回归 |
|
|
|
|
|
|
| `git diff --check` | 通过 |
|
|
|
|
|
|
|
|
|
|
|
|
本地宿主依赖缺口:`tests/test_security_cache.py` 导入 `page_api.py` 时需要 AstrBot runtime 的 `astrbot` 包;该项在 VM runtime 中单独执行。
|
|
|
|
|
|
|
|
|
|
|
|
## 3. VM 运行时验收
|
|
|
|
|
|
|
|
|
|
|
|
- SSH 只读前检:`VM_OK`、用户 `agent`、`astrbot.service active`、`NRestarts=0`。
|
|
|
|
|
|
- 部署后插件目录包含 `core/temporal_context.py`,metadata 版本为 `1.6.2-ops.2`。
|
|
|
|
|
|
- AstrBot 启动日志确认:`astrbot_plugin_memory_companion_ops (1.6.2-ops.2)` 已加载。
|
|
|
|
|
|
- 启动日志确认数据目录仍为 `/var/lib/astrbot/data/plugin_data/astrbot_plugin_memory_companion_ops`。
|
|
|
|
|
|
- Archivist 启动日志确认:`source=memory_companion version=1.6.2-ops.2 available=True search=True`。
|
|
|
|
|
|
- VM 定向测试:`20 passed, 1 warning`;唯一警告是 AstrBot `register_star` 弃用提示,不影响本次功能。
|
2026-07-24 23:15:34 +08:00
|
|
|
|
- VM 完整回归:使用 `PYTHONPATH=/var/lib/astrbot/data/plugins/astrbot_plugin_private_companion_ops:.:core` 匹配双插件测试导入合同,结果 `155 passed, 1 warning`。未设置该路径时的 2 个迁移测试失败是既有导入路径问题,不是本次改造回归。
|
2026-07-24 23:12:02 +08:00
|
|
|
|
- 部署后服务:`active`;`NRestarts=0`。
|
|
|
|
|
|
|
|
|
|
|
|
## 4. Q4 场景结论
|
|
|
|
|
|
|
|
|
|
|
|
- 隔夜天气:动态结果带 `age_label=overnight`、`relative_label=昨晚`、`age_display=约 11 小时`、`crossed_date=true`;天气 TTL 超时后标记 stale。
|
|
|
|
|
|
- 长时间未回复:`bridge_get_reply_delay()` 返回 `delay_label=overnight`;私聊开放话题可建议承认延迟,群聊默认不建议输出私密等待情绪。
|
|
|
|
|
|
- 运维状态:时间感知层只标记旧事实的新鲜度,不把记忆当作当前 Controller 状态。
|
|
|
|
|
|
- 长期创作/偏好:保留历史背景,不因年龄自动标记为实时失效。
|
|
|
|
|
|
|
|
|
|
|
|
## 5. 回滚
|
|
|
|
|
|
|
|
|
|
|
|
1. 停止 `astrbot.service`。
|
|
|
|
|
|
2. 将 `/var/lib/astrbot/ops-replace-backups/20260724-2300-q4-8d21776/plugin-before` 恢复为活动插件目录。
|
|
|
|
|
|
3. 保持 `plugin_data/astrbot_plugin_memory_companion_ops` 不变;如需回退数据库,使用同一备份下的 `data-before`,先做 SQLite 一致性检查。
|
|
|
|
|
|
4. 启动服务并复核 `active`、`NRestarts`、插件版本和 Archivist source。
|
|
|
|
|
|
|
|
|
|
|
|
## 6. 来源
|
|
|
|
|
|
|
|
|
|
|
|
- 本地源码与测试:`astrbot_plugin_memory_companion-main/`,提交 `8d21776`。
|
|
|
|
|
|
- Q4 要求:`Q4_记忆插件时间感知改造要求.md`。
|
|
|
|
|
|
- 平台说明:`astrbot_plugin_memory_companion-main/docs/时间感知兼容说明.md`。
|
|
|
|
|
|
- VM 实证:SSH 服务状态、插件启动日志、Archivist 日志和 VM runtime pytest 输出。
|
2026-07-25 01:41:32 +08:00
|
|
|
|
- 不可用/未执行:未通过真实 QQ/Telegram 用户消息触发人工对话;本次以 Bridge 合同、VM runtime 定向测试和启动加载证据完成插件级验收。
|
|
|
|
|
|
|
|
|
|
|
|
## Deployment writeback - bcd9d9a (2026-07-24)
|
|
|
|
|
|
|
|
|
|
|
|
- Forgejo push: `origin/ops-main` advanced to `bcd9d9a` (`feat: add calendar-aware ops memory history`).
|
|
|
|
|
|
- Package: local and VM `/tmp/memory-bcd9d9a.tar.gz` SHA-256 `014fd492b68c47e67d5f3616fd33f5948011c0c188e56d297e942c8e4f4e9bb4`.
|
|
|
|
|
|
- Deployment target: `agent@192.168.31.215`, active plugin `/var/lib/astrbot/data/plugins/astrbot_plugin_memory_companion_ops`.
|
|
|
|
|
|
- Backup: `/var/lib/astrbot/ops-replace-backups/20260724-2350-bcd9d9a/plugin-before`.
|
|
|
|
|
|
- Data preservation: `/var/lib/astrbot/data/plugin_data/astrbot_plugin_memory_companion_ops` retained; database, WAL and SHM were not removed.
|
|
|
|
|
|
- Runtime result: `astrbot.service active`, `NRestarts=0`, plugin version `1.6.2-ops.2`, Memory Archivist reported `available=True search=True`.
|
|
|
|
|
|
- VM validation: `tests.test_calendar_bridge` and `tests.test_temporal_context` ran `5 tests` and passed.
|
|
|
|
|
|
- Rollback: restore the backup plugin directory above while keeping the independent data directory unchanged, then restart `astrbot.service`.
|