pumuki 6.3.359 → 6.3.360

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.
@@ -7,6 +7,7 @@ import {
7
7
  findKotlinOpenClosedWhenMatch,
8
8
  findKotlinPresentationSrpMatch,
9
9
  hasAndroidAsyncTaskUsage,
10
+ hasAndroidLegacyFingerprintApiUsage,
10
11
  hasKotlinCoroutineTryCatchUsage,
11
12
  hasKotlinDispatcherMainBoundaryLeakUsage,
12
13
  hasKotlinGlobalScopeUsage,
@@ -1243,3 +1244,37 @@ class PumukiLspAndroidCanaryPremiumDiscountPolicy : PumukiLspAndroidCanaryDiscou
1243
1244
  assert.match(match.impact, /sustituci|regresion|crash/i);
1244
1245
  assert.match(match.expected_fix, /contrato base|estrategia|subtipo/i);
1245
1246
  });
1247
+
1248
+ test('hasAndroidLegacyFingerprintApiUsage detecta APIs biométricas legacy y preserva BiometricPrompt', () => {
1249
+ const legacyManager = `
1250
+ import android.hardware.fingerprint.FingerprintManager
1251
+
1252
+ class LegacyBiometricAuth(private val fingerprintManager: FingerprintManager) {
1253
+ fun authenticate(callback: FingerprintManager.AuthenticationCallback) {
1254
+ fingerprintManager.authenticate(null, null, 0, callback, null)
1255
+ }
1256
+ }
1257
+ `;
1258
+ const legacyCompat = `
1259
+ class LegacyCompatAuth(private val fingerprintManager: FingerprintManagerCompat) {
1260
+ fun authenticate(callback: FingerprintManagerCompat.AuthenticationCallback) {
1261
+ fingerprintManager.authenticate(null, 0, null, callback, null)
1262
+ }
1263
+ }
1264
+ `;
1265
+ const modern = `
1266
+ import androidx.biometric.BiometricPrompt
1267
+
1268
+ class ModernBiometricAuth(private val biometricPrompt: BiometricPrompt) {
1269
+ fun authenticate(promptInfo: BiometricPrompt.PromptInfo) {
1270
+ biometricPrompt.authenticate(promptInfo)
1271
+ }
1272
+ }
1273
+ // FingerprintManager should not match inside comments
1274
+ val sample = "FingerprintManagerCompat"
1275
+ `;
1276
+
1277
+ assert.equal(hasAndroidLegacyFingerprintApiUsage(legacyManager), true);
1278
+ assert.equal(hasAndroidLegacyFingerprintApiUsage(legacyCompat), true);
1279
+ assert.equal(hasAndroidLegacyFingerprintApiUsage(modern), false);
1280
+ });
@@ -1407,3 +1407,25 @@ export const findKotlinLiskovSubstitutionMatch = (
1407
1407
 
1408
1408
  return undefined;
1409
1409
  };
1410
+
1411
+ const legacyFingerprintApiPattern =
1412
+ /\b(?:android\.hardware\.fingerprint\.)?FingerprintManager(?:Compat)?\b/;
1413
+
1414
+ export const hasAndroidLegacyFingerprintApiUsage = (source: string): boolean =>
1415
+ scanCodeLikeSource(source, ({ source: scannedSource, index }) => {
1416
+ const match = scannedSource.slice(index).match(legacyFingerprintApiPattern);
1417
+ return match?.index === 0;
1418
+ });
1419
+
1420
+ export const collectAndroidLegacyFingerprintApiLines = (
1421
+ source: string
1422
+ ): readonly number[] => {
1423
+ const lines: number[] = [];
1424
+ source.split(/\r?\n/).forEach((line, index) => {
1425
+ const sanitized = stripKotlinLineForSemanticScan(line);
1426
+ if (legacyFingerprintApiPattern.test(sanitized)) {
1427
+ lines.push(index + 1);
1428
+ }
1429
+ });
1430
+ return sortedUniqueLines(lines);
1431
+ };
@@ -893,6 +893,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
893
893
  { platform: 'android', pathCheck: isAndroidKotlinPath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasKotlinGlobalScopeUsage, ruleId: 'heuristics.android.globalscope.ast', code: 'HEURISTICS_ANDROID_GLOBAL_SCOPE_AST', message: 'AST heuristic detected GlobalScope coroutine usage in production Kotlin code.' },
894
894
  { platform: 'android', pathCheck: isAndroidKotlinPath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasKotlinRunBlockingUsage, ruleId: 'heuristics.android.run-blocking.ast', code: 'HEURISTICS_ANDROID_RUN_BLOCKING_AST', message: 'AST heuristic detected runBlocking usage in production Kotlin code.' },
895
895
  { platform: 'android', pathCheck: isAndroidSourcePath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasAndroidAsyncTaskUsage, ruleId: 'heuristics.android.concurrency.asynctask.ast', code: 'HEURISTICS_ANDROID_CONCURRENCY_ASYNCTASK_AST', message: 'AST heuristic detected deprecated AsyncTask usage in Android production code; use coroutines.' },
896
+ { platform: 'android', pathCheck: isAndroidKotlinPath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasAndroidLegacyFingerprintApiUsage, locateLines: TextAndroid.collectAndroidLegacyFingerprintApiLines, ruleId: 'heuristics.android.security.legacy-fingerprint-api.ast', code: 'HEURISTICS_ANDROID_SECURITY_LEGACY_FINGERPRINT_API_AST', message: 'AST heuristic detected legacy FingerprintManager API usage; use androidx.biometric.BiometricPrompt.' },
896
897
  { platform: 'android', pathCheck: isAndroidKotlinPath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasKotlinGodActivityUsage, ruleId: 'heuristics.android.architecture.god-activity.ast', code: 'HEURISTICS_ANDROID_ARCHITECTURE_GOD_ACTIVITY_AST', message: 'AST heuristic detected an Android Activity mixing UI entrypoint with product responsibilities; keep Activity thin and move features to composables/ViewModels/use cases.' },
