pumuki 6.3.323 → 6.3.324
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.
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
hasSwiftDummyAwaitUsage,
|
|
35
35
|
hasSwiftDispatchSemaphoreUsage,
|
|
36
36
|
collectSwiftLongAsyncOperationWithoutCancellationCheckLines,
|
|
37
|
+
collectSwiftAdHocLoggingLines,
|
|
37
38
|
hasSwiftAdHocLoggingUsage,
|
|
38
39
|
hasSwiftAlamofireUsage,
|
|
39
40
|
collectSwiftComposableArchitectureUsageLines,
|
|
@@ -1944,7 +1945,9 @@ logger.error("Refresh failed \\(refreshToken)")
|
|
|
1944
1945
|
`;
|
|
1945
1946
|
|
|
1946
1947
|
assert.equal(hasSwiftAdHocLoggingUsage(adHoc), true);
|
|
1948
|
+
assert.deepEqual(collectSwiftAdHocLoggingLines(adHoc), [2, 3, 4, 5, 6]);
|
|
1947
1949
|
assert.equal(hasSwiftAdHocLoggingUsage(structuredSafe), false);
|
|
1950
|
+
assert.deepEqual(collectSwiftAdHocLoggingLines(structuredSafe), []);
|
|
1948
1951
|
assert.equal(hasSwiftSensitiveLoggingUsage(sensitive), true);
|
|
1949
1952
|
assert.deepEqual(collectSwiftSensitiveLoggingLines(sensitive), [2, 3]);
|
|
1950
1953
|
assert.equal(hasSwiftSensitiveLoggingUsage(structuredSafe), false);
|
|
@@ -1617,10 +1617,14 @@ export const collectSwiftMagicNumberLayoutLines = (source: string): readonly num
|
|
|
1617
1617
|
};
|
|
1618
1618
|
|
|
1619
1619
|
export const hasSwiftAdHocLoggingUsage = (source: string): boolean => {
|
|
1620
|
+
return collectSwiftAdHocLoggingLines(source).length > 0;
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
export const collectSwiftAdHocLoggingLines = (source: string): readonly number[] => {
|
|
1620
1624
|
return collectSwiftRegexLines(
|
|
1621
1625
|
source,
|
|
1622
1626
|
/\b(?:print|debugPrint|dump|NSLog|os_log)\s*\(/
|
|
1623
|
-
)
|
|
1627
|
+
);
|
|
1624
1628
|
};
|
|
1625
1629
|
|
|
1626
1630
|
export const hasSwiftSensitiveLoggingUsage = (source: string): boolean => {
|
|
@@ -804,7 +804,7 @@ const textDetectorRegistry: ReadonlyArray<TextDetectorRegistryEntry> = [
|
|
|
804
804
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftNonIBOutletImplicitlyUnwrappedOptionalUsage, ruleId: 'heuristics.ios.safety.non-iboutlet-iuo.ast', code: 'HEURISTICS_IOS_SAFETY_NON_IBOUTLET_IUO_AST', message: 'AST heuristic detected an implicitly unwrapped optional outside IBOutlet wiring; explicit optionals or initialization guarantees remain the preferred baseline.' },
|
|
805
805
|
{ platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftMagicNumberLayoutUsage, locateLines: TextIOS.collectSwiftMagicNumberLayoutLines, primaryNode: (lines) => ({ kind: 'call', name: 'SwiftUI layout numeric literal', lines }), relatedNodes: (lines) => [{ kind: 'property', name: 'replacement: named metric constant or design token', lines }], why: 'Inline numeric layout literals hide design intent and make visual remediation dependent on scanning the whole view body.', impact: 'Pixel-perfect slices can be blocked without a concrete node unless the finding points to the exact spacing, frame or padding call to fix.', expected_fix: 'Move repeated or meaningful layout numbers into named constants or design tokens, or use relative layout APIs when the number encodes screen geometry.', ruleId: 'heuristics.ios.maintainability.magic-number-layout.ast', code: 'HEURISTICS_IOS_MAINTAINABILITY_MAGIC_NUMBER_LAYOUT_AST', message: 'AST heuristic detected SwiftUI layout magic numbers; named constants or design tokens remain the preferred baseline.' },
|
|
806
806
|
{ platform: 'ios', pathCheck: isIOSPresentationPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftUIKitManualFrameLayoutUsage, locateLines: TextIOS.collectSwiftUIKitManualFrameLayoutLines, primaryNode: (lines) => ({ kind: 'call', name: 'UIKit manual frame CGRect layout', lines }), relatedNodes: (lines) => [{ kind: 'call', name: 'replacement: Auto Layout constraints or SwiftUI relative layout', lines }], why: 'Manual UIKit frames hard-code geometry instead of using Auto Layout constraints or SwiftUI relative layout, so the layout cannot adapt reliably to devices, Dynamic Type or localization.', impact: 'Pixel-perfect work can regress across screens because fixed CGRect values bypass constraint solving and produce file-level ambiguity unless the exact frame node is reported.', expected_fix: 'Replace UIView(frame: CGRect(...)) and .frame = CGRect(...) layout with Auto Layout anchors/NSLayoutConstraint, UIStackView constraints, or SwiftUI relative layout where the screen is SwiftUI-first.', ruleId: 'heuristics.ios.uikit.manual-frame-layout.ast', code: 'HEURISTICS_IOS_UIKIT_MANUAL_FRAME_LAYOUT_AST', message: 'AST heuristic detected UIKit manual frame layout; use Auto Layout constraints or SwiftUI relative layout.' },
|
|
807
|
-
{ 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
|
|
807
|
+
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftAdHocLoggingUsage, locateLines: TextIOS.collectSwiftAdHocLoggingLines, primaryNode: (lines) => ({ kind: 'call', name: 'ad-hoc iOS logging call', lines }), relatedNodes: (lines) => [{ kind: 'call', name: 'replacement: structured logger with approved privacy level', lines }], why: 'Production iOS code must not use print/debugPrint/dump/NSLog/os_log ad hoc calls because they bypass repository logging policy and privacy controls.', impact: 'Ad-hoc logs create noisy diagnostics, can leak runtime state, and leave the developer without a clear logging boundary to audit or disable by environment.', expected_fix: 'Remove the print/debugPrint/dump/NSLog/os_log call or replace it with the repository-approved structured logger. If the log is still needed, use an explicit privacy level and avoid user data, tokens and request payloads.', ruleId: 'heuristics.ios.logging.adhoc-print.ast', code: 'HEURISTICS_IOS_LOGGING_ADHOC_PRINT_AST', message: 'AST heuristic detected ad-hoc logging in iOS production code.' },
|
|
808
808
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftSensitiveLoggingUsage, locateLines: TextIOS.collectSwiftSensitiveLoggingLines, primaryNode: (lines) => ({ kind: 'call', name: 'logging call with sensitive data', lines }), relatedNodes: (lines) => [{ kind: 'call', name: 'replacement: redacted structured log without token/password/email/userId', lines }], why: 'Production logs must not include tokens, credentials, emails or user identifiers because logs are copied to diagnostics, crash reports and external observability stores.', impact: 'Sensitive values can leak outside the device or backend trust boundary and make incident response depend on scrubbing historical logs.', expected_fix: 'Remove the sensitive value from the log, log a redacted marker, or emit structured metadata that cannot expose token, password, email, authorization or userId values.', 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.' },
|
|
809
809
|
{ platform: 'ios', pathCheck: isIOSSwiftPath, excludePaths: [isSwiftTestPath], detect: TextIOS.hasSwiftHardcodedSensitiveStringUsage, locateLines: TextIOS.collectSwiftHardcodedSensitiveStringLines, primaryNode: (lines) => ({ kind: 'property', name: 'hardcoded sensitive Swift string', lines }), relatedNodes: (lines) => [{ kind: 'property', name: 'replacement: Keychain, secure config or environment-specific secret source', lines }], why: 'Sensitive strings assigned directly to token/password/secret properties create static production secrets and cannot be rotated safely.', impact: 'Credentials or identifiers can leak through source, binaries, logs or screenshots and block release until the concrete assignment is removed.', expected_fix: 'Read sensitive values from Keychain, secure configuration, injected environment or a repository-approved secret provider. Keep user-facing copy in localization assets, not sensitive variables.', 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.' },
|
|
810
810
|
{ 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.' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.324",
|
|
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": {
|