Skip to content

[function-namer] Go function rename plan: pkg/workflowΒ #52285

Description

@github-actions

🏷️ Go Function Rename Plan

Package Analyzed: pkg/workflow
Analysis Date: 2026-08-12
Round-Robin Position: package 8 of 48 total packages
Functions Analyzed: 355 functions across 66 files

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.
Functions in the same package also call each other, so reviewing them together gives
better context for rename decisions.

Rename Suggestions

pkg/workflow/tools.go

Current Name Suggested Name Reason
detectTriggerType() detectImplicitTriggerType() The function does not detect arbitrary trigger types. It specifically infers whether default on: generation should treat the workflow as a slash/command or label-command workflow, including a fallback read from frontmatter when WorkflowData is still incomplete. The new name makes that narrow purpose easier for an agent to find.

All functions in this file (for reference):

  • (*Compiler).applyDefaults() β€” βœ… Clear, no change needed
  • populateWorkflowDataCache() β€” βœ… Clear, no change needed
  • detectTriggerType() β€” ⚠️ Rename suggested (see table above)
  • (*Compiler).applyDefaultOnSection() β€” βœ… Clear, no change needed
  • applyDefaultPermissions() β€” βœ… Clear, no change needed
  • (*Compiler).applyCommandTriggerOnSection() β€” βœ… Clear, no change needed
  • (*Compiler).buildCommandTriggerEventsMap() β€” βœ… Clear, no change needed
  • (*Compiler).applyLabelCommandTriggerOnSection() β€” βœ… Clear, no change needed
  • (*Compiler).buildLabelCommandEventsMap() β€” βœ… Clear, no change needed
  • mergeLabelCommandOtherEvents() β€” βœ… Clear, no change needed
  • ensureWorkflowDispatchItemNumberInput() β€” βœ… Clear, no change needed
  • (*Compiler).mergeToolsAndMCPServers() β€” βœ… Clear, no change needed
  • mergeRuntimes() β€” βœ… Clear, no change needed
  • (*Compiler).hasIssueTrigger() β€” βœ… Clear, no change needed
  • (*Compiler).injectWorkflowDispatchForIssue() β€” βœ… Clear, no change needed
  • (*Compiler).replaceIssueNumberReferences() β€” βœ… Clear, no change needed
  • isBashFullyDisabled() β€” βœ… Clear, no change needed
  • (*Compiler).applyDefaultTools() β€” βœ… Clear, no change needed

pkg/workflow/time_delta.go

Current Name Suggested Name Reason
parseTimeDeltaForStopAfter() parseStopAfterTimeDelta() This helper is specific to the stop-after field rather than a generic β€œfor X” variant. The suggested name leads with the domain concept an agent would likely search for.
parseTimeDeltaWithMinutes() parseTimeDeltaWithOptionalMinutes() The current name sounds like it always parses minute-bearing input. The boolean parameter actually toggles minute support on and off, so the rename better matches behavior.

All functions in this file (for reference):

  • parseTimeDelta() β€” βœ… Clear, no change needed
  • parseTimeDeltaForStopAfter() β€” ⚠️ Rename suggested (see table above)
  • parseTimeDeltaWithMinutes() β€” ⚠️ Rename suggested (see table above)
  • (*TimeDelta).String() β€” βœ… Standard stringer, no change needed
  • isRelativeStopTime() β€” βœ… Clear, no change needed
  • parseAbsoluteDateTime() β€” βœ… Clear, no change needed
  • isRelativeDate() β€” βœ… Clear, no change needed
  • parseRelativeDate() β€” βœ… Clear, no change needed
  • ResolveRelativeDate() β€” βœ… Clear, no change needed
  • parseExpiresFromConfig() β€” βœ… Clear, no change needed
  • parseRelativeTimeSpec() β€” βœ… Clear, no change needed

pkg/workflow/template_injection_utils.go

Current Name Suggested Name Reason
extractRunBlocks() extractRunScriptBlocks() The function recursively walks parsed workflow data and collects run: script contents, not arbitrary YAML blocks. Adding Script makes its output and use in injection validation much easier to infer.

