pumuki 6.3.193 → 6.3.194

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.
@@ -76,6 +76,22 @@ const isIOSSwiftPath = (path: string): boolean => {
76
76
  return path.endsWith('.swift') && path.startsWith('apps/ios/');
77
77
  };
78
78
 
79
+ const isIOSPodfilePath = (path: string): boolean => {
80
+ const normalized = path.replace(/\\/g, '/');
81
+ return (
82
+ normalized.startsWith('apps/ios/') &&
83
+ (normalized.endsWith('/Podfile') || normalized.endsWith('/Podfile.lock'))
84
+ );
85
+ };
86
+
87
+ const isIOSCartfilePath = (path: string): boolean => {
88
+ const normalized = path.replace(/\\/g, '/');
89
+ return (
90
+ normalized.startsWith('apps/ios/') &&
91
+ (normalized.endsWith('/Cartfile') || normalized.endsWith('/Cartfile.resolved'))
92
+ );
93
+ };
94
+
79
95
  const isIOSApplicationOrPresentationPath = (path: string): boolean => {
80
96
  return (
81
97
  isIOSSwiftPath(path) &&
@@ -608,6 +624,8 @@ type TextDetectorRegistryEntry = {
608
624
 
609
625
  const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
610
626
  // iOS
627
+ { platform: 'ios', pathCheck: isIOSPodfilePath, excludePaths: [], detect: detectsTrackedFilePresence, ruleId: 'heuristics.ios.dependencies.cocoapods.ast', code: 'HEURISTICS_IOS_DEPENDENCIES_COCOAPODS_AST', message: 'AST heuristic detected CocoaPods dependency files in an iOS project; Swift Package Manager remains the preferred baseline for new code.' },
628
+ { platform: 'ios', pathCheck: isIOSCartfilePath, excludePaths: [], detect: detectsTrackedFilePresence, ruleId: 'heuristics.ios.dependencies.carthage.ast', code: 'HEURISTICS_IOS_DEPENDENCIES_CARTHAGE_AST', message: 'AST heuristic detected Carthage dependency files in an iOS project; Swift Package Manager remains the preferred baseline for new code.' },
611
629
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftForceUnwrap, ruleId: 'heuristics.ios.force-unwrap.ast', code: 'HEURISTICS_IOS_FORCE_UNWRAP_AST', message: 'AST heuristic detected force unwrap usage.' },
612
630
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftAnyViewUsage, ruleId: 'heuristics.ios.anyview.ast', code: 'HEURISTICS_IOS_ANYVIEW_AST', message: 'AST heuristic detected AnyView usage.' },
613
631
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftForceTryUsage, ruleId: 'heuristics.ios.force-try.ast', code: 'HEURISTICS_IOS_FORCE_TRY_AST', message: 'AST heuristic detected force try usage.' },
@@ -3,7 +3,7 @@ import test from 'node:test';
3
3
  import { iosRules } from './ios';
4
4
 
