@paths.design/caws-cli 10.0.1 → 10.1.0
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/README.md +13 -5
- package/dist/budget-derivation.js +221 -74
- package/dist/commands/evaluate.js +26 -12
- package/dist/commands/gates.js +31 -4
- package/dist/commands/init.js +7 -4
- package/dist/commands/iterate.js +7 -3
- package/dist/commands/scope.js +264 -0
- package/dist/commands/sidecar.js +6 -3
- package/dist/commands/specs.js +148 -1
- package/dist/commands/status.js +8 -4
- package/dist/commands/templates.js +0 -8
- package/dist/commands/validate.js +34 -13
- package/dist/commands/verify-acs.js +25 -10
- package/dist/commands/waivers.js +147 -5
- package/dist/commands/worktree.js +81 -1
- package/dist/gates/budget-limit.js +6 -1
- package/dist/gates/spec-completeness.js +8 -1
- package/dist/index.js +27 -0
- package/dist/policy/PolicyManager.js +9 -7
- package/dist/session/session-manager.js +34 -0
- package/dist/templates/.caws/schemas/policy.schema.json +96 -34
- package/dist/templates/.caws/schemas/scope.schema.json +3 -3
- package/dist/templates/.caws/schemas/waivers.schema.json +91 -21
- package/dist/templates/.caws/schemas/working-spec.schema.json +253 -89
- package/dist/templates/.caws/templates/working-spec.template.yml +3 -1
- package/dist/templates/.caws/tools/scope-guard.js +66 -15
- package/dist/templates/.claude/README.md +1 -1
- package/dist/templates/.claude/hooks/protected-paths.sh +39 -0
- package/dist/templates/.claude/hooks/scope-guard.sh +106 -27
- package/dist/templates/.claude/hooks/worktree-write-guard.sh +96 -3
- package/dist/templates/.claude/settings.json +5 -0
- package/dist/templates/CLAUDE.md +34 -0
- package/dist/templates/agents.md +21 -0
- package/dist/utils/event-log.js +584 -0
- package/dist/utils/event-renderer.js +521 -0
- package/dist/utils/schema-validator.js +10 -2
- package/dist/utils/working-state.js +25 -0
- package/dist/validation/spec-validation.js +99 -9
- package/dist/waivers-manager.js +84 -0
- package/dist/worktree/worktree-manager.js +214 -8
- package/package.json +5 -4
- package/templates/.caws/schemas/policy.schema.json +96 -34
- package/templates/.caws/schemas/scope.schema.json +3 -3
- package/templates/.caws/schemas/waivers.schema.json +91 -21
- package/templates/.caws/schemas/working-spec.schema.json +253 -89
- package/templates/.caws/templates/working-spec.template.yml +3 -1
- package/templates/.caws/tools/scope-guard.js +66 -15
- package/templates/.claude/README.md +1 -1
- package/templates/.claude/hooks/protected-paths.sh +39 -0
- package/templates/.claude/hooks/scope-guard.sh +106 -27
- package/templates/.claude/hooks/worktree-write-guard.sh +96 -3
- package/templates/.claude/settings.json +5 -0
- package/templates/CLAUDE.md +34 -0
- package/templates/agents.md +21 -0
|
@@ -1,50 +1,112 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
3
|
-
"title": "CAWS Policy",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
3
|
"type": "object",
|
|
5
|
-
"required": [
|
|
4
|
+
"required": [
|
|
5
|
+
"version",
|
|
6
|
+
"risk_tiers",
|
|
7
|
+
"edit_rules"
|
|
8
|
+
],
|
|
6
9
|
"properties": {
|
|
7
|
-
"version": {
|
|
10
|
+
"version": {
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"enum": [
|
|
13
|
+
1
|
|
14
|
+
],
|
|
15
|
+
"description": "Policy schema version"
|
|
16
|
+
},
|
|
8
17
|
"risk_tiers": {
|
|
9
18
|
"type": "object",
|
|
10
|
-
"
|
|
11
|
-
"1": {
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
"patternProperties": {
|
|
20
|
+
"^[1-3]$": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"required": [
|
|
23
|
+
"max_files",
|
|
24
|
+
"max_loc"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"max_files": {
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"minimum": 1,
|
|
30
|
+
"description": "Maximum files allowed for this risk tier"
|
|
31
|
+
},
|
|
32
|
+
"max_loc": {
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"minimum": 1,
|
|
35
|
+
"description": "Maximum lines of code allowed for this risk tier"
|
|
36
|
+
},
|
|
37
|
+
"description": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Human-readable description of the tier"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
}
|
|
14
44
|
},
|
|
15
|
-
"
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"description": "Risk tier definitions with budget limits"
|
|
16
47
|
},
|
|
17
48
|
"edit_rules": {
|
|
18
49
|
"type": "object",
|
|
50
|
+
"required": [
|
|
51
|
+
"policy_and_code_same_pr",
|
|
52
|
+
"min_approvers_for_budget_raise"
|
|
53
|
+
],
|
|
19
54
|
"properties": {
|
|
20
|
-
"policy_and_code_same_pr": {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
55
|
+
"policy_and_code_same_pr": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"description": "Whether policy and code changes can be in the same PR"
|
|
58
|
+
},
|
|
59
|
+
"min_approvers_for_budget_raise": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 1,
|
|
62
|
+
"description": "Minimum approvers required for budget increases"
|
|
63
|
+
},
|
|
64
|
+
"require_signed_commits": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"description": "Whether signed commits are required for policy changes"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"description": "Rules governing policy file edits"
|
|
24
71
|
},
|
|
25
72
|
"gates": {
|
|
26
73
|
"type": "object",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
74
|
+
"patternProperties": {
|
|
75
|
+
"^.*$": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"required": [
|
|
78
|
+
"enabled"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"enabled": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "Whether this gate is active"
|
|
84
|
+
},
|
|
85
|
+
"mode": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"enum": [
|
|
88
|
+
"warn",
|
|
89
|
+
"block",
|
|
90
|
+
"skip"
|
|
91
|
+
],
|
|
92
|
+
"description": "How the gate reports failures: warn, block, or skip entirely"
|
|
93
|
+
},
|
|
94
|
+
"description": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Human-readable description of the gate"
|
|
97
|
+
},
|
|
98
|
+
"thresholds": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"description": "Gate-specific thresholds (e.g. warning/critical limits)"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"description": "Quality gate configurations"
|
|
37
108
|
}
|
|
38
109
|
},
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
"type": "object",
|
|
42
|
-
"required": ["max_files", "max_loc"],
|
|
43
|
-
"properties": {
|
|
44
|
-
"max_files": { "type": "integer", "minimum": 1 },
|
|
45
|
-
"max_loc": { "type": "integer", "minimum": 1 },
|
|
46
|
-
"description": { "type": "string" }
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"title": "CAWS Policy"
|
|
50
112
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "CAWS Lite Scope Configuration",
|
|
4
|
-
"description": "Scope configuration for CAWS lite mode — guardrails without YAML specs",
|
|
4
|
+
"description": "Scope configuration for CAWS lite mode — guardrails without YAML specs. This schema governs the standalone .caws/scope.json file ONLY; inline scope: blocks inside working-spec.yaml or feature specs are governed by the working-spec schema's scope sub-schema and do NOT invoke this schema. See CAWSFIX-11.",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"required": ["
|
|
6
|
+
"required": ["allowedDirectories"],
|
|
7
7
|
"properties": {
|
|
8
8
|
"version": {
|
|
9
9
|
"type": "integer",
|
|
10
10
|
"const": 1,
|
|
11
|
-
"description": "Schema version"
|
|
11
|
+
"description": "Schema version. Optional for back-compat with scope.json files that predate versioning; the runtime (src/config/lite-scope.js) defaults to 1 when missing. If present, must be exactly 1. CAWSFIX-11 lifted `version` from the required list because no code path enforces a version mismatch — only the schema did, producing spurious warnings for pre-versioning scope.json files."
|
|
12
12
|
},
|
|
13
13
|
"allowedDirectories": {
|
|
14
14
|
"type": "array",
|
|
@@ -1,36 +1,106 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "CAWS Waiver",
|
|
4
4
|
"description": "Individual waiver file created by caws waivers create",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"required": ["id", "
|
|
6
|
+
"required": ["id", "applies_to", "gates", "delta", "reason_code", "expires_at", "risk_owner", "approvers", "status"],
|
|
7
7
|
"properties": {
|
|
8
|
-
"id": {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"pattern": "^WV-\\d{4}$",
|
|
11
|
+
"description": "Waiver ID in format WV-XXXX"
|
|
12
|
+
},
|
|
13
|
+
"applies_to": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Spec ID or PR number this waiver applies to"
|
|
16
|
+
},
|
|
12
17
|
"gates": {
|
|
13
18
|
"type": "array",
|
|
14
|
-
"items": {
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["budget_limit", "spec_completeness", "contract_compliance", "coverage_threshold", "mutation_threshold", "security_scan", "accessibility_check", "performance_budget", "scope_boundary"]
|
|
22
|
+
},
|
|
23
|
+
"minItems": 1,
|
|
24
|
+
"description": "Quality gates to waive"
|
|
25
|
+
},
|
|
26
|
+
"delta": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"description": "Additive budget deltas (only positive values allowed)",
|
|
29
|
+
"properties": {
|
|
30
|
+
"max_files": {
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"minimum": 0,
|
|
33
|
+
"description": "Additional files allowed"
|
|
34
|
+
},
|
|
35
|
+
"max_loc": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"minimum": 0,
|
|
38
|
+
"description": "Additional lines of code allowed"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
},
|
|
43
|
+
"reason_code": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"enum": ["emergency_hotfix", "legacy_integration", "experimental_feature", "third_party_constraint", "performance_critical", "security_patch", "infrastructure_limitation", "architectural_refactor", "other"],
|
|
46
|
+
"description": "Controlled vocabulary for waiver reasons"
|
|
47
|
+
},
|
|
48
|
+
"description": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"minLength": 50,
|
|
51
|
+
"maxLength": 1000,
|
|
52
|
+
"description": "Detailed explanation of why waiver is needed"
|
|
53
|
+
},
|
|
54
|
+
"mitigation": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 50,
|
|
57
|
+
"description": "Plan to address the underlying issue"
|
|
58
|
+
},
|
|
59
|
+
"expires_at": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"format": "date-time",
|
|
62
|
+
"description": "ISO 8601 datetime when waiver expires"
|
|
63
|
+
},
|
|
64
|
+
"risk_owner": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "Person/entity responsible for managing this risk"
|
|
67
|
+
},
|
|
68
|
+
"approvers": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["handle"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"handle": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "GitHub handle or email of approver"
|
|
77
|
+
},
|
|
78
|
+
"approved_at": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"format": "date-time",
|
|
81
|
+
"description": "When this approval was given"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"additionalProperties": false
|
|
85
|
+
},
|
|
15
86
|
"minItems": 1,
|
|
16
|
-
"description": "
|
|
87
|
+
"description": "List of people who approved this waiver"
|
|
17
88
|
},
|
|
18
|
-
"created_at": { "type": "string" },
|
|
19
|
-
"expires_at": { "type": "string" },
|
|
20
|
-
"approved_by": { "type": "string" },
|
|
21
|
-
"impact_level": { "type": "string" },
|
|
22
|
-
"mitigation_plan": { "type": "string" },
|
|
23
89
|
"status": {
|
|
24
90
|
"type": "string",
|
|
25
|
-
"enum": ["active", "expired", "revoked"],
|
|
26
|
-
"
|
|
91
|
+
"enum": ["proposed", "active", "expired", "revoked"],
|
|
92
|
+
"description": "Current status of the waiver"
|
|
27
93
|
},
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
94
|
+
"metadata": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"properties": {
|
|
97
|
+
"related_pr": { "type": "string" },
|
|
98
|
+
"related_issue": { "type": "string" },
|
|
99
|
+
"environment": { "type": "string", "enum": ["development", "staging", "production"] },
|
|
100
|
+
"urgency": { "type": "string", "enum": ["low", "normal", "high", "critical"] }
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": false
|
|
103
|
+
}
|
|
34
104
|
},
|
|
35
105
|
"additionalProperties": false
|
|
36
106
|
}
|