pumuki 6.3.172 → 6.3.173

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.
Files changed (120) hide show
  1. package/AGENTS.md +1 -16
  2. package/CHANGELOG.md +0 -101
  3. package/README.md +10 -14
  4. package/VERSION +1 -1
  5. package/core/facts/detectors/text/android.test.ts +0 -2827
  6. package/core/facts/detectors/text/android.ts +182 -5121
  7. package/core/facts/detectors/text/ios.test.ts +12 -290
  8. package/core/facts/detectors/text/ios.ts +28 -301
  9. package/core/facts/detectors/typescript/index.test.ts +139 -3733
  10. package/core/facts/detectors/typescript/index.ts +264 -4959
  11. package/core/facts/extractHeuristicFacts.ts +11 -328
  12. package/core/gate/evaluateRules.test.ts +0 -7
  13. package/core/gate/evaluateRules.ts +2 -1
  14. package/core/rules/presets/heuristics/android.test.ts +1 -399
  15. package/core/rules/presets/heuristics/android.ts +1 -1481
  16. package/core/rules/presets/heuristics/ios.test.ts +1 -11
  17. package/core/rules/presets/heuristics/ios.ts +0 -36
  18. package/core/rules/presets/heuristics/typescript.test.ts +2 -158
  19. package/core/rules/presets/heuristics/typescript.ts +0 -508
  20. package/core/rules/presets/iosEnterpriseRuleSet.test.ts +0 -5
  21. package/core/rules/presets/iosEnterpriseRuleSet.ts +5 -5
  22. package/docs/README.md +3 -3
  23. package/docs/operations/RELEASE_NOTES.md +1 -94
  24. package/docs/operations/framework-menu-consumer-walkthrough.md +15 -18
  25. package/docs/product/API_REFERENCE.md +1 -1
  26. package/docs/product/CONFIGURATION.md +0 -7
  27. package/docs/product/USAGE.md +1 -1
  28. package/docs/validation/README.md +1 -3
  29. package/docs/validation/ios-avdlee-parity-matrix.md +1 -1
  30. package/integrations/config/skillsCompilerTemplates.test.ts +0 -145
  31. package/integrations/config/skillsCompilerTemplates.ts +2 -1013
  32. package/integrations/config/skillsDetectorRegistry.ts +8 -523
  33. package/integrations/config/skillsMarkdownRules.ts +8 -1088
  34. package/integrations/config/skillsRuleSet.ts +3 -44
  35. package/integrations/evidence/buildEvidence.ts +5 -34
  36. package/integrations/evidence/platformSummary.test.ts +9 -73
  37. package/integrations/evidence/platformSummary.ts +7 -165
  38. package/integrations/evidence/repoState.ts +0 -3
  39. package/integrations/evidence/rulesCoverage.ts +0 -83
  40. package/integrations/evidence/schema.ts +0 -29
  41. package/integrations/evidence/writeEvidence.test.ts +0 -4
  42. package/integrations/evidence/writeEvidence.ts +2 -41
  43. package/integrations/gate/evaluateAiGate.ts +8 -312
  44. package/integrations/gate/remediationCatalog.ts +2 -20
  45. package/integrations/gate/stagePolicies.ts +18 -24
  46. package/integrations/git/astIntelligenceDualValidation.ts +2 -2
  47. package/integrations/git/gitAtomicity.ts +39 -284
  48. package/integrations/git/resolveGitRefs.ts +6 -35
  49. package/integrations/git/runPlatformGate.ts +143 -512
  50. package/integrations/git/runPlatformGateOutput.ts +8 -13
  51. package/integrations/git/stageRunners.ts +41 -26
  52. package/integrations/lifecycle/adapter.ts +0 -24
  53. package/integrations/lifecycle/audit.ts +16 -14
  54. package/integrations/lifecycle/cli.ts +20 -37
  55. package/integrations/lifecycle/cliSdd.ts +3 -4
  56. package/integrations/lifecycle/doctor.ts +1 -1
  57. package/integrations/lifecycle/packageInfo.ts +1 -118
  58. package/integrations/lifecycle/policyReconcile.ts +4 -27
  59. package/integrations/lifecycle/preWriteAutomation.ts +5 -5
  60. package/integrations/lifecycle/state.ts +1 -8
  61. package/integrations/lifecycle/watch.ts +8 -28
  62. package/integrations/mcp/aiGateCheck.ts +10 -194
  63. package/integrations/mcp/autoExecuteAiStart.ts +4 -7
  64. package/integrations/mcp/enterpriseServer.ts +3 -19
  65. package/integrations/mcp/preFlightCheck.ts +10 -89
  66. package/integrations/policy/gitAtomicityEnforcement.ts +2 -2
  67. package/integrations/policy/heuristicsEnforcement.ts +2 -2
  68. package/integrations/policy/policyProfiles.ts +18 -24
  69. package/integrations/policy/preWriteEnforcement.ts +1 -1
  70. package/integrations/policy/sddCompletenessEnforcement.ts +2 -2
  71. package/integrations/policy/skillsEnforcement.ts +47 -1
  72. package/integrations/policy/tddBddEnforcement.ts +2 -2
  73. package/integrations/sdd/evidenceScaffold.ts +8 -124
  74. package/integrations/tdd/contract.ts +0 -1
  75. package/integrations/tdd/enforcement.ts +0 -103
  76. package/integrations/tdd/types.ts +0 -6
  77. package/package.json +1 -1
  78. package/scripts/check-tracking-single-active.sh +1 -1
  79. package/scripts/framework-menu-advanced-view-lib.ts +0 -49
  80. package/scripts/framework-menu-consumer-actions-lib.ts +32 -32
  81. package/scripts/framework-menu-consumer-preflight-render.ts +0 -10
  82. package/scripts/framework-menu-consumer-preflight-run.ts +5 -31
  83. package/scripts/framework-menu-consumer-preflight-types.ts +0 -12
  84. package/scripts/framework-menu-consumer-runtime-actions.ts +5 -11
  85. package/scripts/framework-menu-consumer-runtime-audit.ts +28 -0
  86. package/scripts/framework-menu-consumer-runtime-evidence-classic.ts +42 -118
  87. package/scripts/framework-menu-consumer-runtime-lib.ts +0 -38
  88. package/scripts/framework-menu-consumer-runtime-menu.ts +15 -55
  89. package/scripts/framework-menu-consumer-runtime-types.ts +0 -4
  90. package/scripts/framework-menu-evidence-summary-read.ts +1 -17
  91. package/scripts/framework-menu-evidence-summary-types.ts +0 -3
  92. package/scripts/framework-menu-layout-data.ts +23 -3
  93. package/scripts/framework-menu-system-notifications-cause.ts +1 -24
  94. package/scripts/framework-menu-system-notifications-env.ts +0 -8
  95. package/scripts/framework-menu-system-notifications-gate.ts +2 -9
  96. package/scripts/framework-menu-system-notifications-macos-applescript-dialog.ts +1 -1
  97. package/scripts/framework-menu-system-notifications-macos-dialog-payload.ts +2 -14
  98. package/scripts/framework-menu-system-notifications-macos-swift-source.ts +1 -1
  99. package/scripts/framework-menu-system-notifications-payloads-blocked.ts +4 -128
  100. package/scripts/framework-menu-system-notifications-payloads.ts +1 -8
  101. package/scripts/framework-menu-system-notifications-remediation.ts +1 -15
  102. package/scripts/framework-menu-system-notifications-text.ts +1 -7
  103. package/scripts/framework-menu.ts +2 -37
  104. package/scripts/package-install-smoke-consumer-git-repo-lib.ts +1 -10
  105. package/scripts/package-install-smoke-consumer-npm-lib.ts +9 -46
  106. package/skills.lock.json +1244 -807
  107. package/integrations/evidence/trackingContract.ts +0 -17
  108. package/integrations/gate/blockingCause.ts +0 -40
  109. package/integrations/gate/governanceActionCatalog.ts +0 -296
  110. package/integrations/gate/runPlatformGateConfig.ts +0 -55
  111. package/integrations/gate/runPlatformGateDefaults.ts +0 -19
  112. package/integrations/lifecycle/bootstrapManifest.ts +0 -248
  113. package/integrations/lifecycle/cliGovernanceConsole.ts +0 -69
  114. package/integrations/lifecycle/governanceNextAction.ts +0 -181
  115. package/integrations/lifecycle/governanceObservationSnapshot.ts +0 -376
  116. package/integrations/lifecycle/trackingState.ts +0 -403
  117. package/integrations/mcp/alignedPlatformGate.ts +0 -248
  118. package/integrations/mcp/readMcpPrePushStdin.ts +0 -7
  119. package/scripts/build-ruralgo-s1-evidence-pack.ts +0 -85
  120. package/scripts/ruralgo-s1-evidence-pack-lib.ts +0 -200
