pumuki 6.3.234 → 6.3.236

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.236
@@ -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') ||
@@ -80,6 +80,61 @@ const defaultServices: GateServices = {
80
80
  evidence: new EvidenceService(),
81
81
  };
82
82
 
83
+ const hasPositiveFindingLine = (lines: Finding['lines']): boolean => {
84
+ if (typeof lines === 'number') {
85
+ return Number.isFinite(lines) && lines > 0;
86
+ }
87
+ if (typeof lines === 'string') {
88
+ return lines.trim().length > 0;
89
+ }
90
+ if (Array.isArray(lines)) {
91
+ return lines.some((line) => Number.isFinite(line) && line > 0);
92
+ }
93
+ return false;
94
+ };
95
+
96
+ const hasActionableFindingLocation = (finding: Finding): boolean => {
97
+ return (
98
+ hasPositiveFindingLine(finding.lines) ||
99
+ finding.primary_node !== undefined ||
100
+ (finding.related_nodes?.length ?? 0) > 0
101
+ );
102
+ };
103
+
104
+ const toNonActionableScopedAdvisoryFinding = (finding: Finding): Finding => ({
105
+ ...finding,
106
+ blocking: false,
107
+ message:
108
+ `${finding.message} ` +
109
+ '(Advisory: Pumuki no pudo atribuir este hallazgo a una linea, rango o nodo accionable en el scope actual.)',
110
+ why:
111
+ finding.why ??
112
+ 'El gate esta limitado a un scope acotado y este finding solo pudo atribuirse al archivo completo.',
113
+ expected_fix:
114
+ finding.expected_fix ??
115
+ 'Reintentar cuando el detector aporte lineas, rango, simbolo o nodo; mientras tanto no bloquea el slice acotado.',
116
+ });
117
+
118
+ const normalizeScopedRuleEngineFindings = (params: {
119
+ findings: ReadonlyArray<Finding>;
120
+ scope: GateScope;
121
+ }): ReadonlyArray<Finding> => {
122
+ if (params.scope.kind !== 'staged' && params.scope.kind !== 'range') {
123
+ return params.findings;
124
+ }
125
+
126
+ return params.findings.map((finding) => {
127
+ if (
128
+ !finding.filePath ||
129
+ hasActionableFindingLocation(finding) ||
130
+ (!finding.ruleId.startsWith('skills.') && !finding.ruleId.startsWith('heuristics.'))
131
+ ) {
132
+ return finding;
133
+ }
134
+ return toNonActionableScopedAdvisoryFinding(finding);
135
+ });
136
+ };
137
+
83
138
  const buildDefaultMemoryShadowRecommendation = (params: {
84
139
  findings: ReadonlyArray<Finding>;
85
140
  tddBddSnapshot?: TddBddSnapshot;
@@ -960,7 +1015,11 @@ export async function runPlatformGate(params: {
960
1015
  evaluationFacts = factsForPlatformEvaluation,
961
1016
  findings: ruleEngineFindings,
962
1017
  } = platformEvaluation;
963
- const findings = [...aiGateRepoPolicyFindings, ...ruleEngineFindings];
1018
+ const scopedRuleEngineFindings = normalizeScopedRuleEngineFindings({
1019
+ findings: ruleEngineFindings,
1020
+ scope: params.scope,
1021
+ });
1022
+ const findings = [...aiGateRepoPolicyFindings, ...scopedRuleEngineFindings];
964
1023
  const evaluationMetrics: SnapshotEvaluationMetrics = coverage
965
1024
  ? {
966
1025
  facts_total: coverage.factsTotal,
@@ -1270,7 +1329,15 @@ export async function runPlatformGate(params: {
1270
1329
  ? [...brownfieldHotspotFindings, ...findings]
1271
1330
  : findings;
1272
1331
  const hasAstIntelligenceBlockingFinding = shouldBlockFromFinding(astIntelligenceDualFinding);
1273
- const decision = dependencies.evaluateGate([...effectiveFindings], params.policy);
1332
+ const gateDecisionFindings = effectiveFindings.filter((finding) => finding.blocking !== false);
1333
+ const decision = dependencies.evaluateGate([...gateDecisionFindings], params.policy);
1334
+ const hasNonBlockingAdvisoryFinding = effectiveFindings.some(
1335
+ (finding) =>
1336
+ finding.blocking === false &&
1337
+ (finding.severity === 'WARN' ||
1338
+ finding.severity === 'ERROR' ||
1339
+ finding.severity === 'CRITICAL')
1340
+ );
1274
1341
  const baseGateOutcome =
1275
1342
  sddBlockingFinding ||
1276
1343
  degradedModeBlocks ||
@@ -1286,7 +1353,8 @@ export async function runPlatformGate(params: {
1286
1353
  brownfieldHotspotFindings.some((finding) => shouldBlockFromFinding(finding)) ||
1287
1354
  hasTddBddBlockingFinding
1288
1355
  ? 'BLOCK'
1289
- : (decision.outcome === 'PASS' && tddBddSnapshot?.status === 'advisory'
1356
+ : (decision.outcome === 'PASS' &&
1357
+ (tddBddSnapshot?.status === 'advisory' || hasNonBlockingAdvisoryFinding)
1290
1358
  ? 'WARN'
1291
1359
  : decision.outcome);
1292
1360
  const gateWaiverStage =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.234",
3
+ "version": "6.3.236",
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
  {