pumuki 6.3.235 → 6.3.237

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/VERSION CHANGED
@@ -1 +1 @@
1
- v6.3.190
1
+ v6.3.237
@@ -25,6 +25,7 @@ import {
25
25
  hasSwiftGeometryReaderUsage,
26
26
  hasSwiftHardcodedUiStringUsage,
27
27
  hasSwiftHardcodedSensitiveStringUsage,
28
+ hasSwiftUnlocalizedDateFormatterUsage,
28
29
  hasSwiftIconOnlyControlWithoutAccessibilityLabelUsage,
29
30
  hasSwiftLooseAssetResourceUsage,
30
31
  hasSwiftLegacyOnChangeUsage,
@@ -766,6 +767,40 @@ final class Credentials {
766
767
  assert.equal(hasSwiftHardcodedSensitiveStringUsage(safe), false);
767
768
  });
768
769
 
770
+ test('hasSwiftUnlocalizedDateFormatterUsage detecta dateFormat fijo sin locale explicito', () => {
771
+ const source = `
772
+ final class DatePresenter {
773
+ func render(date: Date) -> String {
774
+ let formatter = DateFormatter()
775
+ formatter.dateFormat = "yyyy-MM-dd"
776
+ return formatter.string(from: date)
777
+ }
778
+ }
779
+ `;
780
+ const safe = `
781
+ final class DatePresenter {
782
+ func localized(date: Date) -> String {
783
+ let formatter = DateFormatter()
784
+ formatter.locale = .autoupdatingCurrent
785
+ formatter.dateFormat = "yyyy-MM-dd"
786
+ return formatter.string(from: date)
787
+ }
788
+
789
+ func styled(date: Date) -> String {
790
+ let formatter = DateFormatter()
791
+ formatter.dateStyle = .medium
792
+ return formatter.string(from: date)
793
+ }
794
+ }
795
+ let sample = "formatter.dateFormat = yyyy"
796
+ // let formatter = DateFormatter()
797
+ // formatter.dateFormat = "yyyy"
798
+ `;
799
+
800
+ assert.equal(hasSwiftUnlocalizedDateFormatterUsage(source), true);
801
+ assert.equal(hasSwiftUnlocalizedDateFormatterUsage(safe), false);
802
+ });
803
+
769
804
  test('detectores iOS de networking y JSON detectan Alamofire y JSONSerialization sin leer comentarios ni strings', () => {
770
805
  const source = `
771
806
  import Alamofire
@@ -651,6 +651,37 @@ export const hasSwiftHardcodedSensitiveStringUsage = (source: string): boolean =
651
651
  ).length > 0;
652
652
  };
653
653
 
654
+ export const hasSwiftUnlocalizedDateFormatterUsage = (source: string): boolean => {
655
+ const sanitizedSource = sanitizeSwiftSourceForMultilineRegex(source);
656
+ const formatterDeclarations = sanitizedSource.matchAll(
657
+ /\b(?:let|var)\s+([A-Za-z_][A-Za-z0-9_]*)\s*=\s*DateFormatter\s*\(\s*\)/g
658
+ );
659
+
660
+ for (const match of formatterDeclarations) {
661
+ const formatterName = match[1];
662
+ if (!formatterName) {
663
+ continue;
664
+ }
665
+
666
+ const formatterPattern = escapeRegex(formatterName);
667
+ const hasFixedDateFormat = new RegExp(`\\b${formatterPattern}\\s*\\.\\s*dateFormat\\s*=`).test(
668
+ sanitizedSource
669
+ );
670
+ if (!hasFixedDateFormat) {
671
+ continue;
672
+ }
673
+
674
+ const hasExplicitLocale = new RegExp(`\\b${formatterPattern}\\s*\\.\\s*locale\\s*=`).test(
675
+ sanitizedSource
676
+ );
677
+ if (!hasExplicitLocale) {
678
+ return true;
679
+ }
680
+ }
681
+
682
+ return false;
683
+ };
684
+
654
685
  export const hasSwiftAlamofireUsage = (source: string): boolean => {
655
686
  return (
656
687
  collectSwiftRegexLines(source, /^\s*import\s+Alamofire\b/).length > 0 ||
@@ -657,6 +657,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
657
657
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftAdHocLoggingUsage, ruleId: 'heuristics.ios.logging.adhoc-print.ast', code: 'HEURISTICS_IOS_LOGGING_ADHOC_PRINT_AST', message: 'AST heuristic detected print/debugPrint/dump/NSLog/os_log usage in iOS production code.' },
658
658
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftSensitiveLoggingUsage, ruleId: 'heuristics.ios.logging.sensitive-data.ast', code: 'HEURISTICS_IOS_LOGGING_SENSITIVE_DATA_AST', message: 'AST heuristic detected sensitive data in an iOS logging call.' },
659
659
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftHardcodedSensitiveStringUsage, ruleId: 'heuristics.ios.security.hardcoded-sensitive-string.ast', code: 'HEURISTICS_IOS_SECURITY_HARDCODED_SENSITIVE_STRING_AST', message: 'AST heuristic detected hardcoded sensitive Swift string; Keychain, secure config or environment-specific secrets remain the preferred baseline.' },
660
+ { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftUnlocalizedDateFormatterUsage, ruleId: 'heuristics.ios.localization.unlocalized-dateformatter.ast', code: 'HEURISTICS_IOS_LOCALIZATION_UNLOCALIZED_DATEFORMATTER_AST', message: 'AST heuristic detected DateFormatter dateFormat usage without an explicit locale.' },
660
661
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftAlamofireUsage, ruleId: 'heuristics.ios.networking.alamofire.ast', code: 'HEURISTICS_IOS_NETWORKING_ALAMOFIRE_AST', message: 'AST heuristic detected Alamofire usage in iOS production code; URLSession remains the preferred baseline for new code.' },
661
662
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftJSONSerializationUsage, ruleId: 'heuristics.ios.json.jsonserialization.ast', code: 'HEURISTICS_IOS_JSON_JSONSERIALIZATION_AST', message: 'AST heuristic detected JSONSerialization usage in iOS production code; Codable remains the preferred baseline for new code.' },
662
663
  { platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftSensitiveUserDefaultsStorageUsage, ruleId: 'heuristics.ios.security.userdefaults-sensitive-data.ast', code: 'HEURISTICS_IOS_SECURITY_USERDEFAULTS_SENSITIVE_DATA_AST', message: 'AST heuristic detected sensitive data stored in UserDefaults/AppStorage; native Keychain remains the preferred baseline for secrets.' },
@@ -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, 58);
6
+ assert.equal(iosRules.length, 82);
7
7
 
8
8
  const ids = iosRules.map((rule) => rule.id);
9
9
  assert.deepEqual(ids, [
@@ -17,8 +17,18 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
17
17
  'heuristics.ios.dispatchsemaphore.ast',
18
18
  'heuristics.ios.operation-queue.ast',
19
19
  'heuristics.ios.task-detached.ast',
20
+ 'heuristics.ios.swiftui.onappear-task.ast',
21
+ 'heuristics.ios.memory.strong-delegate.ast',
22
+ 'heuristics.ios.memory.strong-self-escaping-closure.ast',
23
+ 'heuristics.ios.architecture.custom-singleton.ast',
24
+ 'heuristics.ios.architecture.swinject.ast',
25
+ 'heuristics.ios.architecture.massive-view-controller.ast',
26
+ 'heuristics.ios.maintainability.magic-number-layout.ast',
27
+ 'heuristics.ios.safety.non-iboutlet-iuo.ast',
20
28
  'heuristics.ios.logging.adhoc-print.ast',
21
29
  'heuristics.ios.logging.sensitive-data.ast',
30
+ 'heuristics.ios.security.hardcoded-sensitive-string.ast',
31
+ 'heuristics.ios.localization.unlocalized-dateformatter.ast',
22
32
  'heuristics.ios.networking.alamofire.ast',
23
33
  'heuristics.ios.json.jsonserialization.ast',
24
34
  'heuristics.ios.dependencies.cocoapods.ast',
@@ -38,12 +48,25 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
38
48
  'heuristics.ios.assume-isolated.ast',
39
49
  'heuristics.ios.observable-object.ast',
40
50
  'heuristics.ios.legacy-swiftui-observable-wrapper.ast',
51
+ 'heuristics.ios.swiftui.non-private-state-ownership.ast',
41
52
  'heuristics.ios.passed-value-state-wrapper.ast',
42
53
  'heuristics.ios.foreach-indices.ast',
54
+ 'heuristics.ios.swiftui.foreach-self-identity.ast',
55
+ 'heuristics.ios.swiftui.inline-foreach-transform.ast',
56
+ 'heuristics.ios.swiftui.self-print-changes.ast',
57
+ 'heuristics.ios.swiftui.foreach-conditional-view-count.ast',
43
58
  'heuristics.ios.contains-user-filter.ast',
44
59
  'heuristics.ios.geometryreader.ast',
45
60
  'heuristics.ios.font-weight-bold.ast',
61
+ 'heuristics.ios.swiftui.explicit-color-static-member.ast',
62
+ 'heuristics.ios.swiftui.closure-based-viewbuilder-content.ast',
63
+ 'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
64
+ 'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast',
65
+ 'heuristics.ios.swiftui.body-object-creation.ast',
66
+ 'heuristics.ios.swiftui.image-data-decoding.ast',
67
+ 'heuristics.ios.swiftui.inline-action-logic.ast',
46
68
  'heuristics.ios.navigation-view.ast',
69
+ 'heuristics.ios.swiftui.untyped-navigation-link-destination.ast',
47
70
  'heuristics.ios.foreground-color.ast',
48
71
  'heuristics.ios.corner-radius.ast',
49
72
  'heuristics.ios.tab-item.ast',
@@ -60,6 +83,7 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
60
83
  'heuristics.ios.testing.wait-for-expectations.ast',
61
84
  'heuristics.ios.testing.legacy-expectation-description.ast',
62
85
  'heuristics.ios.testing.mixed-frameworks.ast',
86
+ 'heuristics.ios.testing.quick-nimble.ast',
63
87
  'heuristics.ios.core-data.nsmanagedobject-boundary.ast',
64
88
  'heuristics.ios.core-data.nsmanagedobject-async-boundary.ast',
65
89
  'heuristics.ios.core-data.layer-leak.ast',
@@ -116,6 +140,10 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
116
140
  byId.get('heuristics.ios.localization.hardcoded-ui-string.ast')?.then.code,
117
141
  'HEURISTICS_IOS_LOCALIZATION_HARDCODED_UI_STRING_AST'
118
142
  );
143
+ assert.equal(
144
+ byId.get('heuristics.ios.localization.unlocalized-dateformatter.ast')?.then.code,
145
+ 'HEURISTICS_IOS_LOCALIZATION_UNLOCALIZED_DATEFORMATTER_AST'
146
+ );
119
147
  assert.equal(
120
148
  byId.get('heuristics.ios.assets.loose-resource.ast')?.then.code,
121
149
  'HEURISTICS_IOS_ASSETS_LOOSE_RESOURCE_AST'
@@ -388,6 +388,25 @@ export const iosRules: RuleSet = [
388
388
  code: 'HEURISTICS_IOS_SECURITY_HARDCODED_SENSITIVE_STRING_AST',
389
389
  },
390
390
  },
391
+ {
392
+ id: 'heuristics.ios.localization.unlocalized-dateformatter.ast',
393
+ description: 'Detects DateFormatter fixed date formats without an explicit locale in iOS production code.',
394
+ severity: 'WARN',
395
+ platform: 'ios',
396
+ locked: true,
397
+ when: {
398
+ kind: 'Heuristic',
399
+ where: {
400
+ ruleId: 'heuristics.ios.localization.unlocalized-dateformatter.ast',
401
+ },
402
+ },
403
+ then: {
404
+ kind: 'Finding',
405
+ message:
406
+ 'AST heuristic detected DateFormatter dateFormat usage without an explicit locale; localized date formatting remains the preferred baseline.',
407
+ code: 'HEURISTICS_IOS_LOCALIZATION_UNLOCALIZED_DATEFORMATTER_AST',
408
+ },
409
+ },
391
410
  {
392
411
  id: 'heuristics.ios.networking.alamofire.ast',
393
412
  description: 'Detects Alamofire usage in iOS production code; URLSession is the preferred baseline for new code.',
@@ -102,6 +102,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
102
102
  'ios.security.hardcoded-sensitive-string',
103
103
  ['heuristics.ios.security.hardcoded-sensitive-string.ast']
104
104
  ),
105
+ 'skills.ios.guideline.ios.dateformatter-fechas-localizadas': heuristicDetector(
106
+ 'ios.localization.unlocalized-dateformatter',
107
+ ['heuristics.ios.localization.unlocalized-dateformatter.ast']
108
+ ),
105
109
  'skills.ios.guideline.ios.alamofire-prohibido-usar-urlsession-nativo': heuristicDetector(
106
110
  'ios.networking.alamofire',
107
111
  ['heuristics.ios.networking.alamofire.ast']
@@ -588,6 +588,9 @@ const normalizeKnownRuleTarget = (
588
588
  ) {
589
589
  return 'skills.ios.guideline.ios.obfuscation-strings-sensibles-en-co-digo';
590
590
  }
591
+ if (includes('dateformatter') && includes('localiz')) {
592
+ return 'skills.ios.guideline.ios.dateformatter-fechas-localizadas';
593
+ }
591
594
  if (
592
595
  includes('mixing legacy xctest style') ||
593
596
  includes('mixed xctest and swift testing') ||
@@ -1989,6 +1989,11 @@ export const buildPreWriteValidationPanel = (params: {
1989
1989
  }): string => {
1990
1990
  const git = params.aiGate.repo_state.git;
1991
1991
  const receipt = params.aiGate.mcp_receipt;
1992
+ const blockingViolations = params.aiGate.violations.filter((violation) => violation.severity === 'ERROR');
1993
+ const nonBlockingViolations = params.aiGate.violations.filter((violation) => violation.severity !== 'ERROR');
1994
+ const rawSkillsContractStatus = params.aiGate.skills_contract?.status ?? 'n/a';
1995
+ const visibleSkillsContractStatus =
1996
+ rawSkillsContractStatus === 'FAIL' && params.aiGate.allowed ? 'ADVISORY' : rawSkillsContractStatus;
1992
1997
  const lines: string[] = [
1993
1998
  'PRE-FLIGHT CHECK',
1994
1999
  `Stage: ${params.sdd.stage} · SDD: ${params.sdd.decision.code} · AI Gate: ${params.aiGate.status}`,
@@ -1997,9 +2002,9 @@ export const buildPreWriteValidationPanel = (params: {
1997
2002
  `Evidence: kind=${params.aiGate.evidence.kind} age=${params.aiGate.evidence.age_seconds ?? 'n/a'}s max=${params.aiGate.evidence.max_age_seconds}s`,
1998
2003
  `Evidence source: source=${params.aiGate.evidence.source.source} path=${params.aiGate.evidence.source.path} digest=${params.aiGate.evidence.source.digest ?? 'null'} generated_at=${params.aiGate.evidence.source.generated_at ?? 'null'}`,
1999
2004
  `MCP receipt: required=${receipt.required ? 'yes' : 'no'} kind=${receipt.kind} age=${receipt.age_seconds ?? 'n/a'}s max=${receipt.max_age_seconds ?? 'n/a'}s`,
2000
- `Skills contract: enforced=${params.aiGate.skills_contract?.enforced ? 'yes' : 'no'} status=${params.aiGate.skills_contract?.status ?? 'n/a'} platforms=${params.aiGate.skills_contract?.detected_platforms.join(',') ?? 'none'}`,
2005
+ `Skills contract: enforced=${params.aiGate.skills_contract?.enforced ? 'yes' : 'no'} status=${visibleSkillsContractStatus} platforms=${params.aiGate.skills_contract?.detected_platforms.join(',') ?? 'none'}`,
2001
2006
  `Auto-heal: attempted=${params.automation.attempted ? 'yes' : 'no'} actions=${params.automation.actions.length}`,
2002
- `Violations: ${params.aiGate.violations.length}`,
2007
+ `Violations: blocking=${blockingViolations.length} advisory=${nonBlockingViolations.length}`,
2003
2008
  ];
2004
2009
 
2005
2010
  if (params.automation.actions.length > 0) {
@@ -2010,15 +2015,15 @@ export const buildPreWriteValidationPanel = (params: {
2010
2015
  }
2011
2016
  }
2012
2017
 
2013
- if (params.aiGate.violations.length > 0) {
2018
+ if (blockingViolations.length > 0) {
2014
2019
  lines.push('');
2015
2020
  lines.push('Blocking causes:');
2016
- for (const violation of params.aiGate.violations) {
2021
+ for (const violation of blockingViolations) {
2017
2022
  lines.push(`- ${violation.code}: ${violation.message}`);
2018
2023
  }
2019
2024
  lines.push('');
2020
2025
  lines.push('Operational hints:');
2021
- for (const violation of params.aiGate.violations) {
2026
+ for (const violation of blockingViolations) {
2022
2027
  const hint = PRE_WRITE_HINTS_BY_CODE[violation.code];
2023
2028
  if (!hint) {
2024
2029
  continue;
@@ -2027,6 +2032,14 @@ export const buildPreWriteValidationPanel = (params: {
2027
2032
  }
2028
2033
  }
2029
2034
 
2035
+ if (nonBlockingViolations.length > 0) {
2036
+ lines.push('');
2037
+ lines.push('Advisory findings:');
2038
+ for (const violation of nonBlockingViolations) {
2039
+ lines.push(`- ${violation.code}: ${violation.message}`);
2040
+ }
2041
+ }
2042
+
2030
2043
  return renderPreWritePanel(lines);
2031
2044
  };
2032
2045
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.235",
3
+ "version": "6.3.237",
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:57:01.364Z",
4
+ "generatedAt": "2026-05-13T18:33:35.600Z",
5
5
  "bundles": [
6
6
  {
7
7
  "name": "android-guidelines",
@@ -5764,7 +5764,7 @@
5764
5764
  "name": "ios-guidelines",
5765
5765
  "version": "1.0.0",
5766
5766
  "source": "file:vendor/skills/ios-enterprise-rules/SKILL.md",
5767
- "hash": "a70065766533e822f2139da42d7933b6f240634c93939ee60969e3fd009409ce",
5767
+ "hash": "d787ee4a7d258686f6053ba89c5eff680d6d991ff54e590dd49b7aaa9a7e39f9",
5768
5768
  "rules": [
5769
5769
  {
5770
5770
  "id": "skills.ios.guideline.ios-swiftui-expert.use-navigationdestination-for-for-type-safe-navigation",
@@ -6315,7 +6315,7 @@
6315
6315
  "sourcePath": "vendor/skills/ios-enterprise-rules/SKILL.md",
6316
6316
  "confidence": "MEDIUM",
6317
6317
  "locked": true,
6318
- "evaluationMode": "DECLARATIVE",
6318
+ "evaluationMode": "AUTO",
6319
6319
  "origin": "core"
6320
6320
  },
6321
6321
  {