pumuki 6.3.246 → 6.3.247
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 +6 -0
- package/core/facts/detectors/text/ios.test.ts +61 -0
- package/core/facts/detectors/text/ios.ts +15 -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 +20 -0
- package/integrations/config/skillsDetectorRegistry.ts +4 -0
- package/integrations/config/skillsMarkdownRules.ts +7 -0
- package/package.json +1 -1
- package/skills.lock.json +3 -3
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.247] - 2026-05-14
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **SwiftUI sheet action parity:** `skills.ios.guideline.ios-swiftui-expert.sheets-should-own-their-actions-and-call-dismiss-internally` now maps to a scoped AUTO heuristic that detects sheet content receiving parent-owned save/cancel/dismiss callbacks, preserving sheets that own their actions internally.
|
|
14
|
+
|
|
9
15
|
## [6.3.246] - 2026-05-14
|
|
10
16
|
|
|
11
17
|
### Added
|
|
@@ -75,6 +75,7 @@ import {
|
|
|
75
75
|
hasSwiftClosureBasedViewBuilderContentUsage,
|
|
76
76
|
hasSwiftLargeConfigContextViewPropertyUsage,
|
|
77
77
|
hasSwiftUiConditionalSameViewIdentityUsage,
|
|
78
|
+
hasSwiftUiParentOwnedSheetActionUsage,
|
|
78
79
|
hasSwiftRedundantReactiveStateAssignmentUsage,
|
|
79
80
|
hasSwiftInlineForEachTransformUsage,
|
|
80
81
|
hasSwiftStringFormatUsage,
|
|
@@ -2112,3 +2113,63 @@ struct StatusBadge: View {
|
|
|
2112
2113
|
assert.equal(hasSwiftUiConditionalSameViewIdentityUsage(source), true);
|
|
2113
2114
|
assert.equal(hasSwiftUiConditionalSameViewIdentityUsage(safe), false);
|
|
2114
2115
|
});
|
|
2116
|
+
|
|
2117
|
+
test('hasSwiftUiParentOwnedSheetActionUsage detecta sheets que reciben callbacks de accion del padre', () => {
|
|
2118
|
+
const source = `
|
|
2119
|
+
struct ParentView: View {
|
|
2120
|
+
@State private var selectedItem: Item?
|
|
2121
|
+
|
|
2122
|
+
var body: some View {
|
|
2123
|
+
List(items) { item in
|
|
2124
|
+
Button(item.name) {
|
|
2125
|
+
selectedItem = item
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
.sheet(item: $selectedItem) { item in
|
|
2129
|
+
EditItemSheet(
|
|
2130
|
+
item: item,
|
|
2131
|
+
onSave: { newName in
|
|
2132
|
+
save(item, newName)
|
|
2133
|
+
},
|
|
2134
|
+
onCancel: {
|
|
2135
|
+
selectedItem = nil
|
|
2136
|
+
}
|
|
2137
|
+
)
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
`;
|
|
2142
|
+
const safe = `
|
|
2143
|
+
struct ParentView: View {
|
|
2144
|
+
@State private var selectedItem: Item?
|
|
2145
|
+
|
|
2146
|
+
var body: some View {
|
|
2147
|
+
List(items) { item in
|
|
2148
|
+
Button(item.name) {
|
|
2149
|
+
selectedItem = item
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
.sheet(item: $selectedItem) { item in
|
|
2153
|
+
EditItemSheet(item: item)
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
let sample = ".sheet(item: $selectedItem) { EditItemSheet(onCancel: {}) }"
|
|
2157
|
+
// .sheet(item: $selectedItem) { EditItemSheet(onSave: {}) }
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
struct EditItemSheet: View {
|
|
2162
|
+
@Environment(\\.dismiss) private var dismiss
|
|
2163
|
+
let item: Item
|
|
2164
|
+
|
|
2165
|
+
var body: some View {
|
|
2166
|
+
Button("Cancel") {
|
|
2167
|
+
dismiss()
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
`;
|
|
2172
|
+
|
|
2173
|
+
assert.equal(hasSwiftUiParentOwnedSheetActionUsage(source), true);
|
|
2174
|
+
assert.equal(hasSwiftUiParentOwnedSheetActionUsage(safe), false);
|
|
2175
|
+
});
|
|
@@ -1019,6 +1019,21 @@ export const hasSwiftUiConditionalSameViewIdentityUsage = (source: string): bool
|
|
|
1019
1019
|
return false;
|
|
1020
1020
|
};
|
|
1021
1021
|
|
|
1022
|
+
export const hasSwiftUiParentOwnedSheetActionUsage = (source: string): boolean => {
|
|
1023
|
+
const sanitized = sanitizeSwiftSourceForMultilineRegex(source);
|
|
1024
|
+
const swiftUIViewBodyPattern =
|
|
1025
|
+
/\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*\{/m;
|
|
1026
|
+
|
|
1027
|
+
if (!swiftUIViewBodyPattern.test(sanitized)) {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
const sheetWithCallbackPattern =
|
|
1032
|
+
/\.(?:sheet|fullScreenCover)\s*\([^)]*\)\s*\{[\s\S]{0,1200}?\b[A-Za-z_][A-Za-z0-9_]*\s*\([\s\S]{0,900}?\b(?:onSave|onCancel|onDismiss|onClose|onDone|onDelete|onConfirm)\s*:\s*\{/g;
|
|
1033
|
+
|
|
1034
|
+
return sheetWithCallbackPattern.test(sanitized);
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1022
1037
|
export const hasSwiftRedundantReactiveStateAssignmentUsage = (source: string): boolean => {
|
|
1023
1038
|
const sanitized = sanitizeSwiftSourceForMultilineRegex(source);
|
|
1024
1039
|
const reactiveAssignmentPattern =
|
|
@@ -691,6 +691,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
|
|
|
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
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.' },
|
|
693
693
|
{ platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftUiConditionalSameViewIdentityUsage, ruleId: 'heuristics.ios.swiftui.conditional-same-view-identity.ast', code: 'HEURISTICS_IOS_SWIFTUI_CONDITIONAL_SAME_VIEW_IDENTITY_AST', message: 'AST heuristic detected conditional branches rebuilding the same SwiftUI View type; prefer conditional modifiers or values to preserve view identity.' },
|
|
694
|
+
{ platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftUiParentOwnedSheetActionUsage, ruleId: 'heuristics.ios.swiftui.parent-owned-sheet-action.ast', code: 'HEURISTICS_IOS_SWIFTUI_PARENT_OWNED_SHEET_ACTION_AST', message: 'AST heuristic detected a SwiftUI sheet receiving parent-owned action callbacks; sheets should own save/cancel actions and call dismiss() internally.' },
|
|
694
695
|
{ 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.' },
|
|
695
696
|
{ 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.' },
|
|
696
697
|
{ 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,
|
|
6
|
+
assert.equal(iosRules.length, 86);
|
|
7
7
|
|
|
8
8
|
const ids = iosRules.map((rule) => rule.id);
|
|
9
9
|
assert.deepEqual(ids, [
|
|
@@ -63,6 +63,7 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
|
|
|
63
63
|
'heuristics.ios.swiftui.closure-based-viewbuilder-content.ast',
|
|
64
64
|
'heuristics.ios.swiftui.large-config-context-prop.ast',
|
|
65
65
|
'heuristics.ios.swiftui.conditional-same-view-identity.ast',
|
|
66
|
+
'heuristics.ios.swiftui.parent-owned-sheet-action.ast',
|
|
66
67
|
'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
|
|
67
68
|
'heuristics.ios.swiftui.non-lazy-scroll-foreach.ast',
|
|
68
69
|
'heuristics.ios.swiftui.body-object-creation.ast',
|
|
@@ -215,6 +216,10 @@ test('iosRules define reglas heurísticas locked para plataforma ios', () => {
|
|
|
215
216
|
byId.get('heuristics.ios.swiftui.conditional-same-view-identity.ast')?.then.code,
|
|
216
217
|
'HEURISTICS_IOS_SWIFTUI_CONDITIONAL_SAME_VIEW_IDENTITY_AST'
|
|
217
218
|
);
|
|
219
|
+
assert.equal(
|
|
220
|
+
byId.get('heuristics.ios.swiftui.parent-owned-sheet-action.ast')?.then.code,
|
|
221
|
+
'HEURISTICS_IOS_SWIFTUI_PARENT_OWNED_SHEET_ACTION_AST'
|
|
222
|
+
);
|
|
218
223
|
assert.equal(
|
|
219
224
|
byId.get('heuristics.ios.uiscreen-main-bounds.ast')?.then.code,
|
|
220
225
|
'HEURISTICS_IOS_UISCREEN_MAIN_BOUNDS_AST'
|
|
@@ -1028,6 +1028,26 @@ export const iosRules: RuleSet = [
|
|
|
1028
1028
|
code: 'HEURISTICS_IOS_SWIFTUI_CONDITIONAL_SAME_VIEW_IDENTITY_AST',
|
|
1029
1029
|
},
|
|
1030
1030
|
},
|
|
1031
|
+
{
|
|
1032
|
+
id: 'heuristics.ios.swiftui.parent-owned-sheet-action.ast',
|
|
1033
|
+
description:
|
|
1034
|
+
'Detects SwiftUI sheets that receive save/cancel/dismiss callbacks from the parent view.',
|
|
1035
|
+
severity: 'WARN',
|
|
1036
|
+
platform: 'ios',
|
|
1037
|
+
locked: true,
|
|
1038
|
+
when: {
|
|
1039
|
+
kind: 'Heuristic',
|
|
1040
|
+
where: {
|
|
1041
|
+
ruleId: 'heuristics.ios.swiftui.parent-owned-sheet-action.ast',
|
|
1042
|
+
},
|
|
1043
|
+
},
|
|
1044
|
+
then: {
|
|
1045
|
+
kind: 'Finding',
|
|
1046
|
+
message:
|
|
1047
|
+
'AST heuristic detected a SwiftUI sheet receiving parent-owned action callbacks; sheets should own save/cancel actions and call dismiss() internally.',
|
|
1048
|
+
code: 'HEURISTICS_IOS_SWIFTUI_PARENT_OWNED_SHEET_ACTION_AST',
|
|
1049
|
+
},
|
|
1050
|
+
},
|
|
1031
1051
|
{
|
|
1032
1052
|
id: 'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
|
|
1033
1053
|
description: 'Detects onChange/onReceive state assignments without a value-change guard.',
|
|
@@ -288,6 +288,10 @@ const registryByRuleId: Record<string, SkillsDetectorBinding> = {
|
|
|
288
288
|
heuristicDetector('ios.swiftui.conditional-same-view-identity', [
|
|
289
289
|
'heuristics.ios.swiftui.conditional-same-view-identity.ast',
|
|
290
290
|
]),
|
|
291
|
+
'skills.ios.guideline.ios-swiftui-expert.sheets-should-own-their-actions-and-call-dismiss-internally':
|
|
292
|
+
heuristicDetector('ios.swiftui.parent-owned-sheet-action', [
|
|
293
|
+
'heuristics.ios.swiftui.parent-owned-sheet-action.ast',
|
|
294
|
+
]),
|
|
291
295
|
'skills.ios.guideline.ios-swiftui-expert.avoid-redundant-state-updates-in-onreceive-onchange-scroll-handlers':
|
|
292
296
|
heuristicDetector('ios.swiftui.redundant-reactive-state-assignment', [
|
|
293
297
|
'heuristics.ios.swiftui.redundant-reactive-state-assignment.ast',
|
|
@@ -330,6 +330,13 @@ const normalizeKnownRuleTarget = (
|
|
|
330
330
|
) {
|
|
331
331
|
return 'skills.ios.guideline.ios-swiftui-expert.prefer-modifiers-over-conditional-views-for-state-changes-maintains-vi';
|
|
332
332
|
}
|
|
333
|
+
if (
|
|
334
|
+
includes('sheets should own their actions') ||
|
|
335
|
+
(includes('call dismiss internally') && includes('sheet')) ||
|
|
336
|
+
(includes('avoid passing dismiss') && includes('callbacks to sheets'))
|
|
337
|
+
) {
|
|
338
|
+
return 'skills.ios.guideline.ios-swiftui-expert.sheets-should-own-their-actions-and-call-dismiss-internally';
|
|
339
|
+
}
|
|
333
340
|
if (
|
|
334
341
|
(includes('foreach') && includes('indices')) ||
|
|
335
342
|
includes('stable identity for foreach') ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.247",
|
|
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-
|
|
4
|
+
"generatedAt": "2026-05-14T08:03:51.620Z",
|
|
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": "
|
|
8623
|
+
"hash": "5a759b80ddf1308e23cd04aef7e1628abf13dcd0e9d7649039da10a40f1de860",
|
|
8624
8624
|
"rules": [
|
|
8625
8625
|
{
|
|
8626
8626
|
"id": "skills.ios.guideline.ios-swiftui-expert.action-handlers-should-reference-methods-not-contain-inline-logic",
|
|
@@ -8775,7 +8775,7 @@
|
|
|
8775
8775
|
"sourcePath": "vendor/skills/swiftui-expert-skill/SKILL.md",
|
|
8776
8776
|
"confidence": "MEDIUM",
|
|
8777
8777
|
"locked": true,
|
|
8778
|
-
"evaluationMode": "
|
|
8778
|
+
"evaluationMode": "AUTO",
|
|
8779
8779
|
"origin": "core"
|
|
8780
8780
|
},
|
|
8781
8781
|
{
|