zizi 9e6f1c4481 R2 改造交付:新版模块化单体全量成果
- src/muse 新版全模块(装配/共享/上下文/任务运行/作品规划/故事世界/正文写作/审校修订/知识方法/作者经验/效果评测/交付连载/资料研究/正式变更/元数据/接入/基础设施/编排)+ 测试树(单元/契约/集成/架构/迁移/端到端/夹具)
- 129 项功能全部实现与自动验证(功能覆盖.json/矩阵),含 W31 补齐的规则与代价/节奏安排/伏笔与承诺
- 旧实现按处置清单退出(702 条中 324 删,保护合同与未迁移条目留存有据);web/app.py 旧工作台退役,新工作台为唯一写入口
- 数据库/旧库迁移:真实旧库内容批次迁移链(端点守卫/PG作品正文映射/质量资产缺省投影)
- 运行手册 docs/运行手册.md;W30 本机服务阶段一已运行(infra PG 为正式内容权威)
- R2 执行证据与私有运行材料在 .agents.local/改造/R2-20260909/(不入库)
2026-09-15 12:47:42 +08:00

33 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# 只启动已安装的明确镜像和配置;迁移是独立维护命令。
set -eu
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
echo "用法:启动.sh <发布目录> <部署环境文件> [明确的覆盖配置]" >&2
exit 2
fi
release_dir=$(cd "$1" && pwd)
environment_file=$(cd "$(dirname "$2")" && pwd)/$(basename "$2")
override_file=${3:-}
compose() {
if [ -n "$override_file" ]; then
set -- -f "$override_file" "$@"
fi
docker compose --project-directory "$release_dir" --env-file "$environment_file" \
-f "$release_dir/compose.yaml" "$@"
}
# 先核镜像身份和包内构建身份,再开放服务端口;核对进程不启动HTTP、不读数据库。
compose config --format json | python3 -c '
import json,re,sys
image=json.load(sys.stdin)["services"]["web"]["image"]
if not re.fullmatch(r"(?:sha256:|[^\s]+@sha256:)[0-9a-f]{64}",image):
raise SystemExit("需要镜像摘要或完整本地镜像ID,不能用可变标签启动")
'
expected_build=$(python3 -c 'import json,sys; r=json.load(open(sys.argv[1]));print(r["build_id"],r["release_id"])' "$release_dir/发布清单.json")
actual_build=$(compose run --rm --no-deps --entrypoint /opt/muse/bin/python web -I -c \
'import json;from muse.资源加载 import 核对资源;print(核对资源()["构建身份"],json.load(open("/opt/muse-release.json"))["release_id"])')
if [ "$actual_build" != "$expected_build" ]; then
echo "镜像与本发布目录的构建身份不一致,拒绝启动" >&2
exit 1
fi
compose up -d --wait --wait-timeout 90