pumuki 6.3.244 → 6.3.245

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/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [6.3.245] - 2026-05-14
10
+
11
+ ### Added
12
+
13
+ - **SwiftUI props fan-out parity:** `skills.ios.guideline.ios-swiftui-expert.pass-only-needed-values-to-views-avoid-large-config-or-context-objects` now maps to a scoped AUTO heuristic that detects SwiftUI Views storing broad `Config`/`Configuration`/`Context` properties, preserving narrow value props as the clean baseline.
14
+
9
15
  ## [6.3.244] - 2026-05-14
10
16
 
11
17
  ### Added
@@ -73,6 +73,7 @@ import {
73
73
  hasSwiftJSONSerializationUsage,
74
74
  hasSwiftExplicitColorStaticMemberUsage,
75
75
  hasSwiftClosureBasedViewBuilderContentUsage,
76
+ hasSwiftLargeConfigContextViewPropertyUsage,
76
77
  hasSwiftRedundantReactiveStateAssignmentUsage,
77
78
  hasSwiftInlineForEachTransformUsage,
78
79
  hasSwiftStringFormatUsage,
@@ -1304,6 +1305,52 @@ let ignored = "let content: () -> Content"
1304
1305
  assert.equal(hasSwiftClosureBasedViewBuilderContentUsage(safe), false);
1305
1306
  });
1306
1307
 
