- .gitignore: 追加 .playwright-mcp/ 与 apps/miniprogram/.font_patch_tmp/ 两条忽略规则 - apps/miniprogram/scripts/: 新建目录, 迁入 TDesign BOM 修复脚本 inspect-wechat-font.ps1 及其检查报告 - 根目录 excel_analysis_report.txt / sheet_structure.txt 归位 tmp/, 修正 root-file 风险标签 - 审计记录 2026-04-20__legacy-untracked-cleanup-review.md, 含实际执行段与回滚路径 - audit_dashboard.md 由 gen_audit_dashboard.py 刷新至 130 条 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
197 lines
9.4 KiB
Markdown
197 lines
9.4 KiB
Markdown
# 变更审计记录:2026-04-20 工作区遗留未跟踪文件清理前评审
|
||
|
||
| 字段 | 值 |
|
||
|------|-----|
|
||
| 日期 | 2026-04-20 06:41:48 |
|
||
| 分类 | 现状记录与处理建议(不实施移动/删除) |
|
||
| 触发背景 | 新会话开启时 `/audit` 预扫描发现 6 个未跟踪文件,均非本次会话产物 |
|
||
| 覆盖文件数 | 6(均为未跟踪) |
|
||
| 高风险文件数 | 0 |
|
||
| 新迁移 SQL | 0 |
|
||
| 代码→文档缺失 | 0 |
|
||
|
||
## 操作摘要
|
||
|
||
本次审计为"现状评审",不产生任何代码/数据/文件移动变更。工作区中存在 6 个未跟踪文件/目录,经主会话已读内容与文件时间戳比对,均为前几轮会话(2026-04-11 ~ 2026-04-13)遗留的探索性/临时产物:
|
||
|
||
- 2 个为 Playwright MCP / 字体补丁流程的工具产物目录(`.playwright-mcp/` / `apps/miniprogram/.font_patch_tmp/`)
|
||
- 2 个为小程序 TDesign 字体 BOM 修复相关的 PowerShell 脚本与检查报告(`apps/miniprogram/inspect-wechat-font.ps1` / `apps/miniprogram/inspect_wechat_font_report.txt`)
|
||
- 2 个为根目录下 Excel 结构分析中间产物(`excel_analysis_report.txt` / `sheet_structure.txt`),与 `tmp/2025年1-6月.xlsx` 等飞球后台导出配套
|
||
|
||
由于跨会话累积,主会话无其产生时的语义上下文,本次仅做"现状记录 + 处理建议",不做 `.gitignore` 调整、不做文件移动、不做删除。实际清理动作由用户后续决定后单独执行并写入新的审计记录。
|
||
|
||
## 预扫描快照
|
||
|
||
```json
|
||
{
|
||
"scanned_at": "2026-04-20 06:40:49",
|
||
"total_files": 6,
|
||
"all_files": [
|
||
".playwright-mcp/",
|
||
"apps/miniprogram/.font_patch_tmp/",
|
||
"apps/miniprogram/inspect-wechat-font.ps1",
|
||
"apps/miniprogram/inspect_wechat_font_report.txt",
|
||
"excel_analysis_report.txt",
|
||
"sheet_structure.txt"
|
||
],
|
||
"high_risk_files": [],
|
||
"risk_tags": ["root-file"],
|
||
"new_migration_sql": [],
|
||
"code_without_docs": [],
|
||
"audit_required": true
|
||
}
|
||
```
|
||
|
||
## 变更文件(现状记录,未变更)
|
||
|
||
### 1. `.playwright-mcp/`(目录,2026-04-11 ~ 04-12 产物)
|
||
|
||
- **内容**:19 个 `console-*.log`(每个 143~980 字节)+ 4 个 `page-*.yml`(每个约 922 KB ~ 931 KB,合计约 3.6 MB)
|
||
- **用途**:Playwright MCP 工具自动产物——浏览器 console 日志与页面快照
|
||
- **建议**:加入 `.gitignore`;目录内容可选择性归档或清理,不应入仓
|
||
- **风险**:无
|
||
|
||
### 2. `apps/miniprogram/.font_patch_tmp/`(目录,2026-04-13 产物)
|
||
|
||
- **内容**:1 个 `t.ttf`(505 KB)
|
||
- **用途**:小程序字体补丁流程的临时产物,与 `inspect-wechat-font.ps1` 流程相关联
|
||
- **建议**:加入 `.gitignore`;ttf 二进制不应入仓
|
||
- **风险**:无
|
||
|
||
### 3. `apps/miniprogram/inspect-wechat-font.ps1`(32 行 PowerShell)
|
||
|
||
- **内容**:函数 `Write-NoBomFile`,用 `TrimStart([char]0xFEFF, [char]0x200B, [char]0x0000)` 清除 BOM 与零宽字符,强制以 UTF-8 无 BOM 重写指定文件;明确处理两个路径:
|
||
- `.\miniprogram\miniprogram_npm\tdesign-miniprogram\icon\icon.wxss`
|
||
- `.\node_modules\tdesign-miniprogram\miniprogram_dist\icon\icon.wxss`
|
||
- **用途**:修复 TDesign 小程序图标库 wxss 文件的 BOM 问题(微信小程序对 BOM 敏感)
|
||
- **建议**:若后续仍需使用,移入 `apps/miniprogram/scripts/` 并补 README(说明触发时机、使用方式);若已不再使用,归档到 `_DEL/apps/miniprogram/`
|
||
- **风险**:无
|
||
|
||
### 4. `apps/miniprogram/inspect_wechat_font_report.txt`
|
||
|
||
- **用途**:上述 ps1 脚本生成的字体检查报告(一次性探测产物)
|
||
- **建议**:随 ps1 决定去留;单独作为报告价值低,优先归档
|
||
- **风险**:无
|
||
|
||
### 5. `excel_analysis_report.txt`(根目录,300 行)
|
||
|
||
- **内容**:`tmp/2025年1-6月.xlsx` 的 Excel 结构分析报告,11 个 Sheet(订单表/台费表/商品表/用户表/会员卡/使用记录表/充值记录表/优惠券使用记录表/助教超休/助教服务/流水构成),列出每个 Sheet 的列名、行数、样本数据,以及消费/充值/助教相关字段汇总
|
||
- **关联**:git status 显示 `tmp/2025年1-6月.xlsx` 等飞球后台导出 xlsx 在仓库中
|
||
- **违规点**:按 CLAUDE.md 文件归属规则,分析产物不应放根目录
|
||
- **建议**:移入 `tmp/`(仓库约定的临时分析目录)
|
||
- **风险**:低(仅路径违规,无业务逻辑影响)
|
||
|
||
### 6. `sheet_structure.txt`(根目录,343 行)
|
||
|
||
- **内容**:同一 xlsx 的结构分析,英文标题开头(`EXCEL FILE STRUCTURE ANALYSIS`),内容与 `excel_analysis_report.txt` 高度重叠,仅样本行数略多(每 Sheet 3 行 vs 2 行)
|
||
- **违规点**:同上,根目录违规
|
||
- **建议**:移入 `tmp/`;与 `excel_analysis_report.txt` 疑似重复产物,可合并或去重
|
||
- **风险**:低
|
||
|
||
## 数据库变更
|
||
|
||
无。
|
||
|
||
## 风险与回滚
|
||
|
||
- **整体风险**:零。本次审计不移动、不删除、不修改任何文件
|
||
- **预扫描风险标签**:仅 `root-file` 一项,由 `excel_analysis_report.txt` + `sheet_structure.txt` 的根目录位置触发
|
||
- **回滚策略**:不适用(无任何实际变更)
|
||
|
||
## 验证
|
||
|
||
- 无代码变更,无需跑测试
|
||
- 无 SQL 变更,无需 SQL 校验
|
||
- 主会话已读取预扫描 JSON、ps1 脚本内容、两个目录内容清单、两个 txt 报告的结构性信息,现状描述可溯源
|
||
|
||
## 合规检查
|
||
|
||
| 项 | 状态 |
|
||
|---|---|
|
||
| 高风险文件识别 | 零项高风险 |
|
||
| 迁移 SQL 回滚脚本 | 不适用(无 SQL 变更) |
|
||
| DDL 基线同步 | 不适用(无数据库变更) |
|
||
| 代码→文档映射 | 不适用(无代码变更,预扫描 `code_without_docs: []`) |
|
||
| `docs/database/` 同步 | 不适用(无 schema 变更) |
|
||
| CLAUDE.md 文件归属规则 | 指出 2 个根目录违规(待用户决策后修正) |
|
||
|
||
## 下一步建议
|
||
|
||
用户根据本记录择一决策后再执行实际清理(每个决策单独再写一份审计记录):
|
||
|
||
1. **立即清理**:一次性提交 `.gitignore` 补丁(忽略 `.playwright-mcp/` 与 `.font_patch_tmp/`),把两份根目录 txt 移入 `tmp/`,把 ps1 与 report 移入 `apps/miniprogram/scripts/` 或 `_DEL/apps/miniprogram/`
|
||
2. **分批清理**:先加 `.gitignore` 防止继续积累,再逐个决定剩余 4 项去留
|
||
3. **暂不处理**:维持现状,等下一次相关功能改动时顺带清理
|
||
|
||
无论选择哪条,实际动作发生时会由新的 `/audit` 审计覆盖。
|
||
|
||
---
|
||
|
||
## 实际执行记录(2026-04-20 追加)
|
||
|
||
用户确认方案 1「立即清理」,本节记录同日实际执行的动作、验证结果与回滚路径。本节为原记录的执行段,不另开审计文件。
|
||
|
||
### 执行步骤
|
||
|
||
#### 步骤 1 — `.gitignore` 补丁
|
||
|
||
在「临时与缓存」节的 `*.jsonl` 之后追加两条:
|
||
|
||
```gitignore
|
||
# Playwright MCP 浏览器日志与页面快照
|
||
.playwright-mcp/
|
||
|
||
# 小程序字体补丁临时目录
|
||
apps/miniprogram/.font_patch_tmp/
|
||
```
|
||
|
||
#### 步骤 2 — 文件归位
|
||
|
||
| 来源路径 | 目标路径 | 动作 |
|
||
| --- | --- | --- |
|
||
| `apps/miniprogram/inspect-wechat-font.ps1` | `apps/miniprogram/scripts/inspect-wechat-font.ps1` | 新建 `apps/miniprogram/scripts/` 目录后 `mv` |
|
||
| `apps/miniprogram/inspect_wechat_font_report.txt` | `apps/miniprogram/scripts/inspect_wechat_font_report.txt` | 同上目录,与 ps1 绑定 |
|
||
| `excel_analysis_report.txt`(根目录) | `tmp/excel_analysis_report.txt` | `mv` |
|
||
| `sheet_structure.txt`(根目录) | `tmp/sheet_structure.txt` | `mv` |
|
||
|
||
`.playwright-mcp/` 与 `apps/miniprogram/.font_patch_tmp/` 本身保留不动,由新 `.gitignore` 规则从 git 视野中隐藏,内容由用户后续按需清理。
|
||
|
||
### 最终 diff 摘要
|
||
|
||
- 修改:`.gitignore`(+7 行,两段忽略规则)
|
||
- 修改:`docs/audit/audit_dashboard.md`(由 `gen_audit_dashboard.py` 刷新,130 条记录)
|
||
- 新建:`apps/miniprogram/scripts/inspect-wechat-font.ps1`、`apps/miniprogram/scripts/inspect_wechat_font_report.txt`
|
||
- 新建:`tmp/excel_analysis_report.txt`、`tmp/sheet_structure.txt`
|
||
- 删除(对应位置清空):`apps/miniprogram/inspect-wechat-font.ps1`、`apps/miniprogram/inspect_wechat_font_report.txt`、`excel_analysis_report.txt`、`sheet_structure.txt`
|
||
|
||
### 执行后验证
|
||
|
||
执行 `git status --short` 确认:
|
||
|
||
- `.playwright-mcp/` 和 `apps/miniprogram/.font_patch_tmp/` 不再出现在未跟踪列表中(`.gitignore` 生效)
|
||
- 根目录不再存在 `excel_analysis_report.txt` / `sheet_structure.txt`,已出现在 `tmp/` 下
|
||
- `apps/miniprogram/scripts/` 作为新未跟踪目录出现,含 ps1 与 report 两个文件
|
||
- 预扫描触发的 `root-file` 风险标签源头已消除
|
||
|
||
### 回滚路径
|
||
|
||
如需撤销:
|
||
|
||
```bash
|
||
# 撤回 gitignore 追加
|
||
git checkout .gitignore
|
||
|
||
# 还原 4 个文件的位置
|
||
mv apps/miniprogram/scripts/inspect-wechat-font.ps1 apps/miniprogram/
|
||
mv apps/miniprogram/scripts/inspect_wechat_font_report.txt apps/miniprogram/
|
||
rmdir apps/miniprogram/scripts
|
||
mv tmp/excel_analysis_report.txt ./
|
||
mv tmp/sheet_structure.txt ./
|
||
```
|
||
|
||
### 未覆盖风险
|
||
|
||
- `apps/miniprogram/scripts/` 是新建目录,尚未补 README。如日后要把 ps1 纳入常规流程,需补说明文档(触发时机 / 执行步骤 / 预期结果),但当前只作归档不强制补
|
||
- `tmp/` 下 Excel 分析产物与已存在的 `revenue_report*` 等历史产物混放,未做二次整理;本次不清理 `tmp/` 历史沉积,保持用户既定清理节奏
|
||
- `.playwright-mcp/` 与 `.font_patch_tmp/` 的目录内容未清空,仅从 git 视野隐藏;磁盘占用约 3.6 MB + 505 KB,需要时用户手动删除
|