@@ -6,14 +6,12 @@ import {
6
6
  findSwiftOpenClosedSwitchMatch,
7
7
  findSwiftConcreteDependencyDipMatch,
8
8
  findSwiftPresentationSrpMatch,
9
- findSwiftXCTestSrpMatch,
10
9
  hasSwiftAnyViewUsage,
11
10
  hasSwiftCallbackStyleSignature,
12
11
  hasSwiftCornerRadiusUsage,
13
12
  hasSwiftDispatchGroupUsage,
14
13
  hasSwiftDispatchQueueUsage,
15
14
  hasSwiftDispatchSemaphoreUsage,
16
- hasSwiftExplicitColorStaticMemberUsage,
17
15
  hasSwiftForEachIndicesUsage,
18
16
  hasSwiftForceCastUsage,
19
17
  hasSwiftFontWeightBoldUsage,
@@ -21,7 +19,6 @@ import {
21
19
  hasSwiftForceTryUsage,
22
20
  hasSwiftForceUnwrap,
23
21
  hasSwiftGeometryReaderUsage,
24
- hasSwiftInlineFilteringInForEachUsage,
25
22
  hasSwiftLegacyOnChangeUsage,
26
23
  hasSwiftLegacyExpectationDescriptionUsage,
27
24
  hasSwiftLegacySwiftUiObservableWrapperUsage,
@@ -40,7 +37,6 @@ import {
40
37
  hasSwiftOperationQueueUsage,
41
38
  hasSwiftContainsUserFilterUsage,
42
39
  hasSwiftPassedValueStateWrapperUsage,
43
- hasSwiftStateWrapperWithoutPrivateUsage,
44
40
  hasSwiftPreconcurrencyUsage,
45
41
  hasSwiftSheetIsPresentedUsage,
46
42
  hasSwiftScrollViewShowsIndicatorsUsage,
@@ -245,9 +241,7 @@ MainActor.assumeIsolated { reload() }
245
241
  assert.equal(hasSwiftNonisolatedUnsafeUsage(source), true);
246
242
  assert.equal(hasSwiftAssumeIsolatedUsage(source), true);
247
243
  assert.equal(hasSwiftForEachIndicesUsage(source), true);
248
- assert.equal(hasSwiftInlineFilteringInForEachUsage('ForEach(items.filter { $0.isActive }) { item in Text(item.title) }'), true);
249
244
  assert.equal(hasSwiftContainsUserFilterUsage(source), true);
250
- assert.equal(hasSwiftExplicitColorStaticMemberUsage('Text("A").foregroundStyle(Color.blue)'), true);
251
245
  assert.equal(hasSwiftGeometryReaderUsage(source), true);
252
246
  assert.equal(hasSwiftFontWeightBoldUsage(source), true);
253
247
  assert.equal(hasSwiftObservableObjectUsage(source), true);
@@ -293,9 +287,7 @@ let t = "MainActor.assumeIsolated { reload() }"
293
287
  assert.equal(hasSwiftNonisolatedUnsafeUsage(source), false);
294
288
  assert.equal(hasSwiftAssumeIsolatedUsage(source), false);
295
289
  assert.equal(hasSwiftForEachIndicesUsage(source), false);
296
- assert.equal(hasSwiftInlineFilteringInForEachUsage(source), false);
297
290
  assert.equal(hasSwiftContainsUserFilterUsage(source), false);
298
- assert.equal(hasSwiftExplicitColorStaticMemberUsage('Text("A").foregroundStyle(.blue)'), false);
299
291
  assert.equal(hasSwiftGeometryReaderUsage(source), false);
300
292
  assert.equal(hasSwiftFontWeightBoldUsage(source), false);
301
293
  assert.equal(hasSwiftTaskDetachedUsage(source), false);
@@ -382,34 +374,11 @@ final class SyncTests: XCTestCase {
382
374
  }
383
375
  }
384
376
  }
385
- `;
386
- const brownfieldCompatibleUnitTest = `
387
- import XCTest
388
-
389
- final class LoginModelTests: XCTestCase {
390
- func test_submit_validCredentials_storesSession() async throws {
391
- let (sut, repository) = makeSUT()
392
- try await sut.submit()
393
- XCTAssertEqual(repository.receivedRequests.count, 1)
394
- }
395
-
396
- private func makeSUT(
397
- file: StaticString = #filePath,
398
- line: UInt = #line
399
- ) -> (LoginModel, AuthRepositorySpy) {
400
- let repository = AuthRepositorySpy()
401
- let sut = LoginModel(repository: repository)
402
- trackForMemoryLeaks(sut, testCase: self, file: file, line: line)
403
- trackForMemoryLeaks(repository, testCase: self, file: file, line: line)
404
- return (sut, repository)
405
- }
406
- }
407
377
  `;
408
378
 
409
- assert.equal(hasSwiftLegacyXCTestImportUsage(unitTest), false);
379
+ assert.equal(hasSwiftLegacyXCTestImportUsage(unitTest), true);
410
380
  assert.equal(hasSwiftLegacyXCTestImportUsage(uiTest), false);
411
381
  assert.equal(hasSwiftLegacyXCTestImportUsage(performanceTest), false);
412
- assert.equal(hasSwiftLegacyXCTestImportUsage(brownfieldCompatibleUnitTest), false);
413
382
  });
414
383
 
415
384
  test('hasSwiftLegacySwiftUiObservableWrapperUsage detecta @StateObject/@ObservedObject legacy', () => {
@@ -456,24 +425,6 @@ struct DetailView: View {
456
425
  assert.equal(hasSwiftPassedValueStateWrapperUsage(validOwnership), false);
457
426
  });
458
427
 
459
- test('hasSwiftStateWrapperWithoutPrivateUsage detecta @State y @StateObject sin private en SwiftUI Views', () => {
460
- const positive = `
461
- struct DetailView: View {
462
- @State var filter: String = ""
463
- @StateObject var viewModel = DetailViewModel()
464
- }
465
- `;
466
- const negative = `
467
- struct DetailView: View {
468
- @State private var filter: String = ""
469
- @StateObject private var viewModel = DetailViewModel()
470
- }
471
- `;
472
-
473
- assert.equal(hasSwiftStateWrapperWithoutPrivateUsage(positive), true);
474
- assert.equal(hasSwiftStateWrapperWithoutPrivateUsage(negative), false);
475
- });
476
-
477
428
  test('hasSwiftModernizableXCTestSuiteUsage detecta suites legacy y excluye mixed/UI', () => {
478
429
  const legacySuite = `
479
430
  import XCTest
@@ -507,33 +458,10 @@ final class LoginUITests: XCTestCase {
507
458
  }
508
459
  }
