pumuki 6.3.200 → 6.3.201
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/core/facts/detectors/text/ios.test.ts +18 -0
- package/core/facts/detectors/text/ios.ts +17 -0
- package/core/facts/extractHeuristicFacts.ts +1 -0
- package/core/rules/presets/heuristics/ios.test.ts +6 -1
- package/core/rules/presets/heuristics/ios.ts +18 -0
- package/docs/codex-skills/ios-enterprise-rules.md +6 -0
- package/integrations/config/skillsDetectorRegistry.ts +8 -0
- package/integrations/config/skillsMarkdownRules.ts +3 -0
- package/package.json +1 -1
- package/skills.lock.json +3 -15
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
hasSwiftForEachIndicesUsage,
|
|
18
18
|
hasSwiftForceCastUsage,
|
|
19
19
|
hasSwiftFontWeightBoldUsage,
|
|
20
|
+
hasSwiftFixedFontSizeUsage,
|
|
20
21
|
hasSwiftForegroundColorUsage,
|
|
21
22
|
hasSwiftForceTryUsage,
|
|
22
23
|
hasSwiftForceUnwrap,
|
|
@@ -317,6 +318,23 @@ let text = "UIImage(contentsOfFile: path)"
|
|
|
317
318
|
assert.equal(hasSwiftLooseAssetResourceUsage(ignored), false);
|
|
318
319
|
});
|
|
319
320
|
|
|
321
|
+
test('detector iOS de accesibilidad detecta tamaños de fuente fijos sin confundir estilos semánticos', () => {
|
|
322
|
+
const source = `
|
|
323
|
+
Text("Total").font(.system(size: 18))
|
|
324
|
+
let title = Font.system(size: 24, weight: .bold)
|
|
325
|
+
label.font = UIFont.systemFont(ofSize: 16)
|
|
326
|
+
`;
|
|
327
|
+
const ignored = `
|
|
328
|
+
Text("Total").font(.headline)
|
|
329
|
+
Text("Body").font(.body)
|
|
330
|
+
let text = "UIFont.systemFont(ofSize: 16)"
|
|
331
|
+
// Text("Total").font(.system(size: 18))
|
|
332
|
+
`;
|
|
333
|
+
|
|
334
|
+
assert.equal(hasSwiftFixedFontSizeUsage(source), true);
|
|
335
|
+
assert.equal(hasSwiftFixedFontSizeUsage(ignored), false);
|
|
336
|
+
});
|
|
337
|
+
|
|
320
338
|
test('hasSwiftUncheckedSendableUsage detecta @unchecked Sendable', () => {
|
|
321
339
|
const source = `
|
|
322
340
|
final class LegacyBox: @unchecked Sendable {}
|
|
@@ -560,6 +560,23 @@ export const hasSwiftLooseAssetResourceUsage = (source: string): boolean => {
|
|
|
560
560
|
});
|
|
561
561
|
};
|
|
562
562
|
|
|
563
|
+
export const hasSwiftFixedFontSizeUsage = (source: string): boolean => {
|
|
564
|
+
const withoutBlockComments = source.replace(/\/\*[\s\S]*?\*\//g, '\n');
|
|
565
|
+
return withoutBlockComments.split(/\r?\n/).some((line) => {
|
|
566
|
+
if (/^\s*\/\//.test(line)) {
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
const sanitized = stripSwiftLineForSemanticScan(line);
|
|
570
|
+
return (
|
|
571
|
+
/\.\s*font\s*\(\s*\.\s*system\s*\(\s*size\s*:/.test(sanitized) ||
|
|
572
|
+
/\bFont\s*\.\s*system\s*\(\s*size\s*:/.test(sanitized) ||
|
|
573
|
+
/\bUIFont\s*\.\s*(?:systemFont|boldSystemFont|italicSystemFont)\s*\(\s*ofSize\s*:/.test(
|
|
574
|
+
sanitized
|
|
575
|
+
)
|
|
576
|
+
);
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
|
|
563
580
|
export const hasSwiftUncheckedSendableUsage = (source: string): boolean => {
|
|
564
581
|
return scanCodeLikeSource(source, ({ source: swiftSource, index, current }) => {
|
|
565
582
|
if (current !== '@' || !swiftSource.startsWith('@unchecked', index)) {
|
|
@@ -656,6 +656,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
|
|
|
656
656
|
{ platform: 'ios', pathCheck: isIOSLocalizableStringsPath, excludePaths: [], detect: detectsTrackedFilePresence, ruleId: 'heuristics.ios.localization.localizable-strings.ast', code: 'HEURISTICS_IOS_LOCALIZATION_LOCALIZABLE_STRINGS_AST', message: 'AST heuristic detected Localizable.strings usage; String Catalogs (.xcstrings) remain the preferred baseline for new localization work.' },
|
|
657
657
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftHardcodedUiStringUsage, ruleId: 'heuristics.ios.localization.hardcoded-ui-string.ast', code: 'HEURISTICS_IOS_LOCALIZATION_HARDCODED_UI_STRING_AST', message: 'AST heuristic detected hardcoded user-facing SwiftUI text; String(localized:) and String Catalogs remain the preferred baseline.' },
|
|
658
658
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftLooseAssetResourceUsage, ruleId: 'heuristics.ios.assets.loose-resource.ast', code: 'HEURISTICS_IOS_ASSETS_LOOSE_RESOURCE_AST', message: 'AST heuristic detected loose image resource loading in iOS production code; Asset Catalogs remain the preferred baseline.' },
|
|
659
|
+
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftFixedFontSizeUsage, ruleId: 'heuristics.ios.accessibility.fixed-font-size.ast', code: 'HEURISTICS_IOS_ACCESSIBILITY_FIXED_FONT_SIZE_AST', message: 'AST heuristic detected fixed font sizing in iOS production code; Dynamic Type semantic text styles remain the preferred baseline.' },
|
|
659
660
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftUncheckedSendableUsage, ruleId: 'heuristics.ios.unchecked-sendable.ast', code: 'HEURISTICS_IOS_UNCHECKED_SENDABLE_AST', message: 'AST heuristic detected @unchecked Sendable usage.' },
|
|
660
661
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftPreconcurrencyUsage, ruleId: 'heuristics.ios.preconcurrency.ast', code: 'HEURISTICS_IOS_PRECONCURRENCY_AST', message: 'AST heuristic detected @preconcurrency usage.' },
|
|
661
662
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftNonisolatedUnsafeUsage, ruleId: 'heuristics.ios.nonisolated-unsafe.ast', code: 'HEURISTICS_IOS_NONISOLATED_UNSAFE_AST', message: 'AST heuristic detected nonisolated(unsafe) usage.' },
|
|
@@ -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,
|
|
6
|
+
assert.equal(iosRules.length, 55);
|
|
7
7
|
|
|
8
8
|
const ids = iosRules.map((rule) => rule.id);
|
|
9
9
|
assert.deepEqual(ids, [
|
|
@@ -28,6 +28,7 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
|
|
|
28
28
|
'heuristics.ios.localization.localizable-strings.ast',
|
|
29
29
|
'heuristics.ios.localization.hardcoded-ui-string.ast',
|
|
30
30
|
'heuristics.ios.assets.loose-resource.ast',
|
|
31
|
+
'heuristics.ios.accessibility.fixed-font-size.ast',
|
|
31
32
|
'heuristics.ios.unchecked-sendable.ast',
|
|
32
33
|
'heuristics.ios.preconcurrency.ast',
|
|
33
34
|
'heuristics.ios.nonisolated-unsafe.ast',
|
|
@@ -116,6 +117,10 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
|
|
|
116
117
|
byId.get('heuristics.ios.assets.loose-resource.ast')?.then.code,
|
|
117
118
|
'HEURISTICS_IOS_ASSETS_LOOSE_RESOURCE_AST'
|
|
118
119
|
);
|
|
120
|
+
assert.equal(
|
|
121
|
+
byId.get('heuristics.ios.accessibility.fixed-font-size.ast')?.then.code,
|
|
122
|
+
'HEURISTICS_IOS_ACCESSIBILITY_FIXED_FONT_SIZE_AST'
|
|
123
|
+
);
|
|
119
124
|
assert.equal(
|
|
120
125
|
byId.get('heuristics.ios.preconcurrency.ast')?.then.code,
|
|
121
126
|
'HEURISTICS_IOS_PRECONCURRENCY_AST'
|
|
@@ -379,6 +379,24 @@ export const iosRules: RuleSet = [
|
|
|
379
379
|
code: 'HEURISTICS_IOS_ASSETS_LOOSE_RESOURCE_AST',
|
|
380
380
|
},
|
|
381
381
|
},
|
|
382
|
+
{
|
|
383
|
+
id: 'heuristics.ios.accessibility.fixed-font-size.ast',
|
|
384
|
+
description: 'Detects fixed font sizes where Dynamic Type semantic styles are the preferred iOS baseline.',
|
|
385
|
+
severity: 'WARN',
|
|
386
|
+
platform: 'ios',
|
|
387
|
+
locked: true,
|
|
388
|
+
when: {
|
|
389
|
+
kind: 'Heuristic',
|
|
390
|
+
where: {
|
|
391
|
+
ruleId: 'heuristics.ios.accessibility.fixed-font-size.ast',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
then: {
|
|
395
|
+
kind: 'Finding',
|
|
396
|
+
message: 'AST heuristic detected fixed font sizing in iOS production code; Dynamic Type semantic text styles remain the preferred baseline.',
|
|
397
|
+
code: 'HEURISTICS_IOS_ACCESSIBILITY_FIXED_FONT_SIZE_AST',
|
|
398
|
+
},
|
|
399
|
+
},
|
|
382
400
|
{
|
|
383
401
|
id: 'heuristics.ios.unchecked-sendable.ast',
|
|
384
402
|
description: 'Detects @unchecked Sendable usage in iOS production code.',
|
|
@@ -622,6 +622,12 @@ struct APIEndpoint: Sendable {
|
|
|
622
622
|
- `skills.ios.guideline.ios.assets-en-asset-catalogs-con-soporte-para-todos-los-taman-os` se mapea a `heuristics.ios.assets.loose-resource.ast`.
|
|
623
623
|
- En `PROJECT MODE: brownfield`, este hallazgo detecta carga de imágenes sueltas desde bundle/filesystem (`UIImage(contentsOfFile:)`, `NSImage(contentsOfFile:)`, `Bundle.main.path/url(...png|jpg|jpeg|pdf|svg|webp)`) como señal de adopción hacia Asset Catalogs. No marca `Image("asset")` ni `UIImage(named:)`.
|
|
624
624
|
|
|
625
|
+
### Enforcement AST inicial de accesibilidad iOS
|
|
626
|
+
|
|
627
|
+
- `skills.ios.guideline.ios.dynamic-type-font-scaling-automa-tico` se mapea a `heuristics.ios.accessibility.fixed-font-size.ast`.
|
|
628
|
+
- `skills.ios.guideline.ios.dynamic-type-fuentes-escalables-y-layouts-adaptativos` se mapea a `heuristics.ios.accessibility.fixed-font-size.ast`.
|
|
629
|
+
- En `PROJECT MODE: brownfield`, este hallazgo detecta tamaños de fuente fijos (`.font(.system(size:))`, `Font.system(size:)`, `UIFont.systemFont(ofSize:)`) como señal de adopción hacia Dynamic Type y estilos semánticos. No marca `.font(.headline)`, `.font(.body)` ni otros estilos semánticos.
|
|
630
|
+
|
|
625
631
|
### Combine (Reactive):
|
|
626
632
|
✅ **Publishers** - AsyncSequence para async, Combine para streams complejos
|
|
627
633
|
✅ **@Published** - En ViewModels para binding con Views
|
|
@@ -115,6 +115,14 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
|
|
|
115
115
|
'ios.assets.loose-resource',
|
|
116
116
|
['heuristics.ios.assets.loose-resource.ast']
|
|
117
117
|
),
|
|
118
|
+
'skills.ios.guideline.ios.dynamic-type-font-scaling-automa-tico': heuristicDetector(
|
|
119
|
+
'ios.accessibility.fixed-font-size',
|
|
120
|
+
['heuristics.ios.accessibility.fixed-font-size.ast']
|
|
121
|
+
),
|
|
122
|
+
'skills.ios.guideline.ios.dynamic-type-fuentes-escalables-y-layouts-adaptativos': heuristicDetector(
|
|
123
|
+
'ios.accessibility.fixed-font-size',
|
|
124
|
+
['heuristics.ios.accessibility.fixed-font-size.ast']
|
|
125
|
+
),
|
|
118
126
|
'skills.ios.no-unchecked-sendable': heuristicDetector('ios.unchecked-sendable', [
|
|
119
127
|
'heuristics.ios.unchecked-sendable.ast',
|
|
120
128
|
]),
|
|
@@ -401,6 +401,9 @@ const normalizeKnownRuleTarget = (
|
|
|
401
401
|
if (includes('assets en asset catalogs') || includes('asset catalogs')) {
|
|
402
402
|
return 'skills.ios.guideline.ios.assets-en-asset-catalogs-con-soporte-para-todos-los-taman-os';
|
|
403
403
|
}
|
|
404
|
+
if (includes('dynamic type')) {
|
|
405
|
+
return 'skills.ios.guideline.ios.dynamic-type-font-scaling-automa-tico';
|
|
406
|
+
}
|
|
404
407
|
if (
|
|
405
408
|
includes('mixing legacy xctest style') ||
|
|
406
409
|
includes('mixed xctest and swift testing') ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.201",
|
|
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-13T11:
|
|
4
|
+
"generatedAt": "2026-05-13T11:41:29.067Z",
|
|
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": "
|
|
5767
|
+
"hash": "d38a68e751fd699460fb183c20c6d950e6e3d728e66d6d9e9de06a2f564cd574",
|
|
5768
5768
|
"rules": [
|
|
5769
5769
|
{
|
|
5770
5770
|
"id": "skills.ios.guideline.ios.accessibility-identifiers-para-localizar-elementos",
|
|
@@ -6380,18 +6380,6 @@
|
|
|
6380
6380
|
},
|
|
6381
6381
|
{
|
|
6382
6382
|
"id": "skills.ios.guideline.ios.dynamic-type-font-scaling-automa-tico",
|
|
6383
|
-
"description": "Dynamic Type - Font scaling automático",
|
|
6384
|
-
"severity": "WARN",
|
|
6385
|
-
"platform": "ios",
|
|
6386
|
-
"sourceSkill": "ios-guidelines",
|
|
6387
|
-
"sourcePath": "vendor/skills/ios-enterprise-rules/SKILL.md",
|
|
6388
|
-
"confidence": "MEDIUM",
|
|
6389
|
-
"locked": true,
|
|
6390
|
-
"evaluationMode": "DECLARATIVE",
|
|
6391
|
-
"origin": "core"
|
|
6392
|
-
},
|
|
6393
|
-
{
|
|
6394
|
-
"id": "skills.ios.guideline.ios.dynamic-type-fuentes-escalables-y-layouts-adaptativos",
|
|
6395
6383
|
"description": "Dynamic Type - fuentes escalables y layouts adaptativos",
|
|
6396
6384
|
"severity": "WARN",
|
|
6397
6385
|
"platform": "ios",
|
|
@@ -6399,7 +6387,7 @@
|
|
|
6399
6387
|
"sourcePath": "vendor/skills/ios-enterprise-rules/SKILL.md",
|
|
6400
6388
|
"confidence": "MEDIUM",
|
|
6401
6389
|
"locked": true,
|
|
6402
|
-
"evaluationMode": "
|
|
6390
|
+
"evaluationMode": "AUTO",
|
|
6403
6391
|
"origin": "core"
|
|
6404
6392
|
},
|
|
6405
6393
|
{
|