Files
Nexus/docs/changelog/2026-06-04-encoding-ubuntu-phase1.md
T
2026-07-08 22:31:31 +08:00

1.2 KiB
Raw Blame History

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.pyscripts/normalize_worktree_lf.sh(新)
  • docker/sync_root_env.pytext_io
  • scripts/linux_mcp_mysql.sh — 去 \r
  • web/agent/agent.pyencoding=utf-8
  • docs/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