897
898
  { platform: 'android', pathCheck: isAndroidKotlinPath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasKotlinApplicationOnCreateHeavyInitializationUsage, ruleId: 'heuristics.android.startup.application-oncreate-heavy-init.ast', code: 'HEURISTICS_ANDROID_STARTUP_APPLICATION_ONCREATE_HEAVY_INIT_AST', message: 'AST heuristic detected heavy library initialization in Application.onCreate; move lazy startup work to AndroidX Startup Initializer or defer it behind the feature boundary.' },
898
899
  { platform: 'android', pathCheck: isAndroidKotlinPath, excludePaths: [isKotlinTestPath], detect: TextAndroid.hasKotlinNonLazyScrollableCollectionUsage, ruleId: 'heuristics.android.compose.non-lazy-scrollable-collection.ast', code: 'HEURISTICS_ANDROID_COMPOSE_NON_LAZY_SCROLLABLE_COLLECTION_AST', message: 'AST heuristic detected a scrollable Column/Row rendering a collection; use LazyColumn/LazyRow for virtualized lists.' },
@@ -3,7 +3,7 @@ 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, 39);
6
+ assert.equal(androidRules.length, 40);
7
7
 
8
8
  const ids = androidRules.map((rule) => rule.id);
9
9
  assert.deepEqual(ids, [
@@ -13,6 +13,7 @@ test('androidRules define reglas heurísticas locked para plataforma android', (
13
13
  'heuristics.android.flow.livedata-state-exposure.ast',
14
14
  'heuristics.android.flow.viewmodel-flow-without-statein.ast',
15
15
  'heuristics.android.flow.sharedflow-used-as-state.ast',
16
+ 'heuristics.android.security.legacy-fingerprint-api.ast',
16
17
  'heuristics.android.concurrency.asynctask.ast',
17
18
  'heuristics.android.architecture.god-activity.ast',
18
19
  'heuristics.android.startup.application-oncreate-heavy-init.ast',
@@ -83,6 +84,10 @@ test('androidRules define reglas heurísticas locked para plataforma android', (
83
84
  byId.get('heuristics.android.flow.sharedflow-used-as-state.ast')?.then.code,
84
85
  'HEURISTICS_ANDROID_FLOW_SHAREDFLOW_USED_AS_STATE_AST'
85
86
  );
87
+ assert.equal(
88
+ byId.get('heuristics.android.security.legacy-fingerprint-api.ast')?.then.code,
89
+ 'HEURISTICS_ANDROID_SECURITY_LEGACY_FINGERPRINT_API_AST'
90
+ );
86
91
  assert.equal(
87
92
  byId.get('heuristics.android.concurrency.asynctask.ast')?.then.code,
88
93
  'HEURISTICS_ANDROID_CONCURRENCY_ASYNCTASK_AST'
@@ -115,6 +115,26 @@ export const androidRules: RuleSet = [
115
115
  code: 'HEURISTICS_ANDROID_FLOW_SHAREDFLOW_USED_AS_STATE_AST',
116
116
  },
117
117
  },
118
+ {
119
+ id: 'heuristics.android.security.legacy-fingerprint-api.ast',
120
+ description:
121
+ 'Detects legacy FingerprintManager API usage where androidx.biometric.BiometricPrompt is the supported baseline.',
122
+ severity: 'WARN',
123
+ platform: 'android',
124
+ locked: true,
125
+ when: {
126
+ kind: 'Heuristic',
127
+ where: {
128
+ ruleId: 'heuristics.android.security.legacy-fingerprint-api.ast',
129
+ },
130
+ },
131
+ then: {
132
+ kind: 'Finding',
133
+ message:
134
+ 'AST heuristic detected legacy FingerprintManager API usage; use androidx.biometric.BiometricPrompt.',
135
+ code: 'HEURISTICS_ANDROID_SECURITY_LEGACY_FINGERPRINT_API_AST',
136
+ },
137
+ },
118
138
  {
119
139
  id: 'heuristics.android.concurrency.asynctask.ast',
120
140
  description:
@@ -1431,6 +1431,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
1431
1431
  'android.flow.state-exposure',
1432
1432
  ['heuristics.android.flow.livedata-state-exposure.ast']
1433
1433
  ),
1434
+ 'skills.android.guideline.android.biometric-auth-biometricprompt-api': heuristicDetector(
1435
+ 'android.security.biometric-prompt',
1436
+ ['heuristics.android.security.legacy-fingerprint-api.ast']
1437
+ ),
1434
1438
  'skills.android.guideline.android.statein-convertir-cold-flow-a-hot-stateflow': heuristicDetector(
1435
1439
  'android.flow.viewmodel-flow-without-statein',
1436
1440
  ['heuristics.android.flow.viewmodel-flow-without-statein.ast']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.359",
3
+ "version": "6.3.360",
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": {
package/skills.lock.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "1.0",
3
3
  "compilerVersion": "1.0.0",
4
- "generatedAt": "2026-05-19T21:32:21.704Z",
4
+ "generatedAt": "2026-05-24T21:08:57.332Z",
5
5
  "bundles": [
6
6
  {
7
7
  "name": "android-guidelines",