Skip to content

chore: restore root .gitignore - #167

Merged
Thy985 merged 1 commit into
mainfrom
chore/restore-root-gitignore
Aug 25, 2026
Merged

chore: restore root .gitignore#167
Thy985 merged 1 commit into
mainfrom
chore/restore-root-gitignore

Conversation

@Thy985

@Thy985 Thy985 commented Aug 25, 2026

Copy link
Copy Markdown
Owner

chore: restore root .gitignore

关联文档

改动说明

What:从 0 起草根 .gitignore(HEAD 即为空文件 blob e69de29,自始至终没有 ignore 规则)。

Why

  • 当前 git status 显示 60 modified + 24 untracked 顶层条目 / 1122 个 untracked 文件
  • 其中绝大多数(1075/1122 = 96%)是运行时/构建产物(.adi/ .ffx/ openwiki/ flutter_app/build/ flutter_app/.dart_tool/ 等),应被 ignore 而非 untracked 漂浮
  • .gitignore 为空违反 AGENTS.md §6.2.1-2(禁止 build/ / .dart_tool/ 入库)等约束

7 类规则(每条理由见 commit message)

  1. Flutter / Dart 构建产物(12 条)
  2. Android / iOS generated(4 条)
  3. Python 工具链(3 条)
  4. Agent / runtime artifacts(9 条)
  5. Local / generated logs(3 条)
  6. Flutter test artifacts(1 条:flutter_app/test/golden/failures/
  7. 显式 NOT ignore 的项目资产(6 个目录 + 1 个文件 .claude/settings.json

验证

  • git check-ignore -v 对 24 个正向路径(flutter_app/build/ flutter_app/.dart_tool/ flutter_app/test/golden/failures/ tools/ffx-cli/.pytest_cache/ openwiki/ .adi/ .ffx/ 等)全部命中
  • git check-ignore -v 对 16 个项目资产路径(.githooks/ design-system/ formulafix-redesign.design/ contracts/ tests/ skills/ AGENTS.md flutter_app/lib/main.dart .claude/settings.json 等)全部 NOT 命中(无误伤)
  • git ls-files --others --exclude-standard 计数 1122 → 6
  • git fsck --no-dangling 零输出
  • 工作区隔离验证:commit 只含 .gitignore(1 file / 52 insertions),60 modified + 6 untracked 仍漂浮(待 PR-2)

不影响公共 API

  • 不改任何 Dart 代码
  • 不改 flutter_app/.gitignore flutter_app/android/.gitignore flutter_app/ios/.gitignore
  • 不改 docs/ AGENTS.md 等架构决策文件
  • 不动分支(PR-4 独立治理)

测试方式

  1. cd flutter_app && bash tool/preflight.sh(必跑)
  2. git check-ignore -v flutter_app/build/ .adi/ openwiki/ flutter_app/test/golden/failures/ .agent/state/CONTRACT.md 应全部命中
  3. git check-ignore -v .githooks/ .claude/settings.json 应 NOT 命中
  4. git ls-files --others --exclude-standard | wc -l 应 = 6

不在本 PR 处理(待 PR-2)

  • flutter_app/pubspec.lock:根级规则被子 .gitignore 屏蔽(git 标准行为),需在 flutter_app/.gitignore 加规则
  • tools/adi/pubspec.lock:库项目是否 commit 需评估
  • .claude/settings.json(项目级 hooks 配置):建议 git add 进跟踪
  • .github/workflows/openwiki-update.yml(CI workflow):建议 git add 进跟踪
  • CLAUDE.md(根目录 untracked):决定去留
  • docs/REPO_AUDIT_2026-08-25.md(调研报告):决定是否 commit 到 docs/

自检清单(AGENTS.md §5.3)

  • 改动范围与 PR 描述一致(仅 .gitignore 1 文件)
  • 没有夹带未在 PR 描述中说明的改动
  • 文档已同步(调研报告 v4 已包含本 PR 策略)
  • AGENTS.md / .agent/ 架构决策类文件未改
  • flutter analyze --no-fatal-infos --fatal-warnings 通过(沙箱 SSH 限制,需沙箱外 Human 跑)
  • flutter test 通过(同上)

Task scope

ROADMAP repo-governance / PR-1

本仓库根 .gitignore HEAD 即为空 (blob e69de29), 自始至终没有 ignore 规则, 导致 1122 个 untracked 临时产物未拦截. 本次从 0 起草完整 .gitignore, 按 7 类收敛:

1. Flutter / Dart 构建产物 (**/build/, **/.dart_tool/ 等 12 条) - Flutter 官方模板
2. Android / iOS generated (**/.gradle/, **/Pods/ 等 4 条) - AGP / CocoaPods 标准
3. Python 工具链 (**/.pytest_cache/, **/__pycache__/, **/*.pyc) - ffx-cli 等
4. Agent / runtime artifacts (.agent/state/, .adi/, .ffx/, .workbuddy/, .wt/, .arts/, .codeartsdoer/, debug/, openwiki/) - REPO_POLICY.md §1 显式
5. Local / generated logs (**/*.local.log, **/logs/, .claude/hooks.log) - 避免 *.log 过宽
6. Flutter test artifacts (flutter_app/test/golden/failures/) - Phase 3.11 E6/E8 防再生
7. 已 tracked 项目资产 (.githooks/, design-system/, formulafix-redesign.design/, contracts/, tests/, skills/, .claude/settings.json) - 显式 NOT ignore

验证:
- git check-ignore 24 个正向路径全部命中
- git check-ignore 16 个项目资产路径全部 NOT 命中 (无误伤)
- untracked 数 1122 → 6 (剩余: .claude/settings.json / .github/workflows/openwiki-update.yml / CLAUDE.md / docs/REPO_AUDIT_2026-08-25.md / flutter_app/pubspec.lock / tools/adi/pubspec.lock — 全部待 PR-2 判定)

未在本 PR 处理:
- flutter_app/pubspec.lock - 子目录 .gitignore 屏蔽根级规则, 留给 PR-2 改 flutter_app/.gitignore
- tools/adi/pubspec.lock - 库项目是否 commit 待 PR-2 评估

Task scope: ROADMAP repo-governance / PR-1
Refs: docs/REPO_AUDIT_2026-08-25.md (v4 调研报告)
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Claude encountered an error after 3m 15s —— View job


I'll analyze this and get back to you.

@Thy985
Thy985 merged commit 8b1c4b0 into main Aug 25, 2026
8 of 9 checks passed
@Thy985
Thy985 deleted the chore/restore-root-gitignore branch August 25, 2026 12:44
Thy985 added a commit that referenced this pull request Aug 25, 2026
)

本会话初期工作区有 60 个 tracked modified PNG (flutter_app/test/golden/failures/), 来源是 Phase 3.11 E6/E8 真实机收口验证的副产物. Human Owner 在沙箱外确认 golden test 当前 PASS, 60 PNG 全部为 stale workspace artifacts.

清理操作 (4 步法) 实际执行情况:
1. 步骤 1 ignore (PR-1 #167): .gitignore 加 flutter_app/test/golden/failures/ 规则 OK
2. 步骤 2 验证 (沙箱外): Human 跑 flutter test --tags golden 确认 PASS OK
3. 步骤 3 恢复: 由沙箱外 merge commit 92e4c45 (origin/main 含 PR #167/168) 隐式完成
4. 步骤 4 防再生: PR-1 ignore 规则已在 .gitignore 行 51 OK

本 PR 0 代码变更, 0 文件删除. 唯一改动: 添加 docs/PR-3_DESCRIPTION.md 作为审计记录, 方便回溯 60 PNG 怎么消失的, 避免后续维护者误以为是神秘自动清理.

Task scope: ROADMAP repo-governance / PR-3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant