Objective
Add a check-validator-sizes Makefile target that enforces the 300-line hard limit for validator files documented in AGENTS.md, and integrate it into the CI/lint chain.
Context
From discussion #21398 (Repository Quality Improvement Report - Validator File Size Compliance). The 300-line hard limit is documented in AGENTS.md but has no automated enforcement. A lightweight check in the Makefile would prevent future regressions after the current violations (Tasks 1–3) are fixed.
Approach
Add the following target to the Makefile:
## check-validator-sizes: Verify validator files do not exceed 300 lines (AGENTS.md hard limit)
check-validator-sizes:
`@echo` "Checking validator file sizes..."
`@violations`=$$(find ./pkg -type f -name "*valid*.go" ! -name "*_test.go" -exec wc -l {} \; | awk '$$1 > 300 {print $$1, $$2}' | sort -rn); \
if [ -n "$$violations" ]; then \
echo "❌ Validator files exceeding 300-line limit (AGENTS.md §Validation Complexity Guidelines):"; \
echo "$$violations"; \
exit 1; \
else \
echo "✅ All validator files within 300-line limit"; \
fi
Then add check-validator-sizes to the lint target's dependencies (or to agent-finish) so it runs automatically.
Important: This task should be completed after the split tasks (Split expression_validation.go, Split strict_mode_validation.go, Split permissions_validation.go) have merged, so the check passes on the first run in CI.
Files to Modify
- Update:
Makefile — add check-validator-sizes target and wire it into lint or agent-finish
Acceptance Criteria
Generated by Plan Command for issue #discussion #21398 · ◷
Objective
Add a
check-validator-sizesMakefile target that enforces the 300-line hard limit for validator files documented in AGENTS.md, and integrate it into the CI/lint chain.Context
From discussion #21398 (Repository Quality Improvement Report - Validator File Size Compliance). The 300-line hard limit is documented in AGENTS.md but has no automated enforcement. A lightweight check in the Makefile would prevent future regressions after the current violations (Tasks 1–3) are fixed.
Approach
Add the following target to the
Makefile:Then add
check-validator-sizesto thelinttarget's dependencies (or toagent-finish) so it runs automatically.Important: This task should be completed after the split tasks (Split expression_validation.go, Split strict_mode_validation.go, Split permissions_validation.go) have merged, so the check passes on the first run in CI.
Files to Modify
Makefile— addcheck-validator-sizestarget and wire it intolintoragent-finishAcceptance Criteria
make check-validator-sizestarget exists and worksmake lintormake agent-finish