pumuki 6.3.201 → 6.3.202
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 +19 -0
- package/core/facts/detectors/text/ios.ts +16 -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 +5 -0
- package/integrations/config/skillsDetectorRegistry.ts +4 -0
- package/integrations/config/skillsMarkdownRules.ts +3 -0
- package/package.json +1 -1
- package/skills.lock.json +3 -3
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
hasSwiftOperationQueueUsage,
|
|
44
44
|
hasSwiftContainsUserFilterUsage,
|
|
45
45
|
hasSwiftPassedValueStateWrapperUsage,
|
|
46
|
+
hasSwiftPhysicalTextAlignmentUsage,
|
|
46
47
|
hasSwiftPreconcurrencyUsage,
|
|
47
48
|
hasSwiftSheetIsPresentedUsage,
|
|
48
49
|
hasSwiftScrollViewShowsIndicatorsUsage,
|
|
@@ -335,6 +336,24 @@ let text = "UIFont.systemFont(ofSize: 16)"
|
|
|
335
336
|
assert.equal(hasSwiftFixedFontSizeUsage(ignored), false);
|
|
336
337
|
});
|
|
337
338
|
|
|
339
|
+
test('detector iOS de localización detecta alineación física sin confundir leading/trailing', () => {
|
|
340
|
+
const source = `
|
|
341
|
+
Text("Name").multilineTextAlignment(.left)
|
|
342
|
+
Text("Price").frame(maxWidth: .infinity, alignment: .right)
|
|
343
|
+
let textAlignment = TextAlignment.right
|
|
344
|
+
label.textAlignment = NSTextAlignment.left
|
|
345
|
+
`;
|
|
346
|
+
const ignored = `
|
|
347
|
+
Text("Name").multilineTextAlignment(.leading)
|
|
348
|
+
Text("Price").frame(maxWidth: .infinity, alignment: .trailing)
|
|
349
|
+
let sample = "TextAlignment.right"
|
|
350
|
+
// Text("Name").multilineTextAlignment(.left)
|
|
351
|
+
`;
|
|
352
|
+
|
|
353
|
+
assert.equal(hasSwiftPhysicalTextAlignmentUsage(source), true);
|
|
354
|
+
assert.equal(hasSwiftPhysicalTextAlignmentUsage(ignored), false);
|
|
355
|
+
});
|
|
356
|
+
|
|
338
357
|
test('hasSwiftUncheckedSendableUsage detecta @unchecked Sendable', () => {
|
|
339
358
|
const source = `
|
|
340
359
|
final class LegacyBox: @unchecked Sendable {}
|
|
@@ -577,6 +577,22 @@ export const hasSwiftFixedFontSizeUsage = (source: string): boolean => {
|
|
|
577
577
|
});
|
|
578
578
|
};
|
|
579
579
|
|
|
580
|
+
export const hasSwiftPhysicalTextAlignmentUsage = (source: string): boolean => {
|
|
581
|
+
const withoutBlockComments = source.replace(/\/\*[\s\S]*?\*\//g, '\n');
|
|
582
|
+
return withoutBlockComments.split(/\r?\n/).some((line) => {
|
|
583
|
+
if (/^\s*\/\//.test(line)) {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
const sanitized = stripSwiftLineForSemanticScan(line);
|
|
587
|
+
return (
|
|
588
|
+
/\.\s*multilineTextAlignment\s*\(\s*\.\s*(?:left|right)\s*\)/.test(sanitized) ||
|
|
589
|
+
/\.\s*frame\s*\([^)]*alignment\s*:\s*\.\s*(?:left|right)\b/.test(sanitized) ||
|
|
590
|
+
/\bTextAlignment\s*\.\s*(?:left|right)\b/.test(sanitized) ||
|
|
591
|
+
/\bNSTextAlignment\s*\.\s*(?:left|right)\b/.test(sanitized)
|
|
592
|
+
);
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
|
|
580
596
|
export const hasSwiftUncheckedSendableUsage = (source: string): boolean => {
|
|
581
597
|
return scanCodeLikeSource(source, ({ source: swiftSource, index, current }) => {
|
|
582
598
|
if (current !== '@' || !swiftSource.startsWith('@unchecked', index)) {
|
|
@@ -657,6 +657,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
|
|
|
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
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.' },
|
|
660
|
+
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftPhysicalTextAlignmentUsage, ruleId: 'heuristics.ios.localization.physical-text-alignment.ast', code: 'HEURISTICS_IOS_LOCALIZATION_PHYSICAL_TEXT_ALIGNMENT_AST', message: 'AST heuristic detected physical left/right text alignment in iOS production code; leading/trailing remain the preferred RTL-safe baseline.' },
|
|
660
661
|
{ 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.' },
|
|
661
662
|
{ 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.' },
|
|
662
663
|
{ 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, 56);
|
|
7
7
|
|
|
8
8
|
const ids = iosRules.map((rule) => rule.id);
|
|
9
9
|
assert.deepEqual(ids, [
|
|
@@ -29,6 +29,7 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
|
|
|
29
29
|
'heuristics.ios.localization.hardcoded-ui-string.ast',
|
|
30
30
|
'heuristics.ios.assets.loose-resource.ast',
|
|
31
31
|
'heuristics.ios.accessibility.fixed-font-size.ast',
|
|
32
|
+
'heuristics.ios.localization.physical-text-alignment.ast',
|
|
32
33
|
'heuristics.ios.unchecked-sendable.ast',
|
|
33
34
|
'heuristics.ios.preconcurrency.ast',
|
|
34
35
|
'heuristics.ios.nonisolated-unsafe.ast',
|
|
@@ -121,6 +122,10 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
|
|
|
121
122
|
byId.get('heuristics.ios.accessibility.fixed-font-size.ast')?.then.code,
|
|
122
123
|
'HEURISTICS_IOS_ACCESSIBILITY_FIXED_FONT_SIZE_AST'
|
|
123
124
|
);
|
|
125
|
+
assert.equal(
|
|
126
|
+
byId.get('heuristics.ios.localization.physical-text-alignment.ast')?.then.code,
|
|
127
|
+
'HEURISTICS_IOS_LOCALIZATION_PHYSICAL_TEXT_ALIGNMENT_AST'
|
|
128
|
+
);
|
|
124
129
|
assert.equal(
|
|
125
130
|
byId.get('heuristics.ios.preconcurrency.ast')?.then.code,
|
|
126
131
|
'HEURISTICS_IOS_PRECONCURRENCY_AST'
|
|
@@ -397,6 +397,24 @@ export const iosRules: RuleSet = [
|
|
|
397
397
|
code: 'HEURISTICS_IOS_ACCESSIBILITY_FIXED_FONT_SIZE_AST',
|
|
398
398
|
},
|
|
399
399
|
},
|
|
400
|
+
{
|
|
401
|
+
id: 'heuristics.ios.localization.physical-text-alignment.ast',
|
|
402
|
+
description: 'Detects physical left/right text alignment where leading/trailing are the preferred RTL-safe iOS baseline.',
|
|
403
|
+
severity: 'WARN',
|
|
404
|
+
platform: 'ios',
|
|
405
|
+
locked: true,
|
|
406
|
+
when: {
|
|
407
|
+
kind: 'Heuristic',
|
|
408
|
+
where: {
|
|
409
|
+
ruleId: 'heuristics.ios.localization.physical-text-alignment.ast',
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
then: {
|
|
413
|
+
kind: 'Finding',
|
|
414
|
+
message: 'AST heuristic detected physical left/right text alignment in iOS production code; leading/trailing remain the preferred RTL-safe baseline.',
|
|
415
|
+
code: 'HEURISTICS_IOS_LOCALIZATION_PHYSICAL_TEXT_ALIGNMENT_AST',
|
|
416
|
+
},
|
|
417
|
+
},
|
|
400
418
|
{
|
|
401
419
|
id: 'heuristics.ios.unchecked-sendable.ast',
|
|
402
420
|
description: 'Detects @unchecked Sendable usage in iOS production code.',
|
|
@@ -628,6 +628,11 @@ struct APIEndpoint: Sendable {
|
|
|
628
628
|
- `skills.ios.guideline.ios.dynamic-type-fuentes-escalables-y-layouts-adaptativos` se mapea a `heuristics.ios.accessibility.fixed-font-size.ast`.
|
|
629
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
630
|
|
|
631
|
+
### Enforcement AST inicial de RTL iOS
|
|
632
|
+
|
|
633
|
+
- `skills.ios.guideline.ios.rtl-support-right-to-left-para-a-rabe-hebreo` se mapea a `heuristics.ios.localization.physical-text-alignment.ast`.
|
|
634
|
+
- En `PROJECT MODE: brownfield`, este hallazgo detecta alineaciones físicas `.left`/`.right` en texto y frames (`multilineTextAlignment`, `frame(alignment:)`, `TextAlignment`, `NSTextAlignment`) como señal de adopción hacia `.leading`/`.trailing`. No marca `.leading` ni `.trailing`.
|
|
635
|
+
|
|
631
636
|
### Combine (Reactive):
|
|
632
637
|
✅ **Publishers** - AsyncSequence para async, Combine para streams complejos
|
|
633
638
|
✅ **@Published** - En ViewModels para binding con Views
|
|
@@ -123,6 +123,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
|
|
|
123
123
|
'ios.accessibility.fixed-font-size',
|
|
124
124
|
['heuristics.ios.accessibility.fixed-font-size.ast']
|
|
125
125
|
),
|
|
126
|
+
'skills.ios.guideline.ios.rtl-support-right-to-left-para-a-rabe-hebreo': heuristicDetector(
|
|
127
|
+
'ios.localization.physical-text-alignment',
|
|
128
|
+
['heuristics.ios.localization.physical-text-alignment.ast']
|
|
129
|
+
),
|
|
126
130
|
'skills.ios.no-unchecked-sendable': heuristicDetector('ios.unchecked-sendable', [
|
|
127
131
|
'heuristics.ios.unchecked-sendable.ast',
|
|
128
132
|
]),
|
|
@@ -404,6 +404,9 @@ const normalizeKnownRuleTarget = (
|
|
|
404
404
|
if (includes('dynamic type')) {
|
|
405
405
|
return 'skills.ios.guideline.ios.dynamic-type-font-scaling-automa-tico';
|
|
406
406
|
}
|
|
407
|
+
if (includes('rtl support') || includes('right to left')) {
|
|
408
|
+
return 'skills.ios.guideline.ios.rtl-support-right-to-left-para-a-rabe-hebreo';
|
|
409
|
+
}
|
|
407
410
|
if (
|
|
408
411
|
includes('mixing legacy xctest style') ||
|
|
409
412
|
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.202",
|
|
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:47:21.054Z",
|
|
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": "4689c3cc0d9f813517c298e0cddac9fffa9c029951fbc1c6f58d95994938f2d9",
|
|
5768
5768
|
"rules": [
|
|
5769
5769
|
{
|
|
5770
5770
|
"id": "skills.ios.guideline.ios.accessibility-identifiers-para-localizar-elementos",
|
|
@@ -7624,7 +7624,7 @@
|
|
|
7624
7624
|
"sourcePath": "vendor/skills/ios-enterprise-rules/SKILL.md",
|
|
7625
7625
|
"confidence": "MEDIUM",
|
|
7626
7626
|
"locked": true,
|
|
7627
|
-
"evaluationMode": "
|
|
7627
|
+
"evaluationMode": "AUTO",
|
|
7628
7628
|
"origin": "core"
|
|
7629
7629
|
},
|
|
7630
7630
|
{
|