Skip to content

Commit 5982eb7

Browse files
committed
feat(forge): add TOML configuration files for validation system
1 parent 2030912 commit 5982eb7

4 files changed

Lines changed: 123 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Aggregator Agent Rules Configuration
2+
3+
[agent]
4+
id = "aggregator"
5+
name = "Result Aggregator"
6+
description = "Collects and summarizes all validation results"
7+
enabled = true
8+
# Always runs last
9+
priority = -1
10+
11+
[thresholds]
12+
# Maximum allowed errors before blocking
13+
max_errors = 0
14+
# Maximum allowed warnings
15+
max_warnings = 10
16+
# Require all agents to pass
17+
require_all_pass = true
18+
19+
[actions]
20+
# What to do when validation passes
21+
on_pass = "proceed"
22+
# What to do when validation fails
23+
on_fail = "block"
24+
# Generate summary report
25+
generate_report = true
26+
report_format = "markdown"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Quality Agent Rules Configuration
2+
3+
[agent]
4+
id = "quality"
5+
name = "Code Quality Validator"
6+
description = "Enforces code quality standards and best practices"
7+
enabled = true
8+
9+
[rules.todo_comments]
10+
enabled = true
11+
severity = "warning"
12+
description = "Find TODO/FIXME/HACK comments"
13+
patterns = ["TODO", "FIXME", "XXX", "HACK"]
14+
max_allowed = 0
15+
16+
[rules.unimplemented_code]
17+
enabled = true
18+
severity = "error"
19+
description = "Detect unimplemented!() and todo!() macros"
20+
21+
[rules.error_handling]
22+
enabled = true
23+
severity = "warning"
24+
description = "Check for unwrap() without context"
25+
allow_in_tests = true
26+
27+
[rules.dead_code]
28+
enabled = false # Often handled by compiler
29+
severity = "info"
30+
description = "Detect potentially unused code"
31+
32+
[rules.documentation]
33+
enabled = true
34+
severity = "info"
35+
description = "Check for missing documentation on public items"
36+
require_module_docs = true
37+
require_function_docs = true
38+
min_doc_length = 10
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Security Agent Rules Configuration
2+
3+
[agent]
4+
id = "security"
5+
name = "Security Validator"
6+
description = "Checks for security vulnerabilities and best practices"
7+
enabled = true
8+
9+
[rules.secrets_exposed]
10+
enabled = true
11+
severity = "error"
12+
description = "Detect hardcoded secrets and API keys"
13+
patterns = [
14+
"(?i)(api[_-]?key|apikey)\\s*[=:]\\s*['\"][^'\"]{8,}['\"]",
15+
"(?i)(secret|password|passwd|pwd)\\s*[=:]\\s*['\"][^'\"]+['\"]",
16+
"(?i)(token|bearer)\\s*[=:]\\s*['\"][^'\"]{16,}['\"]",
17+
]
18+
exclude_patterns = ["*.test.rs", "*_test.go", "*.spec.ts"]
19+
20+
[rules.dependencies_audit]
21+
enabled = true
22+
severity = "warning"
23+
description = "Check for known vulnerable dependencies"
24+
check_cargo_lock = true
25+
check_package_lock = true
26+
27+
[rules.unsafe_code]
28+
enabled = true
29+
severity = "warning"
30+
description = "Detect unsafe blocks without safety comments"
31+
require_safety_comment = true
32+
allowed_files = ["src/ffi/*.rs", "src/sys/*.rs"]
33+
34+
[rules.input_validation]
35+
enabled = true
36+
severity = "info"
37+
description = "Check for proper input validation patterns"

.cortex/forge/forge.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Forge Orchestration Configuration
2+
3+
[global]
4+
# Maximum parallel agent executions
5+
max_parallel = 4
6+
# Timeout for each agent in seconds
7+
timeout_seconds = 300
8+
# Stop on first failure
9+
fail_fast = false
10+
# Output format: "json", "pretty", "minimal"
11+
output_format = "pretty"
12+
13+
[agents]
14+
# Enable/disable specific agents
15+
security = true
16+
quality = true
17+
aggregator = true
18+
19+
# Agent execution order and dependencies
20+
[dependencies]
21+
# aggregator runs after security and quality complete
22+
aggregator = ["security", "quality"]

0 commit comments

Comments
 (0)