All functions in this file (for reference):

  • extractRunBlocks() β€” ⚠️ Rename suggested (see table above)
  • removeHeredocContent() β€” βœ… Clear, no change needed
  • stripShellLineComments() β€” βœ… Clear, no change needed
  • isShellCommentStart() β€” βœ… Clear, no change needed
  • replaceOutsideQuotedHeredocs() β€” βœ… Clear, no change needed
  • replaceOutsideShellLineComments() β€” βœ… Clear, no change needed
  • extractRunSnippet() β€” βœ… Clear, no change needed
  • detectExpressionContext() β€” βœ… Clear, no change needed
  • formatTemplateInjectionError() β€” βœ… Clear, no change needed
  • formatRunScriptExpressionGuardrailError() β€” βœ… Clear, no change needed

pkg/workflow/tool_description_enhancer.go

Current Name Suggested Name Reason
buildConstraints() buildToolConstraints() In this package, β€œconstraints” always refers to tool-description constraint text. The current generic name is hard to search for and easy to overlook. The new name anchors it to the package domain.

All functions in this file (for reference):

  • toolConstraintBuilder() β€” βœ… Type alias is clear, no change needed
  • formatStringList() β€” βœ… Clear, no change needed
  • appendAllowedIssueFieldsConstraint() β€” βœ… Clear, no change needed
  • appendMaxConstraint() β€” βœ… Clear, no change needed
  • buildConstraints() β€” ⚠️ Rename suggested (see table above)
  • appendStringConstraint() β€” βœ… Clear, no change needed
  • appendTargetConstraint() β€” βœ… Clear, no change needed
  • enhanceToolDescription() β€” βœ… Clear, no change needed
  • buildToolDescriptionConstraints() β€” βœ… Clear, no change needed
  • Remaining per-tool *Constraints() helpers β€” βœ… Clear, no change needed

pkg/workflow/trigger_parser.go

Current Name Suggested Name Reason
parseSourceControlTrigger() parseGitRefTrigger() The function only dispatches push and pull_request shorthand parsing. β€œSource control” is broader than the implementation and gives weak search cues. β€œGit ref trigger” better signals branch/tag/PR event parsing.

All functions in this file (for reference):

  • ParseTriggerShorthand() β€” βœ… Clear, no change needed
  • (*TriggerIR).ToYAMLMap() β€” βœ… Clear, no change needed
  • parseSlashCommandTrigger() β€” βœ… Clear, no change needed
  • parseLabelTrigger() β€” βœ… Clear, no change needed
  • parseSourceControlTrigger() β€” ⚠️ Rename suggested (see table above)
  • parsePushTrigger() β€” βœ… Clear, no change needed
  • parsePullRequestTrigger() β€” βœ… Clear, no change needed
  • parseIssueDiscussionTrigger() β€” βœ… Clear, no change needed
  • Remaining parse*Trigger() helpers β€” βœ… Clear, no change needed
  • mergeCommandOtherEvents() β€” βœ… Clear, no change needed
  • mergeEventConfig() β€” βœ… Clear, no change needed
  • parseEventTypes() β€” βœ… Clear, no change needed
  • (*Compiler).parseOnSection() β€” βœ… Clear, no change needed
  • parseOnMapPreamble() β€” βœ… Clear, no change needed
  • parseCommandTriggerFromOnMap() β€” βœ… Clear, no change needed
  • parseLabelCommandFromOnMap() β€” βœ… Clear, no change needed
  • (*Compiler).finalizeCommandTriggerState() β€” βœ… Clear, no change needed
  • parseStatusCommentFromOnMap() β€” βœ… Clear, no change needed
  • parseLockForAgentFromOnMap() β€” βœ… Clear, no change needed

pkg/workflow/workflow_builder.go

Current Name Suggested Name Reason
(*Compiler).extractYAMLSections() (*Compiler).extractWorkflowYAMLSections() The method extracts top-level workflow YAML snippets into WorkflowData, not generic YAML sections. The added qualifier improves package-level searchability and reduces ambiguity with other YAML extraction helpers.

