@paths.design/caws-cli 5.1.0 → 6.0.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.
Files changed (110) hide show
  1. package/package.json +1 -1
  2. package/templates/.cursor/hooks/block-dangerous.sh +8 -2
  3. package/templates/.cursor/rules/README.md +5 -7
  4. package/templates/scripts/v3/analysis/todo_analyzer.py +48 -1
  5. package/dist/budget-derivation.d.ts +0 -74
  6. package/dist/budget-derivation.d.ts.map +0 -1
  7. package/dist/cicd-optimizer.d.ts +0 -142
  8. package/dist/cicd-optimizer.d.ts.map +0 -1
  9. package/dist/commands/archive.d.ts +0 -50
  10. package/dist/commands/archive.d.ts.map +0 -1
  11. package/dist/commands/burnup.d.ts +0 -6
  12. package/dist/commands/burnup.d.ts.map +0 -1
  13. package/dist/commands/diagnose.d.ts +0 -52
  14. package/dist/commands/diagnose.d.ts.map +0 -1
  15. package/dist/commands/evaluate.d.ts +0 -8
  16. package/dist/commands/evaluate.d.ts.map +0 -1
  17. package/dist/commands/init.d.ts +0 -5
  18. package/dist/commands/init.d.ts.map +0 -1
  19. package/dist/commands/iterate.d.ts +0 -8
  20. package/dist/commands/iterate.d.ts.map +0 -1
  21. package/dist/commands/mode.d.ts +0 -24
  22. package/dist/commands/mode.d.ts.map +0 -1
  23. package/dist/commands/plan.d.ts +0 -49
  24. package/dist/commands/plan.d.ts.map +0 -1
  25. package/dist/commands/provenance.d.ts +0 -32
  26. package/dist/commands/provenance.d.ts.map +0 -1
  27. package/dist/commands/quality-gates.d.ts +0 -52
  28. package/dist/commands/quality-gates.d.ts.map +0 -1
  29. package/dist/commands/quality-monitor.d.ts +0 -17
  30. package/dist/commands/quality-monitor.d.ts.map +0 -1
  31. package/dist/commands/specs.d.ts +0 -71
  32. package/dist/commands/specs.d.ts.map +0 -1
  33. package/dist/commands/status.d.ts +0 -44
  34. package/dist/commands/status.d.ts.map +0 -1
  35. package/dist/commands/templates.d.ts +0 -74
  36. package/dist/commands/templates.d.ts.map +0 -1
  37. package/dist/commands/tool.d.ts +0 -13
  38. package/dist/commands/tool.d.ts.map +0 -1
  39. package/dist/commands/troubleshoot.d.ts +0 -8
  40. package/dist/commands/troubleshoot.d.ts.map +0 -1
  41. package/dist/commands/tutorial.d.ts +0 -55
  42. package/dist/commands/tutorial.d.ts.map +0 -1
  43. package/dist/commands/validate.d.ts +0 -15
  44. package/dist/commands/validate.d.ts.map +0 -1
  45. package/dist/commands/waivers.d.ts +0 -8
  46. package/dist/commands/waivers.d.ts.map +0 -1
  47. package/dist/commands/workflow.d.ts +0 -85
  48. package/dist/commands/workflow.d.ts.map +0 -1
  49. package/dist/config/index.d.ts +0 -29
  50. package/dist/config/index.d.ts.map +0 -1
  51. package/dist/config/modes.d.ts +0 -225
  52. package/dist/config/modes.d.ts.map +0 -1
  53. package/dist/constants/spec-types.d.ts +0 -41
  54. package/dist/constants/spec-types.d.ts.map +0 -1
  55. package/dist/error-handler.d.ts +0 -164
  56. package/dist/error-handler.d.ts.map +0 -1
  57. package/dist/generators/jest-config.d.ts +0 -32
  58. package/dist/generators/jest-config.d.ts.map +0 -1
  59. package/dist/generators/working-spec.d.ts +0 -13
  60. package/dist/generators/working-spec.d.ts.map +0 -1
  61. package/dist/index-new.d.ts +0 -5
  62. package/dist/index-new.d.ts.map +0 -1
  63. package/dist/index-new.js +0 -317
  64. package/dist/index.d.ts +0 -5
  65. package/dist/index.d.ts.map +0 -1
  66. package/dist/index.js.backup +0 -4711
  67. package/dist/minimal-cli.d.ts +0 -3
  68. package/dist/minimal-cli.d.ts.map +0 -1
  69. package/dist/policy/PolicyManager.d.ts +0 -104
  70. package/dist/policy/PolicyManager.d.ts.map +0 -1
  71. package/dist/scaffold/cursor-hooks.d.ts +0 -7
  72. package/dist/scaffold/cursor-hooks.d.ts.map +0 -1
  73. package/dist/scaffold/git-hooks.d.ts +0 -20
  74. package/dist/scaffold/git-hooks.d.ts.map +0 -1
  75. package/dist/scaffold/index.d.ts +0 -20
  76. package/dist/scaffold/index.d.ts.map +0 -1
  77. package/dist/spec/SpecFileManager.d.ts +0 -146
  78. package/dist/spec/SpecFileManager.d.ts.map +0 -1
  79. package/dist/test-analysis.d.ts +0 -182
  80. package/dist/test-analysis.d.ts.map +0 -1
  81. package/dist/tool-interface.d.ts +0 -236
  82. package/dist/tool-interface.d.ts.map +0 -1
  83. package/dist/tool-loader.d.ts +0 -77
  84. package/dist/tool-loader.d.ts.map +0 -1
  85. package/dist/tool-validator.d.ts +0 -72
  86. package/dist/tool-validator.d.ts.map +0 -1
  87. package/dist/utils/detection.d.ts +0 -7
  88. package/dist/utils/detection.d.ts.map +0 -1
  89. package/dist/utils/finalization.d.ts +0 -17
  90. package/dist/utils/finalization.d.ts.map +0 -1
  91. package/dist/utils/project-analysis.d.ts +0 -14
  92. package/dist/utils/project-analysis.d.ts.map +0 -1
  93. package/dist/utils/quality-gates.d.ts +0 -49
  94. package/dist/utils/quality-gates.d.ts.map +0 -1
  95. package/dist/utils/spec-resolver.d.ts +0 -88
  96. package/dist/utils/spec-resolver.d.ts.map +0 -1
  97. package/dist/utils/typescript-detector.d.ts +0 -63
  98. package/dist/utils/typescript-detector.d.ts.map +0 -1
  99. package/dist/validation/spec-validation.d.ts +0 -43
  100. package/dist/validation/spec-validation.d.ts.map +0 -1
  101. package/dist/waivers-manager.d.ts +0 -167
  102. package/dist/waivers-manager.d.ts.map +0 -1
  103. package/templates/.cursor/rules/10-authorship-and-attribution.mdc +0 -15
  104. package/templates/.cursor/rules/15-sophisticated-todo-detection.mdc +0 -425
  105. package/templates/apps/tools/caws/prompt-lint.js.backup +0 -274
  106. package/templates/apps/tools/caws/provenance.js.backup +0 -73
  107. /package/templates/.cursor/rules/{11-documentation-quality-standards.mdc → 10-documentation-quality-standards.mdc} +0 -0
  108. /package/templates/.cursor/rules/{12-scope-management-waivers.mdc → 11-scope-management-waivers.mdc} +0 -0
  109. /package/templates/.cursor/rules/{13-implementation-completeness.mdc → 12-implementation-completeness.mdc} +0 -0
  110. /package/templates/.cursor/rules/{14-language-agnostic-standards.mdc → 13-language-agnostic-standards.mdc} +0 -0
