🎯 Repository Quality Report: Validator File Size Compliance (2026-02-23) #17922
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-02-24T13:43:30.052Z.
|
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.
-
Overview
This analysis focuses on Validator File Size Compliance — a custom, repository-specific focus area. The project's documented guidelines in
AGENTS.mddefine a hard limit of 300 lines for validator files (pkg/workflow/*_validation.go), with a target range of 100–200 lines. This run identified 7 validator files currently exceeding that hard limit, with the most severe case at 566 lines (89% over limit).The good news: the majority of validators (39 out of 46 validation files) are already within acceptable size bounds, indicating the architecture is sound and these oversized files are outliers that need splitting.
Critical Issues — Files Exceeding Hard Limit (300 lines)
pkg/workflow/strict_mode_validation.gopkg/workflow/expression_validation.gopkg/workflow/safe_output_validation_config.gopkg/workflow/concurrency_validation.gopkg/workflow/repository_features_validation.gopkg/workflow/permissions_validation.gopkg/workflow/mcp_config_validation.goFull Analysis Report
Focus Area: Validator File Size Compliance
Analysis Date: 2026-02-23
Strategy Type: Custom (60% allocation)
Rationale: This repository has explicit documented guidelines (in
AGENTS.md) about validator file sizes. Periodic compliance checking ensures maintainability and test quality stay on track as validators accumulate new rules.Current State Assessment
Metrics Collected:
Strengths
{domain}_{subdomain}_validation.gois consistently followedAreas for Improvement
strict_mode_validation.go(566 lines) — Highest priority: contains 3+ distinct validation domains (permissions, network, MCP network, bash tools). Should be split intostrict_mode_permissions_validation.go,strict_mode_network_validation.go, etc.expression_validation.go(490 lines) — Contains allowlist management, pattern matching, and expression extraction. Could be split intoexpression_allowlist_validation.goandexpression_syntax_validation.go.safe_output_validation_config.go(412 lines) — This is primarily a data/config file containingTypeValidationConfigstructs and a large data table. The config table itself (~330 lines) could be extracted to a separate file likesafe_output_type_configs.go.concurrency_validation.go(353 lines) — Contains expression parsing logic mixed with validation logic; the expression parser could be extracted.repository_features_validation.go(352 lines) — Contains feature detection, caching layer, and validation logic — three distinct concerns.permissions_validation.go(340 lines) — Contains toolset-to-permissions mapping data + validation logic. The data table could be a separate file.mcp_config_validation.go(326 lines) — Just slightly over limit; likely a quick win with minor extraction.🤖 Tasks for Copilot Agent
Task 1: Split
strict_mode_validation.go(566 lines → target ≤300/file)Priority: High
Estimated Effort: Medium
Focus Area: Validator File Size Compliance
Description:
pkg/workflow/strict_mode_validation.goat 566 lines is 89% over the 300-line hard limit. It contains multiple distinct validation domains that should be split into separate files following the{domain}_{subdomain}_validation.gonaming convention.Acceptance Criteria:
make test-unit){domain}_{subdomain}_validation.gonamingCode Region:
pkg/workflow/strict_mode_validation.goTask 2: Split
expression_validation.go(490 lines → target ≤300/file)Priority: High
Estimated Effort: Medium
Focus Area: Validator File Size Compliance
Description:
pkg/workflow/expression_validation.goat 490 lines contains expression allowlist management, pattern matching logic, and syntax validation — three separable concerns.Acceptance Criteria:
make test-unit)Code Region:
pkg/workflow/expression_validation.goTask 3: Extract config data from
safe_output_validation_config.go(412 lines)Priority: Medium
Estimated Effort: Small
Focus Area: Validator File Size Compliance
Description:
pkg/workflow/safe_output_validation_config.gocontains a largeValidationConfigdata table (~330 lines of type configuration entries) mixed with helper functions. The data table should be extracted to a separate file.Acceptance Criteria:
safe_output_type_configs.goor similarmake test-unit)Code Region:
pkg/workflow/safe_output_validation_config.goTask 4: Split
repository_features_validation.go(352 lines)Priority: Medium
Estimated Effort: Small
Focus Area: Validator File Size Compliance
Description:
pkg/workflow/repository_features_validation.gomixes three concerns: caching infrastructure (sync.Map, sync.Once patterns), GitHub API calls for feature detection, and validation logic. Extracting the caching/API layer would bring the file within limits.Acceptance Criteria:
make test-unit)Code Region:
pkg/workflow/repository_features_validation.goTask 5: Quick fix
mcp_config_validation.go(326 lines)Priority: Low
Estimated Effort: Small
Focus Area: Validator File Size Compliance
Description:
pkg/workflow/mcp_config_validation.gois just 26 lines over the limit (9%). A targeted extraction of the MCP type requirements data or helper utilities would bring it within guidelines.Acceptance Criteria:
make test-unit)Code Region:
pkg/workflow/mcp_config_validation.go📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
strict_mode_validation.go(566 lines) — Priority: Highexpression_validation.go(490 lines) — Priority: HighShort-term Actions (This Month)
safe_output_validation_config.go(412 lines) — Priority: Mediumrepository_features_validation.go(352 lines) — Priority: MediumLong-term Actions (This Quarter)
mcp_config_validation.go(326 lines) — Priority: Low*_validation.gofile exceeds 300 lines to prevent future regressions📈 Success Metrics
References:
Beta Was this translation helpful? Give feedback.
All reactions