509
460
  `;
510
- const brownfieldCompatibleSuite = `
511
- import XCTest
512
-
513
- final class LoginModelTests: XCTestCase {
514
- func test_submit_validCredentials_storesSession() async throws {
515
- let (sut, repository) = makeSUT()
516
- try await sut.submit()
517
- XCTAssertEqual(repository.receivedRequests.count, 1)
518
- }
519
461
 
520
- private func makeSUT(
521
- file: StaticString = #filePath,
522
- line: UInt = #line
523
- ) -> (LoginModel, AuthRepositorySpy) {
524
- let repository = AuthRepositorySpy()
525
- let sut = LoginModel(repository: repository)
526
- trackForMemoryLeaks(sut, testCase: self, file: file, line: line)
527
- trackForMemoryLeaks(repository, testCase: self, file: file, line: line)
528
- return (sut, repository)
529
- }
530
- }
531
- `;
532
-
533
- assert.equal(hasSwiftModernizableXCTestSuiteUsage(legacySuite), false);
462
+ assert.equal(hasSwiftModernizableXCTestSuiteUsage(legacySuite), true);
534
463
  assert.equal(hasSwiftModernizableXCTestSuiteUsage(mixedSuite), false);
535
464
  assert.equal(hasSwiftModernizableXCTestSuiteUsage(uiSuite), false);
536
- assert.equal(hasSwiftModernizableXCTestSuiteUsage(brownfieldCompatibleSuite), false);
537
465
  });
538
466
 
539
467
  test('hasSwiftMixedTestingFrameworksUsage detecta mezcla XCTestCase y Testing/@Test', () => {
@@ -564,34 +492,11 @@ import Testing
564
492
  struct LoginModernTests {
565
493
  @Test func login() async {}
566
494
  }
567
- `;
568
- const mixedWithReexportedTesting = `
569
- import XCTest
570
-
571
- final class LoginTests: XCTestCase {
572
- func testLegacyLogin() {}
573
- }
574
-
575
- struct LoginModernTests {
576
- @Test func login() async {}
577
- }
578
- `;
579
- const ignoredCommentsAndStrings = `
580
- import XCTest
581
-
582
- final class LoginTests: XCTestCase {
583
- func testLegacyLogin() {
584
- let text = "@Test func login() async {}"
585
- // @Suite
586
- }
587
- }
588
495
  `;
