You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analysis Date: 2026-04-29 Focus Area: Validator File Complexity & Documentation Strategy Type: Custom Custom Area: Yes — gh-aw has 70+ validation files with AGENTS.md-defined size guidelines (100-300 lines, hard limit 300 lines, 30% comment coverage). This run audits adherence.
Executive Summary
A review of the 70+ validation files in pkg/workflow/ and pkg/cli/ reveals that 9 files exceed the 300-line hard limit documented in AGENTS.md. Additionally, all sampled files fall below the mandated 30% comment coverage minimum, ranging from 15–22%. These violations make validators harder to navigate, test, and maintain.
The most severe case is compiler_validators.go (465 lines, 4 functions) where validatePermissions spans over 100 lines and mixes multiple concerns. The project already has excellent patterns for splitting — dozens of focused validator files exist — but several key files have grown beyond those boundaries over time.
All fall below the 30% minimum defined in AGENTS.md validation guidelines.
Findings
Strengths
Excellent overall modularization — 70+ files shows commitment to the one-validator-per-domain pattern
Test coverage ratios are excellent (pkg/workflow: 2.72x test-to-source ratio)
Clear naming conventions (*_validation.go) make navigation easy
Areas for Improvement
9 files exceed 300-line hard limit [HIGH severity]
Comment coverage below 30% in all sampled files [MEDIUM severity]
compiler_validators.go mixes 4 validation concerns instead of delegating to separate files [HIGH severity]
repository_features_validation.go mixes caching infrastructure with validation logic [MEDIUM severity]
🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: The following tasks are designed for GitHub Copilot coding agent execution. Please split these into individual work items for the coding agent to process.
Priority: High Estimated Effort: Small Focus Area: Validator File Complexity
Description: pkg/workflow/compiler_validators.go is 465 lines and contains validatePermissions (~100 lines), validateExpressions, validateFeatureConfig, and validateToolConfiguration. Per AGENTS.md, validators should be 100-300 lines. Extract validatePermissions (and helpers) into a new file compiler_permissions_validation.go.
Acceptance Criteria:
compiler_validators.go is under 300 lines after the split
New pkg/workflow/compiler_permissions_validation.go file exists with the extracted function(s)
All existing tests pass (go test ./pkg/workflow/)
make fmt and make lint pass
Code Region:pkg/workflow/compiler_validators.go (function validatePermissions, line ~71–171)
In `pkg/workflow/compiler_validators.go`, the `validatePermissions` function (starting around line 71) is approximately 100 lines long and handles a distinct concern from the other validators in the file.
Please:
1. Move `validatePermissions` and any private helpers used exclusively by it into a new file `pkg/workflow/compiler_permissions_validation.go`2. Keep the `(c *Compiler)` receiver pattern consistent
3. Ensure the new file has a build tag `//go:build !integration` at the top
4. Add doc comments (aim for 30% comment coverage per AGENTS.md)
5. Verify `compiler_validators.go` drops below 300 lines
6. Run `make fmt && go test ./pkg/workflow/ -run "TestCompile" -count=1` to verify
Priority: High Estimated Effort: Small Focus Area: Validator File Complexity
Description: pkg/workflow/engine_validation.go is 316 lines with 6 functions covering three distinct concerns: version validation, harness script validation, and auth/inline definition validation. Split auth/inline validation into engine_auth_validation.go.
Acceptance Criteria:
engine_validation.go drops to under 300 lines
pkg/workflow/engine_auth_validation.go created with validateEngineAuthDefinition, validateEngineInlineDefinition, registerInlineEngineDefinition, validateSingleEngineSpecification
All existing tests pass
make fmt and make lint pass
Code Region:pkg/workflow/engine_validation.go
`pkg/workflow/engine_validation.go` (316 lines) contains 6 functions that cover 3 distinct concerns:
- Version validation: `validateEngineVersion`- Harness validation: `validateEngineHarnessScript`- Auth/definition validation: `validateEngineAuthDefinition`, `validateEngineInlineDefinition`, `registerInlineEngineDefinition`, `validateSingleEngineSpecification`
Please:
1. Move the auth/definition functions (`validateEngineAuthDefinition`, `validateEngineInlineDefinition`, `registerInlineEngineDefinition`, `validateSingleEngineSpecification`) into a new file `pkg/workflow/engine_auth_validation.go`2. Add `//go:build !integration` build tag at the top of the new file
3. Add doc comments targeting 30% comment coverage
4. Verify `engine_validation.go` drops below 300 lines
5. Run `make fmt && go test ./pkg/workflow/ -run "TestEngine\|TestCompile" -count=1`
Task 3: Extract Repository Caching from repository_features_validation.go
Priority: Medium Estimated Effort: Small Focus Area: Validator File Complexity / Single Responsibility
Description: pkg/workflow/repository_features_validation.go (333 lines) mixes two concerns: (1) validating repository features like discussions/issues availability, and (2) implementing a caching layer (currentRepositoryCacheState). The caching infrastructure should live in a separate file.
Acceptance Criteria:
repository_features_validation.go drops to under 300 lines
Caching types (currentRepositoryCacheState and related unexported cache vars) moved to a new file
`pkg/workflow/repository_features_validation.go` (333 lines) mixes validation logic with caching infrastructure:
- Validation concern: `validateRepositoryFeatures`, `checkRepositoryHasDiscussions`, `checkRepositoryHasIssues`- Caching concern: `currentRepositoryCacheState` struct, cache variables, `getCurrentRepository`, `getCurrentRepositoryUncached`, `getRepositoryFeatures`
Please:
1. Move the caching types and infrastructure (`currentRepositoryCacheState`, package-level cache variables, `getCurrentRepository`, `getCurrentRepositoryUncached`, `getRepositoryFeatures`) into a new file `pkg/workflow/repository_cache.go`2. Keep the validation functions in `repository_features_validation.go`3. Add `//go:build !integration` build tag to the new file
4. Add appropriate doc comments
5. Run `make fmt && go test ./pkg/workflow/ -run "TestRepositoryFeature\|TestCompile" -count=1`
Task 4: Add Comment Documentation to permissions_validation.go
Priority: Medium Estimated Effort: Small Focus Area: Validator Documentation Coverage
Description: pkg/workflow/permissions_validation.go has only ~15% comment coverage, well below the 30% minimum in AGENTS.md. The exported types (PermissionsValidationResult, ValidatePermissions, FormatValidationMessage) need doc comments, and key private helpers need inline explanations.
Acceptance Criteria:
Comment coverage reaches ≥ 30% (currently ~15%)
All exported types and functions have Go-style doc comments
Key internal functions (checkMissingPermissions, formatMissingPermissionsMessage) have explanatory comments
`pkg/workflow/permissions_validation.go` has approximately 15% comment coverage, below the 30% minimum defined in AGENTS.md.
Please add documentation to this file:
1. Add Go-style doc comments (starting with the function name) to all exported symbols:
-`PermissionsValidationResult` struct and its fields
-`ValidatePermissions` function
-`FormatValidationMessage` function
-`ValidatableTool` interface (if present)
2. Add explanatory inline comments to key logic in:
-`checkMissingPermissions` — explain the permission-level comparison logic
-`formatMissingPermissionsMessage` — explain the message building strategy
3. Aim for ≥ 30% comment coverage: `grep -c "^\s*//" pkg/workflow/permissions_validation.go` should be ≥ 107 (30% of 359 lines)
4. Run `make lint` to verify no new lint issues
Task 5: Improve Comment Coverage in compiler_validators.go
Priority: Low Estimated Effort: Small Focus Area: Validator Documentation Coverage
Description: pkg/workflow/compiler_validators.go has ~20% comment coverage (97 comment lines out of 465). Key orchestration functions like validateToolConfiguration lack explanatory comments for their internal steps.
Acceptance Criteria:
Comment coverage reaches ≥ 30% in the file (after any split from Task 1)
validateToolConfiguration and validatePermissions have section comments explaining major steps
make lint passes
Code Region:pkg/workflow/compiler_validators.go
After completing Task 1 (splitting `validatePermissions` out), the remaining `compiler_validators.go` should have ≥ 30% comment coverage per AGENTS.md.
Please:
1. Review `validateToolConfiguration` and `validateFeatureConfig` — add section comments explaining what each major block does (e.g., "// Validate MCP server tool configurations", "// Check that GitHub toolsets are properly configured")
2. Add or improve doc comments on all exported/receiver functions
3. After the Task 1 split, verify comment coverage: `grep -c "^\s*//" pkg/workflow/compiler_validators.go` ÷ total lines ≥ 0.30
4. Run `make lint` to verify
📊 Historical Context
Previous Focus Areas
Date
Focus Area
Type
Custom
Key Outcomes
—
—
—
—
First run — no previous history
🎯 Recommendations
Immediate Actions (This Week)
Split compiler_validators.go (Task 1) - Priority: High
Split engine_validation.go (Task 2) - Priority: High
Short-term Actions (This Month)
Extract repository caching (Task 3) - Priority: Medium
Document permissions_validation.go (Task 4) - Priority: Medium
Long-term Actions (This Quarter)
Add comment coverage CI gate — enforce 30% minimum in CI
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - Validator File Complexity
Analysis Date: 2026-04-29
Focus Area: Validator File Complexity & Documentation
Strategy Type: Custom
Custom Area: Yes — gh-aw has 70+ validation files with AGENTS.md-defined size guidelines (100-300 lines, hard limit 300 lines, 30% comment coverage). This run audits adherence.
Executive Summary
A review of the 70+ validation files in
pkg/workflow/andpkg/cli/reveals that 9 files exceed the 300-line hard limit documented in AGENTS.md. Additionally, all sampled files fall below the mandated 30% comment coverage minimum, ranging from 15–22%. These violations make validators harder to navigate, test, and maintain.The most severe case is
compiler_validators.go(465 lines, 4 functions) wherevalidatePermissionsspans over 100 lines and mixes multiple concerns. The project already has excellent patterns for splitting — dozens of focused validator files exist — but several key files have grown beyond those boundaries over time.Full Analysis Report
Focus Area: Validator File Complexity & Documentation
Current State Assessment
Metrics Collected:
compiler_validators.go(465 lines)Files Exceeding Hard Limit (300 lines)
pkg/workflow/compiler_validators.govalidatePermissions~100 linespkg/workflow/safe_outputs_validation_config.gopkg/workflow/permissions_validation.gopkg/cli/run_workflow_validation.gopkg/workflow/repository_features_validation.gopkg/cli/mcp_validation.gopkg/workflow/engine_validation.gopkg/workflow/network_firewall_validation.gopkg/workflow/expression_safety_validation.goComment Coverage (sampled files)
compiler_validators.goengine_validation.gopermissions_validation.gonetwork_firewall_validation.goAll fall below the 30% minimum defined in AGENTS.md validation guidelines.
Findings
Strengths
*_validation.go) make navigation easyAreas for Improvement
compiler_validators.gomixes 4 validation concerns instead of delegating to separate files [HIGH severity]repository_features_validation.gomixes caching infrastructure with validation logic [MEDIUM severity]🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: The following tasks are designed for GitHub Copilot coding agent execution. Please split these into individual work items for the coding agent to process.
Improvement Tasks
Task 1: Split
compiler_validators.go— Extract Permissions ValidationPriority: High
Estimated Effort: Small
Focus Area: Validator File Complexity
Description:
pkg/workflow/compiler_validators.gois 465 lines and containsvalidatePermissions(~100 lines),validateExpressions,validateFeatureConfig, andvalidateToolConfiguration. Per AGENTS.md, validators should be 100-300 lines. ExtractvalidatePermissions(and helpers) into a new filecompiler_permissions_validation.go.Acceptance Criteria:
compiler_validators.gois under 300 lines after the splitpkg/workflow/compiler_permissions_validation.gofile exists with the extracted function(s)go test ./pkg/workflow/)make fmtandmake lintpassCode Region:
pkg/workflow/compiler_validators.go(functionvalidatePermissions, line ~71–171)Task 2: Split
engine_validation.go— Extract Auth & Harness ValidationPriority: High
Estimated Effort: Small
Focus Area: Validator File Complexity
Description:
pkg/workflow/engine_validation.gois 316 lines with 6 functions covering three distinct concerns: version validation, harness script validation, and auth/inline definition validation. Split auth/inline validation intoengine_auth_validation.go.Acceptance Criteria:
engine_validation.godrops to under 300 linespkg/workflow/engine_auth_validation.gocreated withvalidateEngineAuthDefinition,validateEngineInlineDefinition,registerInlineEngineDefinition,validateSingleEngineSpecificationmake fmtandmake lintpassCode Region:
pkg/workflow/engine_validation.goTask 3: Extract Repository Caching from
repository_features_validation.goPriority: Medium
Estimated Effort: Small
Focus Area: Validator File Complexity / Single Responsibility
Description:
pkg/workflow/repository_features_validation.go(333 lines) mixes two concerns: (1) validating repository features like discussions/issues availability, and (2) implementing a caching layer (currentRepositoryCacheState). The caching infrastructure should live in a separate file.Acceptance Criteria:
repository_features_validation.godrops to under 300 linescurrentRepositoryCacheStateand related unexported cache vars) moved to a new filemake fmtandmake lintpassCode Region:
pkg/workflow/repository_features_validation.goTask 4: Add Comment Documentation to
permissions_validation.goPriority: Medium
Estimated Effort: Small
Focus Area: Validator Documentation Coverage
Description:
pkg/workflow/permissions_validation.gohas only ~15% comment coverage, well below the 30% minimum in AGENTS.md. The exported types (PermissionsValidationResult,ValidatePermissions,FormatValidationMessage) need doc comments, and key private helpers need inline explanations.Acceptance Criteria:
checkMissingPermissions,formatMissingPermissionsMessage) have explanatory commentsmake lintpasses (no new lint issues)Code Region:
pkg/workflow/permissions_validation.goTask 5: Improve Comment Coverage in
compiler_validators.goPriority: Low
Estimated Effort: Small
Focus Area: Validator Documentation Coverage
Description:
pkg/workflow/compiler_validators.gohas ~20% comment coverage (97 comment lines out of 465). Key orchestration functions likevalidateToolConfigurationlack explanatory comments for their internal steps.Acceptance Criteria:
validateToolConfigurationandvalidatePermissionshave section comments explaining major stepsmake lintpassesCode Region:
pkg/workflow/compiler_validators.go📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
compiler_validators.go(Task 1) - Priority: Highengine_validation.go(Task 2) - Priority: HighShort-term Actions (This Month)
permissions_validation.go(Task 4) - Priority: MediumLong-term Actions (This Quarter)
compiler_validators.go(Task 5) - Priority: Low📈 Success Metrics
Track these metrics to measure improvement in Validator File Complexity:
compiler_validators.gosize: 465 → <300 linesNext Steps
Generated by Repository Quality Improvement Agent
Next analysis: 2026-04-30 — Focus area will be selected based on diversity algorithm
Beta Was this translation helpful? Give feedback.
All reactions