Files
xc_agent_platform_demo/docs/diff-vs-demo.md
VC_noSugar 0d0f3b611a Phase1 skeleton: replace demo main.py with src.server contract
- Overlay ModelHub XC Phase1 (health/status, STRATEGY_ID gate, dry-run)
- Dockerfile CMD -> python -m src.server; FROM stays platform TCR base
- Remove demo main.py and requirements.txt (stdlib only)
- Add tests/, scripts/, docs/, Makefile, config/examples (no secrets)
2026-10-16 15:47:10 +08:00

41 lines
1.8 KiB
Markdown
Raw Permalink 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.

# 对照官方演示仓 `luopingyi/xc_agent_platform_demo`
- 日期:2026-10-16 Asia/Shanghai
- 官方演示:https://dev.modelhub.org.cn/luopingyi/xc_agent_platform_demo
- 安全探针参照:`huni/huni-probe-agent`(只读)
- **不要照搬**:`huni/huni-adapt-agent` 默认真提交循环
## 对齐项(保留)
| 项 | demo / 规划 | 本仓 |
|----|-------------|------|
| 根目录 Dockerfile | 是 | 是 |
| 默认 base 镜像 | 平台 `python:3.11-slim` | 同(`BASE_IMAGE` 仅 build-arg,默认不改公网) |
| `EXPOSE 8080` | 是 | 是 |
| `GET /health` → 200 `{"status":"ok"}` | 是 | 是 |
| 读 `EXTERNAL_SERVICE_TOKEN` 是否存在 | demo | `/status` 布尔;永不打值 |
| stdlib / 轻依赖 | demo 极简 | Phase1 仅 stdlib |
## 本仓相对 demo 的补强
| 项 | 说明 |
|----|------|
| `STRATEGY_ID` 启动校验 | Phase1:**缺失则 exit ≠0**(产品规划;相对「仅读 token 保活」的社区变体) |
| 双重 live 闸门 | `ALLOW_LIVE_SUBMIT` + `LIVE_CONFIRM=I_CONFIRM_LIVE_SUBMIT` |
| `GET /status` | 仅布尔字段 |
| dry-run 报告 | `scripts/dry_run.py` → `reports/dry-run-*.md` |
| 单测 | health / 缺 STRATEGY_ID / 闸门默认拒绝 / SIGTERM |
| 无默认真提交 | live 仅闸门 + **注入假客户端**单测;仓库无默认真打 `/api/adapt/task/add` 的 HTTP 客户端 |
## 明确不照搬
| 来源 | 行为 | 本仓 |
|------|------|------|
| huni-adapt-agent | 默认真提交循环 | **禁止** |
| CoolBoy / 社区刷分脚本 | 绕队列 / 无闸门 | **禁止** |
| 旧对话口径「缺 STRATEGY_ID 保活 + /health 仍 200」 | 与产品规划 Phase1 冲突 | **以产品规划为准:启动失败** |
## 资源声明
文档按约 **100m–1 CPU / 256–512Mi** 设计;Phase1 不做 k8s manifests。