@paths.design/caws-cli 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/budget-derivation.js +5 -4
- package/dist/commands/diagnose.js +26 -20
- package/dist/commands/init.js +72 -5
- package/dist/commands/specs.js +40 -1
- package/dist/commands/status.js +2 -2
- package/dist/commands/templates.js +10 -0
- package/dist/commands/tool.js +2 -3
- package/dist/commands/validate.js +12 -0
- package/dist/config/index.js +17 -8
- package/dist/generators/working-spec.js +42 -9
- package/dist/index.js +3 -1
- package/dist/scaffold/cursor-hooks.js +10 -2
- package/dist/scaffold/git-hooks.js +189 -32
- package/dist/scaffold/index.js +105 -17
- package/dist/templates/.caws/tools/README.md +20 -0
- package/dist/templates/.cursor/README.md +311 -0
- package/dist/templates/.cursor/hooks/audit.sh +55 -0
- package/dist/templates/.cursor/hooks/block-dangerous.sh +83 -0
- package/dist/templates/.cursor/hooks/caws-quality-check.sh +52 -0
- package/dist/templates/.cursor/hooks/caws-scope-guard.sh +130 -0
- package/dist/templates/.cursor/hooks/caws-tool-validation.sh +121 -0
- package/dist/templates/.cursor/hooks/format.sh +38 -0
- package/dist/templates/.cursor/hooks/naming-check.sh +64 -0
- package/dist/templates/.cursor/hooks/scan-secrets.sh +46 -0
- package/dist/templates/.cursor/hooks/scope-guard.sh +52 -0
- package/dist/templates/.cursor/hooks/validate-spec.sh +83 -0
- package/dist/templates/.cursor/hooks.json +59 -0
- package/dist/templates/.cursor/rules/00-claims-verification.mdc +144 -0
- package/dist/templates/.cursor/rules/01-working-style.mdc +50 -0
- package/dist/templates/.cursor/rules/02-quality-gates.mdc +370 -0
- package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +33 -0
- package/dist/templates/.cursor/rules/04-logging-language-style.mdc +23 -0
- package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +23 -0
- package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +36 -0
- package/dist/templates/.cursor/rules/07-process-ops.mdc +20 -0
- package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +16 -0
- package/dist/templates/.cursor/rules/09-docstrings.mdc +89 -0
- package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +390 -0
- package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +385 -0
- package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +516 -0
- package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +588 -0
- package/dist/templates/.cursor/rules/README.md +148 -0
- package/dist/templates/.github/copilot/instructions.md +311 -0
- package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +5 -0
- package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +5 -0
- package/dist/templates/.vscode/launch.json +56 -0
- package/dist/templates/.vscode/settings.json +93 -0
- package/dist/templates/.windsurf/workflows/caws-guided-development.md +92 -0
- package/dist/templates/COMMIT_CONVENTIONS.md +86 -0
- package/dist/templates/OIDC_SETUP.md +300 -0
- package/dist/templates/agents.md +1047 -0
- package/dist/templates/codemod/README.md +1 -0
- package/dist/templates/codemod/test.js +93 -0
- package/dist/templates/docs/README.md +150 -0
- package/dist/templates/scripts/quality-gates/check-god-objects.js +146 -0
- package/dist/templates/scripts/quality-gates/run-quality-gates.js +50 -0
- package/dist/templates/scripts/v3/analysis/todo_analyzer.py +1997 -0
- package/dist/tool-loader.js +6 -1
- package/dist/tool-validator.js +8 -2
- package/dist/utils/detection.js +34 -6
- package/dist/utils/git-lock.js +118 -0
- package/dist/utils/gitignore-updater.js +148 -0
- package/dist/utils/quality-gates.js +47 -7
- package/dist/utils/spec-resolver.js +23 -3
- package/dist/utils/yaml-validation.js +155 -0
- package/dist/validation/spec-validation.js +105 -2
- package/package.json +2 -2
- package/templates/.caws/schemas/waivers.schema.json +30 -0
- package/templates/.caws/schemas/working-spec.schema.json +133 -0
- package/templates/.caws/templates/working-spec.template.yml +74 -0
- package/templates/.caws/tools/README.md +20 -0
- package/templates/.caws/tools/scope-guard.js +208 -0
- package/templates/.caws/tools-allow.json +331 -0
- package/templates/.caws/waivers.yml +19 -0
- package/templates/.cursor/hooks/scope-guard.sh +2 -2
- package/templates/.cursor/hooks/validate-spec.sh +42 -7
- package/templates/apps/tools/caws/COMPLETION_REPORT.md +0 -331
- package/templates/apps/tools/caws/MIGRATION_SUMMARY.md +0 -360
- package/templates/apps/tools/caws/README.md +0 -463
- package/templates/apps/tools/caws/TEST_STATUS.md +0 -365
- package/templates/apps/tools/caws/attest.js +0 -357
- package/templates/apps/tools/caws/ci-optimizer.js +0 -642
- package/templates/apps/tools/caws/config.ts +0 -245
- package/templates/apps/tools/caws/cross-functional.js +0 -876
- package/templates/apps/tools/caws/dashboard.js +0 -1112
- package/templates/apps/tools/caws/flake-detector.ts +0 -362
- package/templates/apps/tools/caws/gates.js +0 -198
- package/templates/apps/tools/caws/gates.ts +0 -271
- package/templates/apps/tools/caws/language-adapters.ts +0 -381
- package/templates/apps/tools/caws/language-support.d.ts +0 -367
- package/templates/apps/tools/caws/language-support.d.ts.map +0 -1
- package/templates/apps/tools/caws/language-support.js +0 -585
- package/templates/apps/tools/caws/legacy-assessment.ts +0 -408
- package/templates/apps/tools/caws/legacy-assessor.js +0 -764
- package/templates/apps/tools/caws/mutant-analyzer.js +0 -734
- package/templates/apps/tools/caws/perf-budgets.ts +0 -349
- package/templates/apps/tools/caws/prompt-lint.js.backup +0 -274
- package/templates/apps/tools/caws/property-testing.js +0 -707
- package/templates/apps/tools/caws/provenance.d.ts +0 -14
- package/templates/apps/tools/caws/provenance.d.ts.map +0 -1
- package/templates/apps/tools/caws/provenance.js +0 -132
- package/templates/apps/tools/caws/provenance.js.backup +0 -73
- package/templates/apps/tools/caws/provenance.ts +0 -211
- package/templates/apps/tools/caws/security-provenance.ts +0 -483
- package/templates/apps/tools/caws/shared/base-tool.ts +0 -281
- package/templates/apps/tools/caws/shared/config-manager.ts +0 -366
- package/templates/apps/tools/caws/shared/gate-checker.ts +0 -849
- package/templates/apps/tools/caws/shared/types.ts +0 -444
- package/templates/apps/tools/caws/shared/validator.ts +0 -305
- package/templates/apps/tools/caws/shared/waivers-manager.ts +0 -174
- package/templates/apps/tools/caws/spec-test-mapper.ts +0 -391
- package/templates/apps/tools/caws/test-quality.js +0 -578
- package/templates/apps/tools/caws/validate.js +0 -76
- package/templates/apps/tools/caws/validate.ts +0 -228
- package/templates/apps/tools/caws/waivers.js +0 -344
- /package/{templates/apps/tools/caws → dist/templates/.caws}/schemas/waivers.schema.json +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/schemas/working-spec.schema.json +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/templates/working-spec.template.yml +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws/tools}/scope-guard.js +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/tools-allow.json +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/waivers.yml +0 -0
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
## CAWS (Code Assessment Workflow System) Tools
|
|
2
|
-
|
|
3
|
-
A comprehensive suite of tools for code quality assessment, compliance checking, and trust scoring integrated into your development workflow.
|
|
4
|
-
|
|
5
|
-
## 🎯 Overview
|
|
6
|
-
|
|
7
|
-
CAWS provides automated quality gates, performance monitoring, test variance detection, and spec-to-test traceability to ensure high-quality code delivery.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 📦 Architecture
|
|
12
|
-
|
|
13
|
-
### Shared Components (`shared/`)
|
|
14
|
-
|
|
15
|
-
All CAWS tools are built on a unified architecture with shared utilities:
|
|
16
|
-
|
|
17
|
-
- **`base-tool.ts`** - Base class providing common functionality
|
|
18
|
-
- **`types.ts`** - Centralized type definitions
|
|
19
|
-
- **`validator.ts`** - Validation utilities
|
|
20
|
-
- **`config-manager.ts`** - Configuration management
|
|
21
|
-
- **`gate-checker.ts`** - Gate checking logic
|
|
22
|
-
- **`waivers-manager.ts`** - Waivers management
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 🔧 Core Tools
|
|
27
|
-
|
|
28
|
-
### Quality Gates
|
|
29
|
-
|
|
30
|
-
#### `gates.js`
|
|
31
|
-
|
|
32
|
-
Basic gate enforcement for coverage, mutation, trust score, and budget.
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
node gates.js tier 2
|
|
36
|
-
node gates.js coverage 0.85
|
|
37
|
-
node gates.js mutation 0.60
|
|
38
|
-
node gates.js trust 85
|
|
39
|
-
node gates.js budget 20 800
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
#### `validate.js`
|
|
43
|
-
|
|
44
|
-
Validates working specifications and project structure.
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
node validate.js .caws/working-spec.yaml
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Provenance & Attestations
|
|
51
|
-
|
|
52
|
-
#### `provenance.js`
|
|
53
|
-
|
|
54
|
-
Generates provenance information for CAWS projects.
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
node provenance.js
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
#### `attest.js`
|
|
61
|
-
|
|
62
|
-
Generates SBOM and SLSA-style attestations.
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
node attest.js /path/to/project .agent
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## 🚀 Advanced Tools
|
|
71
|
-
|
|
72
|
-
### Flake Detection
|
|
73
|
-
|
|
74
|
-
#### `flake-detector.ts`
|
|
75
|
-
|
|
76
|
-
Monitors test variance and quarantines flaky tests automatically.
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npx tsx flake-detector.ts detect
|
|
80
|
-
npx tsx flake-detector.ts quarantine "test name"
|
|
81
|
-
npx tsx flake-detector.ts release "test name"
|
|
82
|
-
npx tsx flake-detector.ts status
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Features:**
|
|
86
|
-
|
|
87
|
-
- Analyzes test run variance
|
|
88
|
-
- Identifies intermittently failing tests
|
|
89
|
-
- Automatic quarantine based on flake rate threshold (15%)
|
|
90
|
-
- Tracks historical test data
|
|
91
|
-
- Variance score calculation
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
### Spec-to-Test Mapping
|
|
96
|
-
|
|
97
|
-
#### `spec-test-mapper.ts`
|
|
98
|
-
|
|
99
|
-
Links acceptance criteria to actual test cases for full traceability.
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npx tsx spec-test-mapper.ts report
|
|
103
|
-
npx tsx spec-test-mapper.ts save docs/spec-coverage.md
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
**Features:**
|
|
107
|
-
|
|
108
|
-
- Maps acceptance criteria to test files
|
|
109
|
-
- Generates coverage reports
|
|
110
|
-
- Identifies uncovered criteria
|
|
111
|
-
- Supports multiple test types (unit, integration, e2e, property-based)
|
|
112
|
-
- Keyword-based test discovery
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
### Performance Budget Validation
|
|
117
|
-
|
|
118
|
-
#### `perf-budgets.ts`
|
|
119
|
-
|
|
120
|
-
Validates API performance against working spec budgets.
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npx tsx perf-budgets.ts
|
|
124
|
-
npx tsx perf-budgets.ts --real-data
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
**Features:**
|
|
128
|
-
|
|
129
|
-
- Validates p95 latency against budgets
|
|
130
|
-
- Supports mock and real performance data
|
|
131
|
-
- Per-endpoint tracking
|
|
132
|
-
- Deviation percentage reporting
|
|
133
|
-
- CI/CD integration
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
### Configuration Management
|
|
138
|
-
|
|
139
|
-
#### `config.ts`
|
|
140
|
-
|
|
141
|
-
Comprehensive configuration management with YAML import/export.
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
npx tsx config.ts get
|
|
145
|
-
npx tsx config.ts get gates
|
|
146
|
-
npx tsx config.ts set gates.coverage.enabled false
|
|
147
|
-
npx tsx config.ts export > config.yaml
|
|
148
|
-
npx tsx config.ts import config.yaml
|
|
149
|
-
npx tsx config.ts features
|
|
150
|
-
npx tsx config.ts paths
|
|
151
|
-
npx tsx config.ts gates
|
|
152
|
-
npx tsx config.ts tools
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
**Features:**
|
|
156
|
-
|
|
157
|
-
- Get/set configuration values
|
|
158
|
-
- Import/export YAML
|
|
159
|
-
- Section-specific views
|
|
160
|
-
- Feature flag management
|
|
161
|
-
- Path configuration
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
### Waivers Management
|
|
166
|
-
|
|
167
|
-
#### `waivers.js`
|
|
168
|
-
|
|
169
|
-
Manages time-boxed waivers for quality gates.
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
node waivers.js create HOTFIX-001 "Urgent fix" "mutation,coverage" urgent_fix "senior-dev" 3
|
|
173
|
-
node waivers.js list
|
|
174
|
-
node waivers.js check PROJECT-123 mutation
|
|
175
|
-
node waivers.js cleanup
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
**Features:**
|
|
179
|
-
|
|
180
|
-
- Time-boxed exemptions
|
|
181
|
-
- Multiple gate support
|
|
182
|
-
- Approval tracking
|
|
183
|
-
- Automatic expiry
|
|
184
|
-
- Project-specific waivers
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## 📊 Test Quality Tools
|
|
189
|
-
|
|
190
|
-
### `test-quality.js`
|
|
191
|
-
|
|
192
|
-
Analyzes test meaningfulness beyond coverage.
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
node test-quality.js analyze tests .caws/working-spec.yaml
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
**Checks:**
|
|
199
|
-
|
|
200
|
-
- Meaningful assertions
|
|
201
|
-
- Spec coverage
|
|
202
|
-
- Property-based tests
|
|
203
|
-
- Edge case coverage
|
|
204
|
-
- Weak test detection
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
### `property-testing.js`
|
|
209
|
-
|
|
210
|
-
Property-based testing utilities.
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
### `mutant-analyzer.js`
|
|
215
|
-
|
|
216
|
-
Analyzes mutation testing results.
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## 🌍 Multi-Language Support
|
|
221
|
-
|
|
222
|
-
### `language-adapters.ts`
|
|
223
|
-
|
|
224
|
-
Adapts CAWS to different programming languages with language-specific tools and thresholds.
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
npx tsx language-adapters.ts detect
|
|
228
|
-
npx tsx language-adapters.ts list
|
|
229
|
-
npx tsx language-adapters.ts config python
|
|
230
|
-
npx tsx language-adapters.ts tier rust 2
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
**Supported Languages:**
|
|
234
|
-
|
|
235
|
-
- **TypeScript/JavaScript** - vitest, stryker, pact, eslint
|
|
236
|
-
- **Python** - pytest, mutmut, schemathesis, ruff
|
|
237
|
-
- **Rust** - cargo test/tarpaulin/mutants/clippy
|
|
238
|
-
- **Go** - go test, golangci-lint
|
|
239
|
-
- **Java** - maven (jacoco, pitest, pact, checkstyle)
|
|
240
|
-
|
|
241
|
-
**Features:**
|
|
242
|
-
|
|
243
|
-
- Auto-detect project language
|
|
244
|
-
- Language-specific tool configurations
|
|
245
|
-
- Adjusted tier policies per language
|
|
246
|
-
- Fallback strategies for unavailable tools
|
|
247
|
-
- Tool availability checking
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
## 🔒 Security & Compliance
|
|
252
|
-
|
|
253
|
-
### `security-provenance.ts`
|
|
254
|
-
|
|
255
|
-
Cryptographic signing, SLSA attestations, and security scanning.
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
npx tsx security-provenance.ts sign .agent/provenance.json
|
|
259
|
-
npx tsx security-provenance.ts verify .agent/provenance.json <signature>
|
|
260
|
-
npx tsx security-provenance.ts scan .
|
|
261
|
-
npx tsx security-provenance.ts slsa <commit-hash>
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**Features:**
|
|
265
|
-
|
|
266
|
-
- Cryptographic artifact signing
|
|
267
|
-
- Signature verification
|
|
268
|
-
- Model provenance tracking
|
|
269
|
-
- Prompt hashing for audit trails
|
|
270
|
-
- Secret scanning
|
|
271
|
-
- SAST integration placeholder
|
|
272
|
-
- Dependency scanning
|
|
273
|
-
- SLSA attestation generation
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
### `prompt-lint.js`
|
|
278
|
-
|
|
279
|
-
Validates prompts for secrets and tool allowlisting.
|
|
280
|
-
|
|
281
|
-
**Features:**
|
|
282
|
-
|
|
283
|
-
- Secret pattern detection
|
|
284
|
-
- Tool allowlist validation
|
|
285
|
-
- Provenance hashing
|
|
286
|
-
|
|
287
|
-
---
|
|
288
|
-
|
|
289
|
-
## 📊 Legacy Code Migration
|
|
290
|
-
|
|
291
|
-
### `legacy-assessment.ts`
|
|
292
|
-
|
|
293
|
-
Assess legacy code for CAWS migration and generate phased migration plans.
|
|
294
|
-
|
|
295
|
-
```bash
|
|
296
|
-
npx tsx legacy-assessment.ts assess src/auth
|
|
297
|
-
npx tsx legacy-assessment.ts plan .
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
**Features:**
|
|
301
|
-
|
|
302
|
-
- Complexity analysis (cyclomatic complexity)
|
|
303
|
-
- Current coverage assessment
|
|
304
|
-
- Change frequency analysis
|
|
305
|
-
- Dependency analysis
|
|
306
|
-
- Recommended tier inference
|
|
307
|
-
- Migration priority calculation
|
|
308
|
-
- Quick wins identification
|
|
309
|
-
- Effort estimation
|
|
310
|
-
- Phased migration plan generation
|
|
311
|
-
- Critical path identification
|
|
312
|
-
|
|
313
|
-
**Assessment Metrics:**
|
|
314
|
-
|
|
315
|
-
- **Complexity** - Average cyclomatic complexity per file
|
|
316
|
-
- **Coverage** - Current test coverage percentage
|
|
317
|
-
- **Change Frequency** - How often the module changes
|
|
318
|
-
- **Dependencies** - Average imports per file
|
|
319
|
-
- **Recommended Tier** - Suggested CAWS tier based on risk
|
|
320
|
-
- **Migration Priority** - High/Medium/Low priority
|
|
321
|
-
- **Estimated Effort** - Small (2 days), Medium (5 days), Large (10 days)
|
|
322
|
-
|
|
323
|
-
---
|
|
324
|
-
|
|
325
|
-
## 📋 Configuration
|
|
326
|
-
|
|
327
|
-
### Default Configuration Structure
|
|
328
|
-
|
|
329
|
-
```json
|
|
330
|
-
{
|
|
331
|
-
"version": "1.0.0",
|
|
332
|
-
"environment": "development",
|
|
333
|
-
"gates": {
|
|
334
|
-
"coverage": {
|
|
335
|
-
"enabled": true,
|
|
336
|
-
"thresholds": {
|
|
337
|
-
"statements": 80,
|
|
338
|
-
"branches": 75,
|
|
339
|
-
"functions": 80,
|
|
340
|
-
"lines": 80
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
"mutation": {
|
|
344
|
-
"enabled": true,
|
|
345
|
-
"thresholds": {
|
|
346
|
-
"killed": 70,
|
|
347
|
-
"survived": 30
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
"contracts": {
|
|
351
|
-
"enabled": true,
|
|
352
|
-
"required": true
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
"tiers": {
|
|
356
|
-
"1": {
|
|
357
|
-
"min_branch": 0.9,
|
|
358
|
-
"min_coverage": 0.9,
|
|
359
|
-
"min_mutation": 0.8,
|
|
360
|
-
"requires_contracts": true
|
|
361
|
-
},
|
|
362
|
-
"2": {
|
|
363
|
-
"min_branch": 0.8,
|
|
364
|
-
"min_coverage": 0.8,
|
|
365
|
-
"min_mutation": 0.7,
|
|
366
|
-
"requires_contracts": true
|
|
367
|
-
},
|
|
368
|
-
"3": {
|
|
369
|
-
"min_branch": 0.7,
|
|
370
|
-
"min_coverage": 0.7,
|
|
371
|
-
"min_mutation": 0.6,
|
|
372
|
-
"requires_contracts": false
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## 🎯 Tier Policies
|
|
381
|
-
|
|
382
|
-
| Tier | Branch Coverage | Mutation Score | Contracts | Manual Review |
|
|
383
|
-
| ---- | --------------- | -------------- | --------- | ------------- |
|
|
384
|
-
| 1 | ≥90% | ≥80% | Required | Required |
|
|
385
|
-
| 2 | ≥80% | ≥70% | Required | Optional |
|
|
386
|
-
| 3 | ≥70% | ≥60% | Optional | Optional |
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
## 🔄 Workflow Integration
|
|
391
|
-
|
|
392
|
-
### Pre-commit Hook
|
|
393
|
-
|
|
394
|
-
```bash
|
|
395
|
-
#!/bin/bash
|
|
396
|
-
# .git/hooks/pre-commit
|
|
397
|
-
|
|
398
|
-
# Run CAWS quality gates
|
|
399
|
-
npx tsx apps/tools/caws/flake-detector.ts detect
|
|
400
|
-
npx tsx apps/tools/caws/spec-test-mapper.ts report
|
|
401
|
-
node apps/tools/caws/gates.js coverage 2
|
|
402
|
-
node apps/tools/caws/gates.js mutation 2
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
### CI/CD Pipeline
|
|
406
|
-
|
|
407
|
-
```yaml
|
|
408
|
-
# .github/workflows/caws.yml
|
|
409
|
-
name: CAWS Quality Gates
|
|
410
|
-
|
|
411
|
-
on: [push, pull_request]
|
|
412
|
-
|
|
413
|
-
jobs:
|
|
414
|
-
quality:
|
|
415
|
-
runs-on: ubuntu-latest
|
|
416
|
-
steps:
|
|
417
|
-
- uses: actions/checkout@v2
|
|
418
|
-
- name: Run CAWS Gates
|
|
419
|
-
run: |
|
|
420
|
-
npm test -- --coverage
|
|
421
|
-
npx tsx apps/tools/caws/flake-detector.ts detect
|
|
422
|
-
npx tsx apps/tools/caws/perf-budgets.ts
|
|
423
|
-
node apps/tools/caws/gates.js tier 2
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
---
|
|
427
|
-
|
|
428
|
-
## 📚 Documentation
|
|
429
|
-
|
|
430
|
-
- [Hooks & Agent Workflows Guide](../../docs/guides/hooks-and-agent-workflows.md)
|
|
431
|
-
- [Hook Strategy](../../docs/HOOK_STRATEGY.md)
|
|
432
|
-
- [Developer Guide](../../docs/caws-developer-guide.md)
|
|
433
|
-
- [API Documentation](../../docs/api/)
|
|
434
|
-
|
|
435
|
-
---
|
|
436
|
-
|
|
437
|
-
## 🤝 Contributing
|
|
438
|
-
|
|
439
|
-
When adding new CAWS tools:
|
|
440
|
-
|
|
441
|
-
1. **Extend CawsBaseTool** - Use the shared base class
|
|
442
|
-
2. **Use shared types** - Import from `shared/types.ts`
|
|
443
|
-
3. **Leverage validators** - Use `CawsValidator`
|
|
444
|
-
4. **Utilize config manager** - Use `CawsConfigManager`
|
|
445
|
-
5. **Follow gate checker** - Use `CawsGateChecker`
|
|
446
|
-
|
|
447
|
-
---
|
|
448
|
-
|
|
449
|
-
## 📝 License
|
|
450
|
-
|
|
451
|
-
Part of the CAWS project - see main project LICENSE
|
|
452
|
-
|
|
453
|
-
---
|
|
454
|
-
|
|
455
|
-
## 🙏 Credits
|
|
456
|
-
|
|
457
|
-
**Author:** @darianrosebrook
|
|
458
|
-
|
|
459
|
-
Built with insights from production CAWS implementations in:
|
|
460
|
-
|
|
461
|
-
- obsidian-rag project
|
|
462
|
-
- Animator project
|
|
463
|
-
- Portfolio project
|