Repository Quality Improvement Report — Validation System Architecture Health (2026-03-23) #22434
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Repository Quality Improvement Agent. A newer discussion is available at Discussion #22700. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report — Validation System Architecture Health
Analysis Date: 2026-03-23
Focus Area: Validation System Architecture Health
Strategy Type: Custom
Custom Area: Yes — The gh-aw validator system has grown to 51+ validation files in
pkg/workflow/alone. This analysis targets two concrete, measurable architectural issues: (1) file size violations against the 300-line hard limit documented inAGENTS.md, and (2) test coverage gaps in validator files.Executive Summary
The
pkg/workflow/package contains 51 non-test validation files with a total of ~8,700 lines of validation logic. Analysis reveals 8 files exceed the 300-line hard limit defined inAGENTS.md, and a large fraction of validators lack dedicated unit test files (relying solely on integration tests or being exercised only through compilation pipelines).The most critical violations are
safe_outputs_validation.goandsafe_outputs_validation_config.go(both at 407 lines),dispatch_workflow_validation.go(363 lines), andtools_validation.go(359 lines). Additionally,permissions_validation.go(351 lines) andrepository_features_validation.go(342 lines) exceed the limit. These files mix multiple distinct validation domains, making them harder to test, review, and maintain independently.Full Analysis Report
Focus Area: Validation System Architecture Health
Current State Assessment
Metrics Collected:
safe_outputs_validation.go)Findings
Strengths
AGENTS.mddocuments clear refactoring criteria (>300 lines → split)Files Exceeding 300-Line Hard Limit
safe_outputs_validation.gosafe_outputs_validation_config.godispatch_workflow_validation.gotools_validation.gopermissions_validation.gorepository_features_validation.gotemplate_injection_validation.gomcp_config_validation.goValidator Files Without Dedicated Unit Test Files
expression_safety_validation.go(295 lines),expression_syntax_validation.go(236 lines),agent_validation.go(247 lines — only integration tests),docker_validation.go(175 lines),npm_validation.go(106 lines),pip_validation.go(192 lines),jobs_validation.go,strict_mode_env_validation.go(147 lines),strict_mode_network_validation.go(133 lines),strict_mode_permissions_validation.go(190 lines),runtime_validation.go(290 lines),lock_validation.go,firewall_validation.go,cache_validation.go,dispatch_repository_validation.go(107 lines),push_to_pull_request_branch_validation.go(119 lines),repo_memory_validation.go,template_validation.go,safe_outputs_validation.go(407 lines, has many domain tests but nosafe_outputs_validation_test.go),sandbox_validation.go.Detailed Analysis
tools_validation.go(359 lines) contains 7 distinct top-level functions spanning three domains: bash tool validation, GitHub read-only enforcement, GitHub tool config, GitHub guard policy, repos scope validation, repo pattern validation, and toolset cross-validation. The AGENTS.md guidance recommends{domain}_{subdomain}_validation.gonaming. This file should becometools_bash_validation.go,tools_github_validation.go, andtools_toolsets_validation.go.dispatch_workflow_validation.go(363 lines) has a primary validator function (validateDispatchWorkflow) plus 7 utility functions for file discovery (findWorkflowFile,extractWorkflowDispatchInputs,getCurrentWorkflowName,isPathWithinDir, etc.). The utility functions belong in a separatedispatch_workflow_helpers.go.expression_safety_validation.go(295 lines) andexpression_syntax_validation.go(236 lines)** have no dedicated test files. Template injection and expression safety are security-critical paths that deserve explicit unit test coverage rather than relying only on integration tests.agent_validation.go(247 lines) only has integration tests (max_turns_validation_test.go). Unit tests would be faster and more precise for testing the agent validation functions.🤖 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 Claude to process. Each task is self-contained.
Improvement Tasks
Task 1: Split
tools_validation.goby DomainPriority: High
Estimated Effort: Medium
Focus Area: Code Organization / Validation Architecture
Description:
pkg/workflow/tools_validation.go(359 lines) violates the 300-line hard limit inAGENTS.mdand mixes three distinct validation domains. Split it into three files following the{domain}_{subdomain}_validation.gonaming convention.Acceptance Criteria:
tools_bash_validation.gocontainsvalidateBashToolConfigtools_github_validation.gocontainsvalidateGitHubReadOnly,validateGitHubToolConfig,validateGitHubGuardPolicy,validateReposScope,validateRepoPattern,isValidOwnerOrRepotools_toolsets_validation.gocontainsValidateGitHubToolsAgainstToolsetsmake test-unitmake fmtpassesCode Region:
pkg/workflow/tools_validation.goTask 2: Split
dispatch_workflow_validation.go— Extract File UtilitiesPriority: High
Estimated Effort: Medium
Focus Area: Code Organization / Validation Architecture
Description:
pkg/workflow/dispatch_workflow_validation.go(363 lines) exceeds the 300-line limit and mixes validation logic with file discovery utilities. The file utility functions (findWorkflowFile,isPathWithinDir,getCurrentWorkflowName,extractWorkflowDispatchInputs,extractMDWorkflowDispatchInputs,mdHasWorkflowDispatch,containsWorkflowDispatch) should be extracted to a helpers file.Acceptance Criteria:
dispatch_workflow_helpers.gocreated with file discovery/utility functionsdispatch_workflow_validation.goretains onlyvalidateDispatchWorkflowand related validation logicmake test-unitmake fmtpassesCode Region:
pkg/workflow/dispatch_workflow_validation.goTask 3: Add Unit Tests for
expression_safety_validation.goPriority: Medium
Estimated Effort: Medium
Focus Area: Testing / Security
Description:
pkg/workflow/expression_safety_validation.go(295 lines) contains security-critical validation for expression safety but has no dedicated unit test file. This is a risk because expression safety directly impacts security. Add direct unit tests for the key validation functions.Acceptance Criteria:
pkg/workflow/expression_safety_validation_test.gocreated//go:build !integrationadded at topassert.*andrequire.*fromgithub.com/stretchr/testifymake fmtandmake lintpassCode Region:
pkg/workflow/expression_safety_validation.go, new filepkg/workflow/expression_safety_validation_test.goTask 4: Add Unit Tests for
agent_validation.goPriority: Medium
Estimated Effort: Small
Focus Area: Testing
Description:
pkg/workflow/agent_validation.go(247 lines) provides agent-specific validation including engine feature compatibility checks and security constraints on workflow triggers. It currently only has integration tests (max_turns_validation_test.go). Fast unit tests would improve the feedback cycle during development.Acceptance Criteria:
pkg/workflow/agent_validation_test.gocreated//go:build !integrationat topvalidateMaxTurnsSupportwith supported/unsupported enginesvalidateMaxContinuationsSupportvalidateWebSearchSupport(warning vs error behavior)make fmtandmake lintpassCode Region:
pkg/workflow/agent_validation.go, new filepkg/workflow/agent_validation_test.go📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
tools_validation.go(Task 1) — Priority: High. Already over the documented limit, clean domain separation exists.dispatch_workflow_validation.go(Task 2) — Priority: High. File discovery utilities are a clearly separate concern.Short-term Actions (This Month)
expression_safety_validation.go(Task 3) — Priority: Medium. Security-critical path deserves faster unit test feedback.agent_validation.go(Task 4) — Priority: Medium. Integration tests are slow; unit tests improve dev cycle.Long-term Actions (This Quarter)
📈 Success Metrics
Track these metrics to measure improvement in Validation System Architecture Health:
Next Steps
References:
Generated by Repository Quality Improvement Agent
Next analysis: 2026-03-24 — Focus area will be selected based on diversity algorithm
Beta Was this translation helpful? Give feedback.
All reactions