Skip to content

docs(#6785): add text/template sorted map iteration to Go review guidance - #6786

Merged
rh-hemartin merged 2 commits into
mainfrom
agent/6785-template-map-iteration-guidance
Sep 2, 2026
Merged

docs(#6785): add text/template sorted map iteration to Go review guidance#6786
rh-hemartin merged 2 commits into
mainfrom
agent/6785-template-map-iteration-guidance

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds a "Template map iteration" review directive to docs/contributing/go-code.md to prevent the review agent from flagging range over basic-type-keyed maps in text/template as non-deterministic. Go's text/template package guarantees sorted iteration for string, int, and float keys — a documented exception to Go's general unordered map iteration.

Related Issue

Changes

  • Added a new ### Template map iteration subsection under ## Go pitfalls in docs/contributing/go-code.md
  • Includes a "When reviewing PRs" directive following the established pattern of the Timeout() bool and suite-timeout directives
  • Links to the official text/template documentation

Testing

  • No Go production code changed — docs-only change
  • Pre-commit hooks verified (trailing whitespace, end-of-file, link checks)
  • Secret scan passed
  • Gitlint passed

Closes #6785

Post-script verification

  • Branch is not main/master (agent/6785-template-map-iteration-guidance)
  • Secret scan passed (gitleaks — b00042354a39a430b7658aa186ab95690fdfbbb4..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

…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
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 30, 2026 21:14
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Aug 30, 2026
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Site preview

Preview: https://6403aa4e-site.fullsend-ai.workers.dev

Commit: 1cd5370ff93e2f5867318cca13f171e1516ff2b2

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:16 PM UTC · Completed 9:29 PM UTC

Commit: 68f351e · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.37

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/low PR risk: low label Aug 30, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

Risk Assessment: low (1/5)

Details

Docs-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 run

Risk Assessment: low (1/5)

Details

Docs-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.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

Looks good to me

Previous run

Review

Findings

Low

  • [technical accuracy] docs/contributing/go-code.md:314 — The parenthetical list of basic types says "(string, int, float)" but omits unsigned integer types (uint, uint8, uint16, uint32, uint64) which are also basic types with a defined order that receive sorted iteration in text/template. The official Go documentation says "basic type with a defined order" without limiting to only string/int/float. The "When reviewing PRs" directive on line 323 repeats the incomplete list ("string, int, and float keys") without the "basic types" qualifier, making the omission more consequential — a reviewer reading this guidance might incorrectly conclude that a map[uint64]T would NOT get sorted iteration in a template.
    Remediation: Expand the parenthetical to "(string, int, uint, float)" or use the official phrasing "basic type with a defined order" to match the upstream documentation. Apply the same fix to the "When reviewing PRs" directive on line 323.

Labels: PR modifies only documentation under docs/contributing/


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the component/docs User-facing documentation label Aug 30, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 9:31 PM UTC · Completed 9:36 PM UTC

Commit: 68f351e · View workflow run →

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
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. Incomplete basic type list omits uint types in template map iteration guidance (docs/contributing/go-code.md): Added uint to the parenthetical list on line 314 ("string, int, uint, float") and updated the "When reviewing PRs" directive on line 323 to include "uint" in the enumerated key types. The Go text/template documentation specifies sorted iteration for "basic type with a defined order" which includes unsigned integer types.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:38 PM UTC · Completed 9:50 PM UTC

Commit: 1cd5370 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.14

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 30, 2026
@rh-hemartin
rh-hemartin disabled auto-merge September 2, 2026 09:27
@rh-hemartin
rh-hemartin added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 32538f0 Sep 2, 2026
54 checks passed
@rh-hemartin
rh-hemartin deleted the agent/6785-template-map-iteration-guidance branch September 2, 2026 09:28
@fullsend-ai-retro

fullsend-ai-retro Bot commented Sep 2, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 9:29 AM UTC · Completed 9:40 AM UTC

Commit: 1cd5370 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.82

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6786 — Add text/template sorted map iteration to Go review guidance

This was a well-executed end-to-end workflow with no novel improvement opportunities. The automated pipeline (triage → code → review → fix → re-review) completed in ~50 minutes, and the review agent caught a legitimate technical accuracy issue that the code agent missed.

Timeline

Time (UTC) Stage Run Cost Outcome
Aug 30 21:01–21:07 Triage 33335267707 Labeled ready-to-code
Aug 30 21:07–21:14 Code 33335550330 Created PR #6786
Aug 30 21:14–21:29 Review (1st) 33335851315 $3.37 1 low finding: uint omitted from basic type list
Aug 30 21:29–21:36 Fix 33336555776 $1.03 Added uint to type list
Aug 30 21:36–21:51 Review (2nd) 33336906484 $3.14 Approved, no findings
Sep 2 09:26 Human review Approved (rh-hemartin, no comments)
Sep 2 09:28 Merged Via merge queue

Total agent cost (review + fix): $7.54. Agents repo: fullsend-ai/agents@802bbd4fcade.

What went well

  1. Review quality: The review agent caught a genuine technical accuracy gap — the code agent listed (string, int, float) as the sorted-iteration types but omitted uint, which the Go text/template docs include under "basic type with a defined order." The finding was actionable and correctly scoped.
  2. Fix quality: The fix agent addressed the finding in one iteration (7 minutes, $1.03), adding uint to both the description and the reviewer directive.
  3. Pipeline velocity: The full automated cycle completed in 50 minutes. One review–fix round, no oscillation.
  4. Risk assessment accuracy: The review agent correctly scored this as risk 1/5 (docs-only, single file, 15 lines, bot author).

Evidence for existing issues (no new proposals needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/low PR risk: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add text/template sorted map iteration to Go review guidance

1 participant