docs(agents): rewrite AGENTS.md around CI traps and reviewer feedback - #5177
docs(agents): rewrite AGENTS.md around CI traps and reviewer feedback#5177kakkoyun wants to merge 2 commits into
Conversation
The previous file was documentation policy: when to update CONTRIBUTING.md and README.md, plus links to the subdirectory AGENTS.md files. It carried no operational detail, so agents working here learned the repo's constraints by tripping over them in CI. This covers what the code cannot tell you. The multi-module dependency workflow is the largest source of avoidable churn: walking modules by hand leaves go.work.sum and indirect-only modules stale, while go work sync rewrites unrelated dependencies. The supported-configurations allowlist has the same shape, where the tool writes FIX_ME placeholders that must be filled in by hand and the generated file must never be edited directly. The remainder is distilled from human review comments on the last 100 merged pull requests, covering the feedback reviewers repeat: assertions that pin a value rather than a shape, comments that still read correctly once the pull request is gone, and restraint about new exported surface. Guidance with no support in that corpus was dropped rather than carried over.
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 18708fc | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-08-10 13:58:29 Comparing candidate commit 18708fc in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 326 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.
|
WIP
What does this PR do?
Rewrites the root
AGENTS.mdfrom 29 lines of documentation policy into 146 lines describing what CI actually rejects and what reviewers actually send back.Motivation
The old file said to read
CONTRIBUTING.md, listed the five subdirectoryAGENTS.mdfiles, and gave criteria for updating the docs. All of that is still here. What was missing was any operational detail, so an agent had to learn the repository's constraints from CI failures.Two sources fed the new content.
The multi-module dependency workflow, which is the largest source of avoidable churn. Bumping a version with
go getand per-modulego mod tidyleavesgo.work.sumand indirect-only modules stale.go work syncgoes the other way and rewrites unrelated dependencies across the workspace. Neither is a substitute formake fix-modules. The supported-configurations allowlist has a similar shape:configinverter addwritesFIX_MEplaceholders that have to be filled in by hand, thetypefield takes a fixed vocabulary, and re-serialising the JSON by any other means drops the top-level"version"field and reorders every entry.Human review comments on the last 100 merged PRs (#4969–#5147; 286 inline comments and 48 review bodies once bot reviewers are excluded). The themes that recur across several PRs and several reviewers:
reflectfmt.Errorfunless a caller has to match the error witherrors.Is/errors.AsGuidance with no support in that corpus was dropped rather than carried forward: conventional-commit PR titles (0 mentions in 334 comments),
strings.Builderoverfmt.Sprintf(1), cross-compilation (2).Verification
Every command, script path and child
AGENTS.mdlink in the file resolves against the tree. Thetypevocabulary was taken from the committed allowlist rather than from memory.The file was also compared against the current
AGENTS.mdempirically: reconstructions of 13 already-merged PRs, each run twice in isolated single-branch clones at the PR's parent commit — once with each version of the file, nothing else different — and scored against the merged diff. The merged commit is absent from the clones, so it could not be consulted.Across two independent PR sets: 5 wins, 0 losses, 7 ties, with no-op control tasks tying in every round. One further cell was discarded because the agent never opened
AGENTS.md, which makes it a comparison of nothing against nothing. The differences that showed up more than once were dependency propagation, the allowlisttypevocabulary, and use ofconfiginverterinstead of hand-editing the generated file.Two limitations worth stating. The reviewer-derived rules about agent-authored comment scaffolding and
reflect-based tests never triggered in any cell, so they are grounded in real review comments but unproven here. Andmake lintwas never run by any cell in either arm, which suggests that if it needs enforcing it belongs in a hook rather than in prose.