From 2088c1c65f4f806522cc6f59ee6c82fe5519d101 Mon Sep 17 00:00:00 2001 From: Tory Date: Sun, 15 Nov 2026 07:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=81=E5=BE=8B=E5=AD=98=E6=A1=A3:=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=AB=AF=E5=8F=A3=E5=9B=BA=E5=AE=9A=3D5173(2026-11-15?= =?UTF-8?q?=20=E7=94=A8=E6=88=B7=E8=A3=81=E5=AE=9A)=E2=80=94=E2=80=94activ?= =?UTF-8?q?eContext=20=E9=93=81=E5=BE=8B=E6=9D=A1+techContext=20=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E6=AE=B5(=E9=A1=BA=E5=B8=A6=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E5=8E=86=E5=8F=B2=208081=E2=86=92=E7=8E=B0?= =?UTF-8?q?=E8=A1=8C=208080=20=E5=8F=A3=E5=BE=84)+Makefile=20web-dev=20?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E5=90=8C=E6=AD=A5;=E5=BA=9F=E6=AD=A2?= =?UTF-8?q?=E8=BF=87=E6=97=B6=E5=9D=91=E6=9D=A1=E7=9B=AE(.env.development.?= =?UTF-8?q?local=20=E9=92=89=20real,Mock=20=E5=B7=B2=E4=B8=8B=E7=BA=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- memory-bank/activeContext.md | 3 ++- memory-bank/techContext.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 61b9bab0..4de169e1 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ docker-build: ## 构建服务镜像(默认 gateway,可 SERVICE=business 等) # ---- Web 端线上测试(Day 36 增补;Mock 模式零依赖,无需后端/中间件) ---- WEB_PORT ?= 5173 -web-dev: ## 启动 Web 开发服务(单一 real 模式,S3·FE-6 Mock 已下线;WEB_PORT=5173 可覆盖) +web-dev: ## 启动 Web 开发服务(单一 real 模式;【铁律】测试端口固定=5173,WEB_PORT 勿覆盖) @mkdir -p logs @if ss -tln 2>/dev/null | grep -q ":$(WEB_PORT) "; then \ echo ">> 端口 $(WEB_PORT) 已被占用(可能已在运行): make web-log 查看 / make web-stop 停止"; exit 1; fi diff --git a/memory-bank/activeContext.md b/memory-bank/activeContext.md index 1eccaa9b..39b0a564 100644 --- a/memory-bank/activeContext.md +++ b/memory-bank/activeContext.md @@ -9,6 +9,7 @@ - **24h 稳定性门槛 ✅ 终判通过**(S5 压测前置确认)。 - **六项裁决速查(S2 全闭环)**:R1/R6 换算只在 price.go / R2 事实源 D2 落账 / R3 双通道 D3 落地(ref_id 区分)/ R4 rebate_rate D5 落地(profit.go 现算不落档)/ R5 settle_ladder D4 落地。 - 归档仓(只读):/data/poc-archive/repos/go-sms.git。 +- **【铁律】测试端口固定=5173**:Web 测试/联调/走查/对外验收口径**一律** `http://<服务器IP>:5173`(vite dev,`make web-dev`);**禁止**用 WEB_PORT 覆盖到其他端口、禁止 preview(4173 等)/临时容器端口(30099 等)作为验收与走查入口——一次性探测端口仅限本机调试且不入文档口径(2026-11-15 用户裁定)。 - **本会话教训**:①明细雪花 ID 直插 SQL 须 < int64 上限 9.22e18(9302… 段拒收,走查种子统一 7302… 段);②`sg docker -c '…$VAR…'` 单引号内变量不展开(内层空展开致 SQL 语法错)——多语句 SQL 用 `printf|docker exec -i` 外层展开;③网关重启须含最新端点二进制(串行 build→kill→md5);④**本机 chromium(含 headless shell)newPage 即 Target crashed**(disable-gpu/no-sandbox/GLIBC 关 AVX 均不救,dmesg 无痕)——Playwright 截图/e2e/LCP 实测本机不可用,S5 真浏览器指标前先解此环境项;⑤vite preview 只监听 IPv6 [::1](curl 127.0.0.1 不通,用 localhost);⑥组件测试 mount 须 `plugins:[ElementPlus]`(stubs 方式 el-table-column slot scope 会 undefined);⑦`web/.env.development.local` 已随 Mock 下线删除,再出现 VITE_API_MODE 文件即残留可径删。 - **历史运维教训**:①`pkill/pgrep -f` 自匹配(铁律:`[x]` 括号技巧);②大镜像单窗>体积÷带宽;③du 无 sudo 静默失败误诊;④sed 换行/sed 误伤方法名(重构期优先编辑器工具);⑤Go 工具忽略 `_` 前缀文件;⑥集成测试需 `sg docker` 包裹(docker 组未重登);⑦**Makefile recipe 的 `exit 0` 只退出当前行 shell 不终止目标**(幂等短路须 if/else 递归 `$(MAKE)` 子目标);⑧**管道 `| tail -N` 截首行误导诊断**(gw-start"玄学 NOMATCH"两轮误诊实为 THEN 分支已生效,排查须看全量输出)。 @@ -47,7 +48,7 @@ ## 常踩的坑(防复发) -1. `.env.development.local`(gitignore)会把 vite 钉在 real 模式——切 mock 前必查。 +1. ~~`.env.development.local` 会把 vite 钉在 real——切 mock 前必查~~(S3 Mock 已下线,条目废止留痕;该文件已删,再出现 VITE_API_MODE 相关文件即残留径删)。 2. build 与 kill 并行=旧 inode 进程(Day 70);部署必须串行+md5 比对。 3. 持久化-还原键字段必须成对审计(Day 71 ref 字段漏存教训)。 4. 迁移版本号字典序坑(v10