pumuki 6.3.176 → 6.3.178
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.178
|
|
@@ -3,16 +3,31 @@ 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]));
|
|
21
|
+
const coroutineRuleIds = [
|
|
22
|
+
'heuristics.android.globalscope.ast',
|
|
23
|
+
'heuristics.android.run-blocking.ast',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
for (const ruleId of coroutineRuleIds) {
|
|
27
|
+
assert.equal(byId.get(ruleId)?.platform, 'android');
|
|
28
|
+
assert.equal(byId.get(ruleId)?.locked, true);
|
|
29
|
+
}
|
|
30
|
+
|
|
16
31
|
assert.equal(
|
|
17
32
|
byId.get('heuristics.android.thread-sleep.ast')?.then.code,
|
|
18
33
|
'HEURISTICS_ANDROID_THREAD_SLEEP_AST'
|
|
@@ -25,6 +40,26 @@ test('androidRules define reglas heurísticas locked para plataforma android', (
|
|
|
25
40
|
byId.get('heuristics.android.run-blocking.ast')?.then.code,
|
|
26
41
|
'HEURISTICS_ANDROID_RUN_BLOCKING_AST'
|
|
27
42
|
);
|
|
43
|
+
assert.equal(
|
|
44
|
+
byId.get('heuristics.android.solid.srp.presentation-mixed-responsibilities.ast')?.then.code,
|
|
45
|
+
'HEURISTICS_ANDROID_SOLID_SRP_PRESENTATION_MIXED_RESPONSIBILITIES_AST'
|
|
46
|
+
);
|
|
47
|
+
assert.equal(
|
|
48
|
+
byId.get('heuristics.android.solid.ocp.discriminator-branching.ast')?.then.code,
|
|
49
|
+
'HEURISTICS_ANDROID_SOLID_OCP_DISCRIMINATOR_BRANCHING_AST'
|
|
50
|
+
);
|
|
51
|
+
assert.equal(
|
|
52
|
+
byId.get('heuristics.android.solid.dip.concrete-framework-dependency.ast')?.then.code,
|
|
53
|
+
'HEURISTICS_ANDROID_SOLID_DIP_CONCRETE_FRAMEWORK_DEPENDENCY_AST'
|
|
54
|
+
);
|
|
55
|
+
assert.equal(
|
|
56
|
+
byId.get('heuristics.android.solid.isp.fat-interface-dependency.ast')?.then.code,
|
|
57
|
+
'HEURISTICS_ANDROID_SOLID_ISP_FAT_INTERFACE_DEPENDENCY_AST'
|
|
58
|
+
);
|
|
59
|
+
assert.equal(
|
|
60
|
+
byId.get('heuristics.android.solid.lsp.narrowed-precondition.ast')?.then.code,
|
|
61
|
+
'HEURISTICS_ANDROID_SOLID_LSP_NARROWED_PRECONDITION_AST'
|
|
62
|
+
);
|
|
28
63
|
|
|
29
64
|
for (const rule of androidRules) {
|
|
30
65
|
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,16 @@ 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
|
+
|
|
125
|
+
### Enforcement AST inicial de coroutines Android
|
|
126
|
+
✅ `skills.android.guideline.android.coroutines-async-await-no-callbacks` debe mapear a señales ejecutables existentes de uso inseguro de coroutines, empezando por `GlobalScope` y `runBlocking`.
|
|
127
|
+
✅ El baseline inicial de coroutines es parcial: cubre APIs bloqueantes o scopes no estructurados, pero no declara todavía cobertura completa de `Flow`, `viewModelScope`, `supervisorScope`, dispatchers ni cancelación cooperativa.
|
|
128
|
+
✅ Si se amplía esta cobertura, cada nueva regla debe aterrizar como detector AST/textual semántico con test dirigido antes de declararse cubierta en el registry.
|
|
129
|
+
|
|
120
130
|
### Dependency Injection (Hilt):
|
|
121
131
|
✅ **Hilt** - DI framework (NO manual factories)
|
|
122
132
|
✅ **@HiltAndroidApp** - Application class
|
|
@@ -213,6 +213,20 @@ 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.guideline.android.coroutines-async-await-no-callbacks': heuristicDetector(
|
|
217
|
+
'android.coroutines.baseline',
|
|
218
|
+
[
|
|
219
|
+
'heuristics.android.globalscope.ast',
|
|
220
|
+
'heuristics.android.run-blocking.ast',
|
|
221
|
+
]
|
|
222
|
+
),
|
|
223
|
+
'skills.android.no-solid-violations': heuristicDetector('android.solid', [
|
|
224
|
+
'heuristics.android.solid.srp.presentation-mixed-responsibilities.ast',
|
|
225
|
+
'heuristics.android.solid.ocp.discriminator-branching.ast',
|
|
226
|
+
'heuristics.android.solid.dip.concrete-framework-dependency.ast',
|
|
227
|
+
'heuristics.android.solid.isp.fat-interface-dependency.ast',
|
|
228
|
+
'heuristics.android.solid.lsp.narrowed-precondition.ast',
|
|
229
|
+
]),
|
|
216
230
|
};
|
|
217
231
|
|
|
218
232
|
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.178",
|
|
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": {
|