docs(#6785): add text/template sorted map iteration to Go review guidance - #6786
docs(#6785): add text/template sorted map iteration to Go review guidance#6786fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
…ance The review agent repeatedly flagged `range` over a map inside `text/template` as non-deterministic output, applying the general Go heuristic that map iteration order is unspecified. However, Go's `text/template` package documents that `range` visits map keys of basic types (string, int, float) in sorted order. Add a "Template map iteration" subsection to the Go pitfalls section of `docs/contributing/go-code.md` with a "When reviewing PRs" directive, following the established pattern of the `Timeout() bool` and suite-timeout directives already in the file. This prevents the review agent from re-raising this false positive. Closes #6785
Site previewPreview: https://6403aa4e-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 9:16 PM UTC · Completed 9:29 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.37 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Risk Assessment: low (1/5) DetailsDocs-only PR by a bot adding 15 lines to a single contributing guide, with no protected paths, no security-sensitive files, and exact scope match to the linked issue. Previous runRisk Assessment: low (1/5) DetailsDocs-only PR by a bot adding 15 lines to a single contributing guide, with no protected paths, no security-sensitive files, and exact scope match to the linked issue. |
|
Looks good to me Previous runReviewFindingsLow
Labels: PR modifies only documentation under docs/contributing/ Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 9:31 PM UTC · Completed 9:36 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.03 |
Add uint to the parenthetical list of basic types that receive sorted iteration in text/template, and update the "When reviewing PRs" directive to match. The Go text/template documentation specifies "basic type with a defined order" which includes unsigned integer types — omitting them could mislead reviewers into flagging map[uint64]T iteration as non-deterministic. Addresses review feedback on #6786
🔧 Fix agent — iteration 1 (bot-triggered)Addressed 1 review finding: expanded the basic type list in both the description and the reviewer directive to include uint alongside string, int, and float, matching the upstream text/template documentation. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:38 PM UTC · Completed 9:50 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.14 |
Superseded by updated review
Summary
Adds a "Template map iteration" review directive to
docs/contributing/go-code.mdto prevent the review agent from flaggingrangeover basic-type-keyed maps intext/templateas non-deterministic. Go'stext/templatepackage guarantees sorted iteration for string, int, and float keys — a documented exception to Go's general unordered map iteration.Related Issue
Changes
### Template map iterationsubsection under## Go pitfallsindocs/contributing/go-code.mdTimeout() booland suite-timeout directivestext/templatedocumentationTesting
Closes #6785
Post-script verification
agent/6785-template-map-iteration-guidance)b00042354a39a430b7658aa186ab95690fdfbbb4..HEAD)