589
496
 
590
497
  assert.equal(hasSwiftMixedTestingFrameworksUsage(mixedSuite), true);
591
- assert.equal(hasSwiftMixedTestingFrameworksUsage(mixedWithReexportedTesting), true);
592
498
  assert.equal(hasSwiftMixedTestingFrameworksUsage(legacyOnly), false);
593
499
  assert.equal(hasSwiftMixedTestingFrameworksUsage(modernOnly), false);
594
- assert.equal(hasSwiftMixedTestingFrameworksUsage(ignoredCommentsAndStrings), false);
595
500
  });
596
501
 
597
502
  test('hasSwiftXCTestAssertionUsage detecta XCTAssert y XCTFail reales', () => {
@@ -608,87 +513,6 @@ let text = "XCTAssertEqual(value, expected)"
608
513
  assert.equal(hasSwiftXCTestAssertionUsage(ignored), false);
609
514
  });
610
515
 
611
- test('hasSwiftXCTestAssertionUsage excluye XCTest compatible con UI automation', () => {
612
- const uiSource = `
613
- import XCTest
614
-
615
- final class BuyerCommerceUISmokeTests: XCTestCase {
616
- func test_buyer_flow() {
617
- let app = XCUIApplication()
618
- app.launch()
619
- XCTAssertTrue(app.buttons["Comprar"].exists)
620
- }
621
- }
622
- `;
623
-
624
- assert.equal(hasSwiftXCTestAssertionUsage(uiSource), false);
625
- assert.equal(hasSwiftXCTUnwrapUsage(`${uiSource}\nlet value = try XCTUnwrap(optional)`), false);
626
- });
627
-
628
- test('detectores Swift Testing excluyen XCTest brownfield y dejan la calidad a su guard dedicado', () => {
629
- const compatibleSource = `
630
- import XCTest
631
-
632
- final class LoginModelTests: XCTestCase {
633
- func test_submit_validCredentials_storesSession() async throws {
634
- let (sut, repository) = makeSUT()
635
- try await sut.submit()
636
- XCTAssertEqual(repository.receivedRequests.count, 1)
637
- let session = try XCTUnwrap(repository.savedSession)
638
- XCTAssertEqual(session.userId, "buyer-1")
639
- }
640
-
641
- private func makeSUT(
642
- file: StaticString = #filePath,
643
- line: UInt = #line
644
- ) -> (LoginModel, AuthRepositorySpy) {
645
- let repository = AuthRepositorySpy()
646
- let sut = LoginModel(repository: repository)
647
- trackForMemoryLeaks(sut, testCase: self, file: file, line: line)
648
- trackForMemoryLeaks(repository, testCase: self, file: file, line: line)
649
- return (sut, repository)
650
- }
651
- }
652
- `;
653
- const missingQualityContract = `
654
- import XCTest
655
-
656
- final class LoginModelTests: XCTestCase {
657
- func test_submit_validCredentials_storesSession() async throws {
658
- XCTAssertEqual(repository.receivedRequests.count, 1)
659
- }
660
- }
661
- `;
662
-
663
- assert.equal(hasSwiftXCTestAssertionUsage(compatibleSource), false);
664
- assert.equal(hasSwiftXCTUnwrapUsage(compatibleSource), false);
665
- assert.equal(hasSwiftLegacyXCTestImportUsage(compatibleSource), false);
666
- assert.equal(hasSwiftModernizableXCTestSuiteUsage(compatibleSource), false);
667
- assert.equal(hasSwiftXCTestAssertionUsage(missingQualityContract), false);
668
- assert.equal(hasSwiftLegacyXCTestImportUsage(missingQualityContract), false);
669
- assert.equal(hasSwiftModernizableXCTestSuiteUsage(missingQualityContract), false);
670
- });
671
-
672
- test('detectores Swift Testing excluyen helpers y factories XCTest brownfield sin XCTestCase', () => {
673
- const helperSource = `
674
- import XCTest
675
-
676
- final class AuthTestFactories {
677
- static func makeToken() -> String {
678
- "token"
679
- }
680
- }
681
-
682
- func trackForMemoryLeaks(_ instance: AnyObject, file: StaticString = #filePath, line: UInt = #line) {
683
- addTeardownBlock { _ = instance }
684
- }
685
- `;
686
-
687
- assert.equal(hasSwiftLegacyXCTestImportUsage(helperSource), false);
688
- assert.equal(hasSwiftModernizableXCTestSuiteUsage(helperSource), false);
689
- assert.equal(hasSwiftXCTestAssertionUsage(helperSource), false);
690
- });
691
-
692
516
  test('hasSwiftXCTUnwrapUsage detecta XCTUnwrap real y evita strings', () => {
693
517
  const source = `
694
518
  let value = try XCTUnwrap(optionalValue)
@@ -702,84 +526,51 @@ let text = "XCTUnwrap(optionalValue)"
702
526
  });
703
527
 
704
528
  test('hasSwiftWaitForExpectationsUsage detecta waits legacy y excluye await fulfillment', () => {
705
- const legacyAsyncWait = `
706
- func testLegacyAsync() async {
529
+ const legacyWait = `
707
530
  let expectation = expectation(description: "Done")
708
531
  wait(for: [expectation], timeout: 1)
709
532
  waitForExpectations(timeout: 1)
710
- }
711
- `;
712
- const legacySyncWait = `
713
- func testLegacySync() {
714
- let expectation = expectation(description: "Done")
715
- wait(for: [expectation], timeout: 1)
716
- }
717
533
  `;
718
534
  const modernWait = `
719
- func testModernAsync() async {
720
535
  let expectation = expectation(description: "Done")
721
536
  await fulfillment(of: [expectation], timeout: 1)
722
- }
723
537
  `;
724
538
 
725
- assert.equal(hasSwiftWaitForExpectationsUsage(legacyAsyncWait), true);
726
- assert.equal(hasSwiftWaitForExpectationsUsage(legacySyncWait), false);
539
+ assert.equal(hasSwiftWaitForExpectationsUsage(legacyWait), true);
727
540
  assert.equal(hasSwiftWaitForExpectationsUsage(modernWait), false);
728
541
  });
729
542
 
730
- test('hasSwiftLegacyExpectationDescriptionUsage detecta expectation(description:) en tests async sin flujo moderno', () => {
731
- const legacyAsyncExpectation = `
732
- func testLegacyAsync() async {
733
- let expectation = expectation(description: "Done")
734
- doWork { expectation.fulfill() }
735
- }
736
- `;
737
- const legacySyncExpectation = `
738
- func testLegacySync() {
543
+ test('hasSwiftLegacyExpectationDescriptionUsage detecta expectation(description:) sin flujo moderno', () => {
544
+ const legacyExpectation = `
739
545
  let expectation = expectation(description: "Done")
740
546
  doWork { expectation.fulfill() }
741
- }
547
+ waitForExpectations(timeout: 1)
742
548
  `;
743
- const modernAsyncExpectation = `
744
- func testModernAsync() async {
549
+ const modernExpectation = `
745
550
  let expectation = expectation(description: "Done")
746
551
  doWork { expectation.fulfill() }
747
552
  await fulfillment(of: [expectation], timeout: 1)
748
- }
749
553
  `;
750
- const confirmationFlow = `
751
- func testConfirmation() async {
554
+ const confirmationOnly = `
752
555
  await confirmation("Done") { confirm in
753
556
  await doWork { confirm() }
754
557
  }
755
- }
756
- `;
757
- const commentedExpectation = `
758
- func testModernAsync() async {
759
- // let expectation = expectation(description: "Done")
760
- await confirmation("Done") { confirm in confirm() }
761
- }
762
558
  `;
763
559
 
764
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacyAsyncExpectation), true);
765
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacySyncExpectation), false);
766
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(modernAsyncExpectation), false);
767
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(confirmationFlow), false);
768
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(commentedExpectation), false);
560
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacyExpectation), true);
561
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(modernExpectation), false);
562
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(confirmationOnly), false);
769
563
  });
770
564
 
771
565
  test('hasSwiftNSManagedObjectBoundaryUsage detecta boundaries con NSManagedObject y excluye IDs o subclases', () => {
772
566
  const source = `
773
567
  func persist(_ entity: NSManagedObject) {}
774
568
  var selectedEntity: NSManagedObject?
775
- let cachedEntities: Result<[NSManagedObject], Error>
776
569
  `;
777
570
  const ignored = `
778
571
  final class TodoEntity: NSManagedObject {}
779
572
  var selectedID: NSManagedObjectID?
780
573
  let context: NSManagedObjectContext
781
- let text = "var selectedEntity: NSManagedObject?"
782
- // func persist(_ entity: NSManagedObject) {}
783
574
  `;
784
575
 
785
576
  assert.equal(hasSwiftNSManagedObjectBoundaryUsage(source), true);
@@ -791,17 +582,11 @@ test('hasSwiftNSManagedObjectAsyncBoundaryUsage detecta async APIs con NSManaged
791
582
  func fetchEntity() async throws -> NSManagedObject {
792
583
  fatalError()
793
584
  }
794
- func fetchEntities() async throws -> Result<[NSManagedObject], Error> {
795
- fatalError()
796
- }
797
585
  `;
798
586
  const ignored = `
799
587
  func fetchEntityID() async throws -> NSManagedObjectID {
800
588
  fatalError()
801
589
  }
802
- func fetchContext() async throws -> NSManagedObjectContext {
803
- fatalError()
804
- }
805
590
  `;
806
591
 
807
592
  assert.equal(hasSwiftNSManagedObjectAsyncBoundaryUsage(source), true);
@@ -981,69 +766,6 @@ final class PumukiOcpIosCanaryUseCase {
981
766
  assert.match(match.expected_fix, /estrategia|protocolo|registry/i);
982
767
  });
983
768
 
984
- test('findSwiftOpenClosedSwitchMatch detecta switch sobre outcome en Coordinator iOS', () => {
985
- const source = `public final class LaunchFlowCoordinator {
986
- public func bootstrap() async {
987
- let outcome = await appConfigurationUseCase.execute()
988
- switch outcome {
989
- case .mandatoryUpdate:
990
- route = .updateRequired
991
- case .maintenance:
992
- route = .maintenance
993
- case .proceed:
994
- route = .home
995
- }
996
- }
997
- }
998
- `;
999
-
1000
- const match = findSwiftOpenClosedSwitchMatch(source);
1001
-
1002
- assert.ok(match);
1003
- assert.equal(match.primary_node.name, 'LaunchFlowCoordinator');
1004
- assert.deepEqual(match.related_nodes, [
1005
- { kind: 'member', name: 'discriminator switch: outcome', lines: [4] },
1006
- { kind: 'member', name: 'case .mandatoryUpdate', lines: [5] },
1007
- { kind: 'member', name: 'case .maintenance', lines: [7] },
1008
- { kind: 'member', name: 'case .proceed', lines: [9] },
1009
- ]);
1010
- assert.match(match.why, /OCP/);
1011
- });
1012
-
1013
- test('findSwiftXCTestSrpMatch detecta XCTestCase con responsabilidades mezcladas', () => {
1014
- const source = `import XCTest
1015
-
1016
- final class LaunchFlowCoordinatorConfigTests: XCTestCase {
1017
- func test_bootstrap_whenMandatoryUpdate_routesToUpdateRequired() async {}
1018
- func test_bootstrap_whenSessionIsValid_routesHome() async {}
1019
- func test_completeOnboarding_marksProgressAndRoutesToLogin() async {}
1020
- }
1021
- `;
1022
-
1023
- const match = findSwiftXCTestSrpMatch(source);
1024
-
1025
- assert.ok(match);
1026
- assert.equal(match.primary_node.name, 'LaunchFlowCoordinatorConfigTests');
1027
- assert.deepEqual(match.related_nodes, [
1028
- { kind: 'member', name: 'session routing tests', lines: [5] },
1029
- { kind: 'member', name: 'onboarding progress tests', lines: [6] },
1030
- ]);
1031
- assert.match(match.why, /XCTestCase|SRP/);
1032
- });
1033
-
1034
- test('findSwiftXCTestSrpMatch permite XCTestCase enfocado en una responsabilidad', () => {
1035
- const source = `import XCTest
1036
-
1037
- final class LaunchFlowCoordinatorNonBlockingConfigTests: XCTestCase {
1038
- func test_bootstrap_whenConfigFetchFailsWithCache_usesCachedConfigAndContinues() async {}
1039
- func test_bootstrap_whenOptionalUpdate_allowsAccessAndContinues() async {}
1040
- func test_bootstrap_whenProceed_continuesToSessionValidation() async {}
1041
- }
1042
- `;
1043
-
1044
- assert.equal(findSwiftXCTestSrpMatch(source), undefined);
1045
- });
1046
-
1047
769
  test('findSwiftInterfaceSegregationMatch devuelve payload semantico para ISP-iOS en application', () => {
1048
770
  const source = `
1049
771
  protocol PumukiIspIosCanarySessionManaging {