Skip to content

refactor: rename guard/init.go, relocate expandTracingVariables, consolidate collaborator_permission helpers#5844

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering
May 16, 2026
Merged

refactor: rename guard/init.go, relocate expandTracingVariables, consolidate collaborator_permission helpers#5844
lpcox merged 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

Three low-severity structural issues identified by semantic function clustering analysis: a misleadingly named file, a domain-specific function in a generic utility file, and a split response-building concern.

Changes

  • internal/guard/init.gointernal/guard/label_agent.go: File contained only RunLabelAgent(...) — no init() logic. Logger var renamed logGuardInitlogLabelAgent to match.

  • expandTracingVariables moved from config/expand.goconfig/config_tracing.go: expand.go is now a pure generic expansion utility (expandVariablesCore, expandVariables, ExpandRawJSONVariables, expandEnvVariables). The tracing-domain wrapper belongs with TracingConfig and validateOpenTelemetryConfig.

  • LogAndWrapCollaboratorPermission moved from mcp/collaborator_permission.gomcp/tool_result.go: Co-locates it with BuildMCPTextResponse, which it calls directly. collaborator_permission.go is now a single-concern file containing only ParseCollaboratorPermissionArgs.

Copilot AI linked an issue May 16, 2026 that may be closed by this pull request
4 tasks
Copilot AI changed the title [WIP] Refactor semantic function clustering analysis refactor: rename guard/init.go, relocate expandTracingVariables, consolidate collaborator_permission helpers May 16, 2026
Copilot finished work on behalf of lpcox May 16, 2026 21:56
Copilot AI requested a review from lpcox May 16, 2026 21:56
@lpcox lpcox marked this pull request as ready for review May 16, 2026 22:05
Copilot AI review requested due to automatic review settings May 16, 2026 22:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors a few small structural/layout concerns to better align file names and helper locations with their actual responsibilities, and to reduce duplicated collaborator-permission response handling across server/proxy code paths.

Changes:

  • Renamed the guard LabelAgent runner file to label_agent.go and updated its logger namespace/variable name accordingly.
  • Moved expandTracingVariables from the generic expansion utility file into config_tracing.go alongside TracingConfig/OpenTelemetry validation.
  • Relocated LogAndWrapCollaboratorPermission into tool_result.go next to BuildMCPTextResponse, leaving collaborator_permission.go focused on argument parsing.
Show a summary per file
File Description
internal/mcp/tool_result.go Adds LogAndWrapCollaboratorPermission alongside MCP response-building helpers.
internal/mcp/collaborator_permission.go Removes the log/wrap helper, leaving only argument parsing.
internal/guard/label_agent.go Renames logger variable/namespace to match the file’s LabelAgent responsibility.
internal/config/expand.go Removes tracing-specific expansion wrapper to keep this file generic.
internal/config/config_tracing.go Adds expandTracingVariables next to tracing config and validation logic.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 0

@lpcox lpcox merged commit ed86bc3 into main May 16, 2026
27 checks passed
@lpcox lpcox deleted the copilot/refactor-semantic-function-clustering branch May 16, 2026 22:08
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.

[refactor] Semantic Function Clustering Analysis

3 participants