pumuki 6.3.176 → 6.3.177
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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v6.3.
|
|
1
|
+
v6.3.177
|
|
@@ -3,13 +3,18 @@ import test from 'node:test';
|
|
|
3
3
|
import { androidRules } from './android';
|
|
4
4
|
|
|
5
5
|
test('androidRules define reglas heurísticas locked para plataforma android', () => {
|
|
6
|
-
assert.equal(androidRules.length,
|
|
6
|
+
assert.equal(androidRules.length, 8);
|
|
7
7
|
|
|
8
8
|
const ids = androidRules.map((rule) => rule.id);
|
|
9
9
|
assert.deepEqual(ids, [
|
|
10
10
|
'heuristics.android.thread-sleep.ast',
|
|
11
11
|
'heuristics.android.globalscope.ast',
|
|
12
12
|
'heuristics.android.run-blocking.ast',
|
|
13
|
+
'heuristics.android.solid.srp.presentation-mixed-responsibilities.ast',
|
|
14
|
+
'heuristics.android.solid.ocp.discriminator-branching.ast',
|
|
15
|
+
'heuristics.android.solid.dip.concrete-framework-dependency.ast',
|
|
16
|
+
'heuristics.android.solid.isp.fat-interface-dependency.ast',
|
|
17
|
+
'heuristics.android.solid.lsp.narrowed-precondition.ast',
|
|
13
18
|
]);
|
|
14
19
|
|
|
15
20
|
const byId = new Map(androidRules.map((rule) => [rule.id, rule]));
|
|
@@ -25,6 +30,26 @@ test('androidRules define reglas heurísticas locked para plataforma android', (
|
|
|
25
30
|
byId.get('heuristics.android.run-blocking.ast')?.then.code,
|
|
26
31
|
'HEURISTICS_ANDROID_RUN_BLOCKING_AST'
|
|
27
32
|
);
|
|
33
|
+
assert.equal(
|
|
34
|
+
byId.get('heuristics.android.solid.srp.presentation-mixed-responsibilities.ast')?.then.code,
|
|
35
|
+
'HEURISTICS_ANDROID_SOLID_SRP_PRESENTATION_MIXED_RESPONSIBILITIES_AST'
|
|
36
|
+
);
|
|
37
|
+
assert.equal(
|
|
38
|
+
byId.get('heuristics.android.solid.ocp.discriminator-branching.ast')?.then.code,
|
|
39
|
+
'HEURISTICS_ANDROID_SOLID_OCP_DISCRIMINATOR_BRANCHING_AST'
|
|
40
|
+
);
|
|
41
|
+
assert.equal(
|
|
42
|
+
byId.get('heuristics.android.solid.dip.concrete-framework-dependency.ast')?.then.code,
|
|
43
|
+
'HEURISTICS_ANDROID_SOLID_DIP_CONCRETE_FRAMEWORK_DEPENDENCY_AST'
|
|
44
|
+
);
|
|
45
|
+
assert.equal(
|
|
46
|
+
byId.get('heuristics.android.solid.isp.fat-interface-dependency.ast')?.then.code,
|
|
47
|
+
'HEURISTICS_ANDROID_SOLID_ISP_FAT_INTERFACE_DEPENDENCY_AST'
|
|
48
|
+
);
|
|
49
|
+
assert.equal(
|
|
50
|
+
byId.get('heuristics.android.solid.lsp.narrowed-precondition.ast')?.then.code,
|
|
51
|
+
'HEURISTICS_ANDROID_SOLID_LSP_NARROWED_PRECONDITION_AST'
|
|
52
|
+
);
|
|
28
53
|
|
|
29
54
|
for (const rule of androidRules) {
|
|
30
55
|
assert.equal(rule.platform, 'android');
|
|
@@ -55,4 +55,104 @@ export const androidRules: RuleSet = [
|
|
|
55
55
|
code: 'HEURISTICS_ANDROID_RUN_BLOCKING_AST',
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
id: 'heuristics.android.solid.srp.presentation-mixed-responsibilities.ast',
|
|
60
|
+
description:
|
|
61
|
+
'Detects Android presentation types mixing session, networking, persistence and navigation responsibilities.',
|
|
62
|
+
severity: 'WARN',
|
|
63
|
+
platform: 'android',
|
|
64
|
+
locked: true,
|
|
65
|
+
when: {
|
|
66
|
+
kind: 'Heuristic',
|
|
67
|
+
where: {
|
|
68
|
+
ruleId: 'heuristics.android.solid.srp.presentation-mixed-responsibilities.ast',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
then: {
|
|
72
|
+
kind: 'Finding',
|
|
73
|
+
message:
|
|
74
|
+
'AST heuristic detected Android presentation code mixing multiple responsibilities.',
|
|
75
|
+
code: 'HEURISTICS_ANDROID_SOLID_SRP_PRESENTATION_MIXED_RESPONSIBILITIES_AST',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'heuristics.android.solid.ocp.discriminator-branching.ast',
|
|
80
|
+
description:
|
|
81
|
+
'Detects Android application or presentation code branching on discriminators instead of extending behavior.',
|
|
82
|
+
severity: 'WARN',
|
|
83
|
+
platform: 'android',
|
|
84
|
+
locked: true,
|
|
85
|
+
when: {
|
|
86
|
+
kind: 'Heuristic',
|
|
87
|
+
where: {
|
|
88
|
+
ruleId: 'heuristics.android.solid.ocp.discriminator-branching.ast',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
then: {
|
|
92
|
+
kind: 'Finding',
|
|
93
|
+
message:
|
|
94
|
+
'AST heuristic detected Android discriminator branching that weakens OCP.',
|
|
95
|
+
code: 'HEURISTICS_ANDROID_SOLID_OCP_DISCRIMINATOR_BRANCHING_AST',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'heuristics.android.solid.dip.concrete-framework-dependency.ast',
|
|
100
|
+
description:
|
|
101
|
+
'Detects Android application or presentation code depending on concrete framework infrastructure.',
|
|
102
|
+
severity: 'WARN',
|
|
103
|
+
platform: 'android',
|
|
104
|
+
locked: true,
|
|
105
|
+
when: {
|
|
106
|
+
kind: 'Heuristic',
|
|
107
|
+
where: {
|
|
108
|
+
ruleId: 'heuristics.android.solid.dip.concrete-framework-dependency.ast',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
then: {
|
|
112
|
+
kind: 'Finding',
|
|
113
|
+
message:
|
|
114
|
+
'AST heuristic detected Android concrete framework dependency in a high-level layer.',
|
|
115
|
+
code: 'HEURISTICS_ANDROID_SOLID_DIP_CONCRETE_FRAMEWORK_DEPENDENCY_AST',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'heuristics.android.solid.isp.fat-interface-dependency.ast',
|
|
120
|
+
description:
|
|
121
|
+
'Detects Android application or presentation code depending on interfaces broader than the members used.',
|
|
122
|
+
severity: 'WARN',
|
|
123
|
+
platform: 'android',
|
|
124
|
+
locked: true,
|
|
125
|
+
when: {
|
|
126
|
+
kind: 'Heuristic',
|
|
127
|
+
where: {
|
|
128
|
+
ruleId: 'heuristics.android.solid.isp.fat-interface-dependency.ast',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
then: {
|
|
132
|
+
kind: 'Finding',
|
|
133
|
+
message:
|
|
134
|
+
'AST heuristic detected Android dependency on a fat interface.',
|
|
135
|
+
code: 'HEURISTICS_ANDROID_SOLID_ISP_FAT_INTERFACE_DEPENDENCY_AST',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'heuristics.android.solid.lsp.narrowed-precondition.ast',
|
|
140
|
+
description:
|
|
141
|
+
'Detects Android application or presentation subtypes that narrow preconditions and break substitution.',
|
|
142
|
+
severity: 'WARN',
|
|
143
|
+
platform: 'android',
|
|
144
|
+
locked: true,
|
|
145
|
+
when: {
|
|
146
|
+
kind: 'Heuristic',
|
|
147
|
+
where: {
|
|
148
|
+
ruleId: 'heuristics.android.solid.lsp.narrowed-precondition.ast',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
then: {
|
|
152
|
+
kind: 'Finding',
|
|
153
|
+
message:
|
|
154
|
+
'AST heuristic detected Android subtype narrowing a contract precondition.',
|
|
155
|
+
code: 'HEURISTICS_ANDROID_SOLID_LSP_NARROWED_PRECONDITION_AST',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
58
158
|
];
|
|
@@ -117,6 +117,11 @@ app/
|
|
|
117
117
|
di/ # Hilt modules
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
+
### Enforcement AST inicial de arquitectura Android
|
|
121
|
+
✅ `skills.android.no-solid-violations` debe mapear a detectores AST semánticos, no a conteos de líneas ni umbrales arbitrarios.
|
|
122
|
+
✅ El baseline Android debe cubrir al menos SRP en presentation, OCP por branching de discriminadores, DIP por dependencias concretas de framework, ISP por interfaces demasiado anchas y LSP por precondiciones estrechadas.
|
|
123
|
+
✅ Estos detectores son paridad parcial Android: no sustituyen una auditoría completa de arquitectura, pero sí evitan que reglas SOLID críticas queden como doctrina declarativa sin señal ejecutable.
|
|
124
|
+
|
|
120
125
|
### Dependency Injection (Hilt):
|
|
121
126
|
✅ **Hilt** - DI framework (NO manual factories)
|
|
122
127
|
✅ **@HiltAndroidApp** - Application class
|
|
@@ -213,6 +213,13 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
|
|
|
213
213
|
'skills.android.no-runblocking': heuristicDetector('android.run-blocking', [
|
|
214
214
|
'heuristics.android.run-blocking.ast',
|
|
215
215
|
]),
|
|
216
|
+
'skills.android.no-solid-violations': heuristicDetector('android.solid', [
|
|
217
|
+
'heuristics.android.solid.srp.presentation-mixed-responsibilities.ast',
|
|
218
|
+
'heuristics.android.solid.ocp.discriminator-branching.ast',
|
|
219
|
+
'heuristics.android.solid.dip.concrete-framework-dependency.ast',
|
|
220
|
+
'heuristics.android.solid.isp.fat-interface-dependency.ast',
|
|
221
|
+
'heuristics.android.solid.lsp.narrowed-precondition.ast',
|
|
222
|
+
]),
|
|
216
223
|
};
|
|
217
224
|
|
|
218
225
|
export const listSkillsDetectorBindings = (): ReadonlyArray<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.177",
|
|
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": {
|