Objective
Create a weekly workflow that analyzes test coverage, identifies under-tested code paths (especially security-critical areas), and creates PRs with additional tests.
Context
Current test coverage is 75-80% (per COVERAGE_SUMMARY.md). As a security-critical firewall tool, untested code paths represent potential security vulnerabilities. We need comprehensive test coverage, especially for:
- iptables manipulation (NET_ADMIN capability usage)
- Squid ACL rule generation and domain pattern validation
- Container security (capability dropping, seccomp profiles)
- Domain validation and pattern matching
Approach
- Create workflow file:
.github/workflows/test-coverage-improver.md
- Configure triggers:
- Weekly schedule
- Manual workflow_dispatch
- Analyze current coverage:
- Run
npm run test:coverage to generate coverage report
- Parse coverage data to identify under-tested files
- Focus on security-critical modules (see priority areas below)
- Identify test gaps:
- Functions with <80% branch coverage
- Error handling paths not covered
- Edge cases in domain pattern validation
- iptables rule failure scenarios
- Create PR with tests:
- ONE PR per week (max: 1)
- Focus on highest-impact security-critical code
- Include unit tests and integration tests as appropriate
- Ensure new tests pass in CI
Files to Create/Modify
Priority Areas (Security-Critical)
-
iptables management
src/host-iptables.ts - Host iptables rule manipulation
containers/agent/setup-iptables.sh - Container iptables setup
- Focus: Rule validation, error handling, cleanup
-
Squid configuration
src/squid-config.ts - ACL rules, domain patterns
- Focus: Domain pattern edge cases, wildcard handling, malicious input
-
Container security
src/docker-manager.ts - Capability dropping, seccomp
- Focus: Capability verification, privilege escalation prevention
-
Domain validation
src/domain-patterns.ts - Wildcard patterns, protocol handling
- Focus: Pattern matching edge cases, injection prevention
Test Requirements
- Unit tests for security-critical functions (isolation)
- Integration tests for Docker/networking interactions
- Edge cases: empty inputs, malformed data, injection attempts
- Error handling: iptables failures, network conflicts, container crashes
- Security verification: capability dropping, privilege checks
Acceptance Criteria
Success Metrics
AI generated by Plan Command for discussion #328
Objective
Create a weekly workflow that analyzes test coverage, identifies under-tested code paths (especially security-critical areas), and creates PRs with additional tests.
Context
Current test coverage is 75-80% (per COVERAGE_SUMMARY.md). As a security-critical firewall tool, untested code paths represent potential security vulnerabilities. We need comprehensive test coverage, especially for:
Approach
.github/workflows/test-coverage-improver.mdnpm run test:coverageto generate coverage reportFiles to Create/Modify
.github/workflows/test-coverage-improver.mdPriority Areas (Security-Critical)
iptables management
src/host-iptables.ts- Host iptables rule manipulationcontainers/agent/setup-iptables.sh- Container iptables setupSquid configuration
src/squid-config.ts- ACL rules, domain patternsContainer security
src/docker-manager.ts- Capability dropping, seccompDomain validation
src/domain-patterns.ts- Wildcard patterns, protocol handlingTest Requirements
Acceptance Criteria
Success Metrics
Related to [plan] Enhance agentic workflow maturity to Level 4 (Optimized) #332