Skip to content

[function-namer] Go function rename plan: audit_expanded.go #24858

@github-actions

Description

@github-actions

Why This Matters

When AI coding agents search for functions to complete a task, they rely on function
names to understand what code does. Clear, descriptive names increase the likelihood
that an agent will find the right function instead of reimplementing existing logic.

Files Analyzed: pkg/cli/audit_expanded.go, pkg/cli/audit_report.go, pkg/cli/audit_report_analysis.go, pkg/cli/audit_report_render.go
Analysis Date: 2026-04-06
Round-Robin Position: files 35–38 of 659 total
Function Budget: 48 functions (approx) across 4 files

Rename Suggestions

pkg/cli/audit_expanded.go

Current Name Suggested Name Reason
awInfoHasMCPServers() extractMCPServerNamesFromAwInfo() The has prefix implies a boolean predicate, but the function returns ([]string, bool) — it extracts server names. An agent looking to "get MCP server names" would skip a function named hasX. The new name accurately signals data extraction.

All functions in this file (for reference):

  • findAwInfoPath() — ✅ Clear, no change needed
  • extractEngineConfig() — ✅ Clear, no change needed
  • extractPromptAnalysis() — ✅ Clear, no change needed
  • buildSessionAnalysis() — ✅ Clear, no change needed
  • buildSafeOutputSummary() — ✅ Clear, no change needed
  • buildSafeOutputSummaryString() — ✅ Clear, no change needed
  • prettifySafeOutputType() — ✅ Clear, no change needed
  • buildMCPServerHealth() — ✅ Clear, no change needed
  • buildSlowestToolCalls() — ✅ Clear, no change needed
  • awInfoHasMCPServers()⚠️ Rename suggested (see table above)

pkg/cli/audit_report.go

All functions already have clear, descriptive names — no renames needed.

  • buildAuditData() — ✅ Clear
  • extractDownloadedFiles() — ✅ Clear
  • extractCreatedItemsFromManifest() — ✅ Clear
  • describeFile() — ✅ Clear
  • parseDurationString() — ✅ Clear
  • extractPreAgentStepErrors() — ✅ Clear
  • parseStepFilename() — ✅ Clear
  • stripGHALogTimestamps() — ✅ Clear

pkg/cli/audit_report_analysis.go

All functions already have clear, descriptive names — no renames needed.

  • generateFindings() — ✅ Clear
  • generateRecommendations() — ✅ Clear
  • generatePerformanceMetrics() — ✅ Clear

pkg/cli/audit_report_render.go

All functions already have clear, descriptive names — no renames needed. The render* and format* naming is consistent and discoverable.


🤖 Agentic Implementation Plan

Agentic Implementation Plan

This issue is designed to be assigned to a coding agent. The agent should implement
all rename suggestions below in a single pull request.

Prerequisites

  • Read the function body of awInfoHasMCPServers to confirm the rename is accurate
  • Verify no Go interface constraints require the current name

Implementation Steps

1. Rename the function in pkg/cli/audit_expanded.go

// Old
func awInfoHasMCPServers(logsPath string) ([]string, bool) {

// New
func extractMCPServerNamesFromAwInfo(logsPath string) ([]string, bool) {

2. Update all call sites

grep -rn "awInfoHasMCPServers" pkg/ --include="*.go"

Also check test files:

grep -rn "awInfoHasMCPServers" pkg/ --include="*_test.go"

Known call sites (from analysis):

  • pkg/cli/audit_expanded.go:138extractEngineConfig calls awInfoHasMCPServers(logsPath)
  • pkg/cli/audit_expanded_test.go:670TestAwInfoHasMCPServers calls awInfoHasMCPServers(tmpDir)

Also rename the test function from TestAwInfoHasMCPServers to TestExtractMCPServerNamesFromAwInfo.

3. Verify compilation after rename

make build

4. Run tests after rename is complete

make test-unit
make lint
```

### Commit Convention

```
refactor: rename awInfoHasMCPServers to extractMCPServerNamesFromAwInfo for clarity

Validation Checklist

  • Rename implemented in audit_expanded.go
  • Call site in extractEngineConfig updated
  • Test function in audit_expanded_test.go updated
  • make build passes with no errors
  • make test-unit passes
  • make lint passes
  • PR description explains the agent-discoverability rationale

Notes for the Agent

  • This is a pure rename refactor — behavior must not change, only names
  • The has prefix in Go conventionally implies a boolean return (bool only); this function returns ([]string, bool), making extract more accurate
  • Follow existing naming conventions documented in AGENTS.md

Generated by the Daily Go Function Namer workflow
Run: §24029642787

Generated by Daily Go Function Namer · ● 154.2K ·

  • expires on Apr 13, 2026, 11:17 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions