Skip to content

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

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 修订

  • 门禁的 --workspace 与本文件的子模块策略直接冲突(最严重的一条):子模块里的 crate 是 path 依赖,已被 cargo 拉进本 workspace——cargo metadata 目前解析出 25 个 packagegaussdb / tokio-opengauss / ogexplain-core / ogsql-complexity / metamorphosis-core / metamorphosis-rules 等,仅 lib/codewebexclude)。cargo clippy/test/fmt --workspace 会把门禁打到上游代码上。已改用 CI 的 $OUR_CRATES 显式枚举。
  • insta 定位错误:自有 crates/ 零 insta 依赖,唯一的 insta 快照在 lib/ogexplain-analyzer/ 子模块内——而本文件正禁止改子模块。已改为明确区分。
  • 注明 CI 的 cargo clippy $OUR_CRATES 没有 -D warningscargo audit|| true

批次层面

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

@github-actions

Copy link
Copy Markdown

CodeRoughcollie 多项目审核报告

总览

项目 🔴 Critical 🟡 Warning 🔵 Info 健康度
self 0 0 0 100 (优秀)

项目: self

执行摘要

指标
健康度评分 🟢 100/100(优秀)
问题总数 0(🔴 Critical: 0 / 🟡 Warning: 0 / 🔵 Info: 0)
审核分支 origin/main
门禁结论 通过 — 未发现问题

审核通过,未发现问题。

- 门禁改用 CI 的 $OUR_CRATES 显式枚举,不再用 --workspace:子模块里的 crate 是
  path 依赖,已被 cargo 拉进本 workspace(cargo metadata 目前解析出 25 个 package,
  含 gaussdb / tokio-opengauss / ogexplain-core / ogsql-complexity /
  metamorphosis-core 等,仅 lib/codeweb 被 exclude)。--workspace 会把门禁打到
  上游代码上,与本文件「子模块策略」直接冲突,还会在子模块工作树留下产物
- insta 说明改为「自有 crates/ 未引入,lib/*/ 的 insta 快照属上游」——原文把
  insta 当本仓库工具,但自有 crates/ 零 insta 依赖
- 注明 CI 的 cargo clippy $OUR_CRATES 没有 -D warnings、cargo audit 是 || true
@github-actions

Copy link
Copy Markdown

CodeRoughcollie 多项目审核报告

总览

项目 🔴 Critical 🟡 Warning 🔵 Info 健康度
self 0 0 0 100 (优秀)

项目: self

执行摘要

指标
健康度评分 🟢 100/100(优秀)
问题总数 0(🔴 Critical: 0 / 🟡 Warning: 0 / 🔵 Info: 0)
审核分支 origin/main
门禁结论 通过 — 未发现问题

审核通过,未发现问题。

@c2j
c2j merged commit 4f37a1e into main Aug 29, 2026
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