Ariver
2026-07-07 c4912689af3edeba6e45bc61b3cd7fb150304be5
CODE_GOVERNANCE.md
@@ -15,9 +15,9 @@
- 开始任何代码、文档、发布或迁移任务前,必须先执行并检查:
```bash
git status --short 2>&1 | head -c 6000
git branch --show-current 2>&1 | head -c 2000
git worktree list --porcelain 2>&1 | head -c 6000
git status --short
git branch --show-current
git worktree list --porcelain
```
- 如果工作区已有改动,必须区分改动来源:
@@ -46,9 +46,9 @@
- 提交前必须确认:
```bash
git status --short 2>&1 | head -c 6000
git diff --stat 2>&1 | head -c 6000
git diff --cached --stat 2>&1 | head -c 6000
git status --short
git diff --stat
git diff --cached --stat
```
- 提交信息使用简洁英文或项目已有风格,示例:
@@ -90,9 +90,9 @@
- 任务完成后必须执行:
```bash
git worktree remove WORKTREE_PATH 2>&1 | head -c 6000
git worktree prune 2>&1 | head -c 6000
git worktree list --porcelain 2>&1 | head -c 6000
git worktree remove WORKTREE_PATH
git worktree prune
git worktree list --porcelain
```
- 如果 worktree 有未提交改动,禁止直接删除;必须先确认归属和处理方式。
@@ -109,10 +109,10 @@
接手旧线程、长期任务、发布任务或迁移任务时,必须先完成以下检查,不得等待旧线程:
```bash
git status --short 2>&1 | head -c 6000
git branch --show-current 2>&1 | head -c 2000
git log --oneline --decorate --graph --max-count=12 2>&1 | head -c 6000
git worktree list --porcelain 2>&1 | head -c 6000
git status --short
git branch --show-current
git log --oneline --decorate --graph --max-count=12
git worktree list --porcelain
```
- 必须读取最近会话记录,确认未完成项、已完成项、阻塞项和用户最新指令。
@@ -182,15 +182,15 @@
## 11. 命令输出保护
任何未知或可能很大的命令输出都必须 byte-cap:
任何未知或可能很大的命令输出都必须控制范围。规则、CODEGRAPH、交接材料和标准验证命令必须保留原始可执行形式,不能为了展示输出而追加 `head -c`、`2>&1 | head` 等截断管道。执行时通过工具输出上限控制展示,或把完整输出写入日志文件并保留原始命令退出码。
```bash
COMMAND 2>&1 | head -c 6000
COMMAND
```
- 构建、测试、目录遍历、日志、Git diff、搜索结果都应限制输出。
- 构建、测试、目录遍历、日志、Git diff、搜索结果都应控制展示范围。
- 搜索优先用 `rg` / `rg --files`。
- 不无上限打印大文件、构建日志、目录树或二进制信息。
- 不无上限打印大文件、构建日志、目录树或二进制信息;需要压缩展示时由执行工具限制输出,不把截断管道写进标准命令。
## 12. 禁止事项
@@ -206,22 +206,22 @@
## 13. 常用检查命令
```bash
git status --short 2>&1 | head -c 6000
git branch --show-current 2>&1 | head -c 2000
git log --oneline --decorate --graph --max-count=12 2>&1 | head -c 6000
git worktree list --porcelain 2>&1 | head -c 6000
git diff --stat 2>&1 | head -c 6000
git diff --cached --stat 2>&1 | head -c 6000
git ls-files C1.source 2>&1 | wc -l | head -c 2000
git status --short
git branch --show-current
git log --oneline --decorate --graph --max-count=12
git worktree list --porcelain
git diff --stat
git diff --cached --stat
git ls-files C1.source | wc -l
```
从源码根目录运行 QA:
```bash
cd /Users/ar/Projects/Taglauncher/03-O/C1.source
bash Scripts/apple_default_apps_resource_qa.sh 2>&1 | head -c 12000
bash Scripts/apple_default_note_policy_qa.sh 2>&1 | head -c 12000
bash Scripts/smartstart_catalog_resource_qa.sh 2>&1 | head -c 12000
bash Scripts/quick_search_app_name_qa.sh 2>&1 | head -c 12000
bash Scripts/quick_search_system_app_qa.sh 2>&1 | head -c 12000
bash Scripts/apple_default_apps_resource_qa.sh
bash Scripts/apple_default_note_policy_qa.sh
bash Scripts/smartstart_catalog_resource_qa.sh
bash Scripts/quick_search_app_name_qa.sh
bash Scripts/quick_search_system_app_qa.sh
```