@@ -1,43 +0,0 @@
1
- /**
2
- * Basic validation of working spec
3
- * @param {Object} spec - Working spec object
4
- * @param {Object} options - Validation options
5
- * @returns {Object} Validation result
6
- */
7
- export function validateWorkingSpec(spec: any, _options?: {}): any;
8
- /**
9
- * Enhanced validation with suggestions and auto-fix
10
- * @param {Object} spec - Working spec object
11
- * @param {Object} options - Validation options
12
- * @returns {Object} Enhanced validation result
13
- */
14
- export function validateWorkingSpecWithSuggestions(spec: any, options?: any): any;
15
- /**
16
- * Get suggestion for a missing field
17
- * @param {string} field - Field name
18
- * @param {Object} _spec - Spec object (for context)
19
- * @returns {string} Suggestion text
20
- */
21
- export function getFieldSuggestion(field: string, _spec: any): string;
22
- /**
23
- * Check if a field can be auto-fixed
24
- * @param {string} field - Field name
25
- * @param {Object} _spec - Spec object (for context)
26
- * @returns {boolean} Whether field can be auto-fixed
27
- */
28
- export function canAutoFixField(field: string, _spec: any): boolean;
29
- /**
30
- * Calculate compliance score based on errors and warnings
31
- * Score ranges from 0 (many issues) to 1 (perfect)
32
- * @param {Array} errors - Validation errors
33
- * @param {Array} warnings - Validation warnings
34
- * @returns {number} Compliance score (0-1)
35
- */
36
- export function calculateComplianceScore(errors: any[], warnings: any[]): number;
37
- /**
38
- * Get compliance grade from score
39
- * @param {number} score - Compliance score (0-1)
40
- * @returns {string} Grade (A, B, C, D, F)
41
- */
42
- export function getComplianceGrade(score: number): string;
43
- //# sourceMappingURL=spec-validation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-validation.d.ts","sourceRoot":"","sources":["../../src/validation/spec-validation.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,mEA8HC;AAED;;;;;GAKG;AACH,kFAyWC;AAoCD;;;;;GAKG;AACH,0CAJW,MAAM,eAEJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,eAEJ,OAAO,CAKnB;AAnED;;;;;;GAMG;AACH,0EAFa,MAAM,CAclB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,CAQlB"}
@@ -1,167 +0,0 @@
1
- export = WaiversManager;
2
- /**
3
- * Waiver Manager Class
4
- * Handles waiver creation, validation, expiration, and audit logging
5
- */
6
- declare class WaiversManager {
7
- constructor(options?: {});
8
- projectRoot: any;
9
- waiversDir: string;
10
- waiversFile: string;
11
- auditLogFile: string;
12
- /**
13
- * Waiver Schema Definition
14
- */
15
- getWaiverSchema(): {
16
- type: string;
17
- required: string[];
18
- properties: {
19
- id: {
20
- type: string;
21
- pattern: string;
22
- description: string;
23
- };
24
- title: {
25
- type: string;
26
- minLength: number;
27
- maxLength: number;
28
- description: string;
29
- };
30
- reason: {
31
- type: string;
32
- enum: string[];
33
- description: string;
34
- };
35
- description: {
36
- type: string;
37
- minLength: number;
38
- maxLength: number;
39
- description: string;
40
- };
41
- gates: {
42
- type: string;
43
- items: {
44
- type: string;
45
- enum: string[];
46
- };
47
- minItems: number;
48
- description: string;
49
- };
50
- risk_assessment: {
51
- type: string;
52
- properties: {
53
- impact_level: {
54
- type: string;
55
- enum: string[];
56
- };
57
- mitigation_plan: {
58
- type: string;
59
- minLength: number;
60
- };
61
- review_required: {
62
- type: string;
63
- };
64
- };
65
- required: string[];
66
- };
67
- expires_at: {
68
- type: string;
69
- format: string;
70
- description: string;
71
- };
72
- approved_by: {
73
- type: string;
74
- description: string;
75
- };
76
- created_at: {
77
- type: string;
78
- format: string;
79
- description: string;
80
- };
81
- metadata: {
82
- type: string;
83
- properties: {
84
- related_pr: {
85
- type: string;
86
- };
87
- related_issue: {
88
- type: string;
89
- };
90
- environment: {
91
- type: string;
92
- enum: string[];
93
- };
94
- urgency: {
95
- type: string;
96
- enum: string[];
97
- };
98
- };
99
- };
100
- };
101
- };
102
- /**
103
- * Create a new waiver
104
- */
105
- createWaiver(waiverData: any): Promise<{
106
- id: string;
107
- title: any;
108
- reason: any;
109
- description: any;
110
- gates: any;
111
- risk_assessment: any;
112
- expires_at: any;
113
- approved_by: any;
114
- created_at: string;
115
- metadata: any;
116
- }>;
117
- /**
118
- * Check if waiver applies to specific gates
119
- */
120
- checkWaiverCoverage(gatesToCheck: any, context?: {}): Promise<{
121
- coveredGates: any[];
122
- waiverDetails: {
123
- gate: any;
124
- waiver_id: any;
125
- reason: any;
126
- expires_at: any;
127
- approved_by: any;
128
- }[];
129
- allCovered: boolean;
130
- }>;
131
- /**
132
- * Get all active waivers
133
- */
134
- getActiveWaivers(): Promise<any[]>;
135
- /**
136
- * Revoke a waiver
137
- */
138
- revokeWaiver(waiverId: any, reason?: string): Promise<any>;
139
- /**
140
- * Extend waiver expiration
141
- */
142
- extendWaiver(waiverId: any, newExpiryDate: any, approvedBy: any): Promise<any>;
143
- /**
144
- * Get waiver statistics and health metrics
145
- */
146
- getWaiverStats(): Promise<{
147
- total_active: number;
148
- by_reason: {};
149
- by_risk_level: {};
150
- expiring_soon: any[];
151
- high_risk: any[];
152
- total_gates_waived: number;
153
- average_lifespan_days: number;
154
- }>;
155
- generateWaiverId(): Promise<string>;
156
- validateWaiver(waiver: any): {
157
- valid: boolean;
158
- errors: string[];
159
- };
160
- checkWaiverConflicts(newWaiver: any): Promise<string[]>;
161
- waiverAppliesToContext(waiver: any, context: any): boolean;
162
- loadActiveWaivers(): Promise<any[]>;
163
- saveActiveWaivers(waivers: any): Promise<void>;
164
- auditLog(action: any, waiverId: any, details: any): Promise<void>;
165
- flagForReview(waiver: any): Promise<void>;
166
- }
167
- //# sourceMappingURL=waivers-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"waivers-manager.d.ts","sourceRoot":"","sources":["../src/waivers-manager.js"],"names":[],"mappings":";AAaA;;;GAGG;AACH;IACE,0BAUC;IATC,iBAAuD;IACvD,mBAAiE;IACjE,oBAAoE;IACpE,qBAAkE;IAQpE;;OAEG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiGC;IAED;;OAEG;IACH;;;;;;;;;;;OA4DC;IAED;;OAEG;IACH;;;;;;;;;;OA+BC;IAED;;OAEG;IACH,mCAgBC;IAED;;OAEG;IACH,2DAeC;IAED;;OAEG;IACH,+EAuBC;IAED;;OAEG;IACH;;;;;;;;OA2DC;IAID,oCAUC;IAED;;;MAkDC;IAED,wDAkBC;IAED,2DAUC;IAED,oCAyCC;IAED,+CAuBC;IAED,kEAaC;IAED,0CA2CC;CACF"}
@@ -1,15 +0,0 @@
1
- ---
2
- description: File headers and authorship
3
- globs:
4
- alwaysApply: false
5
- ---
6
-
7
- # File Header & Attribution
8
-
9
- For top-of-file documentation, include author signature:
10
-
11
- ```
12
- Author: @darianrosebrook
13
- ```
14
-
15
- Only in source files with public entrypoints or non-trivial modules.
@@ -1,425 +0,0 @@
1
- ---
2
- description: Sophisticated TODO detection patterns and hidden implementation analysis
3
- globs:
4
- alwaysApply: true
5
- ---
6
-
7
- # Sophisticated TODO Detection & Analysis
8
-
9
- ## Core Principle
10
-
11
- **Detect hidden incomplete implementations beyond simple TODO comments.** Use context-aware analysis with confidence scoring to identify stub implementations, temporary solutions, and incomplete business logic.
12
-
13
- ## Advanced Detection Patterns
14
-
15
- ### High-Confidence Hidden TODO Patterns
16
-
17
- **Incomplete Implementation Patterns:**
18
-
19
- ```python
20
- incomplete_implementation_patterns = [
21
- r'\bnot\s+yet\s+implemented\b',
22
- r'\bmissing\s+implementation\b',
23
- r'\bincomplete\s+implementation\b',
24
- r'\bpartial\s+implementation\b',
25
- r'\bunimplemented\b',
26
- r'\bnot\s+done\b',
27
- r'\bpending\s+implementation\b',
28
- r'\bto\s+be\s+implemented\b',
29
- r'\bwill\s+be\s+implemented\b',
30
- r'\bcoming\s+soon\b',
31
- r'\bwork\s+in\s+progress\b',
32
- r'\bwip\b',
33
- ]
34
- ```
35
-
36
- **Placeholder Code Patterns:**
37
-
38
- ```python
39
- placeholder_code_patterns = [
40
- r'\bplaceholder\s+code\b',
41
- r'\bplaceholder\s+implementation\b',
42
- r'\bstub\s+implementation\b',
43
- r'\bdummy\s+implementation\b',
44
- r'\bfake\s+implementation\b',
45
- r'\bsimplified\s+.*?\s+implementation\b',
46
- r'\bfor\s+now\b.*?(just|simply|only)\s+(concatenate|return|use)',
47
- r'\btemporary\s+implementation\b',
48
- r'\bmock\s+implementation\b',
49
- r'\bsample\s+implementation\b',
50
- ]
51
- ```
52
-
53
- **Temporary Solution Patterns:**
54
-
55
- ```python
56
- temporary_solution_patterns = [
57
- r'\btemporary\s+solution\b',
58
- r'\btemporary\s+fix\b',
59
- r'\bquick\s+fix\b',
60
- r'\bworkaround\b',
61
- r'\bhack\b.*?(fix|solution)',
62
- r'\bband-aid\s+solution\b',
63
- r'\bkludge\b',
64
- r'\bcrude\s+solution\b',
65
- r'\brough\s+implementation\b',
66
- ]
67
- ```
68
-
69
- **Hardcoded Value Patterns:**
70
-
71
- ```python
72
- hardcoded_value_patterns = [
73
- r'\bhardcoded\s+value\b',
74
- r'\bmagic\s+number\b',
75
- r'\bmagic\s+string\b',
76
- r'\bconstant\s+value\b.*?(replace|change|make\s+configurable)',
77
- r'\bfixed\s+value\b',
78
- r'\bstatic\s+value\b',
79
- r'\bhardcoded\s+constant\b',
80
- ]
81
- ```
82
-
83
- **Future Improvement Patterns:**
84
-
85
- ```python
86
- future_improvement_patterns = [
87
- r'\bin\s+production\b.*?(implement|add|fix)',
88
- r'\bin\s+a\s+real\s+implementation\b',
89
- r'\beventually\b.*?(implement|add|fix)',
90
- r'\bshould\s+be\b.*?(implemented|added|fixed)',
91
- r'\bwould\s+be\b.*?(implemented|added|fixed)',
92
- r'\bmight\s+be\b.*?(implemented|added|fixed)',
93
- r'\bcould\s+be\b.*?(implemented|added|fixed)',
94
- r'\blater\b.*?(implement|add|fix)',
95
- r'\bsomeday\b.*?(implement|add|fix)',
96
- ]
97
- ```
98
-
99
- ## Language-Specific Code Stub Detection
100
-
101
- ### JavaScript/TypeScript Patterns
102
-
103
- ```python
104
- javascript_stub_patterns = {
105
- 'function_stub': re.compile(r'^\s*(async\s+)?function\s+\w+\(.*\)\s*{'),
106
- 'throw_not_impl': re.compile(r"^\s*throw\s+new\s+Error\((\"|')(TODO|Not\s+Implemented|Not\s+Yet\s+Implemented)"),
107
- 'return_todo': re.compile(r"^\s*return\s+(null|undefined);\s*//\s*(TODO|PLACEHOLDER)"),
108
- 'console_log_stub': re.compile(r"^\s*console\.log\(.*?\);\s*//\s*(TODO|PLACEHOLDER|STUB)"),
109
- 'empty_function': re.compile(r'^\s*(async\s+)?function\s+\w+\(.*\)\s*{\s*}\s*$'),
110
- 'return_mock': re.compile(r"^\s*return\s+\{.*?\};\s*//\s*(MOCK|FAKE|DUMMY)"),
111
- }
112
- ```
113
-
114
- ### Python Patterns
115
-
116
- ```python
117
- python_stub_patterns = {
118
- 'function_stub': re.compile(r'^\s*def\s+\w+\(.*\):'),
119
- 'pass_stmt': re.compile(r'^\s*pass\s*$'),
120
- 'ellipsis_stmt': re.compile(r'^\s*\.\.\.\s*$'),
121
- 'raise_not_impl': re.compile(r'^\s*raise\s+NotImplementedError'),
122
- 'return_none': re.compile(r"^\s*return\s+None\s*#\s*(TODO|PLACEHOLDER)"),
123
- 'print_stub': re.compile(r"^\s*print\(.*?\)\s*#\s*(TODO|PLACEHOLDER|STUB)"),
124
- 'empty_function': re.compile(r'^\s*def\s+\w+\(.*\):\s*pass\s*$'),
125
- }
126
- ```
127
-
128
- ### Rust Patterns
129
-
130
- ```python
131
- rust_stub_patterns = {
132
- 'function_stub': re.compile(r'^\s*(async\s+)?fn\s+\w+\(.*\)\s*->\s*\w+\s*{'),
133
- 'todo_macro': re.compile(r'^\s*todo!\(\)'),
134
- 'unimplemented_macro': re.compile(r'^\s*unimplemented!\(\)'),
135
- 'panic_stub': re.compile(r"^\s*panic!\(\"TODO\"\)"),
136
- 'return_default': re.compile(r"^\s*Default::default\(\)\s*//\s*(TODO|PLACEHOLDER)"),
137
- }
138
- ```
139
-
140
- ## Context-Aware Analysis
141
-
142
- ### Confidence Scoring
143
-
144
- ```python
145
- def calculate_confidence_score(comment: str, line_num: int, file_path: Path) -> float:
146
- score = 0.0
147
-
148
- # Check for documentation indicators (reduce score)
149
- if is_documentation_comment(comment):
150
- score -= 0.5
151
-
152
- # Check for TODO indicators (increase score)
153
- if has_todo_indicators(comment):
154
- score += 0.3
155
-
156
- # Check if it's in a generated file (reduce score)
157
- if is_generated_file(file_path):
158
- score -= 0.4
159
-
160
- # Check for implementation context (increase score)
161
- if is_implementation_context(comment):
162
- score += 0.2
163
-
164
- # Check for business logic context (increase score)
165
- if is_business_logic_context(comment):
166
- score += 0.3
167
-
168
- return max(-1.0, min(1.0, score))
169
- ```
170
-
171
- ### Exclusion Patterns
172
-
173
- ```python
174
- exclusion_patterns = [
175
- r'\bperformance\s+monitoring\b',
176
- r'\bperformance\s+optimization\b',
177
- r'\bfallback\s+mechanism\b',
178
- r'\bbasic\s+authentication\b',
179
- r'\bmock\s+object\b', # For testing
180
- r'\bcurrent\s+implementation\b.*?(uses|provides|supports)',
181
- r'\bexample\s+implementation\b',
182
- r'\bsample\s+code\b',
183
- r'\bdemo\s+implementation\b',
184
- r'\btest\s+implementation\b',
185
- ]
186
- ```
187
-
188
- ## Implementation Detection
189
-
190
- ### Fake Persistence Detection
191
-
192
- ```python
193
- fake_persistence_patterns = [
194
- r'private\s+\w+:\s*\w+\[\]\s*=\s*\[\]', # In-memory arrays
195
- r'const\s+\w+\s*=\s*\[\]', # Empty arrays
196
- r'let\s+\w+\s*=\s*\[\]', # Empty arrays
197
- r'mock.*database',
198
- r'fake.*persistence',
199
- r'in-memory.*storage',
200
- r'temporary.*storage',
201
- ]
202
- ```
203
-
204
- ### Mock API Detection
205
-
206
- ```python
207
- mock_api_patterns = [
208
- r'return\s+\{.*?\};\s*//\s*(MOCK|FAKE|DUMMY)',
209
- r'console\.log.*mock',
210
- r'hardcoded.*response',
211
- r'static.*response',
212
- r'fake.*api',
213
- r'mock.*endpoint',
214
- ]
215
- ```
216
-
217
- ### Stub Business Logic Detection
218
-
219
- ```python
220
- stub_business_logic_patterns = [
221
- r'return\s+\d+;\s*//\s*(TODO|PLACEHOLDER)',
222
- r'return\s+true;\s*//\s*(TODO|PLACEHOLDER)',
223
- r'return\s+false;\s*//\s*(TODO|PLACEHOLDER)',
224
- r'return\s+null;\s*//\s*(TODO|PLACEHOLDER)',
225
- r'throw\s+new\s+Error.*not\s+implemented',
226
- r'raise.*NotImplementedError',
227
- ]
228
- ```
229
-
230
- ## CAWS Integration
231
-
232
- ### Pre-Commit Analysis
233
-
234
- ```bash
235
- # Run sophisticated TODO analysis
236
- check-hidden-todos() {
237
- echo "🔍 Running sophisticated TODO analysis..."
238
-
239
- # Check for high-confidence hidden TODOs
240
- local hidden_todos=$(grep -r -E "(not yet implemented|missing implementation|incomplete implementation|partial implementation|unimplemented|not done|pending implementation|to be implemented|will be implemented)" src/ | wc -l)
241
- if [ "$hidden_todos" -gt 0 ]; then
242
- echo "❌ Found $hidden_todos hidden incomplete implementations"
243
- echo "All implementations must be complete"
244
- exit 1
245
- fi
246
-
247
- # Check for placeholder implementations
248
- local placeholders=$(grep -r -E "(placeholder code|placeholder implementation|stub implementation|dummy implementation|fake implementation)" src/ | wc -l)
249
- if [ "$placeholders" -gt 0 ]; then
250
- echo "❌ Found $placeholders placeholder implementations"
251
- echo "Replace with real implementations"
252
- exit 1
253
- fi
254
-
255
- # Check for temporary solutions
256
- local temp_solutions=$(grep -r -E "(temporary solution|temporary fix|quick fix|workaround|hack.*fix)" src/ | wc -l)
257
- if [ "$temp_solutions" -gt 0 ]; then
258
- echo "❌ Found $temp_solutions temporary solutions"
259
- echo "Implement proper solutions"
260
- exit 1
261
- fi
262
-
263
- echo "✅ No hidden incomplete implementations found"
264
- }
265
- ```
266
-
267
- ### CI/CD Integration
268
-
269
- ```yaml
270
- # Sophisticated TODO analysis in CI
271
- - name: Check Hidden TODOs
272
- run: |
273
- echo "🔍 Running sophisticated hidden TODO analysis..."
274
-
275
- # Check for incomplete implementations
276
- incomplete_count=$(grep -r -E "(not yet implemented|missing implementation|incomplete implementation|partial implementation|unimplemented|not done|pending implementation|to be implemented|will be implemented)" src/ | wc -l)
277
- if [ "$incomplete_count" -gt 0 ]; then
278
- echo "❌ Found $incomplete_count hidden incomplete implementations"
279
- echo "All implementations must be complete"
280
- exit 1
281
- fi
282
-
283
- # Check for placeholder implementations
284
- placeholder_count=$(grep -r -E "(placeholder code|placeholder implementation|stub implementation|dummy implementation|fake implementation)" src/ | wc -l)
285
- if [ "$placeholder_count" -gt 0 ]; then
286
- echo "❌ Found $placeholder_count placeholder implementations"
287
- echo "Replace with real implementations"
288
- exit 1
289
- fi
290
-
291
- # Check for temporary solutions
292
- temp_count=$(grep -r -E "(temporary solution|temporary fix|quick fix|workaround|hack.*fix)" src/ | wc -l)
293
- if [ "$temp_count" -gt 0 ]; then
294
- echo "❌ Found $temp_count temporary solutions"
295
- echo "Implement proper solutions"
296
- exit 1
297
- fi
298
-
299
- # Check for fake persistence
300
- fake_persistence_count=$(grep -r -E "(private.*\[\]|mock.*database|fake.*persistence|in-memory.*storage)" src/ | wc -l)
301
- if [ "$fake_persistence_count" -gt 0 ]; then
302
- echo "❌ Found $fake_persistence_count fake persistence patterns"
303
- echo "Use real database connections"
304
- exit 1
305
- fi
306
-
307
- echo "✅ No hidden incomplete implementations found"
308
-
309
- - name: Generate TODO Analysis Report
310
- run: |
311
- echo "📊 Generating comprehensive TODO analysis report..."
312
-
313
- # Generate detailed report
314
- echo "# Hidden TODO Analysis Report" > hidden-todos-report.md
315
- echo "" >> hidden-todos-report.md
316
- echo "## Incomplete Implementations" >> hidden-todos-report.md
317
- grep -r -E "(not yet implemented|missing implementation|incomplete implementation|partial implementation|unimplemented|not done|pending implementation|to be implemented|will be implemented)" src/ >> hidden-todos-report.md || echo "None found" >> hidden-todos-report.md
318
- echo "" >> hidden-todos-report.md
319
- echo "## Placeholder Implementations" >> hidden-todos-report.md
320
- grep -r -E "(placeholder code|placeholder implementation|stub implementation|dummy implementation|fake implementation)" src/ >> hidden-todos-report.md || echo "None found" >> hidden-todos-report.md
321
- echo "" >> hidden-todos-report.md
322
- echo "## Temporary Solutions" >> hidden-todos-report.md
323
- grep -r -E "(temporary solution|temporary fix|quick fix|workaround|hack.*fix)" src/ >> hidden-todos-report.md || echo "None found" >> hidden-todos-report.md
324
- echo "" >> hidden-todos-report.md
325
- echo "## Fake Persistence Patterns" >> hidden-todos-report.md
326
- grep -r -E "(private.*\[\]|mock.*database|fake.*persistence|in-memory.*storage)" src/ >> hidden-todos-report.md || echo "None found" >> hidden-todos-report.md
327
-
328
- echo "📊 TODO analysis report generated"
329
- ```
330
-
331
- ## CAWS Commands
332
-
333
- ### TODO Analysis Commands
334
-
335
- ```bash
336
- # Run comprehensive TODO analysis
337
- caws analyze-todos --confidence-threshold=0.7
338
-
339
- # Check for hidden incomplete implementations
340
- caws analyze-todos --pattern="incomplete_implementation" --confidence-threshold=0.8
341
-
342
- # Analyze placeholder implementations
343
- caws analyze-todos --pattern="placeholder_code" --confidence-threshold=0.6
344
-
345
- # Check for temporary solutions
346
- caws analyze-todos --pattern="temporary_solution" --confidence-threshold=0.7
347
-
348
- # Analyze fake persistence patterns
349
- caws analyze-todos --pattern="fake_persistence" --confidence-threshold=0.8
350
- ```
351
-
352
- ### Quality Monitoring
353
-
354
- ```bash
355
- # Track TODO resolution progress
356
- caws quality-monitor --action=code_edited --files="$(git diff --name-only)" --check-hidden-todos
357
-
358
- # Update progress with TODO resolution
359
- caws progress update --criterion-id="TODO-001" --status="completed" --tests-passing=1
360
-
361
- # Track implementation completeness metrics
362
- caws metrics track --metric="hidden_todos_count" --value=0
363
- caws metrics track --metric="placeholder_implementations" --value=0
364
- caws metrics track --metric="temporary_solutions" --value=0
365
- ```
366
-
367
- ## Quality Metrics
368
-
369
- ### Implementation Completeness Score
370
-
371
- ```python
372
- def calculate_completeness_score(analysis_results):
373
- total_files = analysis_results['total_files']
374
- files_with_todos = analysis_results['files_with_hidden_todos']
375
- high_conf_todos = analysis_results['high_confidence_todos']
376
-
377
- # Completeness score (higher is better)
378
- completeness_score = 1.0 - (files_with_todos / total_files) if total_files > 0 else 1.0
379
-
380
- # Quality score based on confidence levels
381
- quality_score = 1.0 - (high_conf_todos / total_files) if total_files > 0 else 1.0
382
-
383
- return {
384
- 'completeness_score': completeness_score,
385
- 'quality_score': quality_score,
386
- 'files_with_todos': files_with_todos,
387
- 'high_confidence_todos': high_conf_todos,
388
- 'total_files_analyzed': total_files
389
- }
390
- ```
391
-
392
- ### Anti-Pattern Detection Metrics
393
-
394
- - **Placeholder Density**: Number of high-confidence TODOs per 1000 lines
395
- - **Stub Implementation Rate**: % of functions with stub patterns detected
396
- - **Temporary Solution Rate**: % of code marked as temporary/workaround
397
- - **Hardcoded Value Rate**: % of magic numbers/strings detected
398
- - **Fake Persistence Rate**: % of code using in-memory storage patterns
399
-
400
- ## Continuous Improvement
401
-
402
- ### Monthly Audits
403
-
404
- ```bash
405
- # Generate monthly completeness report
406
- grep -r -E "(not yet implemented|missing implementation|incomplete implementation|partial implementation|unimplemented|not done|pending implementation|to be implemented|will be implemented)" src/ > monthly-hidden-todos.txt
407
- grep -r -E "(placeholder code|placeholder implementation|stub implementation|dummy implementation|fake implementation)" src/ > monthly-placeholders.txt
408
- grep -r -E "(temporary solution|temporary fix|quick fix|workaround|hack.*fix)" src/ > monthly-temp-solutions.txt
409
-
410
- # Track trends over time
411
- echo "Implementation completeness trends:" >> monthly-report.md
412
- echo "- Hidden incomplete implementations: $(wc -l < monthly-hidden-todos.txt)" >> monthly-report.md
413
- echo "- Placeholder implementations: $(wc -l < monthly-placeholders.txt)" >> monthly-report.md
414
- echo "- Temporary solutions: $(wc -l < monthly-temp-solutions.txt)" >> monthly-report.md
415
- ```
416
-
417
- ### Quarterly Reviews
418
-
419
- - Full implementation audit across entire codebase
420
- - Review integration reality and persistence patterns
421
- - Update quality gates based on project evolution
422
- - Refine detection patterns based on new anti-patterns
423
- - Analyze confidence threshold effectiveness
424
-
425
- This rule ensures sophisticated detection of hidden incomplete implementations beyond simple TODO comments, providing context-aware analysis with confidence scoring to maintain high code quality standards.