1308
+ test('hasSwiftLargeConfigContextViewPropertyUsage detecta config/context grandes en SwiftUI View', () => {
1309
+ const source = `
1310
+ struct CheckoutSummaryView: View {
1311
+ let config: CheckoutSummaryConfiguration
1312
+ let title: String
1313
+
1314
+ var body: some View {
1315
+ VStack {
1316
+ Text(config.title)
1317
+ }
1318
+ }
1319
+ }
1320
+
1321
+ struct StoreMapView: View {
1322
+ var context: StoreMapContext
1323
+
1324
+ var body: some View {
1325
+ Text(context.title)
1326
+ }
1327
+ }
1328
+ `;
1329
+ const safe = `
1330
+ struct CheckoutSummaryView: View {
1331
+ let title: String
1332
+ let subtitle: String
1333
+
1334
+ var body: some View {
1335
+ VStack {
1336
+ Text(title)
1337
+ Text(subtitle)
1338
+ }
1339
+ }
1340
+ }
1341
+
1342
+ final class CheckoutPresenter {
1343
+ let context: CheckoutContext
1344
+ }
1345
+
1346
+ let ignored = "struct IgnoredView: View { let config: AppConfig var body: some View { Text(config.title) } }"
1347
+ // struct IgnoredView: View { let config: AppConfig var body: some View { Text(config.title) } }
1348
+ `;
1349
+
1350
+ assert.equal(hasSwiftLargeConfigContextViewPropertyUsage(source), true);
1351
+ assert.equal(hasSwiftLargeConfigContextViewPropertyUsage(safe), false);
1352
+ });
1353
+
1307
1354
  test('hasSwiftRedundantReactiveStateAssignmentUsage detecta asignaciones reactivas redundantes y preserva guard de cambio', () => {
1308
1355
  const source = `
1309
1356
  struct SearchView: View {
@@ -962,6 +962,25 @@ export const hasSwiftClosureBasedViewBuilderContentUsage = (source: string): boo
962
962
  );
963
963
  };
964
964
 
965
+ export const hasSwiftLargeConfigContextViewPropertyUsage = (source: string): boolean => {
966
+ const sanitized = sanitizeSwiftSourceForMultilineRegex(source);
967
+ const swiftUIViewPattern =
968
+ /\bstruct\s+[A-Za-z_][A-Za-z0-9_]*\s*:\s*View\s*\{[\s\S]{0,2200}?\bvar\s+body\s*:\s*some\s+View\s*\{/g;
969
+
970
+ for (const viewMatch of sanitized.matchAll(swiftUIViewPattern)) {
971
+ const viewSegment = viewMatch[0] ?? '';
972
+ if (
973
+ /\b(?:let|var)\s+(?:config|configuration|context)\s*:\s*[A-Za-z_][A-Za-z0-9_]*(?:Config|Configuration|Context)\b/.test(
974
+ viewSegment
975
+ )
976
+ ) {
977
+ return true;
978
+ }
979
+ }
980
+
981
+ return false;
982
+ };
983
+
965
984
  export const hasSwiftRedundantReactiveStateAssignmentUsage = (source: string): boolean => {
966
985
  const sanitized = sanitizeSwiftSourceForMultilineRegex(source);
967
986
  const reactiveAssignmentPattern =
@@ -689,6 +689,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
689
689
  { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftFontWeightBoldUsage, ruleId: 'heuristics.ios.font-weight-bold.ast', code: 'HEURISTICS_IOS_FONT_WEIGHT_BOLD_AST', message: 'AST heuristic detected fontWeight(.bold) usage where bold() may be preferred.' },
690
690
  { 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.' },
691
691
  { 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.' },
692
+ { platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftLargeConfigContextViewPropertyUsage, ruleId: 'heuristics.ios.swiftui.large-config-context-prop.ast', code: 'HEURISTICS_IOS_SWIFTUI_LARGE_CONFIG_CONTEXT_PROP_AST', message: 'AST heuristic detected a SwiftUI View storing a broad config/context object; pass only needed values to reduce update fan-out.' },
692
693
  { 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.' },
693
694
  { 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.' },
694
695
  { 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.' },
@@ -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, 83);
6
+ assert.equal(iosRules.length, 84);
7
7
 
8
8
  const ids = iosRules.map((rule) => rule.id);
9
9
  assert.deepEqual(ids, [
@@ -61,6 +61,7 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
61
61
  'heuristics.ios.font-weight-bold.ast',
62
62
  'heuristics.ios.swiftui.explicit-color-static-member.ast',
63
63
  'heuristics.ios.swiftui.closure-based-viewbuilder-content.ast',
64
+ 'heuristics.ios.swiftui.large-config-context-prop.ast',
64
65
  'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
65
66
  'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast',
66
67
  'heuristics.ios.swiftui.body-object-creation.ast',
@@ -205,6 +206,10 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
205
206
  byId.get('heuristics.ios.font-weight-bold.ast')?.then.code,
206
207
  'HEURISTICS_IOS_FONT_WEIGHT_BOLD_AST'
207
208
  );
209
+ assert.equal(
210
+ byId.get('heuristics.ios.swiftui.large-config-context-prop.ast')?.then.code,
211
+ 'HEURISTICS_IOS_SWIFTUI_LARGE_CONFIG_CONTEXT_PROP_AST'
212
+ );
208
213
  assert.equal(
209
214
  byId.get('heuristics.ios.uiscreen-main-bounds.ast')?.then.code,
210
215
  'HEURISTICS_IOS_UISCREEN_MAIN_BOUNDS_AST'
@@ -989,6 +989,25 @@ export const iosRules: RuleSet = [
989
989
  code: 'HEURISTICS_IOS_SWIFTUI_CLOSURE_BASED_VIEWBUILDER_CONTENT_AST',
990
990
  },
991
991
  },
992
+ {
993
+ id: 'heuristics.ios.swiftui.large-config-context-prop.ast',
994
+ description: 'Detects broad Config/Context properties stored directly on SwiftUI Views.',
995
+ severity: 'WARN',
996
+ platform: 'ios',
997
+ locked: true,
998
+ when: {
999
+ kind: 'Heuristic',
1000
+ where: {
1001
+ ruleId: 'heuristics.ios.swiftui.large-config-context-prop.ast',
1002
+ },
1003
+ },
1004
+ then: {
1005
+ kind: 'Finding',
1006
+ message:
1007
+ 'AST heuristic detected a SwiftUI View storing a broad config/context object; pass only needed values to reduce update fan-out.',
1008
+ code: 'HEURISTICS_IOS_SWIFTUI_LARGE_CONFIG_CONTEXT_PROP_AST',
1009
+ },
1010
+ },
992
1011
  {
993
1012
  id: 'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
994
1013
  description: 'Detects onChange/onReceive state assignments without a value-change guard.',
@@ -280,6 +280,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
280
280
  heuristicDetector('ios.swiftui.closure-based-viewbuilder-content', [
281
281
  'heuristics.ios.swiftui.closure-based-viewbuilder-content.ast',
282
282
  ]),
283
+ 'skills.ios.guideline.ios-swiftui-expert.pass-only-needed-values-to-views-avoid-large-config-or-context-objects':
284
+ heuristicDetector('ios.swiftui.large-config-context-prop', [
285
+ 'heuristics.ios.swiftui.large-config-context-prop.ast',
286
+ ]),
283
287
  'skills.ios.guideline.ios-swiftui-expert.avoid-redundant-state-updates-in-onreceive-onchange-scroll-handlers':
284
288
  heuristicDetector('ios.swiftui.redundant-reactive-state-assignment', [
285
289
  'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
@@ -393,6 +393,15 @@ const normalizeKnownRuleTarget = (
393
393
  ) {
394
394
  return 'skills.ios.guideline.ios-swiftui-expert.prefer-viewbuilder-let-content-content-over-closure-based-content-prop';
395
395
  }
396
+ if (
397
+ includes('pass only needed values') ||
398
+ includes('large config') ||
399
+ includes('large context') ||
400
+ includes('config or context objects') ||
401
+ includes('config/context objects')
402
+ ) {
403
+ return 'skills.ios.guideline.ios-swiftui-expert.pass-only-needed-values-to-views-avoid-large-config-or-context-objects';
404
+ }
396
405
  if (
397
406
  includes('redundant state updates') ||
398
407
  (includes('onreceive') && includes('onchange') && includes('state updates')) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.244",
3
+ "version": "6.3.245",
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-14T07:29:57.101Z",
4
+ "generatedAt": "2026-05-14T07:45:13.168Z",
5
5
  "bundles": [
6
6
  {
7
7
  "name": "android-guidelines",
@@ -8620,7 +8620,7 @@
8620
8620
  "name": "ios-swiftui-expert-guidelines",
8621
8621
  "version": "1.0.0",
8622
8622
  "source": "file:vendor/skills/swiftui-expert-skill/SKILL.md",
8623
- "hash": "95d13f770dcf3a0ecb957e4cabcfd09c9d9b39a15421c8599c6fe5470d1c3f95",
8623
+ "hash": "0c30a1be4bf60d113d15b12da5fdea1f49c5dc64cda8bbb8c3b9885dcfe5abcb",
8624
8624
  "rules": [
8625
8625
  {
8626
8626
  "id": "skills.ios.guideline.ios-swiftui-expert.action-handlers-should-reference-methods-not-contain-inline-logic",
@@ -8715,7 +8715,7 @@
8715
8715
  "sourcePath": "vendor/skills/swiftui-expert-skill/SKILL.md",
8716
8716
  "confidence": "MEDIUM",
8717
8717
  "locked": true,
8718
- "evaluationMode": "DECLARATIVE",
8718
+ "evaluationMode": "AUTO",
8719
8719
  "origin": "core"
8720
8720
  },
8721
8721
  {