pumuki-ast-hooks 6.0.7 → 6.0.9
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/docs/RELEASE_NOTES.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# Release Notes - v6.0.9
|
|
2
|
+
|
|
3
|
+
**Release Date**: January 13, 2026
|
|
4
|
+
**Type**: Patch Release
|
|
5
|
+
**Compatibility**: Fully backward compatible with 6.0.x
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✅ Fixes
|
|
10
|
+
|
|
11
|
+
- **iOS DIP detector**: protocol-named types like `LoginUseCase` are treated as abstract unless they are `*Impl`.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Release Notes - v6.0.8
|
|
16
|
+
|
|
17
|
+
**Release Date**: January 13, 2026
|
|
18
|
+
**Type**: Patch Release
|
|
19
|
+
**Compatibility**: Fully backward compatible with 6.0.x
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ✅ Fixes
|
|
24
|
+
|
|
25
|
+
- **iOS DIP detector**: protocol-constrained generics (e.g. `<Client: APIClientProtocol>`) are treated as abstract dependencies.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
1
29
|
# Release Notes - v6.0.7
|
|
2
30
|
|
|
3
31
|
**Release Date**: January 13, 2026
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.9",
|
|
4
4
|
"description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -135,4 +135,4 @@
|
|
|
135
135
|
"./skills": "./skills/skill-rules.json",
|
|
136
136
|
"./hooks": "./hooks/index.js"
|
|
137
137
|
}
|
|
138
|
-
}
|
|
138
|
+
}
|
|
@@ -790,3 +790,7 @@
|
|
|
790
790
|
{"timestamp":1768290665489,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
791
791
|
{"timestamp":1768290665489,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
792
792
|
{"timestamp":1768290665489,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
793
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"constructor","status":"started","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
794
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"ensure_dir","status":"started"}
|
|
795
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"ensure_dir","status":"success"}
|
|
796
|
+
{"timestamp":1768293907758,"hook":"audit_logger","operation":"constructor","status":"success","repoRoot":"/Users/juancarlosmerlosalbarracin/Developer/Projects/ast-intelligence-hooks/scripts/hooks-system"}
|
|
@@ -35,13 +35,7 @@ describe('DIValidationService', () => {
|
|
|
35
35
|
"'TestViewModel' depends on concrete 'APIClient' - use protocol"
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
expect(mockAnalyzer.pushFinding).
|
|
39
|
-
'ios.solid.dip.concrete_dependency',
|
|
40
|
-
'high',
|
|
41
|
-
'TestViewModel.swift',
|
|
42
|
-
10,
|
|
43
|
-
"'TestViewModel' depends on concrete 'UserRepository' - use protocol"
|
|
44
|
-
);
|
|
38
|
+
expect(mockAnalyzer.pushFinding).toHaveBeenCalledTimes(1);
|
|
45
39
|
});
|
|
46
40
|
|
|
47
41
|
it('should skip allowed types', async () => {
|
|
@@ -77,5 +71,39 @@ describe('DIValidationService', () => {
|
|
|
77
71
|
|
|
78
72
|
expect(mockAnalyzer.pushFinding).not.toHaveBeenCalled();
|
|
79
73
|
});
|
|
74
|
+
|
|
75
|
+
it('should skip generic constraints that bind to protocols', async () => {
|
|
76
|
+
mockAnalyzer.fileContent = 'final class TestViewModel<Client: APIClientProtocol> { }';
|
|
77
|
+
const properties = [
|
|
78
|
+
{ 'key.name': 'apiClient', 'key.typename': 'Client' }
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
await diValidationService.validateDependencyInjection(
|
|
82
|
+
mockAnalyzer,
|
|
83
|
+
properties,
|
|
84
|
+
'TestViewModel.swift',
|
|
85
|
+
'TestViewModel',
|
|
86
|
+
10
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
expect(mockAnalyzer.pushFinding).not.toHaveBeenCalled();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should skip protocol-named concrete-like types', async () => {
|
|
93
|
+
const properties = [
|
|
94
|
+
{ 'key.name': 'loginUseCase', 'key.typename': 'LoginUseCase' },
|
|
95
|
+
{ 'key.name': 'logoutUseCase', 'key.typename': 'LogoutUseCase' }
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
await diValidationService.validateDependencyInjection(
|
|
99
|
+
mockAnalyzer,
|
|
100
|
+
properties,
|
|
101
|
+
'AuthLoginRepositoryImpl.swift',
|
|
102
|
+
'AuthLoginRepositoryImpl',
|
|
103
|
+
1
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
expect(mockAnalyzer.pushFinding).not.toHaveBeenCalled();
|
|
107
|
+
});
|
|
80
108
|
});
|
|
81
109
|
});
|
|
@@ -18,7 +18,7 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
18
18
|
const typename = prop['key.typename'] || '';
|
|
19
19
|
const propName = prop['key.name'] || '';
|
|
20
20
|
|
|
21
|
-
if (this._shouldSkipType(typename, propName, className)) {
|
|
21
|
+
if (this._shouldSkipType(typename, propName, className, context)) {
|
|
22
22
|
continue;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -34,15 +34,23 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
34
34
|
return violations;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
_shouldSkipType(typename, propName, className) {
|
|
37
|
+
_shouldSkipType(typename, propName, className, context) {
|
|
38
38
|
if (this.config.allowedTypes.includes(typename)) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
if (this._isLikelyProtocolType(typename)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
if (this._isGenericTypeParameter(typename, propName, className)) {
|
|
43
47
|
return true;
|
|
44
48
|
}
|
|
45
49
|
|
|
50
|
+
if (this._isGenericConstraintType(typename, className, context)) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
|
|
46
54
|
return false;
|
|
47
55
|
}
|
|
48
56
|
|
|
@@ -62,6 +70,23 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
62
70
|
return isSingleLetter || (isCamelCase && hasContextHint);
|
|
63
71
|
}
|
|
64
72
|
|
|
73
|
+
_isGenericConstraintType(typename, className, context) {
|
|
74
|
+
const content = context?.analyzer?.fileContent || '';
|
|
75
|
+
if (!content) return false;
|
|
76
|
+
|
|
77
|
+
const classPattern = new RegExp(`\\b(class|struct)\\s+${className}\\s*<([^>]+)>`);
|
|
78
|
+
const match = content.match(classPattern);
|
|
79
|
+
if (!match) return false;
|
|
80
|
+
|
|
81
|
+
const genericClause = match[2];
|
|
82
|
+
const constraints = genericClause.split(',').map((part) => part.trim());
|
|
83
|
+
|
|
84
|
+
return constraints.some((constraint) => {
|
|
85
|
+
const [name, bound] = constraint.split(':').map((value) => value.trim());
|
|
86
|
+
return name === typename && bound;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
65
90
|
_isConcreteService(typename) {
|
|
66
91
|
const hasConcretePattern = this.config.concretePatterns.some(pattern =>
|
|
67
92
|
new RegExp(pattern).test(typename)
|
|
@@ -73,6 +98,13 @@ class ConcreteDependencyStrategy extends DIStrategy {
|
|
|
73
98
|
|
|
74
99
|
return hasConcretePattern && !hasProtocolIndicator;
|
|
75
100
|
}
|
|
101
|
+
|
|
102
|
+
_isLikelyProtocolType(typename) {
|
|
103
|
+
if (/Impl$/.test(typename)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return /UseCase$|Repository$/.test(typename);
|
|
107
|
+
}
|
|
76
108
|
}
|
|
77
109
|
|
|
78
110
|
module.exports = ConcreteDependencyStrategy;
|