All functions in this file (for reference):

  • (*Compiler).buildInitialWorkflowData() β€” βœ… Clear, no change needed
  • extractEnclavesConfig() β€” βœ… Clear, no change needed
  • extractLSPConfig() β€” βœ… Clear, no change needed
  • extractFrontmatterSkills() β€” βœ… Clear, no change needed
  • extractFrontmatterSkillReferences() β€” βœ… Clear, no change needed
  • extractMainModelCostsOverlay() β€” βœ… Clear, no change needed
  • mergeModelCostOverlays() β€” βœ… Clear, no change needed
  • mergeModelCostOverlayPair() β€” βœ… Clear, no change needed
  • extractMainModelPolicyOverlay() β€” βœ… Clear, no change needed
  • toFloat64() β€” βœ… Local utility name is acceptable, no change needed
  • resolveDefaultAiCreditsPricing() β€” βœ… Clear, no change needed
  • extractDefaultAiCreditsPricingFromModels() β€” βœ… Clear, no change needed
  • extractDefaultAiCreditsPricingFromModelsMap() β€” βœ… Clear, no change needed
  • extractDefaultAiCreditsPricingFromObject() β€” βœ… Clear, no change needed
  • mergeModelPolicyOverlays() β€” βœ… Clear, no change needed
  • filterAllowedModelConflictsWithSet() β€” βœ… Clear, no change needed
  • modelConflictsWithDisallowedPolicy() β€” βœ… Clear, no change needed
  • modelPolicyPatternMatches() β€” βœ… Clear, no change needed
  • resolveInlinedImports() β€” βœ… Clear, no change needed
  • mergeExcludedEnvVarNames() β€” βœ… Clear, no change needed
  • (*Compiler).extractYAMLSections() β€” ⚠️ Rename suggested (see table above)
  • Remaining workflow-builder helpers β€” βœ… Clear, no change needed
πŸ€– 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 each rename suggestion and verify it is accurate by reviewing the function body
  • Check for any Go interface constraints that prevent renaming (e.g., must match interface method name)

Implementation Steps

For each rename suggestion, follow this sequence:

1. Rename the function in the indicated file

// Old
func oldName(args) returnType {

// New
func newName(args) returnType {

Target renames for this package:

  • pkg/workflow/tools.go: detectTriggerType β†’ detectImplicitTriggerType
  • pkg/workflow/time_delta.go: parseTimeDeltaForStopAfter β†’ parseStopAfterTimeDelta
  • pkg/workflow/time_delta.go: parseTimeDeltaWithMinutes β†’ parseTimeDeltaWithOptionalMinutes
  • pkg/workflow/template_injection_utils.go: extractRunBlocks β†’ extractRunScriptBlocks
  • pkg/workflow/tool_description_enhancer.go: buildConstraints β†’ buildToolConstraints
  • pkg/workflow/trigger_parser.go: parseSourceControlTrigger β†’ parseGitRefTrigger
  • pkg/workflow/workflow_builder.go: (*Compiler).extractYAMLSections β†’ (*Compiler).extractWorkflowYAMLSections

2. Update all call sites

Use grep to find every caller and update the reference:

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

Also check test files:

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

Known call sites from this analysis:

  • detectTriggerType is called by (*Compiler).applyDefaults in pkg/workflow/tools.go
  • parseTimeDeltaForStopAfter is called by resolveStopTime in pkg/workflow/stop_after.go and related tests in pkg/workflow/time_delta_test.go
  • parseTimeDeltaWithMinutes is called by parseTimeDelta and parseTimeDeltaForStopAfter in pkg/workflow/time_delta.go
  • extractRunBlocks is called by validateNoTemplateInjectionFromParsed and validateNoGitHubExpressionsInRunScriptsFromParsed in pkg/workflow/template_injection_validation.go
  • buildConstraints is called broadly by the per-tool *Constraints helpers in pkg/workflow/tool_description_enhancer.go
  • parseSourceControlTrigger is called by ParseTriggerShorthand in pkg/workflow/trigger_parser.go
  • (*Compiler).extractYAMLSections is called by (*Compiler).populateWorkflowBuildContext, (*Compiler).ParseWorkflowString, and associated tests

3. Verify compilation after each rename

make build

4. Run tests after all renames are complete

make test-unit
make lint

Commit Convention

Each rename should be a focused commit:

refactor: rename <oldName> to <newName> for clarity

Validation Checklist

  • All renames implemented
  • All call sites updated (Go files and test files)
  • 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
  • If a rename causes unexpected complexity (e.g., name conflicts, interface constraints),
    skip it and leave a comment in the PR explaining why
  • Follow existing naming conventions documented in AGENTS.md
  • Unexported functions used only as closures or immediately-invoked can be skipped

Generated by the Daily Go Function Namer workflow
Run: 31593990868

Generated by πŸ”§ Daily Go Function Namer Β· gpt54 Β· 21.8 AIC Β· βŒ– 7.48 AIC Β· ⊞ 8.3K Β· β—·

  • expires on Aug 19, 2026, 4:00 AM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions