|
3 | 3 | APP_NOT_INSTALLED_SAMPLE, |
4 | 4 | BROWSERSTACK_CONNECT_SAMPLE, |
5 | 5 | DEVICE_IN_USE_SAMPLE, |
| 6 | + FOREGROUND_SNAPSHOT_FAILURE_SAMPLE, |
| 7 | + MERGED_CARD_ACTIONS_SAMPLE, |
6 | 8 | NOT_SETTLED_SAMPLE, |
7 | 9 | OFFSCREEN_TARGET_SNAPSHOT_SAMPLE, |
8 | 10 | SETTLE_DIFF_SAMPLE, |
@@ -642,4 +644,79 @@ Use the output already shown to determine whether the feed-search UI is present, |
642 | 644 | { id: 'noRedundantInstall', pattern: /(?:^|\n)agent-device\s+install\b/i }, |
643 | 645 | ], |
644 | 646 | }, |
| 647 | + { |
| 648 | + id: 'foreground-attach-single-sim', |
| 649 | + docs: ['--help:first30', 'workflow'], |
| 650 | + task: 'You are starting fresh with no active session. The environment guarantees exactly one booted iOS simulator with exactly one app running on it -- the app you want to keep testing. Plan the command to attach to it and get its initial interactive snapshot in a single call (this only resolves unambiguously because of that guarantee, and it rejects an explicit app or device selector), then press the visible Continue control and close the session.', |
| 651 | + expectations: [ |
| 652 | + 'validPlanCommands', |
| 653 | + 'fullPrefix', |
| 654 | + 'usesSettleOnMutations', |
| 655 | + 'opensAndCloses', |
| 656 | + 'noExplicitForegroundTarget', |
| 657 | + ], |
| 658 | + matchers: [ |
| 659 | + { |
| 660 | + id: 'startsWithForegroundOpen', |
| 661 | + // Flag order is not semantically meaningful (`open --platform ios |
| 662 | + // --foreground` is exactly as correct as `open --foreground |
| 663 | + // --platform ios`); this only checks that --foreground is on the |
| 664 | + // first command and there is no app positional before it. The |
| 665 | + // no-positional guarantee comes from the forbidden checks below. |
| 666 | + pattern: /^agent-device\s+open\b[^\n]*--foreground\b/i, |
| 667 | + }, |
| 668 | + { |
| 669 | + id: 'pressesContinueAfterAttach', |
| 670 | + pattern: /agent-device\s+press\s+[^\n]*continue[^\n]*--settle\b/i, |
| 671 | + }, |
| 672 | + ], |
| 673 | + forbidden: [ |
| 674 | + { |
| 675 | + id: 'noDeviceSelectorWithForeground', |
| 676 | + pattern: /--foreground\b[^\n]*--(?:udid|device)\b|--(?:udid|device)\b[^\n]*--foreground\b/i, |
| 677 | + }, |
| 678 | + { id: 'noRawCoordinateTarget', pattern: RAW_COORDINATE_TARGET }, |
| 679 | + ], |
| 680 | + }, |
| 681 | + { |
| 682 | + id: 'merged-card-actions-not-directly-invokable', |
| 683 | + docs: ['--help:first30', 'workflow'], |
| 684 | + task: quiz( |
| 685 | + MERGED_CARD_ACTIONS_SAMPLE, |
| 686 | + 'The goal is to reply to this post. The actions list names "Reply" as a hidden affordance on @e72, but that name is not a pressable selector. What command should run next?', |
| 687 | + ), |
| 688 | + expectations: ['validPlanCommands', 'fullPrefix'], |
| 689 | + matchers: [ |
| 690 | + { |
| 691 | + id: 'opensCardToReachReply', |
| 692 | + pattern: /(?:^|\n)agent-device\s+(?:press|click)\s+@e72\b[^\n]*--settle\b/i, |
| 693 | + }, |
| 694 | + ], |
| 695 | + forbidden: [ |
| 696 | + { |
| 697 | + id: 'noPressingActionNameAsSelector', |
| 698 | + pattern: /(?:^|\n)agent-device\s+(?:press|click|find)\b[^\n]*(?:label|text)="?reply"?/i, |
| 699 | + }, |
| 700 | + { id: 'noRawCoordinateTarget', pattern: RAW_COORDINATE_TARGET }, |
| 701 | + ], |
| 702 | + }, |
| 703 | + { |
| 704 | + id: 'foreground-attach-snapshot-recovery', |
| 705 | + docs: ['--help:first30', 'workflow'], |
| 706 | + task: quiz( |
| 707 | + FOREGROUND_SNAPSHOT_FAILURE_SAMPLE, |
| 708 | + 'The foreground attach succeeded and the session is still open, but its initial snapshot failed. What command should run next to get interactive refs?', |
| 709 | + ), |
| 710 | + expectations: ['validPlanCommands', 'fullPrefix', 'usesSnapshotI'], |
| 711 | + matchers: [ |
| 712 | + { |
| 713 | + id: 'retriesSnapshotInOpenSession', |
| 714 | + pattern: /(?:^|\n)agent-device\s+snapshot\s+-i\b/i, |
| 715 | + }, |
| 716 | + ], |
| 717 | + forbidden: [ |
| 718 | + { id: 'noSecondOpen', pattern: /(?:^|\n)agent-device\s+open\b/i }, |
| 719 | + { id: 'noPrematureClose', pattern: /(?:^|\n)agent-device\s+close\b/i }, |
| 720 | + ], |
| 721 | + }, |
645 | 722 | ]; |
0 commit comments