feat(channels): 非消息事件接入(notice 归一化 + 传入前审查,fail-safe 静默)与入站脱敏帧日志/日志轮转
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- notice:adapter 归一化 seam + 结构化分类 + 净化(ANSI/控制/零宽/双向字符、200 runes 截断)
  + fail-safe 写死为「静默」(未装配审查/超时/失败 ⇒ 仅登记、不驱动 loop)
- 身份面零改动:notice 发送者恒 RoleSystem + SenderID=system
- 复用策略四的同一个审查模型(Options.Review),未另造第二套
- 入站帧脱敏 DEBUG(post_type/message_type/sub_type/self_id/user_id/sender_id/group_id/段类型/at 目标)
- ctrl.bat 启动前归档轮转(保留 20 份)+ bash 侧改追加(不再重启即截断)
This commit is contained in:
AskaEth committed 2026-10-05 11:55:05 +08:00
1 parent 85abb90067
commit 5139945bfe
15 files changed
+1604 -21

No files matched your search

+6 -2
View File
@@ -11,7 +11,9 @@
# 说明:
# - 管理单个 cyrene 后端进程(单二进制)。llama-server / PG 若需一并管理,
# 可另用 docker / scripts/dev-up.sh。
# - cyrene 在仓库根下运行(读 .env 的 PORT / DATA_DIR 等),日志写 ~/cy.log。
# - cyrene 在仓库根下运行(读 .env 的 PORT / DATA_DIR 等),日志**追加**写 ~/cy.log
# (重启不清空历史;Windows 侧 scripts\ctrl.bat 因 Start-Process 无法追加,改为
# 按时间戳归档,见该脚本的注释)。
# - 用 setsid + nohup 脱离进程组,避免终端/后台 shell 超时误杀。
set -euo pipefail
@@ -64,8 +66,10 @@ start() {
echo "启动 cyrene → $APP_BIN (端口 $GW_PORT)"
# setsid 只脱离会话,但 cyrene 仍是本 bash 的后台 job;脚本退出时 bash 会等待
# 它结束,导致 restart 命令"挂起超时"。disown 把它从作业表剔除,脚本立即返回。
# 日志**追加**(>>)而不是覆盖(>):重启不再截断上一轮日志——排障证据必须能跨重启
# 留存(「日志重启即清空」曾让一个线上问题无从取证)。
cd "$REPO" || return 1
setsid nohup "$APP_BIN" > "$LOG_FILE" 2>&1 < /dev/null &
setsid nohup "$APP_BIN" >> "$LOG_FILE" 2>&1 < /dev/null &
disown
# 等待健康
local i