pumuki 6.3.225 → 6.3.226

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.
@@ -37,6 +37,7 @@ import {
37
37
  hasSwiftModernizableXCTestSuiteUsage,
38
38
  hasSwiftNonLazyScrollForEachUsage,
39
39
  hasSwiftViewBodyObjectCreationUsage,
40
+ hasSwiftUiImageDataDecodingUsage,
40
41
  hasSwiftAssumeIsolatedUsage,
41
42
  hasSwiftCoreDataLayerLeakUsage,
42
43
  hasSwiftSwiftDataLayerLeakUsage,
@@ -191,6 +192,34 @@ struct PriceView: View {
191
192
  assert.equal(hasSwiftViewBodyObjectCreationUsage(safe), false);
192
193
  });
193
194
 
195
+ test('hasSwiftUiImageDataDecodingUsage detecta UIImage(data:) y preserva strings y comentarios', () => {
196
+ const source = `
197
+ struct AvatarView: View {
198
+ let imageData: Data
199
+
200
+ var body: some View {
201
+ if let image = UIImage(data: imageData) {
202
+ Image(uiImage: image)
203
+ }
204
+ }
205
+ }
206
+ `;
207
+ const safe = `
208
+ struct AvatarView: View {
209
+ let image: UIImage
210
+
211
+ var body: some View {
212
+ Image(uiImage: image)
213
+ let sample = "UIImage(data: imageData)"
214
+ // UIImage(data: imageData)
215
+ }
216
+ }
217
+ `;
218
+
219
+ assert.equal(hasSwiftUiImageDataDecodingUsage(source), true);
220
+ assert.equal(hasSwiftUiImageDataDecodingUsage(safe), false);
221
+ });
222
+
194
223
  test('hasSwiftForceTryUsage detecta try! y descarta try?', () => {
195
224
  const positive = `
196
225
  func load() {
@@ -396,6 +396,11 @@ export const hasSwiftViewBodyObjectCreationUsage = (source: string): boolean =>
396
396
  return viewBodyObjectCreationPattern.test(swiftSource);
397
397
  };
398
398
 
399
+ export const hasSwiftUiImageDataDecodingUsage = (source: string): boolean => {
400
+ const swiftSource = sanitizeSwiftSourceForMultilineRegex(source);
401
+ return /\bUIImage\s*\(\s*data\s*:/.test(swiftSource);
402
+ };
403
+
399
404
  export const hasSwiftDispatchQueueUsage = (source: string): boolean => {
400
405
  return scanCodeLikeSource(source, ({ source: swiftSource, index, current }) => {
401
406
  if (current !== 'D' || !hasIdentifierAt(swiftSource, index, 'DispatchQueue')) {
@@ -687,6 +687,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
687
687
  { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftRedundantReactiveStateAssignmentUsage, ruleId: 'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast', code: 'HEURISTICS_IOS_SWIFTUI_REDUNDANT_REACTIVE_STATE_ASSIGNMENT_AST', message: 'AST heuristic detected reactive state assignment without a value-change guard; check for value changes before assigning state in hot paths.' },
688
688
  { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftNonLazyScrollForEachUsage, ruleId: 'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast', code: 'HEURISTICS_IOS_SWIFTUI_NON_LAZY_SCROLL_FOREACH_AST', message: 'AST heuristic detected ScrollView with a non-lazy stack feeding ForEach; LazyVStack/LazyHStack remain the preferred baseline for large scrollable collections.' },
689
689
  { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftViewBodyObjectCreationUsage, ruleId: 'heuristics.ios.swiftui.body-object-creation.ast', code: 'HEURISTICS_IOS_SWIFTUI_BODY_OBJECT_CREATION_AST', message: 'AST heuristic detected formatter object creation inside SwiftUI body; keep body simple and move expensive objects out of render paths.' },
690
+ { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftUiImageDataDecodingUsage, ruleId: 'heuristics.ios.swiftui.image-data-decoding.ast', code: 'HEURISTICS_IOS_SWIFTUI_IMAGE_DATA_DECODING_AST', message: 'AST heuristic detected UIImage(data:) in SwiftUI presentation; downsample image data before rendering large images.' },
690
691
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftNavigationViewUsage, ruleId: 'heuristics.ios.navigation-view.ast', code: 'HEURISTICS_IOS_NAVIGATION_VIEW_AST', message: 'AST heuristic detected NavigationView usage.' },
691
692
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftForegroundColorUsage, ruleId: 'heuristics.ios.foreground-color.ast', code: 'HEURISTICS_IOS_FOREGROUND_COLOR_AST', message: 'AST heuristic detected foregroundColor usage.' },
692
693
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftCornerRadiusUsage, ruleId: 'heuristics.ios.corner-radius.ast', code: 'HEURISTICS_IOS_CORNER_RADIUS_AST', message: 'AST heuristic detected cornerRadius usage.' },
@@ -949,6 +949,25 @@ export const iosRules: RuleSet = [
949
949
  code: 'HEURISTICS_IOS_SWIFTUI_BODY_OBJECT_CREATION_AST',
950
950
  },
951
951
  },
952
+ {
953
+ id: 'heuristics.ios.swiftui.image-data-decoding.ast',
954
+ description: 'Detects UIImage(data:) decoding in SwiftUI presentation paths.',
955
+ severity: 'WARN',
956
+ platform: 'ios',
957
+ locked: true,
958
+ when: {
959
+ kind: 'Heuristic',
960
+ where: {
961
+ ruleId: 'heuristics.ios.swiftui.image-data-decoding.ast',
962
+ },
963
+ },
964
+ then: {
965
+ kind: 'Finding',
966
+ message:
967
+ 'AST heuristic detected UIImage(data:) in SwiftUI presentation; downsample image data before rendering large images.',
968
+ code: 'HEURISTICS_IOS_SWIFTUI_IMAGE_DATA_DECODING_AST',
969
+ },
970
+ },
952
971
  {
953
972
  id: 'heuristics.ios.navigation-view.ast',
954
973
  description: 'Detects NavigationView usage in iOS production code.',
@@ -262,6 +262,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
262
262
  heuristicDetector('ios.swiftui.body-object-creation', [
263
263
  'heuristics.ios.swiftui.body-object-creation.ast',
264
264
  ]),
265
+ 'skills.ios.guideline.ios-swiftui-expert.suggest-image-downsampling-when-uiimage-data-is-encountered':
266
+ heuristicDetector('ios.swiftui.image-data-decoding', [
267
+ 'heuristics.ios.swiftui.image-data-decoding.ast',
268
+ ]),
265
269
  'skills.ios.no-scrollview-shows-indicators': heuristicDetector(
266
270
  'ios.scrollview-shows-indicators',
267
271
  ['heuristics.ios.scrollview-shows-indicators.ast']
@@ -16,7 +16,7 @@ const MARKDOWN_BOLD_PATTERN = /[*_]{1,3}/g;
16
16
  const MULTISPACE_PATTERN = /\s+/g;
17
17
  const AST_NODE_ID_PATTERN = /\bheuristics\.[a-z0-9._-]+\.ast\b/gi;
18
18
  const RULE_KEYWORDS =
19
- /\b(always|siempre|prefer|use|usar|avoid|evitar|never|nunca|must|obligatorio|required|disallow|do not|no)\b/i;
19
+ /\b(always|siempre|prefer|use|usar|avoid|evitar|never|nunca|must|obligatorio|required|disallow|do not|no|suggest)\b/i;
20
20
 
21
21
  const normalizeForLookup = (value: string): string => {
22
22
  return value
@@ -374,6 +374,13 @@ const normalizeKnownRuleTarget = (
374
374
  ) {
375
375
  return 'skills.ios.guideline.ios-swiftui-expert.no-object-creation-in-body';
376
376
  }
377
+ if (
378
+ includes('image downsampling') ||
379
+ (includes('uiimage data') && includes('downsampling')) ||
380
+ (includes('uiimage data') && includes('encountered'))
381
+ ) {
382
+ return 'skills.ios.guideline.ios-swiftui-expert.suggest-image-downsampling-when-uiimage-data-is-encountered';
383
+ }
377
384
  if (
378
385
  includes('scrollindicators hidden') ||
379
386
  includes('scroll indicators hidden') ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.225",
3
+ "version": "6.3.226",
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-13T16:19:49.576Z",
4
+ "generatedAt": "2026-05-13T16:23:26.589Z",
5
5
  "bundles": [
6
6
  {
7
7
  "name": "android-guidelines",
@@ -8632,7 +8632,7 @@
8632
8632
  "name": "ios-swiftui-expert-guidelines",
8633
8633
  "version": "1.0.0",
8634
8634
  "source": "file:vendor/skills/swiftui-expert-skill/SKILL.md",
8635
- "hash": "2acbd66e86e9e809f0c4bdb5d215618096f5773e359085e3a4dc707b83c1ebb1",
8635
+ "hash": "10b8966d8204f1abb91af3254cfb809bf0a3822b8d09347c28639d23e6dfc1c7",
8636
8636
  "rules": [
8637
8637
  {
8638
8638
  "id": "skills.ios.guideline.ios-swiftui-expert.always-mark-state-and-stateobject-as-private-makes-dependencies-clear",
@@ -8742,6 +8742,18 @@
8742
8742
  "evaluationMode": "DECLARATIVE",
8743
8743
  "origin": "core"
8744
8744
  },
8745
+ {
8746
+ "id": "skills.ios.guideline.ios-swiftui-expert.suggest-image-downsampling-when-uiimage-data-is-encountered",
8747
+ "description": "Suggest image downsampling when UIImage(data:) is used (as optional optimization, see references/image-optimization.md)",
8748
+ "severity": "WARN",
8749
+ "platform": "ios",
8750
+ "sourceSkill": "ios-swiftui-expert-guidelines",
8751
+ "sourcePath": "vendor/skills/swiftui-expert-skill/SKILL.md",
8752
+ "confidence": "MEDIUM",
8753
+ "locked": true,
8754
+ "evaluationMode": "AUTO",
8755
+ "origin": "core"
8756
+ },
8745
8757
  {
8746
8758
  "id": "skills.ios.guideline.ios-swiftui-expert.use-glasseffectid-with-namespace-for-morphing-transitions",
8747
8759
  "description": "Use glassEffectID with @Namespace for morphing transitions",