forked from ambient-code/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamber-config.yml
More file actions
221 lines (185 loc) · 5.71 KB
/
Copy pathamber-config.yml
File metadata and controls
221 lines (185 loc) · 5.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# Amber Background Agent Configuration
# Defines autonomous action policies for different issue types
version: "1.0"
# Risk-based automation policies
automation_policies:
# LOW RISK: Auto-fix and create PR (no approval needed)
auto_fix:
enabled: true
branch_prefix: "amber/auto-fix"
pr_labels: ["auto-generated", "amber", "chore"]
require_tests_pass: true
categories:
- name: "Code Formatting"
patterns:
- "gofmt violations"
- "black formatting"
- "prettier issues"
- "unused imports (Go, Python)"
commands:
go: ["gofmt -w .", "goimports -w ."]
python: ["black .", "isort ."]
typescript: ["npm run format"]
- name: "Import Sorting"
patterns:
- "isort violations"
- "import order issues"
- name: "Documentation Fixes"
patterns:
- "broken internal links"
- "outdated code examples in comments"
- "missing docstrings for public functions"
max_files_per_pr: 5 # Avoid massive doc PRs
- name: "Dependency Patches"
patterns:
- "patch version updates (x.y.Z)"
- "security patches (dependabot alerts)"
require_ci_pass: true
auto_merge: false # Create PR but don't auto-merge
# MEDIUM RISK: Create detailed proposal (requires approval)
propose_for_approval:
enabled: true
action: "create_github_issue"
labels: ["amber-proposal", "needs-review"]
categories:
- name: "Refactoring"
patterns:
- "files exceeding 400 lines"
- "context.TODO() replacements"
- "repeated code patterns (DRY violations)"
proposal_template: |
## Refactoring Proposal (Amber)
**File:** {file_path}
**Current LOC:** {line_count}
**Issue:** {issue_description}
### Proposed Changes
{proposed_changes}
### Risk Assessment
- **Blast Radius:** {blast_radius}
- **Rollback Plan:** {rollback_plan}
- **Testing Strategy:** {testing_strategy}
### Before/After Structure
```
{structure_diff}
```
**Estimated Effort:** {effort_hours} hours
**Priority:** {priority}
---
*Generated by Amber Background Agent*
- name: "Test Coverage"
patterns:
- "missing contract tests"
- "untested error paths"
- "coverage below 60%"
action: "create_draft_pr"
include_test_skeleton: true
- name: "Security Improvements"
patterns:
- "missing input validation"
- "unhandled error returns"
- "hardcoded credentials (non-critical)"
labels: ["security", "amber-proposal", "needs-security-review"]
# HIGH RISK: Report only (manual decision required)
report_only:
enabled: true
action: "create_detailed_report"
notify_via: "github_issue"
labels: ["amber-alert", "requires-decision"]
categories:
- name: "Breaking Changes"
patterns:
- "API contract modifications"
- "database schema changes"
- "public interface breaking changes"
severity: "critical"
- name: "Security Vulnerabilities"
patterns:
- "authentication bypass potential"
- "SQL injection risk"
- "XSS vulnerabilities"
- "secrets exposure"
severity: "critical"
notify_team: "security"
- name: "Architectural Changes"
patterns:
- "new service introduction"
- "technology stack changes"
- "cross-component dependencies"
severity: "high"
require_rfc: true
# Constitution compliance checks
constitution_checks:
enabled: true
reference_file: "CLAUDE.md"
principles:
- id: "principle_v_modularity"
name: "Component Modularity"
check: "file_size_limit"
threshold: 400 # lines
action: "propose_for_approval"
- id: "principle_iii_context"
name: "Proper Context Usage"
check: "context_todo_usage"
pattern: "context.TODO()"
action: "propose_for_approval"
- id: "principle_iv_testing"
name: "Test Coverage"
check: "test_file_existence"
require_test_for:
- "**/handlers/*.go"
- "**/services/*.go"
action: "propose_for_approval"
- id: "principle_ii_auth"
name: "User-Scoped Auth"
check: "service_account_usage"
forbidden_pattern: "DynamicClient.*List|Get.*// user operation"
action: "report_only" # Security issue
# Monitoring & reporting
monitoring:
schedule:
daily:
- "check_recent_commits" # Last 24 hours
- "run_linting_checks"
- "verify_ci_status"
weekly:
- "full_codebase_health_check"
- "test_coverage_analysis"
- "dependency_audit"
monthly:
- "architecture_review"
- "technical_debt_assessment"
- "security_audit"
report_format: "markdown"
report_location: ".amber/reports/"
github_issues: true
# Integration settings
integrations:
github:
enabled: true
auto_label: true
create_issues: true
create_prs: true
ci_cd:
require_pass_before_merge: true
run_tests_on_auto_fix: true
notifications:
slack_webhook: null # Configure if desired
email: null
# Safety guardrails
safety:
max_auto_prs_per_day: 5
max_files_per_auto_pr: 10
require_review_for_auto_merge: true
never_push_to_main: true
always_create_branch: true
excluded_paths:
- ".git/"
- "vendor/"
- "node_modules/"
- "*.lock"
- "*.sum"
# Learning & improvement
learning:
track_false_positives: true
learn_from_rejected_proposals: true
adjust_thresholds_over_time: true