pumuki 6.3.223 → 6.3.224

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.
@@ -35,6 +35,7 @@ import {
35
35
  hasSwiftMixedTestingFrameworksUsage,
36
36
  hasSwiftLegacyXCTestImportUsage,
37
37
  hasSwiftModernizableXCTestSuiteUsage,
38
+ hasSwiftNonLazyScrollForEachUsage,
38
39
  hasSwiftAssumeIsolatedUsage,
39
40
  hasSwiftCoreDataLayerLeakUsage,
40
41
  hasSwiftSwiftDataLayerLeakUsage,
@@ -123,6 +124,44 @@ test('hasSwiftAnyViewUsage ignora comentarios, strings y coincidencias parciales
123
124
  assert.equal(hasSwiftAnyViewUsage(source), false);
124
125
  });
125
126
 
127
+ test('hasSwiftNonLazyScrollForEachUsage detecta ScrollView con stack no lazy y preserva LazyVStack', () => {
128
+ const source = `
129
+ struct FeedView: View {
130
+ let items: [Item]
131
+
132
+ var body: some View {
133
+ ScrollView {
134
+ VStack(spacing: 12) {
135
+ ForEach(items) { item in
136
+ FeedRow(item: item)
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ `;
143
+ const safe = `
144
+ struct FeedView: View {
145
+ let items: [Item]
146
+
147
+ var body: some View {
148
+ ScrollView {
149
+ LazyVStack(spacing: 12) {
150
+ ForEach(items) { item in
151
+ FeedRow(item: item)
152
+ }
153
+ }
154
+ }
155
+ let sample = "ScrollView { VStack { ForEach(items) } }"
156
+ // ScrollView { VStack { ForEach(items) } }
157
+ }
158
+ }
159
+ `;
160
+
161
+ assert.equal(hasSwiftNonLazyScrollForEachUsage(source), true);
162
+ assert.equal(hasSwiftNonLazyScrollForEachUsage(safe), false);
163
+ });
164
+
126
165
  test('hasSwiftForceTryUsage detecta try! y descarta try?', () => {
127
166
  const positive = `
128
167
  func load() {
@@ -380,6 +380,14 @@ export const hasSwiftAnyViewUsage = (source: string): boolean => {
380
380
  });
381
381
  };
382
382
 
383
+ export const hasSwiftNonLazyScrollForEachUsage = (source: string): boolean => {
384
+ const swiftSource = sanitizeSwiftSourceForMultilineRegex(source);
385
+ const nonLazyScrollableCollectionPattern =
386
+ /\bScrollView\s*(?:\([^)]*\))?\s*\{[\s\S]{0,2000}\b(?:VStack|HStack)\s*(?:\([^)]*\))?\s*\{[\s\S]{0,1200}\bForEach\s*\(/;
387
+
388
+ return nonLazyScrollableCollectionPattern.test(swiftSource);
389
+ };
390
+
383
391
  export const hasSwiftDispatchQueueUsage = (source: string): boolean => {
384
392
  return scanCodeLikeSource(source, ({ source: swiftSource, index, current }) => {
385
393
  if (current !== 'D' || !hasIdentifierAt(swiftSource, index, 'DispatchQueue')) {
@@ -685,6 +685,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
685
685
  { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftExplicitColorStaticMemberUsage, ruleId: 'heuristics.ios.swiftui.explicit-color-static-member.ast', code: 'HEURISTICS_IOS_SWIFTUI_EXPLICIT_COLOR_STATIC_MEMBER_AST', message: 'AST heuristic detected Color.* static member usage where SwiftUI static member lookup may be preferred.' },
686
686
  { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftClosureBasedViewBuilderContentUsage, ruleId: 'heuristics.ios.swiftui.closure-based-viewbuilder-content.ast', code: 'HEURISTICS_IOS_SWIFTUI_CLOSURE_BASED_VIEWBUILDER_CONTENT_AST', message: 'AST heuristic detected closure-based content storage; @ViewBuilder let content: Content remains the preferred SwiftUI container baseline.' },
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
+ { 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.' },
688
689
  { 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.' },
689
690
  { 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.' },
690
691
  { 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.' },
@@ -911,6 +911,25 @@ export const iosRules: RuleSet = [
911
911
  code: 'HEURISTICS_IOS_SWIFTUI_REDUNDANT_REACTIVE_STATE_ASSIGNMENT_AST',
912
912
  },
913
913
  },
914
+ {
915
+ id: 'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast',
916
+ description: 'Detects ScrollView content backed by non-lazy stacks and ForEach.',
917
+ severity: 'WARN',
918
+ platform: 'ios',
919
+ locked: true,
920
+ when: {
921
+ kind: 'Heuristic',
922
+ where: {
923
+ ruleId: 'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast',
924
+ },
925
+ },
926
+ then: {
927
+ kind: 'Finding',
928
+ message:
929
+ 'AST heuristic detected ScrollView with a non-lazy stack feeding ForEach; LazyVStack/LazyHStack remain the preferred baseline for large scrollable collections.',
930
+ code: 'HEURISTICS_IOS_SWIFTUI_NON_LAZY_SCROLL_FOREACH_AST',
931
+ },
932
+ },
914
933
  {
915
934
  id: 'heuristics.ios.navigation-view.ast',
916
935
  description: 'Detects NavigationView usage in iOS production code.',
@@ -254,6 +254,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
254
254
  heuristicDetector('ios.swiftui.redundant-reactive-state-assignment', [
255
255
  'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
256
256
  ]),
257
+ 'skills.ios.guideline.ios-swiftui-expert.use-lazyvstack-lazyhstack-for-large-lists':
258
+ heuristicDetector('ios.swiftui.non-lazy-scroll-foreach', [
259
+ 'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast',
260
+ ]),
257
261
  'skills.ios.no-scrollview-shows-indicators': heuristicDetector(
258
262
  'ios.scrollview-shows-indicators',
259
263
  ['heuristics.ios.scrollview-shows-indicators.ast']
@@ -360,6 +360,13 @@ const normalizeKnownRuleTarget = (
360
360
  ) {
361
361
  return 'skills.ios.guideline.ios-swiftui-expert.avoid-redundant-state-updates-in-onreceive-onchange-scroll-handlers';
362
362
  }
363
+ if (
364
+ (includes('lazyvstack') && includes('lazyhstack') && includes('large lists')) ||
365
+ (includes('lazyvstack') && includes('foreach') && includes('scrollview')) ||
366
+ (includes('lazyhstack') && includes('foreach') && includes('scrollview'))
367
+ ) {
368
+ return 'skills.ios.guideline.ios-swiftui-expert.use-lazyvstack-lazyhstack-for-large-lists';
369
+ }
363
370
  if (
364
371
  includes('scrollindicators hidden') ||
365
372
  includes('scroll indicators hidden') ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.223",
3
+ "version": "6.3.224",
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:08:30.839Z",
4
+ "generatedAt": "2026-05-13T16:15:52.668Z",
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": "6570119e6399677bda8b010b801f6397859f7a066eeecf1a33fcfe9ca97348fe",
8635
+ "hash": "2acbd66e86e9e809f0c4bdb5d215618096f5773e359085e3a4dc707b83c1ebb1",
8636
8636
  "rules": [
8637
8637
  {
8638
8638
  "id": "skills.ios.guideline.ios-swiftui-expert.always-mark-state-and-stateobject-as-private-makes-dependencies-clear",
@@ -8787,7 +8787,7 @@
8787
8787
  "sourcePath": "vendor/skills/swiftui-expert-skill/SKILL.md",
8788
8788
  "confidence": "MEDIUM",
8789
8789
  "locked": true,
8790
- "evaluationMode": "DECLARATIVE",
8790
+ "evaluationMode": "AUTO",
8791
8791
  "origin": "core"
8792
8792
  },
8793
8793
  {