From 702b16568bc4424325a3ca58e7694c33f29dd806 Mon Sep 17 00:00:00 2001 From: ila <2+ila@noreply.git.ilapage.cn> Date: Thu, 27 Aug 2026 19:02:56 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=E4=B8=89=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=9E=84=E5=BB=BA=E4=B8=8E=E9=AA=8C=E6=94=B6=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=20(#113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Local-Development-and-Verification.-.md | 64 +++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/Local-Development-and-Verification.-.md b/Local-Development-and-Verification.-.md index d57e0bc..3c2fea3 100644 --- a/Local-Development-and-Verification.-.md +++ b/Local-Development-and-Verification.-.md @@ -9,7 +9,7 @@ | Gitea | 工单与 Wiki | 浏览仓库或调用 MCP | | Gitea PAT | Wiki 写入 | 仅由 MCP 或 `GITEA_TOKEN` 提供,不打印 | -Sense/Bell 的 Go、Node 与 pnpm 基线已冻结并记录于下文;Brain 的 Python/CUDA 以及 PostgreSQL、MediaMTX 精确版本仍将在对应骨架工单冻结。旧仓库环境不自动成为新项目事实。 +Sense/Bell 的 Go、Node 与 pnpm 基线已冻结并记录于下文;Brain 的 Python/PyTorch 基线也已由骨架工单固定。PostgreSQL、MediaMTX 的交付版本仍按各产品工单与部署环境冻结,旧仓库环境不自动成为新项目事实。 ## Windows PowerShell 与 UTF-8 @@ -55,9 +55,9 @@ Sense/Bell 的 Go、Node 与 pnpm 基线已冻结并记录于下文;Brain 的 | 项目 | 构建 | 测试 | 运行 | 当前状态 | |---|---|---|---|---| -| Sense | `cd Sense/server; go build ./...`、`cd Sense/ui; corepack pnpm@9.15.1 build:prod` | `go test ./...`、`go vet ./...`、前端 lint/单测 | `sense server -c <仓库外配置>` | GoAdmin 源码骨架已建立;业务模块待后续工单 | -| Brain | 待骨架工单冻结 | 待冻结 | 待冻结 | 未初始化业务代码 | -| Bell | 待 GoAdmin 派生工单建立 | 待建立 | 待建立 | 旧实现仅在 `explore`;新基线未初始化 | +| Sense | `cd Sense/server; go build ./...`、`cd Sense/ui; corepack pnpm@9.15.1 build:prod` | `go test ./...`、`go vet ./...`、前端 lint/单测、独立 E2E | `sense server -c <仓库外配置>` | GoAdmin 产品骨架与独立纵切已建立,待用户验收 | +| Brain | `Brain\\.venv\\Scripts\\python.exe -m pip install -e "Brain[dev]"` | `python -m pytest Brain/tests/test_package.py -q`、CPU/CUDA smoke | `python -m yovision_brain --runtime-info` | Python/PyTorch 骨架已建立;CPU 已验证,CUDA 未验证 | +| Bell | `cd Bell/server; go build ./...`、`cd Bell/ui; corepack pnpm@9.15.1 build:prod` | `go test ./...`、`go vet ./...`、前端 lint/单测 | `go run . server -c config/settings.yml` | 冻结 GoAdmin 产品骨架已建立,待用户验收 | 不得复制旧仓库命令来填空。每个骨架工单必须同时建立 README、可复制命令和最小测试。 @@ -223,12 +223,66 @@ corepack pnpm@9.15.1 build:prod + +## Brain 本地环境与验证 + +Brain 固定使用 CPython 3.11.15、pip 26.2.1、setuptools 80.9.0、pytest 8.4.2、NumPy 2.3.3 和 PyTorch 2.12.1。CPU 与 CUDA wheel 必须使用不同虚拟环境,不能混装: + +```powershell +uv python install 3.11.15 +uv venv --python 3.11.15 Brain/.venv +Brain\.venv\Scripts\python.exe -m pip install pip==26.2.1 --index-url https://pypi.org/simple +Brain\.venv\Scripts\python.exe -m pip install -e "Brain[dev]" --index-url https://pypi.org/simple +Brain\.venv\Scripts\python.exe -m pip install numpy==2.3.3 --index-url https://pypi.org/simple +Brain\.venv\Scripts\python.exe -m pip install torch==2.12.1 --index-url https://download.pytorch.org/whl/cpu + +Brain\.venv\Scripts\python.exe -m pytest Brain/tests/test_package.py -q +Brain\.venv\Scripts\python.exe -m yovision_brain --runtime-info +Brain\.venv\Scripts\python.exe -m yovision_brain --smoke cpu +``` + +NVIDIA 环境将最后一个索引替换为 `https://download.pytorch.org/whl/cu126`,再执行 `--smoke cuda`。本轮只验证了 CPU wheel 与 CPU tensor smoke;不得在未执行真实 CUDA smoke 时声明 GPU 可用。 + + ## Bell 本地构建与验证 -新 Bell 尚未初始化。骨架工单必须从冻结 GoAdmin 源码建立并验证独立构建、数据库、认证和前端流程;旧 Bell 命令只在 `explore` 对应提交中适用。 +Bell 已从冻结 GoAdmin 基线独立派生。运行前只在进程环境提供独立的 `BELL_DATABASE_URL`、至少 32 字符的 `BELL_JWT_SECRET`,以及仅首次迁移使用的 `BELL_BOOTSTRAP_USERNAME` / `BELL_BOOTSTRAP_PASSWORD`;不得提交真实值。 + +```powershell +Set-Location Bell/server +$env:GOTOOLCHAIN='go1.26.5' +go test ./... +go vet ./... +go build ./... +go run . migrate -c config/settings.yml +go run . server -c config/settings.yml + +Set-Location ../../Bell/ui +corepack pnpm@9.15.1 install --frozen-lockfile +corepack pnpm@9.15.1 lint +corepack pnpm@9.15.1 test:unit +corepack pnpm@9.15.1 build:prod +``` + +默认监听为 `127.0.0.1:18090`,可用 `BELL_HOST` / `BELL_PORT` 覆盖。当前已验证隔离 PostgreSQL 17 的迁移、健康检查、登录、未认证拒绝和 RBAC 菜单;浏览器级前后端登录、生产 PostgreSQL 部署与发布打包尚未验证。 + +## Sense 独立端到端验收 + +从仓库根目录执行: + +```powershell +& Sense\tests\compatibility\run-static-regression.ps1 +& Sense\tests\e2e\run-isolated-e2e.ps1 +``` + +详细矩阵见 `Sense/ACCEPTANCE.md`。隔离 E2E 默认需要 PostgreSQL 17 工具目录、已审核的 MediaMTX、FFmpeg 与 Chrome;路径不同时用参数显式指定。所有运行数据、随机凭据、数据库、日志、截图和构建副本位于系统临时目录,只有排错时才使用 `-KeepTemporary`,并须把保留目录当作敏感数据及时清理。 + +PowerShell 7 调用入口时会自动转入 Windows PowerShell 5.1 执行本地 HTTP 回归,源码打包仍显式使用 PowerShell 7。这是当前 Windows 交付宿主边界。现场真机、客户新主机、16 路长稳、硬件解码及 Brain/Bell 跨项目链路不在本验收覆盖内。 + + ## Sense Windows 打包与验证