1.2 KiB
1.2 KiB
2026-06-04 — Ubuntu 编码/换行审查(阶段 1)
摘要
离线 tar 工作区存在 CRLF(约 171 个跟踪文件),与 Git 索引 LF 不一致;新增工作区门控并修复 sync_root_env、MCP 脚本、Agent 读 os-release。
动机
Windows 开发 + tar 解压到 Ubuntu 后,source *.sh 失败、MCP 读 .env 可能带 \r;需与既有 check_text_eol(索引)互补。
涉及文件
scripts/check_worktree_eol.py、scripts/normalize_worktree_lf.sh(新)docker/sync_root_env.py→text_ioscripts/linux_mcp_mysql.sh— 去\rweb/agent/agent.py—encoding=utf-8docs/audit/2026-06-04-encoding-review-ubuntu-phase1.md
迁移 / 重启
- 无 DB 迁移
- 建议本机执行
bash scripts/normalize_worktree_lf.sh后 Reload MCP
验证
python3 scripts/check_text_eol.py
python3 scripts/check_worktree_eol.py # 归一化前应 FAIL
bash scripts/normalize_worktree_lf.sh
python3 scripts/check_worktree_eol.py # 期望 OK
pytest tests/test_text_io.py -q
阶段 2(同日续)
web/agent/agent.py全量 UTF-8/LF;.cursor/rules纳入 EOL 门控- 审计:
docs/audit/2026-06-04-encoding-review-ubuntu-phase2.md