Skip to content

docs: add TDD workflow to AGENTS.md - #45

Merged
c2j merged 2 commits into
mainfrom
docs/tdd-agents
Aug 29, 2026
Merged

c2j merged 2 commits into
mainfrom
docs/tdd-agents

Conversation

@c2j

@c2j c2j commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Add a test-driven development (Red → Green → Refactor) discipline section to AGENTS.md.

Codifies for coding agents:

  • Never / Ask first / Always rules — never skip, delete, or weaken existing tests; ask before touching human tests / snapshots
  • Red → Green → Refactor loop, with characterization tests for legacy paths
  • Seam-creation priorities for testability
  • Testing layer guidance (unit / integration / doc / CLI / invariants / snapshots)
  • Completion standards + self-check questions

修订说明(round 2):本 PR 初版声称命令「verified against this repo's actual toolchain」,实测并不成立——见下方「Round 2 修订」。命令现已逐条对照本仓库的 Cargo.toml / pom.xml.github/workflows/ 核对。


Round 2 修订

  • 门禁漏了 CI 的 cargo deny checkcargo audit ——而 Security Audit 正是当前红灯之一。已补上。
  • --all-features 会拉进 CI 明确排除的 crate:CI 与 lefthook.yml 都用 --workspace --exclude astgrep-web --exclude astgrep-gui;裸 cargo test 只测 root package。已对齐,并说明 lefthook 的 pre-commit/pre-push 是同一套命令。
  • 注明 main 当前本身为红Build & Test 编译失败 + Security Audit 2 个 vulnerability,main 最近 3 次 run 全 failure):要求先在未改动的 main 上跑基线以区分既有失败。本 PR 的 CI 红灯与本 PR 无关(纯文档改动)。
  • insta 未引入:已移除。rust-toolchain.toml 引用保留——本仓库确实有该文件。

批次层面

  • 补上第 13 个仓库 flux-gauss#106(原批次遗漏)。
  • 12 个 PR 合并后,umbrella 仓库 GaussDB_Heptadecagon 需要一个 submodule 指针 bump PR(目前不存在)。
  • 中期建议:把约 85% 的共性样板抽到 umbrella 的 docs/tdd-policy.md,各仓库只留实测过的命令块 + 一个 drift 检查,避免下次修一行要开 13 个 PR。

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 776d20ca-5ce6-4cb0-abee-1e5663a6a8fa


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- 门禁对齐 lefthook.yml 与 .github/workflows/ci.yml:clippy 与 test 都必须带
  --workspace --exclude astgrep-web --exclude astgrep-gui。原命令用
  --all-features / 裸 cargo test,会把 CI 明确排除的 web/gui 拉进来,
  产生 CI 上不存在的失败
- 补上 CI 有而文档完全漏掉的 cargo deny check 与 cargo audit
- 说明 lefthook 的 pre-commit / pre-push 与该门禁是同一套命令
- 注明 main 当前本身为红(Build & Test 编译失败 + Security Audit 报 2 个
  vulnerability),要求先在未改动的 main 上跑基线以区分既有失败
- 移除未引入的 insta 引用

rust-toolchain.toml 引用保留——本仓库确实有该文件。
@c2j
c2j merged commit da9488a into main Aug 29, 2026
3 of 5 checks passed
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