5
5
  test('iosRules define reglas heurísticas locked para plataforma ios', () => {
6
- assert.equal(iosRules.length, 47);
6
+ assert.equal(iosRules.length, 49);
7
7
 
8
8
  const ids = iosRules.map((rule) => rule.id);
9
9
  assert.deepEqual(ids, [
@@ -21,6 +21,8 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
21
21
  'heuristics.ios.logging.sensitive-data.ast',
22
22
  'heuristics.ios.networking.alamofire.ast',
23
23
  'heuristics.ios.json.jsonserialization.ast',
24
+ 'heuristics.ios.dependencies.cocoapods.ast',
25
+ 'heuristics.ios.dependencies.carthage.ast',
24
26
  'heuristics.ios.unchecked-sendable.ast',
25
27
  'heuristics.ios.preconcurrency.ast',
26
28
  'heuristics.ios.nonisolated-unsafe.ast',
@@ -81,6 +83,14 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
81
83
  byId.get('heuristics.ios.json.jsonserialization.ast')?.then.code,
82
84
  'HEURISTICS_IOS_JSON_JSONSERIALIZATION_AST'
83
85
  );
86
+ assert.equal(
87
+ byId.get('heuristics.ios.dependencies.cocoapods.ast')?.then.code,
88
+ 'HEURISTICS_IOS_DEPENDENCIES_COCOAPODS_AST'
89
+ );
90
+ assert.equal(
91
+ byId.get('heuristics.ios.dependencies.carthage.ast')?.then.code,
92
+ 'HEURISTICS_IOS_DEPENDENCIES_CARTHAGE_AST'
93
+ );
84
94
  assert.equal(
85
95
  byId.get('heuristics.ios.preconcurrency.ast')?.then.code,
86
96
  'HEURISTICS_IOS_PRECONCURRENCY_AST'
@@ -253,6 +253,42 @@ export const iosRules: RuleSet = [
253
253
  code: 'HEURISTICS_IOS_JSON_JSONSERIALIZATION_AST',
254
254
  },
255
255
  },
256
+ {
257
+ id: 'heuristics.ios.dependencies.cocoapods.ast',
258
+ description: 'Detects CocoaPods dependency files in iOS projects; Swift Package Manager is the preferred baseline for new code.',
259
+ severity: 'WARN',
260
+ platform: 'ios',
261
+ locked: true,
262
+ when: {
263
+ kind: 'Heuristic',
264
+ where: {
265
+ ruleId: 'heuristics.ios.dependencies.cocoapods.ast',
266
+ },
267
+ },
268
+ then: {
269
+ kind: 'Finding',
270
+ message: 'AST heuristic detected CocoaPods dependency files in an iOS project; Swift Package Manager remains the preferred baseline for new code.',
271
+ code: 'HEURISTICS_IOS_DEPENDENCIES_COCOAPODS_AST',
272
+ },
273
+ },
274
+ {
275
+ id: 'heuristics.ios.dependencies.carthage.ast',
276
+ description: 'Detects Carthage dependency files in iOS projects; Swift Package Manager is the preferred baseline for new code.',
277
+ severity: 'WARN',
278
+ platform: 'ios',
279
+ locked: true,
280
+ when: {
281
+ kind: 'Heuristic',
282
+ where: {
283
+ ruleId: 'heuristics.ios.dependencies.carthage.ast',
284
+ },
285
+ },
286
+ then: {
287
+ kind: 'Finding',
288
+ message: 'AST heuristic detected Carthage dependency files in an iOS project; Swift Package Manager remains the preferred baseline for new code.',
289
+ code: 'HEURISTICS_IOS_DEPENDENCIES_CARTHAGE_AST',
290
+ },
291
+ },
256
292
  {
257
293
  id: 'heuristics.ios.unchecked-sendable.ast',
258
294
  description: 'Detects @unchecked Sendable usage in iOS production code.',
@@ -509,6 +509,12 @@ struct UseCaseFactory {
509
509
  - `skills.ios.guideline.ios.codable-para-serializacio-n-json-nunca-jsonserialization` se mapea a `heuristics.ios.json.jsonserialization.ast`.
510
510
  - En `PROJECT MODE: brownfield`, estos hallazgos son señal de baseline/adopción y deben evitar drift nuevo sin bloquear deuda histórica salvo promoción explícita de policy.
511
511
 
512
+ ### Enforcement AST inicial de dependencias iOS
513
+
514
+ - `skills.ios.guideline.ios.cocoapods-prohibido` se mapea a `heuristics.ios.dependencies.cocoapods.ast`.
515
+ - `skills.ios.guideline.ios.carthage-prohibido` se mapea a `heuristics.ios.dependencies.carthage.ast`.
516
+ - En `PROJECT MODE: brownfield`, estos hallazgos son señal de baseline/adopción y deben evitar drift nuevo sin bloquear deuda histórica salvo promoción explícita de policy. Swift Package Manager permanece como baseline preferente para código nuevo.
517
+
512
518
  ```swift
513
519
  // ✅ Ejemplo: APIClient con URLSession y async/await
514
520
  protocol APIClientProtocol: Sendable {
@@ -67,6 +67,14 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
67
67
  'ios.json.jsonserialization',
68
68
  ['heuristics.ios.json.jsonserialization.ast']
69
69
  ),
70
+ 'skills.ios.guideline.ios.cocoapods-prohibido': heuristicDetector(
71
+ 'ios.dependencies.cocoapods',
72
+ ['heuristics.ios.dependencies.cocoapods.ast']
73
+ ),
74
+ 'skills.ios.guideline.ios.carthage-prohibido': heuristicDetector(
75
+ 'ios.dependencies.carthage',
76
+ ['heuristics.ios.dependencies.carthage.ast']
77
+ ),
70
78
  'skills.ios.no-unchecked-sendable': heuristicDetector('ios.unchecked-sendable', [
71
79
  'heuristics.ios.unchecked-sendable.ast',
72
80
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.193",
3
+ "version": "6.3.194",
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": {